Y_Less

ysi-version php

Oct 26th, 2010
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.71 KB | None | 0 0
  1. <?php
  2.         define('NL', "\r\n");
  3.         $version = '1.02.0011';
  4.         $new = $_GET['v'];
  5.         if ($_GET['c'] !== '2' || !is_string($new) || $new == $version)
  6.         {
  7.                 echo '1' . NL . $version . NL;
  8.                 exit;
  9.         }
  10.         // If we get to here, they are using a newer version of the
  11.         // version system, but it's not the latest.
  12.         echo '2' . NL . $version . NL;
  13.         // Define the data for the changelog.
  14.         $changelog = array(
  15.                 '1.02.0011' => 'Added files for the y_timers Delay: system previ                                                                                                                                                                                                                                        ously not updated.  Also updated the version system to accept changelogs.',
  16. //              '1.02.0012' => 'Testing multiple changelog entries.  May as well                                                                                                                                                                                                                                         make it a long one.',
  17.         );
  18.         foreach ($changelog as $v => $c)
  19.         {
  20.                 if ($v > $new)
  21.                 {
  22.                         echo NL . NL . '  ' . $v . ':' . NL . NL . wordwrap('  '                                                                                                                                                                                                                                         . $c, 38, NL, true);
  23.                 }
  24.         }
  25. ?>
  26.  
  27. alex@server /raid/web/version $ cat index.php
  28. <?php
  29.         define('NL', "\r\n");
  30.         $version = '1.02.0011';
  31.         $new = $_GET['v'];
  32.         if ($_GET['c'] !== '2' || !is_string($new) || $new == $version)
  33.         {
  34.                 echo '1' . NL . $version . NL;
  35.                 exit;
  36.         }
  37.         // If we get to here, they are using a newer version of the
  38.         // version system, but it's not the latest.
  39.         echo '2' . NL . $version . NL;
  40.         // Define the data for the changelog.
  41.         $changelog = array(
  42.                 '1.02.0011' => 'Added files for the y_timers Delay: system previously not updated.  Also updated the version system to accept changelogs.',
  43. //              '1.02.0012' => 'Testing multiple changelog entries.  May as well make it a long one.',
  44.         );
  45.         foreach ($changelog as $v => $c)
  46.         {
  47.                 if ($v > $new)
  48.                 {
  49.                         echo NL . NL . '  ' . $v . ':' . NL . NL . wordwrap('  ' . $c, 38, NL, true);
  50.                 }
  51.         }
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment