Changeset 2481
- Timestamp:
- 07/29/2008 08:43:12 PM (5 months ago)
- Location:
- trunk/framework
- Files:
-
- 15 modified
-
Data/ActiveRecord/TActiveRecordManager.php (modified) (1 diff)
-
Data/SqlMap/TSqlMapConfig.php (modified) (4 diffs)
-
I18N/core/CultureInfo.php (modified) (3 diffs)
-
I18N/core/DateFormat.php (modified) (2 diffs)
-
I18N/core/DateTimeFormatInfo.php (modified) (1 diff)
-
I18N/core/HTTPNegotiator.php (modified) (2 diffs)
-
I18N/core/MessageSource_XLIFF.php (modified) (2 diffs)
-
I18N/core/MessageSource_gettext.php (modified) (2 diffs)
-
I18N/core/NumberFormat.php (modified) (2 diffs)
-
I18N/core/NumberFormatInfo.php (modified) (1 diff)
-
PradoBase.php (modified) (1 diff)
-
Util/TSimpleDateFormatter.php (modified) (5 diffs)
-
Web/Javascripts/TJavaScript.php (modified) (2 diffs)
-
Web/UI/TClientScriptManager.php (modified) (3 diffs)
-
prado-cli.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/framework/Data/ActiveRecord/TActiveRecordManager.php
r2329 r2481 94 94 public function getRecordGateway() 95 95 { 96 if( is_null($this->_gateway))96 if($this->_gateway === null) { 97 97 $this->_gateway = $this->createRecordGateway(); 98 } 98 99 return $this->_gateway; 99 100 } -
trunk/framework/Data/SqlMap/TSqlMapConfig.php
r2373 r2481 48 48 { 49 49 $cache = $this->getApplication()->getCache(); 50 if( !is_null($cache))50 if($cache !== null) { 51 51 $cache->delete($this->getCacheKey()); 52 } 52 53 } 53 54 … … 61 62 { 62 63 $cache = $this->getApplication()->getCache(); 63 if( !is_null($cache))64 if($cache !== null) { 64 65 return $cache->set($this->getCacheKey(), $manager); 66 } 65 67 } 66 68 return false; … … 76 78 { 77 79 $cache = $this->getApplication()->getCache(); 78 if( !is_null($cache))80 if($cache !== null) 79 81 { 80 82 $manager = $cache->get($this->getCacheKey()); … … 105 107 { 106 108 $file = Prado::getPathOfNamespace($value,self::CONFIG_FILE_EXT); 107 if( is_null($file)|| !is_file($file))109 if($file === null || !is_file($file)) 108 110 throw new TConfigurationException('sqlmap_configfile_invalid',$value); 109 111 else -
trunk/framework/I18N/core/CultureInfo.php
r2398 r2481 376 376 function getDateTimeFormat() 377 377 { 378 if( is_null($this->dateTimeFormat))378 if($this->dateTimeFormat === null) 379 379 { 380 380 $calendar = $this->getCalendar(); … … 456 456 { 457 457 static $invariant; 458 if( is_null($invariant))458 if($invariant === null) 459 459 $invariant = new CultureInfo(); 460 460 return $invariant; … … 479 479 function getNumberFormat() 480 480 { 481 if( is_null($this->numberFormat))481 if($this->numberFormat === null) 482 482 { 483 483 $elements = $this->findInfo('NumberElements'); -
trunk/framework/I18N/core/DateFormat.php
r1509 r2481 92 92 function __construct($formatInfo=null) 93 93 { 94 if( is_null($formatInfo))94 if($formatInfo === null) 95 95 $this->formatInfo = DateTimeFormatInfo::getInvariantInfo(); 96 96 else if($formatInfo instanceof CultureInfo) … … 116 116 $time = @strtotime($time); 117 117 118 if( is_null($pattern))118 if($pattern === null) 119 119 $pattern = 'F'; 120 120 -
trunk/framework/I18N/core/DateTimeFormatInfo.php
r2081 r2481 153 153 { 154 154 static $invariant; 155 if( is_null($invariant))155 if($invariant === null) 156 156 { 157 157 $culture = CultureInfo::getInvariantCulture(); -
trunk/framework/I18N/core/HTTPNegotiator.php
r1747 r2481 52 52 function getLanguages() 53 53 { 54 if( !is_null($this->languages))54 if($this->languages !== null) { 55 55 return $this->languages; 56 } 56 57 57 58 $this->languages = array(); … … 108 109 function getCharsets() 109 110 { 110 if( !is_null($this->charsets))111 if($this->charsets !== null) { 111 112 return $this->charsets; 113 } 112 114 113 115 $this->charsets = array(); -
trunk/framework/I18N/core/MessageSource_XLIFF.php
r1789 r2481 252 252 private function getVariants($catalogue='messages') 253 253 { 254 if( is_null($catalogue))254 if($catalogue === null) { 255 255 $catalogue = 'messages'; 256 } 256 257 257 258 foreach($this->getCatalogueList($catalogue) as $variant) … … 479 480 protected function createMessageTemplate($catalogue) 480 481 { 481 if( is_null($catalogue))482 if($catalogue === null) { 482 483 $catalogue = 'messages'; 484 } 483 485 $variants = $this->getCatalogueList($catalogue); 484 486 $variant = array_shift($variants); -
trunk/framework/I18N/core/MessageSource_gettext.php
r1637 r2481 187 187 private function getVariants($catalogue='messages') 188 188 { 189 if( is_null($catalogue))189 if($catalogue === null) { 190 190 $catalogue = 'messages'; 191 } 191 192 192 193 foreach($this->getCatalogueList($catalogue) as $variant) … … 424 425 protected function createMessageTemplate($catalogue) 425 426 { 426 if( is_null($catalogue))427 if($catalogue === null) { 427 428 $catalogue = 'messages'; 429 } 428 430 $variants = $this->getCatalogueList($catalogue); 429 431 $variant = array_shift($variants); -
trunk/framework/I18N/core/NumberFormat.php
r1762 r2481 91 91 function __construct($formatInfo=null) 92 92 { 93 if( is_null($formatInfo))93 if($formatInfo === null) 94 94 $this->formatInfo = NumberFormatInfo::getInvariantInfo(); 95 95 else if($formatInfo instanceof CultureInfo) … … 144 144 //replace currency sign 145 145 $symbol = @$this->formatInfo->getCurrencySymbol($currency); 146 if( is_null($symbol))146 if($symbol === null) { 147 147 $symbol = $currency; 148 } 148 149 149 150 $result = str_replace('€',$symbol, $result); -
trunk/framework/I18N/core/NumberFormatInfo.php
r1738 r2481 156 156 { 157 157 static $invariant; 158 if( is_null($invariant))158 if($invariant === null) 159 159 { 160 160 $culture = CultureInfo::getInvariantCulture(); -
trunk/framework/PradoBase.php
r2465 r2481 415 415 else if (is_bool($item)) 416 416 echo $item ? 'true' : 'false'; 417 else if ( is_null($item))417 else if ($item === null) 418 418 echo 'NULL'; 419 419 else if (is_resource($item)) -
trunk/framework/Util/TSimpleDateFormatter.php
r2479 r2481 190 190 public function isValidDate($value) 191 191 { 192 if( is_null($value))192 if($value === null) { 193 193 return false; 194 else 195 return !is_null($this->parse($value, false)); 194 } else { 195 return $this->parse($value, false) !== null; 196 } 196 197 } 197 198 … … 255 256 if ($token=='y') { $x=2;$y=4; } 256 257 $year = $this->getInteger($value,$i_val,$x,$y); 257 if( is_null($year))258 if($year === null) 258 259 return null; 259 260 //throw new TInvalidDataValueException('Invalid year', $value); … … 274 275 $this->length($token),2); 275 276 $iMonth = intval($month); 276 if( is_null($month)|| $iMonth < 1 || $iMonth > 12 )277 if($month === null || $iMonth < 1 || $iMonth > 12 ) 277 278 return null; 278 279 //throw new TInvalidDataValueException('Invalid month', $value); … … 285 286 $this->length($token), 2); 286 287 $iDay = intval($day); 287 if( is_null($day)|| $iDay < 1 || $iDay >31)288 if($day === null || $iDay < 1 || $iDay >31) 288 289 return null; 289 290 //throw new TInvalidDataValueException('Invalid day', $value); … … 302 303 if ($i_val != $this->length($value)) 303 304 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)) 305 306 return null; 306 307 else -
trunk/framework/Web/Javascripts/TJavaScript.php
r2351 r2481 209 209 public static function jsonEncode($value) 210 210 { 211 if( is_null(self::$_json))211 if(self::$_json === null) 212 212 self::$_json = Prado::createComponent('System.Web.Javascripts.TJSON'); 213 213 return self::$_json->encode($value); … … 222 222 public static function jsonDecode($value) 223 223 { 224 if( is_null(self::$_json))224 if(self::$_json === null) 225 225 self::$_json = Prado::createComponent('System.Web.Javascripts.TJSON'); 226 226 return self::$_json->decode($value); -
trunk/framework/Web/UI/TClientScriptManager.php
r2283 r2481 116 116 if(!isset($this->_registeredPradoScripts[$name])) 117 117 { 118 if( is_null(self::$_pradoScripts))118 if(self::$_pradoScripts === null) 119 119 { 120 120 $packageFile = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_PATH.'/packages.php'; … … 208 208 if(strpos($base, $assets->getBaseUrl())===false) 209 209 { 210 if( !is_null($dir = Prado::getPathOfNameSpace($base)))210 if(($dir = Prado::getPathOfNameSpace($base)) !== null) { 211 211 $base = $dir; 212 } 212 213 return array($assets->getPublishedPath($base), $assets->publishFilePath($base)); 213 214 } … … 260 261 public function registerPostBackControl($class,$options) 261 262 { 262 if(is_null($class)) return; 263 if($class === null) { 264 return; 265 } 263 266 if(!isset($options['FormID']) && ($form=$this->_page->getForm())!==null) 264 267 $options['FormID']=$form->getClientID(); -
trunk/framework/prado-cli.php
r1954 r2481 80 80 { 81 81 static $instance; 82 if( is_null($instance))82 if($instance === null) 83 83 $instance = new self; 84 84 return $instance;
