home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Resources / Developers / XAMPP 1.5.4 / Windows installer / xampp-win32-1.5.4-installer.exe / xampp / php / pear / CodeGen / Release.php < prev    next >
Encoding:
PHP Script  |  2006-04-07  |  3.9 KB  |  214 lines

  1. <?php
  2. /**
  3.  * Class collecting release information
  4.  *
  5.  * PHP versions 5
  6.  *
  7.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  8.  * that is available through the world-wide-web at the following URI:
  9.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  10.  * the PHP License and are unable to obtain it through the web, please
  11.  * send a note to license@php.net so we can mail you a copy immediately.
  12.  *
  13.  * @category   Tools and Utilities
  14.  * @package    CodeGen
  15.  * @author     Hartmut Holzgraefe <hartmut@php.net>
  16.  * @copyright  2005 Hartmut Holzgraefe
  17.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  18.  * @version    CVS: $Id: Release.php,v 1.5 2006/01/25 21:16:34 hholzgra Exp $
  19.  * @link       http://pear.php.net/package/CodeGen
  20.  */
  21.  
  22. /**
  23.  * Class collecting release information
  24.  *
  25.  * This class wraps up the functionality needed for the 
  26.  * command line script. 
  27.  *
  28.  * @category   Tools and Utilities
  29.  * @package    CodeGen
  30.  * @author     Hartmut Holzgraefe <hartmut@php.net>
  31.  * @copyright  2005 Hartmut Holzgraefe
  32.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  33.  * @version    Release: @package_version@
  34.  * @link       http://pear.php.net/package/CodeGen
  35.  */
  36. class CodeGen_Release 
  37. {
  38.     /**
  39.      * The current version number 
  40.      *
  41.      * @access private
  42.      * @var     string
  43.      */
  44.     protected $version = "0.0.1";
  45.     
  46.     /**
  47.      * Set method for version number
  48.      *
  49.      * @access public
  50.      * @param  string version
  51.      * @return bool   true on success
  52.      */
  53.     function setVersion($version) 
  54.     {
  55.         // TODO check format
  56.         $this->version = $version;
  57.         
  58.         return true;
  59.     }
  60.     
  61.     /**
  62.      * version getter
  63.      *
  64.      * @access public
  65.      * @return string
  66.      */
  67.     function getVersion()
  68.     {
  69.         return $this->version;
  70.     }
  71.  
  72.  
  73.  
  74.     /**
  75.      * The release date
  76.      *
  77.      * @access private
  78.      * @var     string
  79.      */
  80.     protected $date = "";
  81.     
  82.     /**
  83.      * Set method for release date
  84.      *
  85.      * @access public
  86.      * @param  int    timestamp
  87.      * @return bool   true on success
  88.      */
  89.     function setDate($date)
  90.     {
  91.         if (!is_numeric($date)) {
  92.             $date = strtotime($date);
  93.         }
  94.  
  95.         // TODO check valid dates
  96.         $this->date = $date;
  97.         
  98.         return true;
  99.     }
  100.     
  101.  
  102.     /**
  103.      * date getter
  104.      *
  105.      * @access public
  106.      * @return int 
  107.      */
  108.     function getDate()
  109.     {
  110.         return $this->date;
  111.     }
  112.  
  113.  
  114.  
  115.  
  116.  
  117.     /**
  118.      * The 'state': alpha, beta, stable, devel ...
  119.      *
  120.      * @access private
  121.      * @var     string
  122.      */
  123.     protected $state = "devel";
  124.     
  125.     /**
  126.      * Set method for state
  127.      *
  128.      * @access public
  129.      * @param  string state
  130.      * @return bool   true on success
  131.      */
  132.     function setState($state)
  133.     {
  134.         switch ($state) {
  135.             case "alpha":
  136.             case "beta":
  137.             case "stable":
  138.             case "snapshot":
  139.             case "devel":
  140.                 $this->state = $state;
  141.                 return true;
  142.  
  143.             default:
  144.                 return PEAR::raiseError("'$state' is not a valid release state'");
  145.         }
  146.     }
  147.  
  148.     /**
  149.      * state getter
  150.      *
  151.      * @access public
  152.      * @return string
  153.      */
  154.     function getState()
  155.     {
  156.         return $this->state;
  157.     }
  158.  
  159.  
  160.  
  161.  
  162.  
  163.     /**
  164.      * Release notes
  165.      *
  166.      * @access private
  167.      * @var     string
  168.      */
  169.     protected $notes = "";
  170.  
  171.  
  172.     /**
  173.      * Set method for release notes
  174.      *
  175.      * @access public
  176.      * @param  string release notes
  177.      * @return bool   true on success
  178.      */
  179.     function setNotes($notes)
  180.     {
  181.         $this->notes = $notes;
  182.         
  183.         return true;
  184.     }
  185.     
  186.     /**
  187.      * notes getter
  188.      *
  189.      * @access public
  190.      * @return string
  191.      */
  192.     function getNotes()
  193.     {
  194.         return $this->notes;
  195.     }
  196.  
  197.     
  198.  
  199.  
  200.  
  201.     /**
  202.      * Constructor
  203.      *
  204.      * @access public
  205.      */
  206.     function __construct()
  207.     {
  208.         $this->date = time();
  209.     }
  210.  
  211. }
  212.  
  213. ?>
  214.