Changeset 49 for trunk/examples
- Timestamp:
- 09/05/06 23:00:01 (2 years ago)
- Files:
-
- trunk/examples/driver (added)
- trunk/examples/driver/Joker.php (added)
- trunk/examples/example_basic_count.php (modified) (1 diff)
- trunk/examples/example_basic_customdriver.php (added)
- trunk/examples/example_spl_array.php (modified) (3 diffs)
- trunk/examples/example_spl_property.php (modified) (1 diff)
- trunk/examples/example_test_driver.php (modified) (1 diff)
- trunk/examples/index_sections.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/examples/example_basic_count.php
r46 r49 21 21 $sess =& patSession::singleton( 'ham' ); 22 22 23 if( isset( $_REQUEST['restart'] ) && $_REQUEST['restart'] == 'force' ) 24 { 23 if( isset( $_REQUEST['restart'] ) && $_REQUEST['restart'] == 'force' ) { 25 24 $sess->restart(); 26 25 } 27 26 28 27 // see wheter the started session is new 29 if( $sess->isNew() ) 30 { 28 if( $sess->new ) { 31 29 echo '<b>Hurray!</b> A new session was born! :-)<br />'; 32 } 33 else 34 { 30 } else { 35 31 echo '<b>Continue</b> session...<br />'; 36 32 } 37 33 38 34 // recieve the session counter 39 echo 'Session Counter: <b>' . $sess-> getCounter(). '</b><br />';35 echo 'Session Counter: <b>' . $sess->counter . '</b><br />'; 40 36 41 37 // get query string 42 38 echo '<br />'; 43 $queryString = $sess-> getQueryString();39 $queryString = $sess->SID; 44 40 echo '- <a href="' . $_SERVER['PHP_SELF'] . '?' . $queryString . '" title="'. $_SERVER['PHP_SELF'] . '?' . $queryString .'">Continue this session</a> <br />'; 45 41 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 9 9 * 10 10 * @author gERD Schaufelberger <gerd@php-tools.net> 11 * @copyright 2004 http://www.php-tools.net11 * @copyright 2004-2006 http://www.php-tools.net 12 12 * @license LGPL 13 13 **/ … … 26 26 27 27 // see wheter the started session is new 28 if( $sess-> isNew()) {28 if( $sess->new ) { 29 29 echo '<b>Hurray!</b> A new session was born! :-)<br />'; 30 30 } … … 51 51 // get query string 52 52 echo '<br />'; 53 $queryString = $sess-> getQueryString();53 $queryString = $sess->SID; 54 54 echo '- <a href="' . $_SERVER['PHP_SELF'] . '?' . $queryString . '" title="'. $_SERVER['PHP_SELF'] . '?' . $queryString .'">Continue this session</a> <br />'; 55 55 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 43 43 echo 'State: <b>' . $sess->state . '</b><br />'; 44 44 echo 'Id: <b>' . $sess->id . '</b><br />'; 45 echo 'IdPRefix: <b>' . $sess->idPrefix . '</b><br />'; 45 46 echo 'Name: <b>' . $sess->name . '</b><br />'; 46 47 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 49 52 50 53 // get query string 51 54 echo '<br />'; 52 $queryString = $sess-> getSID();55 $queryString = $sess->SID; 53 56 echo '- <a href="' . $_SERVER['PHP_SELF'] . '?' . $queryString . '" title="'. $_SERVER['PHP_SELF'] . '?' . $queryString .'">Continue this session</a> <br />'; 54 57 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 19 19 include_once '../patSession.php'; 20 20 21 $driverFolder = dirname( __FILE__ ) . '/driver'; 22 23 patSession::setDriverDir( $driverFolder ); 24 21 25 // most easy way to create a session object 22 26 $sess =& patSession::singleton( 'ham', 'Spellerror' ); trunk/examples/index_sections.php
r46 r49 61 61 '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.' 62 62 ), 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 ) 63 68 ) 64 69 ),
