Changeset 2481

Show
Ignore:
Timestamp:
07/29/2008 08:43:12 PM (5 months ago)
Author:
knut
Message:

fixed #890

Location:
trunk/framework
Files:
15 modified

Legend:

Unmodified
Added
Removed
  • trunk/framework/Data/ActiveRecord/TActiveRecordManager.php

    r2329 r2481  
    9494        public function getRecordGateway() 
    9595        { 
    96                 if(is_null($this->_gateway)) 
     96                if($this->_gateway === null) { 
    9797                        $this->_gateway = $this->createRecordGateway(); 
     98                } 
    9899                return $this->_gateway; 
    99100        } 
  • trunk/framework/Data/SqlMap/TSqlMapConfig.php

    r2373 r2481  
    4848        { 
    4949                $cache = $this->getApplication()->getCache(); 
    50                 if(!is_null($cache)) 
     50                if($cache !== null) { 
    5151                        $cache->delete($this->getCacheKey()); 
     52                }        
    5253        } 
    5354 
     
    6162                { 
    6263                        $cache = $this->getApplication()->getCache(); 
    63                         if(!is_null($cache)) 
     64                        if($cache !== null) { 
    6465                                return $cache->set($this->getCacheKey(), $manager); 
     66                        } 
    6567                } 
    6668                return false; 
     
    7678                { 
    7779                        $cache = $this->getApplication()->getCache(); 
    78                         if(!is_null($cache)) 
     80                        if($cache !== null) 
    7981                        { 
    8082                                $manager = $cache->get($this->getCacheKey()); 
     
    105107                { 
    106108                        $file = Prado::getPathOfNamespace($value,self::CONFIG_FILE_EXT); 
    107                         if(is_null($file) || !is_file($file)) 
     109                        if($file === null || !is_file($file)) 
    108110                                throw new TConfigurationException('sqlmap_configfile_invalid',$value); 
    109111                        else 
  • trunk/framework/I18N/core/CultureInfo.php

    r2398 r2481  
    376376        function getDateTimeFormat() 
    377377        { 
    378                 if(is_null($this->dateTimeFormat)) 
     378                if($this->dateTimeFormat === null) 
    379379                { 
    380380                        $calendar = $this->getCalendar(); 
     
    456456        { 
    457457                static $invariant; 
    458                 if(is_null($invariant)) 
     458                if($invariant === null) 
    459459                        $invariant = new CultureInfo(); 
    460460                return $invariant; 
     
    479479        function getNumberFormat() 
    480480        { 
    481                 if(is_null($this->numberFormat)) 
     481                if($this->numberFormat === null) 
    482482                { 
    483483                        $elements = $this->findInfo('NumberElements'); 
  • trunk/framework/I18N/core/DateFormat.php

    r1509 r2481  
    9292        function __construct($formatInfo=null) 
    9393        { 
    94                 if(is_null($formatInfo)) 
     94                if($formatInfo === null) 
    9595                        $this->formatInfo = DateTimeFormatInfo::getInvariantInfo(); 
    9696                else if($formatInfo instanceof CultureInfo) 
     
    116116                        $time = @strtotime($time); 
    117117 
    118                 if(is_null($pattern)) 
     118                if($pattern === null) 
    119119                        $pattern = 'F'; 
    120120 
  • trunk/framework/I18N/core/DateTimeFormatInfo.php

    r2081 r2481  
    153153    { 
    154154        static $invariant; 
    155                 if(is_null($invariant)) 
     155                if($invariant === null) 
    156156        { 
    157157            $culture = CultureInfo::getInvariantCulture(); 
  • trunk/framework/I18N/core/HTTPNegotiator.php

    r1747 r2481  
    5252        function getLanguages() 
    5353        { 
    54                 if(!is_null($this->languages)) 
     54                if($this->languages !== null) { 
    5555                        return $this->languages; 
     56                } 
    5657 
    5758                $this->languages = array(); 
     
    108109        function getCharsets() 
    109110        { 
    110         if(!is_null($this->charsets)) 
     111        if($this->charsets !== null) { 
    111112                        return $this->charsets; 
     113                } 
    112114 
    113115                $this->charsets = array(); 
  • trunk/framework/I18N/core/MessageSource_XLIFF.php

    r1789 r2481  
    252252        private function getVariants($catalogue='messages') 
    253253        { 
    254                 if(is_null($catalogue)) 
     254                if($catalogue === null) { 
    255255                        $catalogue = 'messages'; 
     256                } 
    256257 
    257258                foreach($this->getCatalogueList($catalogue) as $variant) 
     
    479480        protected function createMessageTemplate($catalogue) 
    480481        { 
    481                 if(is_null($catalogue)) 
     482                if($catalogue === null) { 
    482483                        $catalogue = 'messages'; 
     484                } 
    483485                $variants = $this->getCatalogueList($catalogue); 
    484486                $variant = array_shift($variants); 
  • trunk/framework/I18N/core/MessageSource_gettext.php

    r1637 r2481  
    187187        private function getVariants($catalogue='messages') 
    188188        { 
    189                 if(is_null($catalogue)) 
     189                if($catalogue === null) { 
    190190                        $catalogue = 'messages'; 
     191                } 
    191192 
    192193                foreach($this->getCatalogueList($catalogue) as $variant) 
     
    424425        protected function createMessageTemplate($catalogue) 
    425426        { 
    426                 if(is_null($catalogue)) 
     427                if($catalogue === null) { 
    427428                        $catalogue = 'messages'; 
     429                } 
    428430                $variants = $this->getCatalogueList($catalogue); 
    429431                $variant = array_shift($variants); 
  • trunk/framework/I18N/core/NumberFormat.php

    r1762 r2481  
    9191        function __construct($formatInfo=null) 
    9292        { 
    93                 if(is_null($formatInfo)) 
     93                if($formatInfo === null) 
    9494                        $this->formatInfo = NumberFormatInfo::getInvariantInfo(); 
    9595                else if($formatInfo instanceof CultureInfo) 
     
    144144                //replace currency sign 
    145145                $symbol = @$this->formatInfo->getCurrencySymbol($currency); 
    146                 if(is_null($symbol)) 
     146                if($symbol === null) { 
    147147                        $symbol = $currency; 
     148                } 
    148149 
    149150                $result = str_replace('€',$symbol, $result); 
  • trunk/framework/I18N/core/NumberFormatInfo.php

    r1738 r2481  
    156156    { 
    157157        static $invariant; 
    158                 if(is_null($invariant)) 
     158                if($invariant === null) 
    159159        { 
    160160            $culture = CultureInfo::getInvariantCulture(); 
  • trunk/framework/PradoBase.php

    r2465 r2481  
    415415                                        else if (is_bool($item)) 
    416416                                                echo $item ? 'true' : 'false'; 
    417                                         else if (is_null($item)) 
     417                                        else if ($item === null) 
    418418                                                echo 'NULL'; 
    419419                                        else if (is_resource($item)) 
  • trunk/framework/Util/TSimpleDateFormatter.php

    r2479 r2481  
    190190        public function isValidDate($value) 
    191191        { 
    192                 if(is_null($value)) 
     192                if($value === null) { 
    193193                        return false; 
    194                 else 
    195                         return !is_null($this->parse($value, false)); 
     194                } else { 
     195                        return $this->parse($value, false) !== null; 
     196                } 
    196197        } 
    197198 
     
    255256                                if ($token=='y')    { $x=2;$y=4; } 
    256257                                $year = $this->getInteger($value,$i_val,$x,$y); 
    257                                 if(is_null($year)) 
     258                                if($year === null) 
    258259                                        return null; 
    259260                                        //throw new TInvalidDataValueException('Invalid year', $value); 
     
    274275                                                                        $this->length($token),2); 
    275276                                $iMonth = intval($month); 
    276                                 if(is_null($month) || $iMonth < 1 || $iMonth > 12 ) 
     277                                if($month === null || $iMonth < 1 || $iMonth > 12 ) 
    277278                                        return null; 
    278279                                        //throw new TInvalidDataValueException('Invalid month', $value); 
     
    285286                                                                        $this->length($token), 2); 
    286287                                $iDay = intval($day); 
    287                                 if(is_null($day) || $iDay < 1 || $iDay >31) 
     288                                if($day === null || $iDay < 1 || $iDay >31) 
    288289                                        return null; 
    289290                                        //throw new TInvalidDataValueException('Invalid day', $value); 
     
    302303                if ($i_val != $this->length($value)) 
    303304                        throw new TInvalidDataValueException("Pattern '{$this->pattern}' mismatch", $value); 
    304                 if(!$defaultToCurrentTime && (is_null($month) || is_null($day) || is_null($year))) 
     305                if(!$defaultToCurrentTime && ($month === null || $day === null || $year === null)) 
    305306                        return null; 
    306307                else 
  • trunk/framework/Web/Javascripts/TJavaScript.php

    r2351 r2481  
    209209        public static function jsonEncode($value) 
    210210        { 
    211                 if(is_null(self::$_json)) 
     211                if(self::$_json === null) 
    212212                        self::$_json = Prado::createComponent('System.Web.Javascripts.TJSON'); 
    213213                return self::$_json->encode($value); 
     
    222222        public static function jsonDecode($value) 
    223223        { 
    224                 if(is_null(self::$_json)) 
     224                if(self::$_json === null) 
    225225                        self::$_json = Prado::createComponent('System.Web.Javascripts.TJSON'); 
    226226                return self::$_json->decode($value); 
  • trunk/framework/Web/UI/TClientScriptManager.php

    r2283 r2481  
    116116                if(!isset($this->_registeredPradoScripts[$name])) 
    117117                { 
    118                         if(is_null(self::$_pradoScripts)) 
     118                        if(self::$_pradoScripts === null) 
    119119                        { 
    120120                                $packageFile = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH.'/packages.php'; 
     
    208208                if(strpos($base, $assets->getBaseUrl())===false) 
    209209                { 
    210                         if(!is_null($dir = Prado::getPathOfNameSpace($base))) 
     210                        if(($dir = Prado::getPathOfNameSpace($base)) !== null) { 
    211211                                $base = $dir; 
     212                        } 
    212213                        return array($assets->getPublishedPath($base), $assets->publishFilePath($base)); 
    213214                } 
     
    260261        public function registerPostBackControl($class,$options) 
    261262        { 
    262                 if(is_null($class)) return; 
     263                if($class === null) { 
     264                        return; 
     265                } 
    263266                if(!isset($options['FormID']) && ($form=$this->_page->getForm())!==null) 
    264267                        $options['FormID']=$form->getClientID(); 
  • trunk/framework/prado-cli.php

    r1954 r2481  
    8080        { 
    8181                static $instance; 
    82                 if(is_null($instance)) 
     82                if($instance === null) 
    8383                        $instance = new self; 
    8484                return $instance;