@@ -806,8 +806,7 @@ discard block |
||
| 806 | 806 | $this->_navigation->renderControl($writer); |
| 807 | 807 | $writer->write("\n</td></tr></table>\n"); |
| 808 | 808 | $this->renderEndTag($writer); |
| 809 | - } |
|
| 810 | - else |
|
| 809 | + } else |
|
| 811 | 810 | { |
| 812 | 811 | $this->applyControlProperties(); |
| 813 | 812 | $this->renderBeginTag($writer); |
@@ -905,8 +904,7 @@ discard block |
||
| 905 | 904 | { |
| 906 | 905 | $container->setVisible(true); |
| 907 | 906 | $showStandard=false; |
| 908 | - } |
|
| 909 | - else |
|
| 907 | + } else |
|
| 910 | 908 | $container->setVisible(false); |
| 911 | 909 | } |
| 912 | 910 | } |
@@ -1031,11 +1029,9 @@ discard block |
||
| 1031 | 1029 | return TWizardStepType::Finish; |
| 1032 | 1030 | else |
| 1033 | 1031 | return TWizardStepType::Step; |
| 1034 | - } |
|
| 1035 | - else |
|
| 1032 | + } else |
|
| 1036 | 1033 | return $type; |
| 1037 | - } |
|
| 1038 | - else |
|
| 1034 | + } else |
|
| 1039 | 1035 | return $type; |
| 1040 | 1036 | } |
| 1041 | 1037 | |
@@ -1102,8 +1098,7 @@ discard block |
||
| 1102 | 1098 | $this->_sideBarDataList->setSelectedItemIndex($this->getActiveStepIndex()); |
| 1103 | 1099 | $this->_sideBarDataList->dataBind(); |
| 1104 | 1100 | } |
| 1105 | - } |
|
| 1106 | - else |
|
| 1101 | + } else |
|
| 1107 | 1102 | { |
| 1108 | 1103 | $this->_sideBar=new TPanel; |
| 1109 | 1104 | $this->getControls()->add($this->_sideBar); |
@@ -1140,8 +1135,7 @@ discard block |
||
| 1140 | 1135 | { |
| 1141 | 1136 | if(!$this->_activeStepIndexSet && $this->allowNavigationToStep($newStepIndex)) |
| 1142 | 1137 | $this->setActiveStepIndex($newStepIndex); |
| 1143 | - } |
|
| 1144 | - else |
|
| 1138 | + } else |
|
| 1145 | 1139 | $this->setActiveStepIndex($stepIndex); |
| 1146 | 1140 | } |
| 1147 | 1141 | } |
@@ -1285,8 +1279,7 @@ discard block |
||
| 1285 | 1279 | $previousStepIndex=$history->pop(); |
| 1286 | 1280 | if($activeStepIndex===$previousStepIndex && $history->getCount()>0) |
| 1287 | 1281 | $previousStepIndex=$history->pop(); |
| 1288 | - } |
|
| 1289 | - else |
|
| 1282 | + } else |
|
| 1290 | 1283 | { |
| 1291 | 1284 | $previousStepIndex=$history->peek(); |
| 1292 | 1285 | if($activeStepIndex===$previousStepIndex && $history->getCount()>1) |
@@ -1297,8 +1290,7 @@ discard block |
||
| 1297 | 1290 | } |
| 1298 | 1291 | } |
| 1299 | 1292 | return $activeStepIndex===$previousStepIndex ? -1 : $previousStepIndex; |
| 1300 | - } |
|
| 1301 | - else |
|
| 1293 | + } else |
|
| 1302 | 1294 | return -1; |
| 1303 | 1295 | } |
| 1304 | 1296 | |
@@ -1362,8 +1354,7 @@ discard block |
||
| 1362 | 1354 | $navParam->setNextStepIndex($index+1); |
| 1363 | 1355 | $this->onNextButtonClick($navParam); |
| 1364 | 1356 | $handled=true; |
| 1365 | - } |
|
| 1366 | - else if(strcasecmp($command,self::CMD_PREVIOUS)===0) |
|
| 1357 | + } else if(strcasecmp($command,self::CMD_PREVIOUS)===0) |
|
| 1367 | 1358 | { |
| 1368 | 1359 | if($type!==TWizardStepType::Finish && $type!==TWizardStepType::Step) |
| 1369 | 1360 | throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_PREVIOUS); |
@@ -1372,8 +1363,7 @@ discard block |
||
| 1372 | 1363 | $navParam->setNextStepIndex($prevIndex); |
| 1373 | 1364 | $this->onPreviousButtonClick($navParam); |
| 1374 | 1365 | $handled=true; |
| 1375 | - } |
|
| 1376 | - else if(strcasecmp($command,self::CMD_COMPLETE)===0) |
|
| 1366 | + } else if(strcasecmp($command,self::CMD_COMPLETE)===0) |
|
| 1377 | 1367 | { |
| 1378 | 1368 | if($type!==TWizardStepType::Finish) |
| 1379 | 1369 | throw new TInvalidDataValueException('wizard_command_invalid',self::CMD_COMPLETE); |
@@ -1381,8 +1371,7 @@ discard block |
||
| 1381 | 1371 | $navParam->setNextStepIndex($index+1); |
| 1382 | 1372 | $this->onCompleteButtonClick($navParam); |
| 1383 | 1373 | $handled=true; |
| 1384 | - } |
|
| 1385 | - else if(strcasecmp($command,self::CMD_MOVETO)===0) |
|
| 1374 | + } else if(strcasecmp($command,self::CMD_MOVETO)===0) |
|
| 1386 | 1375 | { |
| 1387 | 1376 | if($this->_cancelNavigation) // may be set in onSideBarButtonClick |
| 1388 | 1377 | $navParam->setCancelNavigation(true); |
@@ -1398,8 +1387,7 @@ discard block |
||
| 1398 | 1387 | } |
| 1399 | 1388 | if ($requestedIndex<0) |
| 1400 | 1389 | throw new TConfigurationException('wizard_step_invalid'); |
| 1401 | - } |
|
| 1402 | - else |
|
| 1390 | + } else |
|
| 1403 | 1391 | $requestedIndex=TPropertyValue::ensureInteger($requestedStep); |
| 1404 | 1392 | $navParam->setNextStepIndex($requestedIndex); |
| 1405 | 1393 | $handled=true; |
@@ -1416,8 +1404,7 @@ discard block |
||
| 1416 | 1404 | $this->getPreviousStepIndex(true); // pop out the previous move from history |
| 1417 | 1405 | $this->setActiveStepIndex($nextStepIndex); |
| 1418 | 1406 | } |
| 1419 | - } |
|
| 1420 | - else |
|
| 1407 | + } else |
|
| 1421 | 1408 | $this->setActiveStepIndex($index); |
| 1422 | 1409 | return true; |
| 1423 | 1410 | } |
@@ -110,13 +110,13 @@ |
||
| 110 | 110 | /** |
| 111 | 111 | * Factory method to instantiate a new MessageSource depending on the |
| 112 | 112 | * source type. The allowed source types are 'XLIFF', 'PHP', 'gettext' and |
| 113 | - * 'Database'. The source parameter depends on the source type. |
|
| 114 | - * For 'gettext', 'PHP' and 'XLIFF', 'source' should point to the directory |
|
| 115 | - * where the messages are stored. |
|
| 116 | - * For 'Database', 'source' must be a valid connection id. |
|
| 113 | + * 'Database'. The source parameter depends on the source type. |
|
| 114 | + * For 'gettext', 'PHP' and 'XLIFF', 'source' should point to the directory |
|
| 115 | + * where the messages are stored. |
|
| 116 | + * For 'Database', 'source' must be a valid connection id. |
|
| 117 | 117 | * |
| 118 | - * Custom message source are possible by supplying the a filename parameter |
|
| 119 | - * in the factory method. |
|
| 118 | + * Custom message source are possible by supplying the a filename parameter |
|
| 119 | + * in the factory method. |
|
| 120 | 120 | * |
| 121 | 121 | * @param string the message source type. |
| 122 | 122 | * @param string the location of the resource or the ConnectionID. |
@@ -101,8 +101,7 @@ |
||
| 101 | 101 | $dt->format('j'), |
| 102 | 102 | $dt->format('Y') |
| 103 | 103 | ); |
| 104 | - } |
|
| 105 | - else |
|
| 104 | + } else |
|
| 106 | 105 | return parent::getDateTimeValue($container, $column, $record); |
| 107 | 106 | } |
| 108 | 107 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * The DateTimeFormatInfo, containing culture specific patterns and names. |
| 85 | - * @var DateTimeFormatInfo |
|
| 85 | + * @var DateTimeFormatInfo |
|
| 86 | 86 | */ |
| 87 | 87 | protected $formatInfo; |
| 88 | 88 | |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | /** |
| 312 | 312 | * Get the year. |
| 313 | - * "yy" will return the last two digits of year. |
|
| 314 | - * "yyyy" will return the full integer year. |
|
| 313 | + * "yy" will return the last two digits of year. |
|
| 314 | + * "yyyy" will return the full integer year. |
|
| 315 | 315 | * @param array getdate format. |
| 316 | 316 | * @param string a pattern. |
| 317 | 317 | * @return string year |
@@ -331,10 +331,10 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | /** |
| 333 | 333 | * Get the month. |
| 334 | - * "M" will return integer 1 through 12 |
|
| 335 | - * "MM" will return the narrow month name, e.g. "J" |
|
| 336 | - * "MMM" will return the abrreviated month name, e.g. "Jan" |
|
| 337 | - * "MMMM" will return the month name, e.g. "January" |
|
| 334 | + * "M" will return integer 1 through 12 |
|
| 335 | + * "MM" will return the narrow month name, e.g. "J" |
|
| 336 | + * "MMM" will return the abrreviated month name, e.g. "Jan" |
|
| 337 | + * "MMMM" will return the month name, e.g. "January" |
|
| 338 | 338 | * @param array getdate format. |
| 339 | 339 | * @param string a pattern. |
| 340 | 340 | * @return string month name |
@@ -358,10 +358,10 @@ discard block |
||
| 358 | 358 | |
| 359 | 359 | /** |
| 360 | 360 | * Get the day of the week. |
| 361 | - * "E" will return integer 0 (for Sunday) through 6 (for Saturday). |
|
| 362 | - * "EE" will return the narrow day of the week, e.g. "M" |
|
| 363 | - * "EEE" will return the abrreviated day of the week, e.g. "Mon" |
|
| 364 | - * "EEEE" will return the day of the week, e.g. "Monday" |
|
| 361 | + * "E" will return integer 0 (for Sunday) through 6 (for Saturday). |
|
| 362 | + * "EE" will return the narrow day of the week, e.g. "M" |
|
| 363 | + * "EEE" will return the abrreviated day of the week, e.g. "Mon" |
|
| 364 | + * "EEEE" will return the day of the week, e.g. "Monday" |
|
| 365 | 365 | * @param array getdate format. |
| 366 | 366 | * @param string a pattern. |
| 367 | 367 | * @return string day of the week. |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | |
| 387 | 387 | /** |
| 388 | 388 | * Get the day of the month. |
| 389 | - * "d" for non-padding, "dd" will always return 2 characters. |
|
| 389 | + * "d" for non-padding, "dd" will always return 2 characters. |
|
| 390 | 390 | * @param array getdate format. |
| 391 | 391 | * @param string a pattern. |
| 392 | 392 | * @return string day of the month |
@@ -558,12 +558,12 @@ discard block |
||
| 558 | 558 | protected function getDayInMonth($date, $pattern='FF') |
| 559 | 559 | { |
| 560 | 560 | switch ($pattern) { |
| 561 | - case 'F': |
|
| 562 | - return $date->format('j'); |
|
| 563 | - case 'FF': |
|
| 564 | - return $date->format('d'); |
|
| 565 | - default: |
|
| 566 | - throw new Exception('The pattern for day in month is "F" or "FF".'); |
|
| 561 | + case 'F': |
|
| 562 | + return $date->format('j'); |
|
| 563 | + case 'FF': |
|
| 564 | + return $date->format('d'); |
|
| 565 | + default: |
|
| 566 | + throw new Exception('The pattern for day in month is "F" or "FF".'); |
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | |
@@ -105,17 +105,17 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | private $_port=11211; |
| 107 | 107 | |
| 108 | - private $_timeout = 360; |
|
| 108 | + private $_timeout = 360; |
|
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * @var integer Controls the minimum value length before attempting to compress automatically. |
|
| 112 | - */ |
|
| 113 | - private $_threshold=0; |
|
| 111 | + * @var integer Controls the minimum value length before attempting to compress automatically. |
|
| 112 | + */ |
|
| 113 | + private $_threshold=0; |
|
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * @var float Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings. |
|
| 117 | - */ |
|
| 118 | - private $_minSavings=0.0; |
|
| 116 | + * @var float Specifies the minimum amount of savings to actually store the value compressed. The supplied value must be between 0 and 1. Default value is 0.2 giving a minimum 20% compression savings. |
|
| 117 | + */ |
|
| 118 | + private $_minSavings=0.0; |
|
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | 121 | * @var boolean whether to use memcached or memcache as the underlying caching extension. |
@@ -159,63 +159,63 @@ discard block |
||
| 159 | 159 | $this->_cache = $this->_useMemcached ? new Memcached : new Memcache; |
| 160 | 160 | $this->loadConfig($config); |
| 161 | 161 | if(count($this->_servers)) |
| 162 | - { |
|
| 163 | - foreach($this->_servers as $server) |
|
| 164 | - { |
|
| 165 | - Prado::trace('Adding server '.$server['Host'].' from serverlist', '\Prado\Caching\TMemCache'); |
|
| 166 | - if($this->_cache->addServer($server['Host'],$server['Port'],$server['Persistent'], |
|
| 167 | - $server['Weight'],$server['Timeout'],$server['RetryInterval'])===false) |
|
| 168 | - throw new TConfigurationException('memcache_connection_failed',$server['Host'],$server['Port']); |
|
| 169 | - } |
|
| 170 | - } |
|
| 171 | - else |
|
| 172 | - { |
|
| 173 | - Prado::trace('Adding server '.$this->_host, '\Prado\Caching\TMemCache'); |
|
| 174 | - if($this->_cache->addServer($this->_host,$this->_port)===false) |
|
| 175 | - throw new TConfigurationException('memcache_connection_failed',$this->_host,$this->_port); |
|
| 176 | - } |
|
| 162 | + { |
|
| 163 | + foreach($this->_servers as $server) |
|
| 164 | + { |
|
| 165 | + Prado::trace('Adding server '.$server['Host'].' from serverlist', '\Prado\Caching\TMemCache'); |
|
| 166 | + if($this->_cache->addServer($server['Host'],$server['Port'],$server['Persistent'], |
|
| 167 | + $server['Weight'],$server['Timeout'],$server['RetryInterval'])===false) |
|
| 168 | + throw new TConfigurationException('memcache_connection_failed',$server['Host'],$server['Port']); |
|
| 169 | + } |
|
| 170 | + } |
|
| 171 | + else |
|
| 172 | + { |
|
| 173 | + Prado::trace('Adding server '.$this->_host, '\Prado\Caching\TMemCache'); |
|
| 174 | + if($this->_cache->addServer($this->_host,$this->_port)===false) |
|
| 175 | + throw new TConfigurationException('memcache_connection_failed',$this->_host,$this->_port); |
|
| 176 | + } |
|
| 177 | 177 | if($this->_threshold!==0) |
| 178 | - $this->_cache->setCompressThreshold($this->_threshold,$this->_minSavings); |
|
| 178 | + $this->_cache->setCompressThreshold($this->_threshold,$this->_minSavings); |
|
| 179 | 179 | $this->_initialized=true; |
| 180 | 180 | parent::init($config); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - /** |
|
| 183 | + /** |
|
| 184 | 184 | * Loads configuration from an XML element |
| 185 | 185 | * @param TXmlElement configuration node |
| 186 | 186 | * @throws TConfigurationException if log route class or type is not specified |
| 187 | 187 | */ |
| 188 | 188 | private function loadConfig($xml) |
| 189 | 189 | { |
| 190 | - if($xml instanceof TXmlElement) |
|
| 190 | + if($xml instanceof TXmlElement) |
|
| 191 | 191 | { |
| 192 | - foreach($xml->getElementsByTagName('server') as $serverConfig) |
|
| 193 | - { |
|
| 194 | - $properties=$serverConfig->getAttributes(); |
|
| 195 | - if(($host=$properties->remove('Host'))===null) |
|
| 196 | - throw new TConfigurationException('memcache_serverhost_required'); |
|
| 197 | - if(($port=$properties->remove('Port'))===null) |
|
| 198 | - throw new TConfigurationException('memcache_serverport_required'); |
|
| 199 | - if(!is_numeric($port)) |
|
| 200 | - throw new TConfigurationException('memcache_serverport_invalid'); |
|
| 201 | - $server = array('Host'=>$host,'Port'=>$port,'Weight'=>1,'Timeout'=>1800,'RetryInterval'=>15,'Persistent'=>true); |
|
| 202 | - $checks = array( |
|
| 203 | - 'Weight'=>'memcache_serverweight_invalid', |
|
| 204 | - 'Timeout'=>'memcache_servertimeout_invalid', |
|
| 205 | - 'RetryInterval'=>'memcach_serverretryinterval_invalid' |
|
| 206 | - ); |
|
| 207 | - foreach($checks as $property=>$exception) |
|
| 208 | - { |
|
| 209 | - $value=$properties->remove($property); |
|
| 210 | - if($value!==null && is_numeric($value)) |
|
| 211 | - $server[$property]=$value; |
|
| 212 | - else if($value!==null) |
|
| 213 | - throw new TConfigurationException($exception); |
|
| 214 | - } |
|
| 215 | - $server['Persistent']= TPropertyValue::ensureBoolean($properties->remove('Persistent')); |
|
| 216 | - $this->_servers[]=$server; |
|
| 217 | - } |
|
| 218 | - } |
|
| 192 | + foreach($xml->getElementsByTagName('server') as $serverConfig) |
|
| 193 | + { |
|
| 194 | + $properties=$serverConfig->getAttributes(); |
|
| 195 | + if(($host=$properties->remove('Host'))===null) |
|
| 196 | + throw new TConfigurationException('memcache_serverhost_required'); |
|
| 197 | + if(($port=$properties->remove('Port'))===null) |
|
| 198 | + throw new TConfigurationException('memcache_serverport_required'); |
|
| 199 | + if(!is_numeric($port)) |
|
| 200 | + throw new TConfigurationException('memcache_serverport_invalid'); |
|
| 201 | + $server = array('Host'=>$host,'Port'=>$port,'Weight'=>1,'Timeout'=>1800,'RetryInterval'=>15,'Persistent'=>true); |
|
| 202 | + $checks = array( |
|
| 203 | + 'Weight'=>'memcache_serverweight_invalid', |
|
| 204 | + 'Timeout'=>'memcache_servertimeout_invalid', |
|
| 205 | + 'RetryInterval'=>'memcach_serverretryinterval_invalid' |
|
| 206 | + ); |
|
| 207 | + foreach($checks as $property=>$exception) |
|
| 208 | + { |
|
| 209 | + $value=$properties->remove($property); |
|
| 210 | + if($value!==null && is_numeric($value)) |
|
| 211 | + $server[$property]=$value; |
|
| 212 | + else if($value!==null) |
|
| 213 | + throw new TConfigurationException($exception); |
|
| 214 | + } |
|
| 215 | + $server['Persistent']= TPropertyValue::ensureBoolean($properties->remove('Persistent')); |
|
| 216 | + $this->_servers[]=$server; |
|
| 217 | + } |
|
| 218 | + } |
|
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | /** |