Changeset 1582

Show
Ignore:
Timestamp:
10/31/08 01:45:27 (2 months ago)
Author:
paulrogers
Message:

Updated PEAR, and PEAR packages. Packages updated include; PEAR Core, Auth, Date, DB, DB_DataObject, Mail, Mail_MIME, Mail_Queue, MDB2, Net_SMTP, Net_Socket. Part of #319

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r1580 r1582  
    33Version 4.0.2.2 
    44=============== 
     5AUTHOR: Paul Rogers <paul@omnium.net.au> 
     6DATE:   31/10/2008 
     7  - Updated PEAR, and PEAR packages. Part of [#319] 
     8  - Packages updated include: 
     9        - PEAR Core 
     10        - Auth 
     11        - Date 
     12        - DB 
     13        - DB_DataObject 
     14        - Mail 
     15        - Mail_MIME 
     16        - Mail_Queue 
     17        - MDB2 
     18        - Net_SMTP 
     19        - Net_Socket 
     20 
    521AUTHOR: Tim Neill <tim@omnium.net.au> 
    622DATE:   30/10/2008 
     
    2743    text nodes with the parser. This was mostly done to allow for prettier 
    2844    <embed> style tags for the youtube tag. It will also allow for "sprintf" 
    29     to be applied to the content captured inside tags. 
     45    to be applied to the content captured inside tags. Part of [#331] 
    3046 
    3147 
  • trunk/codebase/includes/classes/PEAR/Auth/Anonymous.php

    r1381 r1582  
    1919 * @copyright  2001-2006 The PHP Group 
    2020 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01 
    21  * @version    CVS: $Id: Anonymous.php,v 1.5 2006/03/02 06:53:08 aashley Exp $ 
     21 * @version    CVS: $Id: Anonymous.php,v 1.6 2007/06/12 03:11:26 aashley Exp $ 
    2222 * @link       http://pear.php.net/package/Auth 
    2323 * @since      File available since Release 1.3.0 
     
    3131/** 
    3232 * Anonymous Authentication 
    33  *  
    34  * This class provides anonymous authentication if username and password  
     33 * 
     34 * This class provides anonymous authentication if username and password 
    3535 * were not supplied 
    3636 * 
     
    4141 * @copyright  2001-2006 The PHP Group 
    4242 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01 
    43  * @version    Release: 1.5.0  File: $Revision: 1.5
     43 * @version    Release: 1.6.1  File: $Revision: 1.6
    4444 * @link       http://pear.php.net/package/Auth 
    4545 * @since      Class available since Release 1.3.0 
    4646 */ 
    47 class Auth_Anonymous extends Auth  
     47class Auth_Anonymous extends Auth 
    4848{ 
    4949 
     
    6666    // }}} 
    6767    // {{{ Auth_Anonymous() [constructor] 
    68      
     68 
    6969    /** 
    7070     * Pass all parameters to Parent Auth class 
    71      *  
     71     * 
    7272     * Set up the storage driver. 
    7373     * 
     
    8888    // }}} 
    8989    // {{{ login() 
    90      
     90 
    9191    /** 
    9292     * Login function 
    93      *  
     93     * 
    9494     * If no username & password is passed then login as the username 
    9595     * provided in $this->anonymous_username else call standard login() 
     
    101101     */ 
    102102    function login() { 
    103         if (   $this->allow_anonymous  
    104             && empty($this->username)  
     103        if (   $this->allow_anonymous 
     104            && empty($this->username) 
    105105            && empty($this->password) ) { 
    106106            $this->setAuth($this->anonymous_username); 
     
    116116    // }}} 
    117117    // {{{ forceLogin() 
    118      
     118 
    119119    /** 
    120120     * Force the user to login 
  • trunk/codebase/includes/classes/PEAR/Auth/Controller.php

    r1381 r1582  
    1919 * @copyright  2001-2006 The PHP Group 
    2020 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01 
    21  * @version    CVS: $Id: Controller.php,v 1.10 2006/03/02 06:53:08 aashley Exp $ 
     21 * @version    CVS: $Id: Controller.php,v 1.11 2007/06/12 03:11:26 aashley Exp $ 
    2222 * @link       http://pear.php.net/package/Auth 
    2323 * @since      File available since Release 1.3.0 
     
    2525 
    2626/** 
    27  * Controlls access to a group of php access  
    28  * and redirects to a predefined login page as  
     27 * Controlls access to a group of php access 
     28 * and redirects to a predefined login page as 
    2929 * needed 
    3030 * 
     
    4747 * if( $authController->isAuthorised() ){ 
    4848 *   $authController->redirectBack(); 
    49  * }   
     49 * } 
    5050 * </code> 
    5151 * 
     
    5555 * @copyright  2001-2006 The PHP Group 
    5656 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01 
    57  * @version    Release: 1.5.0  File: $Revision: 1.10
     57 * @version    Release: 1.6.1  File: $Revision: 1.11
    5858 * @link       http://pear.php.net/package/Auth 
    5959 * @since      Class available since Release 1.3.0 
     
    6464    // {{{ properties 
    6565 
    66     /**  
     66    /** 
    6767     * The Auth instance this controller is managing 
    6868     * 
     
    7070     */ 
    7171    var $auth = null; 
    72      
     72 
    7373    /** 
    7474     * The login URL 
     
    7676     * */ 
    7777    var $login = null; 
    78      
     78 
    7979    /** 
    8080     * The default index page to use when the caller page is not set 
    8181     * 
    82      * @var string  
     82     * @var string 
    8383     */ 
    8484    var $default = null; 
    85      
    86     /**  
    87      * If this is set to true after a succesfull login the  
    88      * Auth_Controller::redirectBack() is invoked automatically  
     85 
     86    /** 
     87     * If this is set to true after a succesfull login the 
     88     * Auth_Controller::redirectBack() is invoked automatically 
    8989     * 
    9090     * @var boolean 
     
    9494    // }}} 
    9595    // {{{ Auth_Controller() [constructor] 
    96      
     96 
    9797    /** 
    9898     * Constructor 
     
    122122    // }}} 
    123123    // {{{ setAutoRedirectBack() 
    124      
    125     /**  
     124 
     125    /** 
    126126     * Enables auto redirection when login is done 
    127      *  
     127     * 
    128128     * @param bool Sets the autoRedirectBack flag to this 
    129129     * @see Auth_Controller::autoRedirectBack 
     
    137137    // }}} 
    138138    // {{{ redirectBack() 
    139      
     139 
    140140    /** 
    141141     * Redirects Back to the calling page 
     
    147147        // If redirectback go there 
    148148        // else go to the default page 
    149          
     149 
    150150        $returnUrl = $this->auth->getAuthData('returnUrl'); 
    151151        if(!$returnUrl) { 
    152152            $returnUrl = $this->_defaultPage; 
    153153        } 
    154          
     154 
    155155        // Add some entropy to the return to make it unique 
    156156        // avoind problems with cached pages and proxies 
     
    163163        if($this->auth->status != '') { 
    164164            $url .= '&authstatus='.$this->auth->status; 
    165         }         
     165        } 
    166166        header('Location:'.$returnUrl); 
    167167        print("You could not be redirected to <a href=\"$returnUrl\">$returnUrl</a>"); 
     
    170170    // }}} 
    171171    // {{{ redirectLogin() 
    172      
     172 
    173173    /** 
    174174      * Redirects to the login Page if not authorised 
    175       *  
     175      * 
    176176      * put return page on the query or in auth 
    177177      * 
     
    181181    { 
    182182        // Go to the login Page 
    183          
     183 
    184184        // For Auth, put some check to avoid infinite redirects, this should at least exclude 
    185185        // the login page 
    186          
     186 
    187187        $url = $this->_loginPage; 
    188188        if(strpos($url, '?') === false) { 
     
    205205    // }}} 
    206206    // {{{ start() 
    207      
     207 
    208208    /** 
    209209      * Starts the Auth Procedure 
     
    227227            // Logged on and on login page 
    228228            if(strstr($_SERVER['PHP_SELF'], $this->_loginPage) && $this->auth->checkAuth()){ 
    229                 $this->autoRedirectBack ?  
     229                $this->autoRedirectBack ? 
    230230                    $this->redirectBack() : 
    231231                    null ; 
    232232            } 
    233233        } 
    234          
    235          
     234 
     235 
    236236    } 
    237237 
    238238    // }}} 
    239239    // {{{ isAuthorised() 
    240    
     240 
    241241    /** 
    242242      * Checks is the user is logged on 
  • trunk/codebase/includes/classes/PEAR/DB/DataObject.php

    r1287 r1582  
    1616 * @copyright  1997-2006 The PHP Group 
    1717 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    18  * @version    CVS: $Id: DataObject.php,v 1.432 2007/07/09 08:55:50 alan_k Exp $ 
     18 * @version    CVS: $Id: DataObject.php,v 1.439 2008/01/30 02:14:06 alan_k Exp $ 
    1919 * @link       http://pear.php.net/package/DB_DataObject 
    2020 */ 
     
    236236    * @var      string 
    237237    */ 
    238     var $_DB_DataObject_version = "1.8.7"; 
     238    var $_DB_DataObject_version = "1.8.8"; 
    239239 
    240240    /** 
     
    389389    { 
    390390        global $_DB_DATAOBJECT; 
    391         if (!isset($this->_query)) { 
     391        if ($this->_query === false) { 
    392392            $this->raiseError( 
    393393                "You cannot do two queries on the same object (copy it before finding)",  
     
    572572            $this->debug("{$this->__table} DONE", "fetchrow",2); 
    573573        } 
    574         if (isset($this->_query) &&  empty($_DB_DATAOBJECT['CONFIG']['keep_query_after_fetch'])) { 
    575             unset($this->_query)
     574        if (($this->_query !== false) &&  empty($_DB_DATAOBJECT['CONFIG']['keep_query_after_fetch'])) { 
     575            $this->_query = false
    576576        } 
    577577        return true; 
     
    592592    function whereAdd($cond = false, $logic = 'AND') 
    593593    { 
    594          
    595         if (!isset($this->_query)) { 
     594        // for PHP5.2.3 - there is a bug with setting array properties of an object. 
     595        $_query = $this->_query; 
     596          
     597        if (!isset($this->_query) || ($_query === false)) { 
    596598            return $this->raiseError( 
    597599                "You cannot do two queries on the same object (clone it before finding)",  
     
    601603        if ($cond === false) { 
    602604            $r = $this->_query['condition']; 
    603             $this->_query['condition'] = ''; 
     605            $_query['condition'] = ''; 
     606            $this->_query = $_query; 
    604607            return preg_replace('/^\s+WHERE\s+/','',$r); 
    605608        } 
     
    608611            return $this->raiseError("WhereAdd: No Valid Arguments", DB_DATAOBJECT_ERROR_INVALIDARGS); 
    609612        } 
    610         $r = $this->_query['condition']; 
    611         if ($this->_query['condition']) { 
    612             $this->_query['condition'] .= " {$logic} ( {$cond} )"; 
     613        $r = $_query['condition']; 
     614        if ($_query['condition']) { 
     615            $_query['condition'] .= " {$logic} ( {$cond} )"; 
     616            $this->_query = $_query; 
    613617            return $r; 
    614618        } 
    615         $this->_query['condition'] = " WHERE ( {$cond} ) "; 
     619        $_query['condition'] = " WHERE ( {$cond} ) "; 
     620        $this->_query = $_query; 
    616621        return $r; 
    617622    } 
     
    630635    function orderBy($order = false) 
    631636    { 
    632         if (!isset($this->_query)) { 
     637        if ($this->_query === false) { 
    633638            $this->raiseError( 
    634639                "You cannot do two queries on the same object (copy it before finding)",  
     
    665670    function groupBy($group = false) 
    666671    { 
    667         if (!isset($this->_query)) { 
     672        if ($this->_query === false) { 
    668673            $this->raiseError( 
    669674                "You cannot do two queries on the same object (copy it before finding)",  
     
    700705    function having($having = false) 
    701706    { 
    702         if (!isset($this->_query)) { 
     707        if ($this->_query === false) { 
    703708            $this->raiseError( 
    704709                "You cannot do two queries on the same object (copy it before finding)",  
     
    741746    function limit($a = null, $b = null) 
    742747    { 
    743         if (!isset($this->_query)) { 
     748        if ($this->_query === false) { 
    744749            $this->raiseError( 
    745750                "You cannot do two queries on the same object (copy it before finding)",  
     
    784789    function selectAdd($k = null) 
    785790    { 
    786         if (!isset($this->_query)) { 
     791        if ($this->_query === false) { 
    787792            $this->raiseError( 
    788793                "You cannot do two queries on the same object (copy it before finding)",  
     
    826831        global $_DB_DATAOBJECT; 
    827832         
    828         if (!isset($this->_query)) { 
     833        if ($this->_query === false) { 
    829834            $this->raiseError( 
    830835                "You cannot do two queries on the same object (copy it before finding)",  
     
    10591064                        $mssql_key = $DB->$method("SELECT @@IDENTITY"); 
    10601065                        if (PEAR::isError($mssql_key)) { 
    1061                             $this->raiseError($r); 
     1066                            $this->raiseError($mssql_key); 
    10621067                            return false; 
    10631068                        } 
     
    10671072                    case 'pgsql': 
    10681073                        if (!$seq) { 
    1069                             $seq = $DB->getSequenceName($this->__table ); 
     1074                            $seq = $DB->getSequenceName(strtolower($this->__table)); 
    10701075                        } 
    1071                         $pgsql_key = $DB->getOne("SELECT currval('".$seq . "')");  
     1076                        $db_driver = empty($options['db_driver']) ? 'DB' : $options['db_driver']; 
     1077                        $method = ($db_driver  == 'DB') ? 'getOne' : 'queryOne'; 
     1078                        $pgsql_key = $DB->$method("SELECT currval('".$seq . "')");  
     1079 
    10721080 
    10731081                        if (PEAR::isError($pgsql_key)) { 
    1074                             $this->raiseError($r); 
     1082                            $this->raiseError($pgsql_key); 
    10751083                            return false; 
    10761084                        } 
     
    11451153         
    11461154         
    1147         $original_query = isset($this->_query) ? $this->_query : null
     1155        $original_query = $this->_query
    11481156         
    11491157        $items =  isset($_DB_DATAOBJECT['INI'][$this->_database][$this->__table]) ?    
     
    13591367 
    13601368        // don't delete without a condition 
    1361         if (isset($this->_query) && $this->_query['condition']) { 
     1369        if (($this->_query !== false) && $this->_query['condition']) { 
    13621370         
    13631371            $table = ($quoteIdentifiers ? $DB->quoteIdentifier($this->__table) : $this->__table); 
     
    14941502         
    14951503        $t = clone($this); 
     1504        $items   = $t->table(); 
    14961505         
    14971506        $quoteIdentifiers = !empty($_DB_DATAOBJECT['CONFIG']['quote_identifiers']); 
    14981507         
    1499         $items   = $t->table(); 
     1508         
    15001509        if (!isset($t->_query)) { 
    15011510            $this->raiseError( 
     
    20362045        // we need to get the new improved tabledata sorted out first. 
    20372046         
    2038         if (    in_array($dbtype , array( 'mysql', 'mysqli', 'mssql', 'ifx')) &&  
     2047        if (    in_array($dbtype , array('psql', 'mysql', 'mysqli', 'mssql', 'ifx')) &&  
    20392048                ($table[$usekey] & DB_DATAOBJECT_INT) &&  
    20402049                isset($realkeys[$usekey]) && ($realkeys[$usekey] == 'N') 
     
    22282237            require_once 'DB.php'; 
    22292238            if ($db_options) { 
    2230                 $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = DB::connect($dsn,$db_options); 
     2239                $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = &DB::connect($dsn,$db_options); 
    22312240            } else { 
    2232                 $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = DB::connect($dsn); 
     2241                $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = &DB::connect($dsn); 
    22332242            } 
    22342243             
     
    22382247            // this allows the setings of compatibility on MDB2  
    22392248            $db_options = PEAR::getStaticProperty('MDB2','options'); 
    2240             $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = MDB2::connect($dsn,$db_options); 
     2249            $db_options = is_array($db_options) ? $db_options : array(); 
     2250            $db_options['portability'] = isset($db_options['portability'] ) 
     2251                ? $db_options['portability']  : MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_FIX_CASE; 
     2252            $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = &MDB2::connect($dsn,$db_options); 
    22412253             
    22422254        } 
     
    24312443         
    24322444        // if we dont have query vars.. - reset them. 
    2433         if (!isset($this->_query)) { 
     2445        if ($this->_query === false) { 
    24342446            $x = new DB_DataObject; 
    24352447            $this->_query= $x->_query; 
     
    32863298                $obj->whereAdd("{$joinAs}.{$kSql} = 0"); 
    32873299            } 
    3288             if (!isset($this->_query)) { 
     3300            if ($this->_query === false) { 
    32893301                $this->raiseError( 
    32903302                    "joinAdd can not be run from a object that has had a query run on it, 
  • trunk/codebase/includes/classes/PEAR/DB/DataObject/Generator.php

    r1287 r1582  
    1616 * @copyright  1997-2006 The PHP Group 
    1717 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0 
    18  * @version    CVS: $Id: Generator.php,v 1.136 2007/07/12 02:57:04 alan_k Exp $ 
     18 * @version    CVS: $Id: Generator.php,v 1.141 2008/01/30 02:29:39 alan_k Exp $ 
    1919 * @link       http://pear.php.net/package/DB_DataObject 
    2020 */ 
     
    257257                } 
    258258            } 
    259             $quotedTable = !empty($options['quote_identifiers']) ?  
     259            $quotedTable = !empty($options['quote_identifiers_tableinfo']) ?  
    260260                $__DB->quoteIdentifier($table) : $table; 
    261261                 
     
    354354        fclose($fh); 
    355355        $perms = file_exists($file) ? fileperms($file) : 0755; 
    356         rename($tmpname, $file); 
     356        // windows can fail doing this. - not a perfect solution but otherwise it's getting really kludgy.. 
     357         
     358        if (!@rename($tmpname, $file)) {  
     359            unlink($file);  
     360            rename($tmpname, $file); 
     361        } 
    357362        chmod($file,$perms); 
    358363        //$ret = $this->_newConfig->writeInput($file,false); 
     
    445450        fclose($fh); 
    446451        $perms = file_exists($file) ? fileperms($file) : 0755; 
    447         rename($tmpname, $file); 
     452        // windows can fail doing this. - not a perfect solution but otherwise it's getting really kludgy.. 
     453        if (!@rename($tmpname, $file)) {  
     454            unlink($file);  
     455            rename($tmpname, $file); 
     456        } 
    448457        chmod($file, $perms); 
    449458    } 
     
    600609                         "** Please submit a bug, describe what type you expect this     **\n". 
    601610                         "** column  to be                                               **\n". 
     611                         "** ---------POSSIBLE FIX / WORKAROUND -------------------------**\n". 
     612                         "** Try using MDB2 as the backend - eg set the config option    **\n". 
     613                         "** db_driver = MDB2                                            **\n". 
    602614                         "*****************************************************************\n"; 
    603615                    $write_ini = false; 
     
    776788            fclose($fh); 
    777789            $perms = file_exists($outfilename) ? fileperms($outfilename) : 0755; 
    778             rename($tmpname, $outfilename); 
     790             
     791            // windows can fail doing this. - not a perfect solution but otherwise it's getting really kludgy.. 
     792            if (!@rename($tmpname, $outfilename)) { 
     793                unlink($outfilename);  
     794                rename($tmpname, $outfilename); 
     795            } 
     796             
    779797            chmod($outfilename, $perms); 
    780798        } 
     
    9851003        $class_rewrite = 'DB_DataObject'; 
    9861004        $options = &PEAR::getStaticProperty('DB_DataObject','options'); 
    987         if (!($class_rewrite = @$options['generator_class_rewrite'])) { 
     1005        if (empty($options['generator_class_rewrite']) || !($class_rewrite = $options['generator_class_rewrite'])) { 
    9881006            $class_rewrite = 'DB_DataObject'; 
    9891007        } 
     
    9931011 
    9941012        $input = preg_replace( 
    995             '/(\n|\r\n)class\s*[a-z0-9_]+\s*extends\s*' .$class_rewrite . '\s*\{(\n|\r\n)/si', 
     1013            '/(\n|\r\n)class\s*[a-z0-9_]+\s*extends\s*' .$class_rewrite . '\s*(\n|\r\n)\{(\n|\r\n)/si', 
    9961014            "\nclass {$this->classname} extends {$this->_extends} \n{\n", 
    9971015            $input); 
  • trunk/codebase/includes/classes/PEAR/Date.php

    r1287 r1582  
    77 * Generic date handling class for PEAR 
    88 * 
    9  * Generic date handling class for PEAR.  Attempts to be time zone aware 
    10  * through the Date::TimeZone class.  Supports several operations from 
    11  * Date::Calc on Date objects. 
     9 * Handles time zones and changes from local standard to local Summer 
     10 * time (daylight-saving time) through the Date_TimeZone class. 
     11 * Supports several operations from Date_Calc on Date objects. 
    1212 * 
    1313 * PHP versions 4 and 5 
     
    1515 * LICENSE: 
    1616 * 
    17  * Copyright (c) 1997-2006 Baba Buehler, Pierre-Alain Joye 
     17 * Copyright (c) 1997-2007 Baba Buehler, Pierre-Alain Joye, Firman 
     18 * Wandayandi, C.A. Woodcock 
    1819 * All rights reserved. 
    1920 * 
     
    3940 * @author     Pierre-Alain Joye <pajoye@php.net> 
    4041 * @author     Firman Wandayandi <firman@php.net> 
    41  * @copyright  1997-2006 Baba Buehler, Pierre-Alain Joye 
     42 * @author     C.A. Woodcock <c01234@netcomuk.co.uk> 
     43 * @copyright  1997-2007 Baba Buehler, Pierre-Alain Joye, Firman Wandayandi, C.A. Woodcock 
    4244 * @license    http://www.opensource.org/licenses/bsd-license.php 
    4345 *             BSD License 
    44  * @version    CVS: $Id: Date.php,v 1.41 2006/11/22 00:28:03 firman Exp $ 
     46 * @version    CVS: $Id: Date.php,v 1.89 2008/03/23 18:34:16 c01234 Exp $ 
    4547 * @link       http://pear.php.net/package/Date 
    4648 */ 
    4749 
     50 
    4851// }}} 
    49  
     52// {{{ Error constants 
     53 
     54define('DATE_ERROR_INVALIDDATE', 1); 
     55define('DATE_ERROR_INVALIDTIME', 2); 
     56define('DATE_ERROR_INVALIDTIMEZONE', 3); 
     57define('DATE_ERROR_INVALIDDATEFORMAT', 4); 
     58define('DATE_ERROR_INVALIDFORMATSTRING', 5); 
     59 
     60 
     61// }}} 
    5062// {{{ Includes 
    5163 
     64require_once 'PEAR.php'; 
     65 
    5266/** 
    53  * Load Date_TimeZone. 
     67 * Load Date_TimeZone 
    5468 */ 
    5569require_once 'Date/TimeZone.php'; 
    5670 
    5771/** 
    58  * Load Date_Calc. 
     72 * Load Date_Calc 
    5973 */ 
    6074require_once 'Date/Calc.php'; 
    6175 
    6276/** 
    63  * Load Date_Span. 
     77 * Load Date_Span 
    6478 */ 
    6579require_once 'Date/Span.php'; 
    6680 
     81 
    6782// }}} 
    68 // {{{ Constants 
    69  
    70 // {{{ Output formats Pass this to getDate(). 
     83// {{{ General constants 
     84 
     85/** 
     86 * Whether to capture the micro-time (in microseconds) by default 
     87 * in calls to 'Date::setNow()'.  Note that this makes a call to 
     88 * 'gettimeofday()', which may not work on all systems. 
     89 * 
     90 * @since    Constant available since Release 1.5.0 
     91 */ 
     92define('DATE_CAPTURE_MICROTIME_BY_DEFAULT', false); 
     93 
     94/** 
     95 * Whether to correct, by adding the local Summer time offset, the 
     96 * specified time if it falls in the 'skipped hour' (encountered 
     97 * when the clocks go forward). 
     98 * 
     99 * N.B. if specified as 'false', and if a time zone that adjusts 
     100 * for Summer time is specified, then an object of this class will 
     101 * be set to a semi-invalid state if an invalid time is set.  That 
     102 * is, an error will not be returned, unless the user then calls 
     103 * a function, directly or indirectly, that accesses the time 
     104 * part of the object.  So, for example, if the user calls: 
     105 * 
     106 *  <code>$date_object->format2('HH.MI.SS')</code> or: 
     107 *  <code>$date->object->addSeconds(30)</code>, 
     108 * 
     109 * an error will be returned if the time is invalid.  However, 
     110 * if the user calls: 
     111 * 
     112 *  <code>$date->object->addDays(1)</code>, 
     113 * 
     114 * for example, such that the time is no longer invalid, then the 
     115 * object will no longer be in this invalid state.  This behaviour 
     116 * is intended to minimize unexpected errors when a user uses the 
     117 * class to do addition with days only, and does not intend to 
     118 * access the time. 
     119 * 
     120 * Of course, this constant will be unused if the user chooses to 
     121 * work in UTC or a time zone without Summer time, in which case 
     122 * this situation will never arise. 
     123 * 
     124 * This constant is set to 'true' by default for backwards-compatibility 
     125 * reasons, however, you are recommended to set it to 'false'.  Note that the 
     126 * behaviour is not intended to match that of previous versions of the class 
     127 * in terms of ignoring the Summer time offset when making calculations which 
     128 * involve dates in both standard and Summer time - this was recognized as a 
     129 * bug - but in terms of returning a PEAR error object when the user sets the 
     130 * object to an invalid date (i.e. a time in the hour which is skipped when 
     131 * the clocks go forwards, which in Europe would be a time such as 01.30). 
     132 * Backwards compatibility here means that the behaviour is the same as it 
     133 * used to be, less the bug. 
     134 * 
     135 * Note that this problem is not an issue for the user if: 
     136 * 
     137 *  (a) the user uses a time zone that does not observe Summer time, e.g. UTC 
     138 *  (b) the user never accesses the time, that is, he never makes a call to 
     139 *       Date::getHour() or Date::format("%H"), for example, even if he sets 
     140 *       the time to something invalid 
     141 *  (c) the user sets DATE_CORRECTINVALIDTIME_DEFAULT to true 
     142 * 
     143 * @since    Constant available since Release 1.5.0 
     144 */ 
     145define('DATE_CORRECTINVALIDTIME_DEFAULT', true); 
     146 
     147/** 
     148 * Whether to validate dates (i.e. day-month-year, ignoring the time) by 
     149 * disallowing invalid dates (e.g. 31st February) being set by the following 
     150 * functions: 
     151 * 
     152 *  Date::setYear() 
     153 *  Date::setMonth() 
     154 *  Date::setDay() 
     155 * 
     156 * If the constant is set to 'true', then the date will be checked (by 
     157 * default), and if invalid, an error will be returned with the Date object 
     158 * left unmodified. 
     159 * 
     160 * This constant is set to 'false' by default for backwards-compatibility 
     161 * reasons, however, you are recommended to set it to 'true'. 
     162 * 
     163 * Note that setHour(), setMinute(), setSecond() and setPartSecond() 
     164 * allow an invalid date/time to be set regardless of the value of this 
     165 * constant. 
     166 * 
     167 * @since    Constant available since Release 1.5.0 
     168 */ 
     169define('DATE_VALIDATE_DATE_BY_DEFAULT', false); 
     170 
     171/** 
     172 * Whether, by default, to accept times including leap seconds (i.e. '23.59.60') 
     173 * when setting the date/time, and whether to count leap seconds in the 
     174 * following functions: 
     175 * 
     176 *  Date::addSeconds() 
     177 *  Date::subtractSeconds() 
     178 *  Date_Calc::addSeconds() 
     179 *  Date::round() 
     180 *  Date::roundSeconds() 
     181 * 
     182 * This constant is set to 'false' by default for backwards-compatibility 
     183 * reasons, however, you are recommended to set it to 'true'. 
     184 * 
     185 * Note that this constant does not affect Date::addSpan() and 
     186 * Date::subtractSpan() which will not count leap seconds in any case. 
     187 * 
     188 * @since    Constant available since Release 1.5.0 
     189 */ 
     190define('DATE_COUNT_LEAP_SECONDS', false); 
     191 
     192 
     193// }}} 
     194// {{{ Output format constants (used in 'Date::getDate()') 
    71195 
    72196/** 
     
    100224define('DATE_FORMAT_UNIXTIME', 5); 
    101225 
    102 // }}} 
    103226 
    104227// }}} 
     
    108231 * Generic date handling class for PEAR 
    109232 * 
    110  * Generic date handling class for PEAR.  Attempts to be time zone aware 
    111  * through the Date::TimeZone class.  Supports several operations from 
    112  * Date::Calc on Date objects. 
     233 * Supports time zones with the Date_TimeZone class.  Supports several 
     234 * operations from Date_Calc on Date objects. 
    113235 * 
    114  * @author     Baba Buehler <baba@babaz.com> 
    115  * @author     Pierre-Alain Joye <pajoye@php.net> 
    116  * @author     Firman Wandayandi <firman@php.net> 
    117  * @copyright  1997-2006 Baba Buehler, Pierre-Alain Joye 
    118  * @license    http://www.opensource.org/licenses/bsd-license.php 
    119  *             BSD License 
    120  * @version    Release: 1.4.7 
    121  * @link       http://pear.php.net/package/Date 
     236 * Note to developers: the class stores the local time and date in the 
     237 * local standard time.  That is, it does not store the time as the 
     238 * local Summer time when and if the time zone is in Summer time.  It 
     239 * is much easier to store local standard time and remember to offset 
     240 * it when the user requests it. 
     241 * 
     242 * @category  Date and Time 
     243 * @package   Date 
     244 * @author    Baba Buehler <baba@babaz.com> 
     245 * @author    Pierre-Alain Joye <pajoye@php.net> 
     246 * @author    Firman Wandayandi <firman@php.net> 
     247 * @author    C.A. Woodcock <c01234@netcomuk.co.uk> 
     248 * @copyright 1997-2007 Baba Buehler, Pierre-Alain Joye, Firman Wandayandi, C.A. Woodcock 
     249 * @license   http://www.opensource.org/licenses/bsd-license.php 
     250 *            BSD License 
     251 * @version   Release: 1.5.0a1 
     252 * @link      http://pear.php.net/package/Date 
    122253 */ 
    123254class Date 
    124255{ 
     256 
    125257    // {{{ Properties 
    126258 
    127259    /** 
    128      * the year 
    129      * @var int 
     260     * The year 
     261     * 
     262     * @var      int 
     263     * @access   private 
     264     * @since    Property available since Release 1.0 
    130265     */ 
    131266    var $year; 
    132267 
    133268    /** 
    134      * the month 
    135      * @var int 
     269     * The month 
     270     * 
     271     * @var      int 
     272     * @access   private 
     273     * @since    Property available since Release 1.0 
    136274     */ 
    137275    var $month; 
    138276 
    139277    /** 
    140      * the day 
    141      * @var int 
     278     * The day 
     279     * 
     280     * @var      int 
     281     * @access   private 
     282     * @since    Property available since Release 1.0 
    142283     */ 
    143284    var $day; 
    144285 
    145286    /** 
    146      * the hour 
    147      * @var int 
     287     * The hour 
     288     * 
     289     * @var      int 
     290     * @access   private 
     291     * @since    Property available since Release 1.0 
    148292     */ 
    149293    var $hour; 
    150294 
    151295    /** 
    152      * the minute 
    153      * @var int 
     296     * The minute 
     297     * 
     298     * @var      int 
     299     * @access   private 
     300     * @since    Property available since Release 1.0 
    154301     */ 
    155302    var $minute; 
    156303 
    157304    /** 
    158      * the second 
    159      * @var int&nb