Source for file 1.php
Documentation is available at 1.php
* Description: Passes through all main calendar classes, beginning with year
* and down to seconds, skipping weeks. Useful to test Calendar is (basically)
return ((float) $usec + (float) $sec);
if ( !@include 'Calendar/Calendar.php' ) {
define ('CALENDAR_ROOT','../../');
if (!isset ($_GET['y'])) $_GET['y'] = 2003;
if (!isset ($_GET['m'])) $_GET['m'] = 8;
if (!isset ($_GET['d'])) $_GET['d'] = 9;
if (!isset ($_GET['h'])) $_GET['h'] = 12;
if (!isset ($_GET['i'])) $_GET['i'] = 34;
if (!isset ($_GET['s'])) $_GET['s'] = 46;
switch ( @$_GET['view'] ) {
$_GET['view'] = 'calendar_year';
require_once CALENDAR_ROOT. 'Year.php';
require_once CALENDAR_ROOT. 'Month.php';
require_once CALENDAR_ROOT. 'Day.php';
require_once CALENDAR_ROOT. 'Hour.php';
$c = new Calendar_Hour($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h']);
require_once CALENDAR_ROOT. 'Minute.php';
$c = new Calendar_Minute($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h'],$_GET['i']);
require_once CALENDAR_ROOT. 'Second.php';
$c = new Calendar_Second($_GET['y'],$_GET['m'],$_GET['d'],$_GET['h'],$_GET['i'],$_GET['s']);
echo ( 'Viewing: '. @$_GET['view']. '<br />' );
echo ( 'The time is now: '. date('Y M d H:i:s',$c->getTimestamp ()). '<br >' );
echo ( '<h1>First Iteration</h1>' );
echo ( '<p>The first iteration is more "expensive", the calendar data
structures having to be built.</p>' );
while ( $e = $c->fetch () ) {
$link = "&y=". $e->thisYear (). "&m=". $e->thisMonth (). "&d=". $e->thisDay ().
"&h=". $e->thisHour (). "&i=". $e->thisMinute (). "&s=". $e->thisSecond ();
echo ( "<a href=\"". $_SERVER['PHP_SELF']. "?view=". $class. $link. "\">". $e->{$method}(). "</a> : " );
echo ( '<p><b>Took: '. (getmicrotime()- $start). ' seconds</b></p>' );
echo ( '<h1>Second Iteration</h1>' );
echo ( '<p>This second iteration is faster, the data structures
while ( $e = $c->fetch () ) {
$link = "&y=". $e->thisYear (). "&m=". $e->thisMonth (). "&d=". $e->thisDay ().
"&h=". $e->thisHour (). "&i=". $e->thisMinute (). "&s=". $e->thisSecond ();
echo ( "<a href=\"". $_SERVER['PHP_SELF']. "?view=". $class. $link. "\">". $e->{$method}(). "</a> : " );
echo ( '<p><b>Took: '. (getmicrotime()- $start). ' seconds</b></p>' );
Documentation generated on Mon, 11 Mar 2019 15:37:47 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|