@@ -8,17 +8,17 @@ discard block |
||
| 8 | 8 | { |
| 9 | 9 | list($usec, $sec) = explode(' ', microtime()); |
| 10 | 10 | |
| 11 | - return (float)$usec + (float)$sec; |
|
| 11 | + return (float) $usec + (float) $sec; |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | $start = getmicrotime(); |
| 15 | 15 | |
| 16 | 16 | //if (!@require_once dirname(dirname(__DIR__)) . '/Calendar.php') { |
| 17 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 17 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 18 | 18 | define('CALENDAR_ROOT', '../../'); |
| 19 | 19 | } |
| 20 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
| 21 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 20 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 21 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 22 | 22 | |
| 23 | 23 | if (!isset($_GET['y'])) { |
| 24 | 24 | $_GET['y'] = date('Y'); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | <anchor> |
| 50 | 50 | Back to Month View |
| 51 | 51 | <go href="<?php |
| 52 | - echo '?y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . '&mime=wml'; ?>"> |
|
| 52 | + echo '?y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay().'&mime=wml'; ?>"> |
|
| 53 | 53 | </anchor> |
| 54 | 54 | </p> |
| 55 | 55 | <table> |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $Day->build(); |
| 58 | 58 | while ($Hour = $Day->fetch()) { |
| 59 | 59 | echo "<tr>\n"; |
| 60 | - echo '<td>' . date('g a', $Hour->getTimestamp()) . "</td><td>Free time!</td>\n"; |
|
| 60 | + echo '<td>'.date('g a', $Hour->getTimestamp())."</td><td>Free time!</td>\n"; |
|
| 61 | 61 | echo "</tr>\n"; |
| 62 | 62 | } ?> |
| 63 | 63 | </table> |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | if ($Day->isEmpty()) { |
| 85 | 85 | echo "<td></td>\n"; |
| 86 | 86 | } elseif ($Day->isSelected()) { |
| 87 | - echo '<td><anchor><strong><u>' . $Day->thisDay() . "</u></strong>\n<go href=\"" . $_SERVER['PHP_SELF'] . '?viewday=true&y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . "&mime=wml\">\n</anchor></td>\n"; |
|
| 87 | + echo '<td><anchor><strong><u>'.$Day->thisDay()."</u></strong>\n<go href=\"".$_SERVER['PHP_SELF'].'?viewday=true&y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay()."&mime=wml\">\n</anchor></td>\n"; |
|
| 88 | 88 | } else { |
| 89 | - echo '<td><anchor>' . $Day->thisDay() . "\n<go href=\"?viewday=true&y=" . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . "&mime=wml\"></anchor></td>\n"; |
|
| 89 | + echo '<td><anchor>'.$Day->thisDay()."\n<go href=\"?viewday=true&y=".$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay()."&mime=wml\"></anchor></td>\n"; |
|
| 90 | 90 | } |
| 91 | 91 | if ($Day->isLast()) { |
| 92 | 92 | echo "</tr>\n"; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | <anchor> |
| 98 | 98 | << |
| 99 | 99 | <go href="<?php |
| 100 | - echo '?y=' . $Month->thisYear() . '&m=' . $Month->prevMonth() . '&d=' . $Month->thisDay() . '&mime=wml'; ?>"> |
|
| 100 | + echo '?y='.$Month->thisYear().'&m='.$Month->prevMonth().'&d='.$Month->thisDay().'&mime=wml'; ?>"> |
|
| 101 | 101 | </anchor> |
| 102 | 102 | </td> |
| 103 | 103 | <td></td> |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | <anchor> |
| 110 | 110 | >> |
| 111 | 111 | <go href="<?php |
| 112 | - echo '?y=' . $Month->thisYear() . '&m=' . $Month->nextMonth() . '&d=' . $Month->thisDay() . '&mime=wml'; ?>"> |
|
| 112 | + echo '?y='.$Month->thisYear().'&m='.$Month->nextMonth().'&d='.$Month->thisDay().'&mime=wml'; ?>"> |
|
| 113 | 113 | </anchor> |
| 114 | 114 | </td> |
| 115 | 115 | </tr> |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | <?php |
| 119 | 119 | } ?> |
| 120 | 120 | <p><a href="<?php echo $_SERVER['PHP_SELF']; ?>">Back to HTML</a></p> |
| 121 | - <?php echo '<p>Took: ' . (getmicrotime() - $start) . ' seconds</p>'; ?> |
|
| 121 | + <?php echo '<p>Took: '.(getmicrotime() - $start).' seconds</p>'; ?> |
|
| 122 | 122 | </wml> |
| 123 | 123 | <?php |
| 124 | 124 | #-----------------------------------------------------------------------------# |
@@ -142,14 +142,14 @@ discard block |
||
| 142 | 142 | <p> |
| 143 | 143 | <anchor> |
| 144 | 144 | <a href="<?php |
| 145 | - echo '?y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay(); ?>">Back to Month View</a> |
|
| 145 | + echo '?y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay(); ?>">Back to Month View</a> |
|
| 146 | 146 | </p> |
| 147 | 147 | <table> |
| 148 | 148 | <?php |
| 149 | 149 | $Day->build(); |
| 150 | 150 | while ($Hour = $Day->fetch()) { |
| 151 | 151 | echo "<tr>\n"; |
| 152 | - echo '<td>' . date('g a', $Hour->getTimestamp()) . "</td><td>Free time!</td>\n"; |
|
| 152 | + echo '<td>'.date('g a', $Hour->getTimestamp())."</td><td>Free time!</td>\n"; |
|
| 153 | 153 | echo "</tr>\n"; |
| 154 | 154 | } ?> |
| 155 | 155 | </table> |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | if ($Day->isEmpty()) { |
| 177 | 177 | echo "<td></td>\n"; |
| 178 | 178 | } elseif ($Day->isSelected()) { |
| 179 | - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?viewday=true&y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . '&wml"><strong><u>' . $Day->thisDay() . "</u></strong></a></td>\n"; |
|
| 179 | + echo '<td><a href="'.$_SERVER['PHP_SELF'].'?viewday=true&y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay().'&wml"><strong><u>'.$Day->thisDay()."</u></strong></a></td>\n"; |
|
| 180 | 180 | } else { |
| 181 | - echo '<td><a href="' . $_SERVER['PHP_SELF'] . '?viewday=true&y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay() . '">' . $Day->thisDay() . "</a></td>\n"; |
|
| 181 | + echo '<td><a href="'.$_SERVER['PHP_SELF'].'?viewday=true&y='.$Day->thisYear().'&m='.$Day->thisMonth().'&d='.$Day->thisDay().'">'.$Day->thisDay()."</a></td>\n"; |
|
| 182 | 182 | } |
| 183 | 183 | if ($Day->isLast()) { |
| 184 | 184 | echo "</tr>\n"; |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | <tr> |
| 188 | 188 | <td> |
| 189 | 189 | <a href="<?php |
| 190 | - echo '?y=' . $Month->thisYear() . '&m=' . $Month->prevMonth() . '&d=' . $Month->thisDay(); ?>"> |
|
| 190 | + echo '?y='.$Month->thisYear().'&m='.$Month->prevMonth().'&d='.$Month->thisDay(); ?>"> |
|
| 191 | 191 | <<</a> |
| 192 | 192 | </td> |
| 193 | 193 | <td></td> |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | <td></td> |
| 198 | 198 | <td> |
| 199 | 199 | <a href="<?php |
| 200 | - echo '?y=' . $Month->thisYear() . '&m=' . $Month->nextMonth() . '&d=' . $Month->thisDay(); ?>">>></a> |
|
| 200 | + echo '?y='.$Month->thisYear().'&m='.$Month->nextMonth().'&d='.$Month->thisDay(); ?>">>></a> |
|
| 201 | 201 | </td> |
| 202 | 202 | </tr> |
| 203 | 203 | </table> |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | <?php |
| 206 | 206 | } ?> |
| 207 | 207 | |
| 208 | - <?php echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; ?> |
|
| 208 | + <?php echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; ?> |
|
| 209 | 209 | </body> |
| 210 | 210 | </html> |
| 211 | 211 | <?php |
@@ -3,12 +3,12 @@ discard block |
||
| 3 | 3 | /** |
| 4 | 4 | * Description: demonstrates using the Textual util. |
| 5 | 5 | */ |
| 6 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 6 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 7 | 7 | define('CALENDAR_ROOT', '../../'); |
| 8 | 8 | } |
| 9 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 10 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
| 11 | -require_once CALENDAR_ROOT . 'Util/Textual.php'; |
|
| 9 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 10 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 11 | +require_once CALENDAR_ROOT.'Util/Textual.php'; |
|
| 12 | 12 | |
| 13 | 13 | // Could change language like this |
| 14 | 14 | // setlocale (LC_TIME, "de_DE"); // Unix based (probably) |
@@ -25,12 +25,12 @@ discard block |
||
| 25 | 25 | echo "<hr>Creating: new Calendar_Day(date('Y'), date('n'), date('d'));<br>"; |
| 26 | 26 | $Calendar = new Calendar_Day(date('Y'), date('n'), date('d')); |
| 27 | 27 | |
| 28 | -echo '<hr>Previous month is: ' . Calendar_Util_Textual::prevMonthName($Calendar, 'two') . '<br>'; |
|
| 29 | -echo 'This month is: ' . Calendar_Util_Textual::thisMonthName($Calendar, 'short') . '<br>'; |
|
| 30 | -echo 'Next month is: ' . Calendar_Util_Textual::nextMonthName($Calendar) . '<br><hr>'; |
|
| 31 | -echo 'Previous day is: ' . Calendar_Util_Textual::prevDayName($Calendar) . '<br>'; |
|
| 32 | -echo 'This day is: ' . Calendar_Util_Textual::thisDayName($Calendar, 'short') . '<br>'; |
|
| 33 | -echo 'Next day is: ' . Calendar_Util_Textual::nextDayName($Calendar, 'one') . '<br><hr>'; |
|
| 28 | +echo '<hr>Previous month is: '.Calendar_Util_Textual::prevMonthName($Calendar, 'two').'<br>'; |
|
| 29 | +echo 'This month is: '.Calendar_Util_Textual::thisMonthName($Calendar, 'short').'<br>'; |
|
| 30 | +echo 'Next month is: '.Calendar_Util_Textual::nextMonthName($Calendar).'<br><hr>'; |
|
| 31 | +echo 'Previous day is: '.Calendar_Util_Textual::prevDayName($Calendar).'<br>'; |
|
| 32 | +echo 'This day is: '.Calendar_Util_Textual::thisDayName($Calendar, 'short').'<br>'; |
|
| 33 | +echo 'Next day is: '.Calendar_Util_Textual::nextDayName($Calendar, 'one').'<br><hr>'; |
|
| 34 | 34 | |
| 35 | 35 | echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week<br>"; |
| 36 | 36 | $Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6); |
@@ -38,12 +38,12 @@ discard block |
||
| 38 | 38 | ?> |
| 39 | 39 | <p>Rendering calendar....</p> |
| 40 | 40 | <table> |
| 41 | - <caption><?php echo Calendar_Util_Textual::thisMonthName($Calendar) . ' ' . $Calendar->thisYear(); ?></caption> |
|
| 41 | + <caption><?php echo Calendar_Util_Textual::thisMonthName($Calendar).' '.$Calendar->thisYear(); ?></caption> |
|
| 42 | 42 | <tr> |
| 43 | 43 | <?php |
| 44 | 44 | $dayheaders = Calendar_Util_Textual::orderedWeekdays($Calendar, 'short'); |
| 45 | 45 | foreach ($dayheaders as $dayheader) { |
| 46 | - echo '<th>' . $dayheader . '</th>'; |
|
| 46 | + echo '<th>'.$dayheader.'</th>'; |
|
| 47 | 47 | } |
| 48 | 48 | ?> |
| 49 | 49 | </tr> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if ($Day->isEmpty()) { |
| 57 | 57 | echo '<td> </td>'; |
| 58 | 58 | } else { |
| 59 | - echo '<td>' . $Day->thisDay() . '</td>'; |
|
| 59 | + echo '<td>'.$Day->thisDay().'</td>'; |
|
| 60 | 60 | } |
| 61 | 61 | if ($Day->isLast()) { |
| 62 | 62 | echo "</tr>\n"; |
@@ -3,12 +3,12 @@ discard block |
||
| 3 | 3 | /** |
| 4 | 4 | * Description: demonstrates using the Textual decorator. |
| 5 | 5 | */ |
| 6 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 6 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 7 | 7 | define('CALENDAR_ROOT', '../../'); |
| 8 | 8 | } |
| 9 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 10 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
| 11 | -require_once CALENDAR_ROOT . 'Decorator/Textual.php'; |
|
| 9 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 10 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 11 | +require_once CALENDAR_ROOT.'Decorator/Textual.php'; |
|
| 12 | 12 | |
| 13 | 13 | // Could change language like this |
| 14 | 14 | // setlocale (LC_TIME, "de_DE"); // Unix based (probably) |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | // Decorate |
| 29 | 29 | $Textual = new Calendar_Decorator_Textual($Calendar); |
| 30 | 30 | |
| 31 | -echo '<hr>Previous month is: ' . $Textual->prevMonthName('two') . '<br>'; |
|
| 32 | -echo 'This month is: ' . $Textual->thisMonthName('short') . '<br>'; |
|
| 33 | -echo 'Next month is: ' . $Textual->nextMonthName() . '<br><hr>'; |
|
| 34 | -echo 'Previous day is: ' . $Textual->prevDayName() . '<br>'; |
|
| 35 | -echo 'This day is: ' . $Textual->thisDayName('short') . '<br>'; |
|
| 36 | -echo 'Next day is: ' . $Textual->nextDayName('one') . '<br><hr>'; |
|
| 31 | +echo '<hr>Previous month is: '.$Textual->prevMonthName('two').'<br>'; |
|
| 32 | +echo 'This month is: '.$Textual->thisMonthName('short').'<br>'; |
|
| 33 | +echo 'Next month is: '.$Textual->nextMonthName().'<br><hr>'; |
|
| 34 | +echo 'Previous day is: '.$Textual->prevDayName().'<br>'; |
|
| 35 | +echo 'This day is: '.$Textual->thisDayName('short').'<br>'; |
|
| 36 | +echo 'Next day is: '.$Textual->nextDayName('one').'<br><hr>'; |
|
| 37 | 37 | |
| 38 | 38 | echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week<br>"; |
| 39 | 39 | $Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6); |
@@ -43,12 +43,12 @@ discard block |
||
| 43 | 43 | ?> |
| 44 | 44 | <p>Rendering calendar....</p> |
| 45 | 45 | <table> |
| 46 | - <caption><?php echo $Textual->thisMonthName() . ' ' . $Textual->thisYear(); ?></caption> |
|
| 46 | + <caption><?php echo $Textual->thisMonthName().' '.$Textual->thisYear(); ?></caption> |
|
| 47 | 47 | <tr> |
| 48 | 48 | <?php |
| 49 | 49 | $dayheaders = $Textual->orderedWeekdays('short'); |
| 50 | 50 | foreach ($dayheaders as $dayheader) { |
| 51 | - echo '<th>' . $dayheader . '</th>'; |
|
| 51 | + echo '<th>'.$dayheader.'</th>'; |
|
| 52 | 52 | } |
| 53 | 53 | ?> |
| 54 | 54 | </tr> |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ($Day->isEmpty()) { |
| 62 | 62 | echo '<td> </td>'; |
| 63 | 63 | } else { |
| 64 | - echo '<td>' . $Day->thisDay() . '</td>'; |
|
| 64 | + echo '<td>'.$Day->thisDay().'</td>'; |
|
| 65 | 65 | } |
| 66 | 66 | if ($Day->isLast()) { |
| 67 | 67 | echo "</tr>\n"; |
@@ -6,11 +6,11 @@ discard block |
||
| 6 | 6 | * hit for extra method calls. For this example some simple functions could help |
| 7 | 7 | * format the month while the days are accessed via the normal Month object. |
| 8 | 8 | */ |
| 9 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 9 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 10 | 10 | define('CALENDAR_ROOT', '../../'); |
| 11 | 11 | } |
| 12 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
| 13 | -require_once CALENDAR_ROOT . 'Decorator.php'; |
|
| 12 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 13 | +require_once CALENDAR_ROOT.'Decorator.php'; |
|
| 14 | 14 | |
| 15 | 15 | // Decorate a Month with methods to improve formatting |
| 16 | 16 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $prevStamp = parent::prevMonth(true); |
| 38 | 38 | |
| 39 | 39 | // Build the URL for the previous month |
| 40 | - return $_SERVER['PHP_SELF'] . '?y=' . date('Y', $prevStamp) . '&m=' . date('n', $prevStamp) . '&d=' . date('j', $prevStamp); |
|
| 40 | + return $_SERVER['PHP_SELF'].'?y='.date('Y', $prevStamp).'&m='.date('n', $prevStamp).'&d='.date('j', $prevStamp); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $nextStamp = parent::nextMonth(true); |
| 60 | 60 | |
| 61 | 61 | // Build the URL for next month |
| 62 | - return $_SERVER['PHP_SELF'] . '?y=' . date('Y', $nextStamp) . '&m=' . date('n', $nextStamp) . '&d=' . date('j', $nextStamp); |
|
| 62 | + return $_SERVER['PHP_SELF'].'?y='.date('Y', $nextStamp).'&m='.date('n', $nextStamp).'&d='.date('j', $nextStamp); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | if ($Day->isEmpty()) { |
| 96 | 96 | echo '<td> </td>'; |
| 97 | 97 | } else { |
| 98 | - echo '<td>' . $Day->thisDay() . '</td>'; |
|
| 98 | + echo '<td>'.$Day->thisDay().'</td>'; |
|
| 99 | 99 | } |
| 100 | 100 | if ($Day->isLast()) { |
| 101 | 101 | echo "\n</tr>\n"; |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | - remove @ before include below to see why'); |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | -if (!@require_once __DIR__ . '/SOAP/Client.php') { |
|
| 10 | +if (!@require_once __DIR__.'/SOAP/Client.php') { |
|
| 11 | 11 | die('You must have PEAR::SOAP installed'); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $basePath = explode('/', $_SERVER['SCRIPT_NAME']); |
| 16 | 16 | array_pop($basePath); |
| 17 | 17 | $basePath = implode('/', $basePath); |
| 18 | -$url = 'http://' . $_SERVER['SERVER_NAME'] . $basePath . '/7.php?wsdl'; |
|
| 18 | +$url = 'http://'.$_SERVER['SERVER_NAME'].$basePath.'/7.php?wsdl'; |
|
| 19 | 19 | |
| 20 | 20 | if (!isset($_GET['y'])) { |
| 21 | 21 | $_GET['y'] = date('Y'); |
@@ -26,11 +26,11 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $wsdl = new SOAP_WSDL($url); |
| 28 | 28 | |
| 29 | -echo '<pre>' . $wsdl->generateProxyCode() . '</pre>'; |
|
| 29 | +echo '<pre>'.$wsdl->generateProxyCode().'</pre>'; |
|
| 30 | 30 | |
| 31 | 31 | $calendarClient = $wsdl->getProxy(); |
| 32 | 32 | |
| 33 | -$month = $calendarClient->getMonth((int)$_GET['y'], (int)$_GET['m']); |
|
| 33 | +$month = $calendarClient->getMonth((int) $_GET['y'], (int) $_GET['m']); |
|
| 34 | 34 | |
| 35 | 35 | if (PEAR::isError($month)) { |
| 36 | 36 | die($month->toString()); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | if (1 === $day->isEmpty) { |
| 63 | 63 | echo '<td></td>'; |
| 64 | 64 | } else { |
| 65 | - echo '<td>' . $day->day . '</td>'; |
|
| 65 | + echo '<td>'.$day->day.'</td>'; |
|
| 66 | 66 | } |
| 67 | 67 | if (1 === $day->isLast) { |
| 68 | 68 | echo "</tr>\n"; |
@@ -2,12 +2,12 @@ discard block |
||
| 2 | 2 | /** |
| 3 | 3 | * Description: demonstrates using the Wrapper decorator. |
| 4 | 4 | */ |
| 5 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 5 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 6 | 6 | define('CALENDAR_ROOT', '../../'); |
| 7 | 7 | } |
| 8 | -require_once CALENDAR_ROOT . 'Month.php'; |
|
| 9 | -require_once CALENDAR_ROOT . 'Decorator.php'; // Not really needed but added to help this make sense |
|
| 10 | -require_once CALENDAR_ROOT . 'Decorator/Wrapper.php'; |
|
| 8 | +require_once CALENDAR_ROOT.'Month.php'; |
|
| 9 | +require_once CALENDAR_ROOT.'Decorator.php'; // Not really needed but added to help this make sense |
|
| 10 | +require_once CALENDAR_ROOT.'Decorator/Wrapper.php'; |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * Class MyBoldDecorator. |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function thisDay() |
| 29 | 29 | { |
| 30 | - return '<b>' . parent::thisDay() . '</b>'; |
|
| 30 | + return '<b>'.parent::thisDay().'</b>'; |
|
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
@@ -39,5 +39,5 @@ discard block |
||
| 39 | 39 | echo '<h2>The Wrapper decorator</h2>'; |
| 40 | 40 | echo '<i>Day numbers are rendered in bold</i><br> <br>'; |
| 41 | 41 | while ($DecoratedDay = $Wrapper->fetch('MyBoldDecorator')) { |
| 42 | - echo $DecoratedDay->thisDay() . '<br>'; |
|
| 42 | + echo $DecoratedDay->thisDay().'<br>'; |
|
| 43 | 43 | } |
@@ -6,15 +6,15 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | list($usec, $sec) = explode(' ', microtime()); |
| 8 | 8 | |
| 9 | - return (float)$usec + (float)$sec; |
|
| 9 | + return (float) $usec + (float) $sec; |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | $start = getmicrotime(); |
| 13 | 13 | |
| 14 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 14 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 15 | 15 | define('CALENDAR_ROOT', '../../'); |
| 16 | 16 | } |
| 17 | -require_once CALENDAR_ROOT . 'Week.php'; |
|
| 17 | +require_once CALENDAR_ROOT.'Week.php'; |
|
| 18 | 18 | |
| 19 | 19 | if (!isset($_GET['y'])) { |
| 20 | 20 | $_GET['y'] = date('Y'); |
@@ -42,19 +42,19 @@ discard block |
||
| 42 | 42 | </head> |
| 43 | 43 | <body> |
| 44 | 44 | <h1>Paging Weeks</h1> |
| 45 | -<h2>Week: <?php echo $Week->thisWeek() . ' ' . date('F Y', $Week->thisMonth(true)); ?></h2> |
|
| 45 | +<h2>Week: <?php echo $Week->thisWeek().' '.date('F Y', $Week->thisMonth(true)); ?></h2> |
|
| 46 | 46 | <?php |
| 47 | 47 | $Week->build(); |
| 48 | 48 | while ($Day = $Week->fetch()) { |
| 49 | - echo '<p>' . date('jS F', $Day->thisDay(true)) . "</p>\n"; |
|
| 49 | + echo '<p>'.date('jS F', $Day->thisDay(true))."</p>\n"; |
|
| 50 | 50 | } |
| 51 | 51 | $days = $Week->fetchAll(); |
| 52 | 52 | |
| 53 | 53 | $prevWeek = $Week->prevWeek('array'); |
| 54 | -$prevWeekLink = $_SERVER['PHP_SELF'] . '?y=' . $prevWeek['year'] . '&m=' . $prevWeek['month'] . '&d=' . $prevWeek['day']; |
|
| 54 | +$prevWeekLink = $_SERVER['PHP_SELF'].'?y='.$prevWeek['year'].'&m='.$prevWeek['month'].'&d='.$prevWeek['day']; |
|
| 55 | 55 | |
| 56 | 56 | $nextWeek = $Week->nextWeek('array'); |
| 57 | -$nextWeekLink = $_SERVER['PHP_SELF'] . '?y=' . $nextWeek['year'] . '&m=' . $nextWeek['month'] . '&d=' . $nextWeek['day']; |
|
| 57 | +$nextWeekLink = $_SERVER['PHP_SELF'].'?y='.$nextWeek['year'].'&m='.$nextWeek['month'].'&d='.$nextWeek['day']; |
|
| 58 | 58 | ?> |
| 59 | 59 | <p><a href="<?php echo $prevWeekLink; ?>"><<</a> | <a href="<?php echo $nextWeekLink; ?>">>></a></p> |
| 60 | 60 | </body> |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | /** |
| 3 | 3 | * Description: a SOAP Calendar Server. |
| 4 | 4 | */ |
| 5 | -if (!@require_once __DIR__ . '/SOAP/Server.php') { |
|
| 5 | +if (!@require_once __DIR__.'/SOAP/Server.php') { |
|
| 6 | 6 | die('You must have PEAR::SOAP installed'); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 9 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 10 | 10 | define('CALENDAR_ROOT', '../../'); |
| 11 | 11 | } |
| 12 | 12 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | 'in' => ['year' => 'int', 'month' => 'int'], |
| 25 | 25 | 'out' => ['month' => '{urn:PEAR_SOAP_Calendar}Month'], |
| 26 | 26 | ]; |
| 27 | - $this->__typedef['Month'] = [ |
|
| 27 | + $this->__typedef['Month'] = [ |
|
| 28 | 28 | 'monthname' => 'string', |
| 29 | 29 | 'days' => '{urn:PEAR_SOAP_Calendar}MonthDays', |
| 30 | 30 | ]; |
@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function getMonth($year, $month) |
| 60 | 60 | { |
| 61 | - require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
| 61 | + require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 62 | 62 | $Month = new Calendar_Month_Weekdays($year, $month); |
| 63 | 63 | if (!$Month->isValid()) { |
| 64 | 64 | $V = $Month->getValidator(); |
| 65 | 65 | $errorMsg = ''; |
| 66 | 66 | while ($error = $V->fetch()) { |
| 67 | - $errorMsg .= $error->toString() . "\n"; |
|
| 67 | + $errorMsg .= $error->toString()."\n"; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | return new Soap_fault($errorMsg, 'Client'); |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | $Month->build(); |
| 75 | 75 | while ($Day = $Month->fetch()) { |
| 76 | 76 | $day = [ |
| 77 | - 'isFirst' => (int)$Day->isFirst(), |
|
| 78 | - 'isLast' => (int)$Day->isLast(), |
|
| 79 | - 'isEmpty' => (int)$Day->isEmpty(), |
|
| 80 | - 'day' => (int)$Day->thisDay(), |
|
| 77 | + 'isFirst' => (int) $Day->isFirst(), |
|
| 78 | + 'isLast' => (int) $Day->isLast(), |
|
| 79 | + 'isEmpty' => (int) $Day->isEmpty(), |
|
| 80 | + 'day' => (int) $Day->thisDay(), |
|
| 81 | 81 | ]; |
| 82 | 82 | $days[] = $day; |
| 83 | 83 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | if ('POST' === strtoupper($_SERVER['REQUEST_METHOD'])) { |
| 96 | 96 | $server->service($GLOBALS['HTTP_RAW_POST_DATA']); |
| 97 | 97 | } else { |
| 98 | - require_once __DIR__ . '/SOAP/Disco.php'; |
|
| 98 | + require_once __DIR__.'/SOAP/Disco.php'; |
|
| 99 | 99 | $disco = new SOAP_DISCO_Server($server, 'PEAR_SOAP_Calendar'); |
| 100 | 100 | if (\Xmf\Request::hasVar('QUERY_STRING', 'SERVER') && 0 == strcasecmp($_SERVER['QUERY_STRING'], 'wsdl')) { |
| 101 | 101 | header('Content-type: text/xml'); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | { |
| 8 | 8 | list($usec, $sec) = explode(' ', microtime()); |
| 9 | 9 | |
| 10 | - return (float)$usec + (float)$sec; |
|
| 10 | + return (float) $usec + (float) $sec; |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | $start = getmicrotime(); |
@@ -15,11 +15,11 @@ discard block |
||
| 15 | 15 | // Switch to PEAR::Date engine |
| 16 | 16 | define('CALENDAR_ENGINE', 'PearDate'); |
| 17 | 17 | |
| 18 | -if (!@require_once __DIR__ . '/Calendar/Calendar.php') { |
|
| 18 | +if (!@require_once __DIR__.'/Calendar/Calendar.php') { |
|
| 19 | 19 | define('CALENDAR_ROOT', '../../'); |
| 20 | 20 | } |
| 21 | -require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
| 22 | -require_once CALENDAR_ROOT . 'Day.php'; |
|
| 21 | +require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
| 22 | +require_once CALENDAR_ROOT.'Day.php'; |
|
| 23 | 23 | |
| 24 | 24 | // Initialize GET variables if not set |
| 25 | 25 | if (!isset($_GET['y'])) { |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | // Construct strings for next/previous links |
| 49 | 49 | $PMonth = $month->prevMonth('object'); // Get previous month as object |
| 50 | -$prev = $_SERVER['PHP_SELF'] . '?y=' . $PMonth->thisYear() . '&m=' . $PMonth->thisMonth() . '&d=' . $PMonth->thisDay(); |
|
| 50 | +$prev = $_SERVER['PHP_SELF'].'?y='.$PMonth->thisYear().'&m='.$PMonth->thisMonth().'&d='.$PMonth->thisDay(); |
|
| 51 | 51 | $NMonth = $month->nextMonth('object'); |
| 52 | -$next = $_SERVER['PHP_SELF'] . '?y=' . $NMonth->thisYear() . '&m=' . $NMonth->thisMonth() . '&d=' . $NMonth->thisDay(); |
|
| 52 | +$next = $_SERVER['PHP_SELF'].'?y='.$NMonth->thisYear().'&m='.$NMonth->thisMonth().'&d='.$NMonth->thisDay(); |
|
| 53 | 53 | |
| 54 | 54 | $thisDate = new Date($month->thisMonth('timestamp')); |
| 55 | 55 | ?> |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | <?php |
| 117 | 117 | while ($day = $month->fetch()) { |
| 118 | 118 | // Build a link string for each day |
| 119 | - $link = $_SERVER['PHP_SELF'] . '?y=' . $day->thisYear() . '&m=' . $day->thisMonth() . '&d=' . $day->thisDay(); |
|
| 119 | + $link = $_SERVER['PHP_SELF'].'?y='.$day->thisYear().'&m='.$day->thisMonth().'&d='.$day->thisDay(); |
|
| 120 | 120 | |
| 121 | 121 | // isFirst() to find start of week |
| 122 | 122 | if ($day->isFirst()) { |
@@ -124,11 +124,11 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if ($day->isSelected()) { |
| 127 | - echo '<td class="selected">' . $day->thisDay() . '</td>' . "\n"; |
|
| 127 | + echo '<td class="selected">'.$day->thisDay().'</td>'."\n"; |
|
| 128 | 128 | } elseif ($day->isEmpty()) { |
| 129 | - echo '<td> </td>' . "\n"; |
|
| 129 | + echo '<td> </td>'."\n"; |
|
| 130 | 130 | } else { |
| 131 | - echo '<td><a href="' . $link . '">' . $day->thisDay() . '</a></td>' . "\n"; |
|
| 131 | + echo '<td><a href="'.$link.'">'.$day->thisDay().'</a></td>'."\n"; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | // isLast() to find end of week |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | </tr> |
| 149 | 149 | </table> |
| 150 | 150 | <?php |
| 151 | -echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
|
| 151 | +echo '<p><b>Took: '.(getmicrotime() - $start).' seconds</b></p>'; |
|
| 152 | 152 | ?> |
| 153 | 153 | </body> |
| 154 | 154 | </html> |