Changeset 49 for trunk/examples

Show
Ignore:
Timestamp:
09/05/06 23:00:01 (2 years ago)
Author:
gerd
Message:

- support for autopackage
- added feature: custom driver

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/examples/example_basic_count.php

    r46 r49  
    2121        $sess   =&      patSession::singleton( 'ham' ); 
    2222 
    23         if( isset( $_REQUEST['restart'] ) &&  $_REQUEST['restart'] == 'force' ) 
    24         { 
     23        if( isset( $_REQUEST['restart'] ) &&  $_REQUEST['restart'] == 'force' ) { 
    2524                $sess->restart(); 
    2625        } 
    2726         
    2827        // see wheter the started session is new 
    29         if( $sess->isNew() ) 
    30         { 
     28        if( $sess->new ) { 
    3129                echo '<b>Hurray!</b> A new session was born! :-)<br />'; 
    32         } 
    33         else 
    34         { 
     30        } else { 
    3531                echo '<b>Continue</b> session...<br />'; 
    3632        } 
    3733         
    3834        // recieve the session counter 
    39         echo 'Session  Counter: <b>' . $sess->getCounter() . '</b><br />'; 
     35        echo 'Session  Counter: <b>' . $sess->counter . '</b><br />'; 
    4036         
    4137        // get query string 
    4238        echo '<br />'; 
    43         $queryString    =       $sess->getQueryString()
     39        $queryString    =       $sess->SID
    4440        echo '- <a href="' . $_SERVER['PHP_SELF'] . '?' . $queryString . '" title="'. $_SERVER['PHP_SELF'] . '?' . $queryString .'">Continue this session</a> <br />'; 
    4541        echo '- <a href="' . $_SERVER['PHP_SELF'] . '" title="'. $_SERVER['PHP_SELF'] . '">Start over</a> (make sure, that you don\'t send cookies!) <br />'; 
  • trunk/examples/example_spl_array.php

    r46 r49  
    99 *  
    1010 * @author gERD Schaufelberger <gerd@php-tools.net> 
    11  * @copyright 2004 http://www.php-tools.net 
     11 * @copyright 2004-2006 http://www.php-tools.net 
    1212 * @license LGPL 
    1313 **/ 
     
    2626         
    2727        // see wheter the started session is new 
    28         if( $sess->isNew() ) { 
     28        if( $sess->new ) { 
    2929                echo '<b>Hurray!</b> A new session was born! :-)<br />'; 
    3030        } 
     
    5151        // get query string 
    5252        echo '<br />'; 
    53         $queryString    =       $sess->getQueryString()
     53        $queryString    =       $sess->SID
    5454        echo '- <a href="' . $_SERVER['PHP_SELF'] . '?' . $queryString . '" title="'. $_SERVER['PHP_SELF'] . '?' . $queryString .'">Continue this session</a> <br />'; 
    5555        echo '- <a href="' . $_SERVER['PHP_SELF'] . '" title="'. $_SERVER['PHP_SELF'] . '">Start over</a> (make sure, that you don\'t send cookies!) <br />'; 
  • trunk/examples/example_spl_property.php

    r46 r49  
    4343    echo 'State: <b>' . $sess->state . '</b><br />'; 
    4444    echo 'Id: <b>' . $sess->id . '</b><br />'; 
     45    echo 'IdPRefix: <b>' . $sess->idPrefix . '</b><br />'; 
    4546    echo 'Name: <b>' . $sess->name . '</b><br />'; 
    4647    echo 'SID: <b>' . $sess->SID . '</b><br />'; 
    47  
    48  
     48    echo 'new: <b>'; var_dump( $sess->new );  echo '</b><br />'; 
     49    echo 'Counter: <b>' . $sess->counter . '</b><br />'; 
     50    echo 'Timer: <pre>' . print_r( $sess->timer, true ) .'</pre><br />'; 
     51     
    4952         
    5053        // get query string 
    5154        echo '<br />'; 
    52         $queryString    =       $sess->getSID()
     55        $queryString    =       $sess->SID
    5356        echo '- <a href="' . $_SERVER['PHP_SELF'] . '?' . $queryString . '" title="'. $_SERVER['PHP_SELF'] . '?' . $queryString .'">Continue this session</a> <br />'; 
    5457        echo '- <a href="' . $_SERVER['PHP_SELF'] . '" title="'. $_SERVER['PHP_SELF'] . '">Start over</a> (make sure, that you don\'t send cookies!) <br />'; 
  • trunk/examples/example_test_driver.php

    r46 r49  
    1919        include_once '../patSession.php'; 
    2020         
     21    $driverFolder   =   dirname( __FILE__ ) . '/driver'; 
     22     
     23    patSession::setDriverDir( $driverFolder );     
     24     
    2125        // most easy way to create a session object 
    2226        $sess   =&      patSession::singleton( 'ham', 'Spellerror' ); 
  • trunk/examples/index_sections.php

    r46 r49  
    6161                    'descr' =>  'patSession itself uses the session container to store some internal values. In order to avoid conflicts, the namespace "patSession" is used as a prefix for all values.' 
    6262                ), 
     63                'customdriver' => array( 
     64                    'title' =>  'Custom storage driver', 
     65                    'descr' =>  'The official distribution of patSession only contains general purpose storage driver.  
     66                                 Still you can implement your own driver without getting in conflict with your patSession installation.' 
     67                ) 
    6368                        ) 
    6469                ),