@@ -78,6 +78,10 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | exit(1); |
| 80 | 80 | } |
| 81 | + |
|
| 82 | + /** |
|
| 83 | + * @param TApplication $application |
|
| 84 | + */ |
|
| 81 | 85 | public static function setApplication($application) |
| 82 | 86 | { |
| 83 | 87 | if(self::$_application!==null && !defined('PRADO_TEST_RUN')) |
@@ -371,14 +375,26 @@ discard block |
||
| 371 | 375 | interface IModule |
| 372 | 376 | { |
| 373 | 377 | public function init($config); |
| 378 | + |
|
| 379 | + /** |
|
| 380 | + * @return string |
|
| 381 | + */ |
|
| 374 | 382 | public function getID(); |
| 375 | 383 | public function setID($id); |
| 376 | 384 | } |
| 377 | 385 | interface IService |
| 378 | 386 | { |
| 379 | 387 | public function init($config); |
| 388 | + |
|
| 389 | + /** |
|
| 390 | + * @return string |
|
| 391 | + */ |
|
| 380 | 392 | public function getID(); |
| 381 | 393 | public function setID($id); |
| 394 | + |
|
| 395 | + /** |
|
| 396 | + * @return boolean |
|
| 397 | + */ |
|
| 382 | 398 | public function getEnabled(); |
| 383 | 399 | public function setEnabled($value); |
| 384 | 400 | public function run(); |
@@ -390,14 +406,37 @@ discard block |
||
| 390 | 406 | } |
| 391 | 407 | interface IUser |
| 392 | 408 | { |
| 409 | + /** |
|
| 410 | + * @return string |
|
| 411 | + */ |
|
| 393 | 412 | public function getName(); |
| 394 | 413 | public function setName($value); |
| 414 | + |
|
| 415 | + /** |
|
| 416 | + * @return boolean |
|
| 417 | + */ |
|
| 395 | 418 | public function getIsGuest(); |
| 419 | + |
|
| 420 | + /** |
|
| 421 | + * @param boolean $value |
|
| 422 | + */ |
|
| 396 | 423 | public function setIsGuest($value); |
| 397 | 424 | public function getRoles(); |
| 398 | 425 | public function setRoles($value); |
| 426 | + |
|
| 427 | + /** |
|
| 428 | + * @return boolean |
|
| 429 | + */ |
|
| 399 | 430 | public function isInRole($role); |
| 431 | + |
|
| 432 | + /** |
|
| 433 | + * @return string |
|
| 434 | + */ |
|
| 400 | 435 | public function saveToString(); |
| 436 | + |
|
| 437 | + /** |
|
| 438 | + * @return TUser |
|
| 439 | + */ |
|
| 401 | 440 | public function loadFromString($string); |
| 402 | 441 | } |
| 403 | 442 | interface IStatePersister |
@@ -409,6 +448,12 @@ discard block |
||
| 409 | 448 | { |
| 410 | 449 | public function get($id); |
| 411 | 450 | public function set($id,$value,$expire=0,$dependency=null); |
| 451 | + |
|
| 452 | + /** |
|
| 453 | + * @param string $id |
|
| 454 | + * |
|
| 455 | + * @return boolean |
|
| 456 | + */ |
|
| 412 | 457 | public function add($id,$value,$expire=0,$dependency=null); |
| 413 | 458 | public function delete($id); |
| 414 | 459 | public function flush(); |
@@ -427,12 +472,22 @@ discard block |
||
| 427 | 472 | } |
| 428 | 473 | interface IStyleable |
| 429 | 474 | { |
| 475 | + /** |
|
| 476 | + * @return boolean |
|
| 477 | + */ |
|
| 430 | 478 | public function getHasStyle(); |
| 479 | + |
|
| 480 | + /** |
|
| 481 | + * @return TStyle |
|
| 482 | + */ |
|
| 431 | 483 | public function getStyle(); |
| 432 | 484 | public function clearStyle(); |
| 433 | 485 | } |
| 434 | 486 | interface IActiveControl |
| 435 | 487 | { |
| 488 | + /** |
|
| 489 | + * @return TBaseActiveControl |
|
| 490 | + */ |
|
| 436 | 491 | public function getActiveControl(); |
| 437 | 492 | } |
| 438 | 493 | interface ICallbackEventHandler |
@@ -442,6 +497,10 @@ discard block |
||
| 442 | 497 | interface IDataRenderer |
| 443 | 498 | { |
| 444 | 499 | public function getData(); |
| 500 | + |
|
| 501 | + /** |
|
| 502 | + * @param TActiveRecord $value |
|
| 503 | + */ |
|
| 445 | 504 | public function setData($value); |
| 446 | 505 | } |
| 447 | 506 | class TApplicationComponent extends TComponent |
@@ -470,6 +529,10 @@ discard block |
||
| 470 | 529 | { |
| 471 | 530 | return Prado::getApplication()->getUser(); |
| 472 | 531 | } |
| 532 | + |
|
| 533 | + /** |
|
| 534 | + * @param string $assetPath |
|
| 535 | + */ |
|
| 473 | 536 | public function publishAsset($assetPath,$className=null) |
| 474 | 537 | { |
| 475 | 538 | if($className===null) |
@@ -478,6 +541,10 @@ discard block |
||
| 478 | 541 | $fullPath=dirname($class->getFileName()).DIRECTORY_SEPARATOR.$assetPath; |
| 479 | 542 | return $this->publishFilePath($fullPath); |
| 480 | 543 | } |
| 544 | + |
|
| 545 | + /** |
|
| 546 | + * @param string $fullPath |
|
| 547 | + */ |
|
| 481 | 548 | public function publishFilePath($fullPath, $checkTimestamp=false) |
| 482 | 549 | { |
| 483 | 550 | return Prado::getApplication()->getAssetManager()->publishFilePath($fullPath, $checkTimestamp); |
@@ -509,6 +576,10 @@ discard block |
||
| 509 | 576 | { |
| 510 | 577 | return $this->_id; |
| 511 | 578 | } |
| 579 | + |
|
| 580 | + /** |
|
| 581 | + * @param string $value |
|
| 582 | + */ |
|
| 512 | 583 | public function setID($value) |
| 513 | 584 | { |
| 514 | 585 | $this->_id=$value; |
@@ -548,6 +619,10 @@ discard block |
||
| 548 | 619 | else |
| 549 | 620 | throw new TConfigurationException('errorhandler_errortemplatepath_invalid',$value); |
| 550 | 621 | } |
| 622 | + |
|
| 623 | + /** |
|
| 624 | + * @param null|TApplication $sender |
|
| 625 | + */ |
|
| 551 | 626 | public function handleError($sender,$param) |
| 552 | 627 | { |
| 553 | 628 | static $handling=false; |
@@ -570,6 +645,10 @@ discard block |
||
| 570 | 645 | $this->handleExternalError(500,$param); |
| 571 | 646 | } |
| 572 | 647 | } |
| 648 | + |
|
| 649 | + /** |
|
| 650 | + * @return string |
|
| 651 | + */ |
|
| 573 | 652 | protected static function hideSecurityRelated($value, $exception=null) |
| 574 | 653 | { |
| 575 | 654 | $aRpl = array(); |
@@ -589,6 +668,10 @@ discard block |
||
| 589 | 668 | $aRpl = array_reverse($aRpl, true); |
| 590 | 669 | return str_replace(array_keys($aRpl), $aRpl, $value); |
| 591 | 670 | } |
| 671 | + |
|
| 672 | + /** |
|
| 673 | + * @param integer $statusCode |
|
| 674 | + */ |
|
| 592 | 675 | protected function handleExternalError($statusCode,$exception) |
| 593 | 676 | { |
| 594 | 677 | if(!($exception instanceof THttpException)) |
@@ -722,6 +805,10 @@ discard block |
||
| 722 | 805 | return null; |
| 723 | 806 | return $result; |
| 724 | 807 | } |
| 808 | + |
|
| 809 | + /** |
|
| 810 | + * @param string $pattern |
|
| 811 | + */ |
|
| 725 | 812 | private function getPropertyAccessTrace($trace,$pattern) |
| 726 | 813 | { |
| 727 | 814 | $result=null; |
@@ -751,6 +838,10 @@ discard block |
||
| 751 | 838 | } |
| 752 | 839 | return $source; |
| 753 | 840 | } |
| 841 | + |
|
| 842 | + /** |
|
| 843 | + * @param string $message |
|
| 844 | + */ |
|
| 754 | 845 | private function addLink($message) |
| 755 | 846 | { |
| 756 | 847 | $baseUrl='http://pradosoft.github.io/docs/manual/class-'; |
@@ -772,6 +863,10 @@ discard block |
||
| 772 | 863 | { |
| 773 | 864 | return $this->_r; |
| 774 | 865 | } |
| 866 | + |
|
| 867 | + /** |
|
| 868 | + * @param boolean $value |
|
| 869 | + */ |
|
| 775 | 870 | protected function setReadOnly($value) |
| 776 | 871 | { |
| 777 | 872 | $this->_r=TPropertyValue::ensureBoolean($value); |
@@ -1018,9 +1113,27 @@ discard block |
||
| 1018 | 1113 | { |
| 1019 | 1114 | throw new TNotSupportedException('cache_flush_unsupported'); |
| 1020 | 1115 | } |
| 1116 | + |
|
| 1117 | + /** |
|
| 1118 | + * @param string $key |
|
| 1119 | + */ |
|
| 1021 | 1120 | abstract protected function getValue($key); |
| 1121 | + |
|
| 1122 | + /** |
|
| 1123 | + * @param string $key |
|
| 1124 | + * @param integer $expire |
|
| 1125 | + */ |
|
| 1022 | 1126 | abstract protected function setValue($key,$value,$expire); |
| 1127 | + |
|
| 1128 | + /** |
|
| 1129 | + * @param string $key |
|
| 1130 | + * @param integer $expire |
|
| 1131 | + */ |
|
| 1023 | 1132 | abstract protected function addValue($key,$value,$expire); |
| 1133 | + |
|
| 1134 | + /** |
|
| 1135 | + * @param string $key |
|
| 1136 | + */ |
|
| 1024 | 1137 | abstract protected function deleteValue($key); |
| 1025 | 1138 | public function offsetExists($id) |
| 1026 | 1139 | { |
@@ -1109,14 +1222,26 @@ discard block |
||
| 1109 | 1222 | { |
| 1110 | 1223 | return $this->generateTimestamps($this->_directory)!=$this->_timestamps; |
| 1111 | 1224 | } |
| 1225 | + |
|
| 1226 | + /** |
|
| 1227 | + * @param string $fileName |
|
| 1228 | + */ |
|
| 1112 | 1229 | protected function validateFile($fileName) |
| 1113 | 1230 | { |
| 1114 | 1231 | return true; |
| 1115 | 1232 | } |
| 1233 | + |
|
| 1234 | + /** |
|
| 1235 | + * @param string $directory |
|
| 1236 | + */ |
|
| 1116 | 1237 | protected function validateDirectory($directory) |
| 1117 | 1238 | { |
| 1118 | 1239 | return true; |
| 1119 | 1240 | } |
| 1241 | + |
|
| 1242 | + /** |
|
| 1243 | + * @param string $directory |
|
| 1244 | + */ |
|
| 1120 | 1245 | protected function generateTimestamps($directory,$level=0) |
| 1121 | 1246 | { |
| 1122 | 1247 | if(($dir=opendir($directory))===false) |
@@ -1207,6 +1332,10 @@ discard block |
||
| 1207 | 1332 | $this->_str=''; |
| 1208 | 1333 | return $str; |
| 1209 | 1334 | } |
| 1335 | + |
|
| 1336 | + /** |
|
| 1337 | + * @param string $str |
|
| 1338 | + */ |
|
| 1210 | 1339 | public function write($str) |
| 1211 | 1340 | { |
| 1212 | 1341 | $this->_str.=$str; |
@@ -1254,6 +1383,10 @@ discard block |
||
| 1254 | 1383 | { |
| 1255 | 1384 | return $this->_dp; |
| 1256 | 1385 | } |
| 1386 | + |
|
| 1387 | + /** |
|
| 1388 | + * @param integer $value |
|
| 1389 | + */ |
|
| 1257 | 1390 | protected function setDefaultPriority($value) |
| 1258 | 1391 | { |
| 1259 | 1392 | $this->_dp=(string)round(TPropertyValue::ensureFloat($value),$this->_p); |
@@ -1262,6 +1395,10 @@ discard block |
||
| 1262 | 1395 | { |
| 1263 | 1396 | return $this->_p; |
| 1264 | 1397 | } |
| 1398 | + |
|
| 1399 | + /** |
|
| 1400 | + * @param integer $value |
|
| 1401 | + */ |
|
| 1265 | 1402 | protected function setPrecision($value) |
| 1266 | 1403 | { |
| 1267 | 1404 | $this->_p=TPropertyValue::ensureInteger($value); |
@@ -1500,6 +1637,10 @@ discard block |
||
| 1500 | 1637 | $this->sortPriorities(); |
| 1501 | 1638 | return $this->_d; |
| 1502 | 1639 | } |
| 1640 | + |
|
| 1641 | + /** |
|
| 1642 | + * @param integer $priority |
|
| 1643 | + */ |
|
| 1503 | 1644 | public function toArrayBelowPriority($priority,$inclusive=false) |
| 1504 | 1645 | { |
| 1505 | 1646 | $this->sortPriorities(); |
@@ -1512,6 +1653,10 @@ discard block |
||
| 1512 | 1653 | } |
| 1513 | 1654 | return $items; |
| 1514 | 1655 | } |
| 1656 | + |
|
| 1657 | + /** |
|
| 1658 | + * @param integer $priority |
|
| 1659 | + */ |
|
| 1515 | 1660 | public function toArrayAbovePriority($priority,$inclusive=true) |
| 1516 | 1661 | { |
| 1517 | 1662 | $this->sortPriorities(); |
@@ -1609,6 +1754,10 @@ discard block |
||
| 1609 | 1754 | { |
| 1610 | 1755 | return $this->_r; |
| 1611 | 1756 | } |
| 1757 | + |
|
| 1758 | + /** |
|
| 1759 | + * @param boolean $value |
|
| 1760 | + */ |
|
| 1612 | 1761 | protected function setReadOnly($value) |
| 1613 | 1762 | { |
| 1614 | 1763 | $this->_r=TPropertyValue::ensureBoolean($value); |
@@ -1681,6 +1830,10 @@ discard block |
||
| 1681 | 1830 | else if($data!==null) |
| 1682 | 1831 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 1683 | 1832 | } |
| 1833 | + |
|
| 1834 | + /** |
|
| 1835 | + * @param TMap $data |
|
| 1836 | + */ |
|
| 1684 | 1837 | public function mergeWith($data) |
| 1685 | 1838 | { |
| 1686 | 1839 | if(is_array($data) || $data instanceof Traversable) |
@@ -1732,6 +1885,10 @@ discard block |
||
| 1732 | 1885 | { |
| 1733 | 1886 | return $this->_r; |
| 1734 | 1887 | } |
| 1888 | + |
|
| 1889 | + /** |
|
| 1890 | + * @param boolean $value |
|
| 1891 | + */ |
|
| 1735 | 1892 | protected function setReadOnly($value) |
| 1736 | 1893 | { |
| 1737 | 1894 | $this->_r=TPropertyValue::ensureBoolean($value); |
@@ -1740,6 +1897,10 @@ discard block |
||
| 1740 | 1897 | { |
| 1741 | 1898 | return $this->_dp; |
| 1742 | 1899 | } |
| 1900 | + |
|
| 1901 | + /** |
|
| 1902 | + * @param integer $value |
|
| 1903 | + */ |
|
| 1743 | 1904 | protected function setDefaultPriority($value) |
| 1744 | 1905 | { |
| 1745 | 1906 | $this->_dp = (string)round(TPropertyValue::ensureFloat($value), $this->_p); |
@@ -1748,6 +1909,10 @@ discard block |
||
| 1748 | 1909 | { |
| 1749 | 1910 | return $this->_p; |
| 1750 | 1911 | } |
| 1912 | + |
|
| 1913 | + /** |
|
| 1914 | + * @param integer $value |
|
| 1915 | + */ |
|
| 1751 | 1916 | protected function setPrecision($value) |
| 1752 | 1917 | { |
| 1753 | 1918 | $this->_p=TPropertyValue::ensureInteger($value); |
@@ -2133,6 +2298,10 @@ discard block |
||
| 2133 | 2298 | { |
| 2134 | 2299 | return $this->_parent; |
| 2135 | 2300 | } |
| 2301 | + |
|
| 2302 | + /** |
|
| 2303 | + * @param TXmlElement|null $parent |
|
| 2304 | + */ |
|
| 2136 | 2305 | public function setParent($parent) |
| 2137 | 2306 | { |
| 2138 | 2307 | $this->_parent=$parent; |
@@ -2194,6 +2363,10 @@ discard block |
||
| 2194 | 2363 | } |
| 2195 | 2364 | return null; |
| 2196 | 2365 | } |
| 2366 | + |
|
| 2367 | + /** |
|
| 2368 | + * @param string $tagName |
|
| 2369 | + */ |
|
| 2197 | 2370 | public function getElementsByTagName($tagName) |
| 2198 | 2371 | { |
| 2199 | 2372 | $list=new TList; |
@@ -2263,6 +2436,10 @@ discard block |
||
| 2263 | 2436 | { |
| 2264 | 2437 | return $this->_version; |
| 2265 | 2438 | } |
| 2439 | + |
|
| 2440 | + /** |
|
| 2441 | + * @param string $version |
|
| 2442 | + */ |
|
| 2266 | 2443 | public function setVersion($version) |
| 2267 | 2444 | { |
| 2268 | 2445 | $this->_version=$version; |
@@ -2271,6 +2448,10 @@ discard block |
||
| 2271 | 2448 | { |
| 2272 | 2449 | return $this->_encoding; |
| 2273 | 2450 | } |
| 2451 | + |
|
| 2452 | + /** |
|
| 2453 | + * @param string $encoding |
|
| 2454 | + */ |
|
| 2274 | 2455 | public function setEncoding($encoding) |
| 2275 | 2456 | { |
| 2276 | 2457 | $this->_encoding=$encoding; |
@@ -2341,6 +2522,10 @@ discard block |
||
| 2341 | 2522 | { |
| 2342 | 2523 | return $this->saveToString(); |
| 2343 | 2524 | } |
| 2525 | + |
|
| 2526 | + /** |
|
| 2527 | + * @param DOMElement $node |
|
| 2528 | + */ |
|
| 2344 | 2529 | protected function buildElement($node) |
| 2345 | 2530 | { |
| 2346 | 2531 | $element=new TXmlElement($node->tagName); |
@@ -2499,10 +2684,18 @@ discard block |
||
| 2499 | 2684 | } |
| 2500 | 2685 | return 0; |
| 2501 | 2686 | } |
| 2687 | + |
|
| 2688 | + /** |
|
| 2689 | + * @param IUser $user |
|
| 2690 | + */ |
|
| 2502 | 2691 | private function isUserMatched($user) |
| 2503 | 2692 | { |
| 2504 | 2693 | return ($this->_everyone || ($this->_guest && $user->getIsGuest()) || ($this->_authenticated && !$user->getIsGuest()) || in_array(strtolower($user->getName()),$this->_users)); |
| 2505 | 2694 | } |
| 2695 | + |
|
| 2696 | + /** |
|
| 2697 | + * @param IUser $user |
|
| 2698 | + */ |
|
| 2506 | 2699 | private function isRoleMatched($user) |
| 2507 | 2700 | { |
| 2508 | 2701 | foreach($this->_roles as $role) |
@@ -2519,6 +2712,11 @@ discard block |
||
| 2519 | 2712 | } |
| 2520 | 2713 | class TAuthorizationRuleCollection extends TList |
| 2521 | 2714 | { |
| 2715 | + /** |
|
| 2716 | + * @param IUser $user |
|
| 2717 | + * @param string $verb |
|
| 2718 | + * @param string $ip |
|
| 2719 | + */ |
|
| 2522 | 2720 | public function isUserAllowed($user,$verb,$ip) |
| 2523 | 2721 | { |
| 2524 | 2722 | if($user instanceof IUser) |
@@ -2626,6 +2824,10 @@ discard block |
||
| 2626 | 2824 | { |
| 2627 | 2825 | $this->_cryptAlgorithm = $value; |
| 2628 | 2826 | } |
| 2827 | + |
|
| 2828 | + /** |
|
| 2829 | + * @param string $data |
|
| 2830 | + */ |
|
| 2629 | 2831 | public function encrypt($data) |
| 2630 | 2832 | { |
| 2631 | 2833 | $module=$this->openCryptModule(); |
@@ -2638,6 +2840,10 @@ discard block |
||
| 2638 | 2840 | mcrypt_module_close($module); |
| 2639 | 2841 | return $encrypted; |
| 2640 | 2842 | } |
| 2843 | + |
|
| 2844 | + /** |
|
| 2845 | + * @param string $data |
|
| 2846 | + */ |
|
| 2641 | 2847 | public function decrypt($data) |
| 2642 | 2848 | { |
| 2643 | 2849 | $module=$this->openCryptModule(); |
@@ -2699,6 +2905,11 @@ discard block |
||
| 2699 | 2905 | { |
| 2700 | 2906 | return $this->_mbstring ? mb_strlen($string,'8bit') : strlen($string); |
| 2701 | 2907 | } |
| 2908 | + |
|
| 2909 | + /** |
|
| 2910 | + * @param integer $start |
|
| 2911 | + * @param integer $length |
|
| 2912 | + */ |
|
| 2702 | 2913 | private function substr($string,$start,$length) |
| 2703 | 2914 | { |
| 2704 | 2915 | return $this->_mbstring ? mb_substr($string,$start,$length,'8bit') : substr($string,$start,$length); |
@@ -2858,6 +3069,10 @@ discard block |
||
| 2858 | 3069 | self::checkJsonError(); |
| 2859 | 3070 | return $s; |
| 2860 | 3071 | } |
| 3072 | + |
|
| 3073 | + /** |
|
| 3074 | + * @param string $sourceEncoding |
|
| 3075 | + */ |
|
| 2861 | 3076 | private static function convertToUtf8(&$value, $sourceEncoding) { |
| 2862 | 3077 | if(is_string($value)) |
| 2863 | 3078 | $value=iconv($sourceEncoding, 'UTF-8', $value); |
@@ -2867,6 +3082,10 @@ discard block |
||
| 2867 | 3082 | self::convertToUtf8($element, $sourceEncoding); |
| 2868 | 3083 | } |
| 2869 | 3084 | } |
| 3085 | + |
|
| 3086 | + /** |
|
| 3087 | + * @param string $value |
|
| 3088 | + */ |
|
| 2870 | 3089 | public static function jsonDecode($value, $assoc = false, $depth = 512) |
| 2871 | 3090 | { |
| 2872 | 3091 | $s= @json_decode($value, $assoc, $depth); |
@@ -2901,6 +3120,10 @@ discard block |
||
| 2901 | 3120 | } |
| 2902 | 3121 | throw new Exception("JSON error ($err): $msg"); |
| 2903 | 3122 | } |
| 3123 | + |
|
| 3124 | + /** |
|
| 3125 | + * @param string $code |
|
| 3126 | + */ |
|
| 2904 | 3127 | public static function JSMin($code) |
| 2905 | 3128 | { |
| 2906 | 3129 | Prado::using('System.Web.Javascripts.JSMin'); |
@@ -3088,6 +3311,10 @@ discard block |
||
| 3088 | 3311 | { |
| 3089 | 3312 | return $this->getID(); |
| 3090 | 3313 | } |
| 3314 | + |
|
| 3315 | + /** |
|
| 3316 | + * @param TUrlManager $manager |
|
| 3317 | + */ |
|
| 3091 | 3318 | protected function cacheUrlManager($manager) |
| 3092 | 3319 | { |
| 3093 | 3320 | if($this->getEnableCache()) |
@@ -3337,6 +3564,10 @@ discard block |
||
| 3337 | 3564 | { |
| 3338 | 3565 | return $_ENV; |
| 3339 | 3566 | } |
| 3567 | + |
|
| 3568 | + /** |
|
| 3569 | + * @param string $serviceID |
|
| 3570 | + */ |
|
| 3340 | 3571 | public function constructUrl($serviceID,$serviceParam,$getItems=null,$encodeAmpersand=true,$encodeGetItems=true) |
| 3341 | 3572 | { |
| 3342 | 3573 | if ($this->_cookieOnly===null) |
@@ -3457,6 +3688,10 @@ discard block |
||
| 3457 | 3688 | class THttpCookieCollection extends TList |
| 3458 | 3689 | { |
| 3459 | 3690 | private $_o; |
| 3691 | + |
|
| 3692 | + /** |
|
| 3693 | + * @param THttpResponse $owner |
|
| 3694 | + */ |
|
| 3460 | 3695 | public function __construct($owner=null) |
| 3461 | 3696 | { |
| 3462 | 3697 | $this->_o=$owner; |
@@ -3520,6 +3755,10 @@ discard block |
||
| 3520 | 3755 | { |
| 3521 | 3756 | return $this->_expire; |
| 3522 | 3757 | } |
| 3758 | + |
|
| 3759 | + /** |
|
| 3760 | + * @param integer $value |
|
| 3761 | + */ |
|
| 3523 | 3762 | public function setExpire($value) |
| 3524 | 3763 | { |
| 3525 | 3764 | $this->_expire=TPropertyValue::ensureInteger($value); |
@@ -3586,6 +3825,10 @@ discard block |
||
| 3586 | 3825 | private $_query; |
| 3587 | 3826 | private $_fragment; |
| 3588 | 3827 | private $_uri; |
| 3828 | + |
|
| 3829 | + /** |
|
| 3830 | + * @param string $uri |
|
| 3831 | + */ |
|
| 3589 | 3832 | public function __construct($uri) |
| 3590 | 3833 | { |
| 3591 | 3834 | if(($ret=@parse_url($uri))!==false) |
@@ -3651,6 +3894,10 @@ discard block |
||
| 3651 | 3894 | class THttpResponseAdapter extends TApplicationComponent |
| 3652 | 3895 | { |
| 3653 | 3896 | private $_response; |
| 3897 | + |
|
| 3898 | + /** |
|
| 3899 | + * @param THttpResponse $response |
|
| 3900 | + */ |
|
| 3654 | 3901 | public function __construct($response) |
| 3655 | 3902 | { |
| 3656 | 3903 | $this->_response=$response; |
@@ -3746,6 +3993,10 @@ discard block |
||
| 3746 | 3993 | { |
| 3747 | 3994 | return $this->_charset; |
| 3748 | 3995 | } |
| 3996 | + |
|
| 3997 | + /** |
|
| 3998 | + * @param string $charset |
|
| 3999 | + */ |
|
| 3749 | 4000 | public function setCharset($charset) |
| 3750 | 4001 | { |
| 3751 | 4002 | $this->_charset = (strToLower($charset) === 'false') ? false : (string)$charset; |
@@ -3969,6 +4220,10 @@ discard block |
||
| 3969 | 4220 | return array_change_key_case($result, $case); |
| 3970 | 4221 | return $result; |
| 3971 | 4222 | } |
| 4223 | + |
|
| 4224 | + /** |
|
| 4225 | + * @param string $value |
|
| 4226 | + */ |
|
| 3972 | 4227 | public function appendHeader($value, $replace=true) |
| 3973 | 4228 | { |
| 3974 | 4229 | header($value, $replace); |
@@ -3977,6 +4232,10 @@ discard block |
||
| 3977 | 4232 | { |
| 3978 | 4233 | error_log($message,$messageType,$destination,$extraHeaders); |
| 3979 | 4234 | } |
| 4235 | + |
|
| 4236 | + /** |
|
| 4237 | + * @param THttpCookie $cookie |
|
| 4238 | + */ |
|
| 3980 | 4239 | public function addCookie($cookie) |
| 3981 | 4240 | { |
| 3982 | 4241 | $request=$this->getRequest(); |
@@ -4034,6 +4293,10 @@ discard block |
||
| 4034 | 4293 | else |
| 4035 | 4294 | return $this->createNewHtmlWriter($type, $this); |
| 4036 | 4295 | } |
| 4296 | + |
|
| 4297 | + /** |
|
| 4298 | + * @param THttpResponse $writer |
|
| 4299 | + */ |
|
| 4037 | 4300 | public function createNewHtmlWriter($type, $writer) |
| 4038 | 4301 | { |
| 4039 | 4302 | return Prado::createComponent($type, $writer); |
@@ -4143,6 +4406,10 @@ discard block |
||
| 4143 | 4406 | { |
| 4144 | 4407 | return $this->_customStorage; |
| 4145 | 4408 | } |
| 4409 | + |
|
| 4410 | + /** |
|
| 4411 | + * @param boolean $value |
|
| 4412 | + */ |
|
| 4146 | 4413 | public function setUseCustomStorage($value) |
| 4147 | 4414 | { |
| 4148 | 4415 | $this->_customStorage=TPropertyValue::ensureBoolean($value); |
@@ -4285,10 +4552,18 @@ discard block |
||
| 4285 | 4552 | { |
| 4286 | 4553 | return array_keys($_SESSION); |
| 4287 | 4554 | } |
| 4555 | + |
|
| 4556 | + /** |
|
| 4557 | + * @param string $key |
|
| 4558 | + */ |
|
| 4288 | 4559 | public function itemAt($key) |
| 4289 | 4560 | { |
| 4290 | 4561 | return isset($_SESSION[$key]) ? $_SESSION[$key] : null; |
| 4291 | 4562 | } |
| 4563 | + |
|
| 4564 | + /** |
|
| 4565 | + * @param string $key |
|
| 4566 | + */ |
|
| 4292 | 4567 | public function add($key,$value) |
| 4293 | 4568 | { |
| 4294 | 4569 | $_SESSION[$key]=$value; |
@@ -4395,6 +4670,10 @@ discard block |
||
| 4395 | 4670 | { |
| 4396 | 4671 | return $this->_caseSensitive; |
| 4397 | 4672 | } |
| 4673 | + |
|
| 4674 | + /** |
|
| 4675 | + * @param boolean $value |
|
| 4676 | + */ |
|
| 4398 | 4677 | public function setCaseSensitive($value) |
| 4399 | 4678 | { |
| 4400 | 4679 | $this->_caseSensitive=TPropertyValue::ensureBoolean($value); |
@@ -4407,6 +4686,10 @@ discard block |
||
| 4407 | 4686 | { |
| 4408 | 4687 | parent::add($this->_caseSensitive?$key:strtolower($key),$value); |
| 4409 | 4688 | } |
| 4689 | + |
|
| 4690 | + /** |
|
| 4691 | + * @param string $key |
|
| 4692 | + */ |
|
| 4410 | 4693 | public function remove($key) |
| 4411 | 4694 | { |
| 4412 | 4695 | return parent::remove($this->_caseSensitive?$key:strtolower($key)); |
@@ -4557,6 +4840,10 @@ discard block |
||
| 4557 | 4840 | } |
| 4558 | 4841 | return $this->_page; |
| 4559 | 4842 | } |
| 4843 | + |
|
| 4844 | + /** |
|
| 4845 | + * @param TPage $page |
|
| 4846 | + */ |
|
| 4560 | 4847 | public function setPage($page) |
| 4561 | 4848 | { |
| 4562 | 4849 | $this->_page=$page; |
@@ -4700,6 +4987,10 @@ discard block |
||
| 4700 | 4987 | else |
| 4701 | 4988 | return $this->getViewState('Visible',true); |
| 4702 | 4989 | } |
| 4990 | + |
|
| 4991 | + /** |
|
| 4992 | + * @param boolean $value |
|
| 4993 | + */ |
|
| 4703 | 4994 | public function setVisible($value) |
| 4704 | 4995 | { |
| 4705 | 4996 | $this->setViewState('Visible',TPropertyValue::ensureBoolean($value),true); |
@@ -4738,6 +5029,10 @@ discard block |
||
| 4738 | 5029 | return $attributes; |
| 4739 | 5030 | } |
| 4740 | 5031 | } |
| 5032 | + |
|
| 5033 | + /** |
|
| 5034 | + * @param string $name |
|
| 5035 | + */ |
|
| 4741 | 5036 | public function hasAttribute($name) |
| 4742 | 5037 | { |
| 4743 | 5038 | if($attributes=$this->getViewState('Attributes',null)) |
@@ -4745,6 +5040,10 @@ discard block |
||
| 4745 | 5040 | else |
| 4746 | 5041 | return false; |
| 4747 | 5042 | } |
| 5043 | + |
|
| 5044 | + /** |
|
| 5045 | + * @param string $name |
|
| 5046 | + */ |
|
| 4748 | 5047 | public function getAttribute($name) |
| 4749 | 5048 | { |
| 4750 | 5049 | if($attributes=$this->getViewState('Attributes',null)) |
@@ -4752,6 +5051,10 @@ discard block |
||
| 4752 | 5051 | else |
| 4753 | 5052 | return null; |
| 4754 | 5053 | } |
| 5054 | + |
|
| 5055 | + /** |
|
| 5056 | + * @param string $name |
|
| 5057 | + */ |
|
| 4755 | 5058 | public function setAttribute($name,$value) |
| 4756 | 5059 | { |
| 4757 | 5060 | $this->getAttributes()->add($name,$value); |
@@ -4775,6 +5078,10 @@ discard block |
||
| 4775 | 5078 | else |
| 4776 | 5079 | return !($this->_flags & self::IS_DISABLE_VIEWSTATE); |
| 4777 | 5080 | } |
| 5081 | + |
|
| 5082 | + /** |
|
| 5083 | + * @param boolean $value |
|
| 5084 | + */ |
|
| 4778 | 5085 | public function setEnableViewState($value) |
| 4779 | 5086 | { |
| 4780 | 5087 | if(TPropertyValue::ensureBoolean($value)) |
@@ -4782,10 +5089,20 @@ discard block |
||
| 4782 | 5089 | else |
| 4783 | 5090 | $this->_flags |= self::IS_DISABLE_VIEWSTATE; |
| 4784 | 5091 | } |
| 5092 | + |
|
| 5093 | + /** |
|
| 5094 | + * @param string $key |
|
| 5095 | + * @param integer $defaultValue |
|
| 5096 | + */ |
|
| 4785 | 5097 | protected function getControlState($key,$defaultValue=null) |
| 4786 | 5098 | { |
| 4787 | 5099 | return isset($this->_rf[self::RF_CONTROLSTATE][$key])?$this->_rf[self::RF_CONTROLSTATE][$key]:$defaultValue; |
| 4788 | 5100 | } |
| 5101 | + |
|
| 5102 | + /** |
|
| 5103 | + * @param string $key |
|
| 5104 | + * @param integer $defaultValue |
|
| 5105 | + */ |
|
| 4789 | 5106 | protected function setControlState($key,$value,$defaultValue=null) |
| 4790 | 5107 | { |
| 4791 | 5108 | if($value===$defaultValue) |
@@ -4797,6 +5114,10 @@ discard block |
||
| 4797 | 5114 | { |
| 4798 | 5115 | unset($this->_rf[self::RF_CONTROLSTATE][$key]); |
| 4799 | 5116 | } |
| 5117 | + |
|
| 5118 | + /** |
|
| 5119 | + * @param boolean $enabled |
|
| 5120 | + */ |
|
| 4800 | 5121 | public function trackViewState($enabled) |
| 4801 | 5122 | { |
| 4802 | 5123 | $this->_trackViewState=TPropertyValue::ensureBoolean($enabled); |
@@ -4814,6 +5135,10 @@ discard block |
||
| 4814 | 5135 | else |
| 4815 | 5136 | return $defaultValue; |
| 4816 | 5137 | } |
| 5138 | + |
|
| 5139 | + /** |
|
| 5140 | + * @param string $key |
|
| 5141 | + */ |
|
| 4817 | 5142 | public function setViewState($key,$value,$defaultValue=null) |
| 4818 | 5143 | { |
| 4819 | 5144 | if($this->_trackViewState) |
@@ -4833,6 +5158,10 @@ discard block |
||
| 4833 | 5158 | $this->_tempState[$key]=$value; |
| 4834 | 5159 | } |
| 4835 | 5160 | } |
| 5161 | + |
|
| 5162 | + /** |
|
| 5163 | + * @param string $key |
|
| 5164 | + */ |
|
| 4836 | 5165 | public function clearViewState($key) |
| 4837 | 5166 | { |
| 4838 | 5167 | unset($this->_viewState[$key]); |
@@ -4889,6 +5218,10 @@ discard block |
||
| 4889 | 5218 | { |
| 4890 | 5219 | return ($this->_flags & self::IS_CHILD_CREATED)!==0; |
| 4891 | 5220 | } |
| 5221 | + |
|
| 5222 | + /** |
|
| 5223 | + * @param boolean $value |
|
| 5224 | + */ |
|
| 4892 | 5225 | final protected function setChildControlsCreated($value) |
| 4893 | 5226 | { |
| 4894 | 5227 | if($value) |
@@ -4948,6 +5281,10 @@ discard block |
||
| 4948 | 5281 | return null; |
| 4949 | 5282 | } |
| 4950 | 5283 | } |
| 5284 | + |
|
| 5285 | + /** |
|
| 5286 | + * @param string $type |
|
| 5287 | + */ |
|
| 4951 | 5288 | public function findControlsByType($type,$strict=true) |
| 4952 | 5289 | { |
| 4953 | 5290 | $controls=array(); |
@@ -4985,6 +5322,10 @@ discard block |
||
| 4985 | 5322 | unset($this->_rf[self::RF_NAMED_CONTROLS_ID]); |
| 4986 | 5323 | $this->clearNameTable(); |
| 4987 | 5324 | } |
| 5325 | + |
|
| 5326 | + /** |
|
| 5327 | + * @param TCheckBox $object |
|
| 5328 | + */ |
|
| 4988 | 5329 | public function registerObject($name,$object) |
| 4989 | 5330 | { |
| 4990 | 5331 | if(isset($this->_rf[self::RF_NAMED_OBJECTS][$name])) |
@@ -5019,6 +5360,10 @@ discard block |
||
| 5019 | 5360 | { |
| 5020 | 5361 | return $this->getControlStage() >= self::CS_PRERENDERED; |
| 5021 | 5362 | } |
| 5363 | + |
|
| 5364 | + /** |
|
| 5365 | + * @param string $name |
|
| 5366 | + */ |
|
| 5022 | 5367 | public function getRegisteredObject($name) |
| 5023 | 5368 | { |
| 5024 | 5369 | return isset($this->_rf[self::RF_NAMED_OBJECTS][$name])?$this->_rf[self::RF_NAMED_OBJECTS][$name]:null; |
@@ -5042,6 +5387,10 @@ discard block |
||
| 5042 | 5387 | $control=$control->_parent; |
| 5043 | 5388 | return $control===$ancestor; |
| 5044 | 5389 | } |
| 5390 | + |
|
| 5391 | + /** |
|
| 5392 | + * @param TControl $control |
|
| 5393 | + */ |
|
| 5045 | 5394 | public function addedControl($control) |
| 5046 | 5395 | { |
| 5047 | 5396 | if($control->_parent) |
@@ -5080,6 +5429,10 @@ discard block |
||
| 5080 | 5429 | } |
| 5081 | 5430 | } |
| 5082 | 5431 | } |
| 5432 | + |
|
| 5433 | + /** |
|
| 5434 | + * @param TControl $control |
|
| 5435 | + */ |
|
| 5083 | 5436 | public function removedControl($control) |
| 5084 | 5437 | { |
| 5085 | 5438 | if($this->_namingContainer) |
@@ -5225,6 +5578,10 @@ discard block |
||
| 5225 | 5578 | $rootControl=(($page=$this->getPage())===null)?$this:$page; |
| 5226 | 5579 | $rootControl->broadcastEventInternal($name,$sender,new TBroadcastEventParameter($name,$param)); |
| 5227 | 5580 | } |
| 5581 | + |
|
| 5582 | + /** |
|
| 5583 | + * @param TBroadcastEventParameter $param |
|
| 5584 | + */ |
|
| 5228 | 5585 | private function broadcastEventInternal($name,$sender,$param) |
| 5229 | 5586 | { |
| 5230 | 5587 | if($this->hasEvent($name)) |
@@ -5370,6 +5727,10 @@ discard block |
||
| 5370 | 5727 | else if($this->_flags & self::IS_STYLESHEET_APPLIED) |
| 5371 | 5728 | throw new TInvalidOperationException('control_stylesheet_applied',get_class($this)); |
| 5372 | 5729 | } |
| 5730 | + |
|
| 5731 | + /** |
|
| 5732 | + * @param boolean $recursive |
|
| 5733 | + */ |
|
| 5373 | 5734 | private function clearCachedUniqueID($recursive) |
| 5374 | 5735 | { |
| 5375 | 5736 | if($recursive && $this->_uid!==null && isset($this->_rf[self::RF_CONTROLS])) |
@@ -5393,6 +5754,10 @@ discard block |
||
| 5393 | 5754 | { |
| 5394 | 5755 | unset($this->_rf[self::RF_NAMED_CONTROLS]); |
| 5395 | 5756 | } |
| 5757 | + |
|
| 5758 | + /** |
|
| 5759 | + * @param TControl $container |
|
| 5760 | + */ |
|
| 5396 | 5761 | private function fillNameTable($container,$controls) |
| 5397 | 5762 | { |
| 5398 | 5763 | foreach($controls as $control) |
@@ -5465,11 +5830,18 @@ discard block |
||
| 5465 | 5830 | } |
| 5466 | 5831 | interface IPostBackEventHandler |
| 5467 | 5832 | { |
| 5833 | + /** |
|
| 5834 | + * @return void |
|
| 5835 | + */ |
|
| 5468 | 5836 | public function raisePostBackEvent($param); |
| 5469 | 5837 | } |
| 5470 | 5838 | interface IPostBackDataHandler |
| 5471 | 5839 | { |
| 5472 | 5840 | public function loadPostData($key,$values); |
| 5841 | + |
|
| 5842 | + /** |
|
| 5843 | + * @return void |
|
| 5844 | + */ |
|
| 5473 | 5845 | public function raisePostDataChangedEvent(); |
| 5474 | 5846 | public function getDataChanged(); |
| 5475 | 5847 | } |
@@ -5477,8 +5849,16 @@ discard block |
||
| 5477 | 5849 | { |
| 5478 | 5850 | public function validate(); |
| 5479 | 5851 | public function getIsValid(); |
| 5852 | + |
|
| 5853 | + /** |
|
| 5854 | + * @return void |
|
| 5855 | + */ |
|
| 5480 | 5856 | public function setIsValid($value); |
| 5481 | 5857 | public function getErrorMessage(); |
| 5858 | + |
|
| 5859 | + /** |
|
| 5860 | + * @return void |
|
| 5861 | + */ |
|
| 5482 | 5862 | public function setErrorMessage($value); |
| 5483 | 5863 | } |
| 5484 | 5864 | interface IValidatable |
@@ -5493,26 +5873,66 @@ discard block |
||
| 5493 | 5873 | } |
| 5494 | 5874 | interface ITheme |
| 5495 | 5875 | { |
| 5876 | + /** |
|
| 5877 | + * @return boolean |
|
| 5878 | + */ |
|
| 5496 | 5879 | public function applySkin($control); |
| 5497 | 5880 | } |
| 5498 | 5881 | interface ITemplate |
| 5499 | 5882 | { |
| 5883 | + /** |
|
| 5884 | + * @return void |
|
| 5885 | + */ |
|
| 5500 | 5886 | public function instantiateIn($parent); |
| 5501 | 5887 | } |
| 5502 | 5888 | interface IButtonControl |
| 5503 | 5889 | { |
| 5504 | 5890 | public function getText(); |
| 5891 | + |
|
| 5892 | + /** |
|
| 5893 | + * @param string $value |
|
| 5894 | + * |
|
| 5895 | + * @return void |
|
| 5896 | + */ |
|
| 5505 | 5897 | public function setText($value); |
| 5506 | 5898 | public function getCausesValidation(); |
| 5899 | + |
|
| 5900 | + /** |
|
| 5901 | + * @return void |
|
| 5902 | + */ |
|
| 5507 | 5903 | public function setCausesValidation($value); |
| 5508 | 5904 | public function getCommandName(); |
| 5905 | + |
|
| 5906 | + /** |
|
| 5907 | + * @return void |
|
| 5908 | + */ |
|
| 5509 | 5909 | public function setCommandName($value); |
| 5510 | 5910 | public function getCommandParameter(); |
| 5911 | + |
|
| 5912 | + /** |
|
| 5913 | + * @return void |
|
| 5914 | + */ |
|
| 5511 | 5915 | public function setCommandParameter($value); |
| 5512 | 5916 | public function getValidationGroup(); |
| 5917 | + |
|
| 5918 | + /** |
|
| 5919 | + * @return void |
|
| 5920 | + */ |
|
| 5513 | 5921 | public function setValidationGroup($value); |
| 5922 | + |
|
| 5923 | + /** |
|
| 5924 | + * @return void |
|
| 5925 | + */ |
|
| 5514 | 5926 | public function onClick($param); |
| 5927 | + |
|
| 5928 | + /** |
|
| 5929 | + * @return void |
|
| 5930 | + */ |
|
| 5515 | 5931 | public function onCommand($param); |
| 5932 | + |
|
| 5933 | + /** |
|
| 5934 | + * @return void |
|
| 5935 | + */ |
|
| 5516 | 5936 | public function setIsDefaultButton($value); |
| 5517 | 5937 | public function getIsDefaultButton(); |
| 5518 | 5938 | } |
@@ -5970,6 +6390,10 @@ discard block |
||
| 5970 | 6390 | { |
| 5971 | 6391 | return $this->_customStyle===null?'':$this->_customStyle; |
| 5972 | 6392 | } |
| 6393 | + |
|
| 6394 | + /** |
|
| 6395 | + * @param string $value |
|
| 6396 | + */ |
|
| 5973 | 6397 | public function setCustomStyle($value) |
| 5974 | 6398 | { |
| 5975 | 6399 | $this->_customStyle=$value; |
@@ -5978,6 +6402,11 @@ discard block |
||
| 5978 | 6402 | { |
| 5979 | 6403 | return isset($this->_fields[$name])?$this->_fields[$name]:''; |
| 5980 | 6404 | } |
| 6405 | + |
|
| 6406 | + /** |
|
| 6407 | + * @param string $name |
|
| 6408 | + * @param string $value |
|
| 6409 | + */ |
|
| 5981 | 6410 | public function setStyleField($name,$value) |
| 5982 | 6411 | { |
| 5983 | 6412 | $this->_fields[$name]=$value; |
@@ -6473,6 +6902,10 @@ discard block |
||
| 6473 | 6902 | { |
| 6474 | 6903 | private $_ensureid=false; |
| 6475 | 6904 | protected $_decorator; |
| 6905 | + |
|
| 6906 | + /** |
|
| 6907 | + * @param boolean $value |
|
| 6908 | + */ |
|
| 6476 | 6909 | public function setEnsureId($value) |
| 6477 | 6910 | { |
| 6478 | 6911 | $this->_ensureid |= TPropertyValue::ensureBoolean($value); |
@@ -6562,6 +6995,10 @@ discard block |
||
| 6562 | 6995 | else |
| 6563 | 6996 | return ''; |
| 6564 | 6997 | } |
| 6998 | + |
|
| 6999 | + /** |
|
| 7000 | + * @param string $value |
|
| 7001 | + */ |
|
| 6565 | 7002 | public function setForeColor($value) |
| 6566 | 7003 | { |
| 6567 | 7004 | $this->getStyle()->setForeColor($value); |
@@ -6592,6 +7029,10 @@ discard block |
||
| 6592 | 7029 | else |
| 6593 | 7030 | return ''; |
| 6594 | 7031 | } |
| 7032 | + |
|
| 7033 | + /** |
|
| 7034 | + * @param string $value |
|
| 7035 | + */ |
|
| 6595 | 7036 | public function setHeight($value) |
| 6596 | 7037 | { |
| 6597 | 7038 | $this->getStyle()->setHeight($value); |
@@ -6653,6 +7094,10 @@ discard block |
||
| 6653 | 7094 | else |
| 6654 | 7095 | return ''; |
| 6655 | 7096 | } |
| 7097 | + |
|
| 7098 | + /** |
|
| 7099 | + * @param string $value |
|
| 7100 | + */ |
|
| 6656 | 7101 | public function setWidth($value) |
| 6657 | 7102 | { |
| 6658 | 7103 | $this->getStyle()->setWidth($value); |
@@ -6780,6 +7225,10 @@ discard block |
||
| 6780 | 7225 | $tpl->instantiateIn($this); |
| 6781 | 7226 | } |
| 6782 | 7227 | } |
| 7228 | + |
|
| 7229 | + /** |
|
| 7230 | + * @param string $id |
|
| 7231 | + */ |
|
| 6783 | 7232 | public function registerContent($id,TContent $object) |
| 6784 | 7233 | { |
| 6785 | 7234 | if(isset($this->_contents[$id])) |
@@ -6787,6 +7236,10 @@ discard block |
||
| 6787 | 7236 | else |
| 6788 | 7237 | $this->_contents[$id]=$object; |
| 6789 | 7238 | } |
| 7239 | + |
|
| 7240 | + /** |
|
| 7241 | + * @param string $id |
|
| 7242 | + */ |
|
| 6790 | 7243 | public function registerContentPlaceHolder($id,TContentPlaceHolder $object) |
| 6791 | 7244 | { |
| 6792 | 7245 | if(isset($this->_placeholders[$id])) |
@@ -6983,6 +7436,10 @@ discard block |
||
| 6983 | 7436 | { |
| 6984 | 7437 | return $this->getViewState('Enctype',''); |
| 6985 | 7438 | } |
| 7439 | + |
|
| 7440 | + /** |
|
| 7441 | + * @param string $value |
|
| 7442 | + */ |
|
| 6986 | 7443 | public function setEnctype($value) |
| 6987 | 7444 | { |
| 6988 | 7445 | $this->setViewState('Enctype',$value,''); |
@@ -7102,6 +7559,10 @@ discard block |
||
| 7102 | 7559 | $scripts = array_unique($scripts); |
| 7103 | 7560 | return $scripts; |
| 7104 | 7561 | } |
| 7562 | + |
|
| 7563 | + /** |
|
| 7564 | + * @param string $base |
|
| 7565 | + */ |
|
| 7105 | 7566 | protected function getPackagePathUrl($base) |
| 7106 | 7567 | { |
| 7107 | 7568 | $assets = Prado::getApplication()->getAssetManager(); |
@@ -7251,6 +7712,11 @@ discard block |
||
| 7251 | 7712 | $params=func_get_args(); |
| 7252 | 7713 | $this->_page->registerCachingAction('Page.ClientScript','registerEndScript',$params); |
| 7253 | 7714 | } |
| 7715 | + |
|
| 7716 | + /** |
|
| 7717 | + * @param string $name |
|
| 7718 | + * @param string $value |
|
| 7719 | + */ |
|
| 7254 | 7720 | public function registerHiddenField($name,$value) |
| 7255 | 7721 | { |
| 7256 | 7722 | $this->_hiddenFields[$name]=$value; |
@@ -7388,6 +7854,10 @@ discard block |
||
| 7388 | 7854 | $this->renderAllPendingScriptFiles($writer); |
| 7389 | 7855 | } |
| 7390 | 7856 | } |
| 7857 | + |
|
| 7858 | + /** |
|
| 7859 | + * @param boolean $initial |
|
| 7860 | + */ |
|
| 7391 | 7861 | protected function renderHiddenFieldsInt($writer, $initial) |
| 7392 | 7862 | { |
| 7393 | 7863 | if ($initial) $this->_renderedHiddenFields = array(); |
@@ -7423,12 +7893,20 @@ discard block |
||
| 7423 | 7893 | abstract class TClientSideOptions extends TComponent |
| 7424 | 7894 | { |
| 7425 | 7895 | private $_options; |
| 7896 | + |
|
| 7897 | + /** |
|
| 7898 | + * @param string $name |
|
| 7899 | + */ |
|
| 7426 | 7900 | protected function setFunction($name, $code) |
| 7427 | 7901 | { |
| 7428 | 7902 | if(!TJavaScript::isJsLiteral($code)) |
| 7429 | 7903 | $code = TJavaScript::quoteJsLiteral($this->ensureFunction($code)); |
| 7430 | 7904 | $this->setOption($name, $code); |
| 7431 | 7905 | } |
| 7906 | + |
|
| 7907 | + /** |
|
| 7908 | + * @param string $name |
|
| 7909 | + */ |
|
| 7432 | 7910 | protected function getOption($name) |
| 7433 | 7911 | { |
| 7434 | 7912 | if ($this->_options) |
@@ -7551,6 +8029,10 @@ discard block |
||
| 7551 | 8029 | $this->renderControl($writer); |
| 7552 | 8030 | $this->unloadRecursive(); |
| 7553 | 8031 | } |
| 8032 | + |
|
| 8033 | + /** |
|
| 8034 | + * @param string $enc |
|
| 8035 | + */ |
|
| 7554 | 8036 | protected static function decodeUTF8($data, $enc) |
| 7555 | 8037 | { |
| 7556 | 8038 | if(is_array($data)) |
@@ -7633,6 +8115,10 @@ discard block |
||
| 7633 | 8115 | else |
| 7634 | 8116 | throw new TInvalidOperationException('page_form_duplicated'); |
| 7635 | 8117 | } |
| 8118 | + |
|
| 8119 | + /** |
|
| 8120 | + * @param string $validationGroup |
|
| 8121 | + */ |
|
| 7636 | 8122 | public function getValidators($validationGroup=null) |
| 7637 | 8123 | { |
| 7638 | 8124 | if(!$this->_validators) |
@@ -7703,6 +8189,10 @@ discard block |
||
| 7703 | 8189 | { |
| 7704 | 8190 | $this->_styleSheet=empty($value)?null:$value; |
| 7705 | 8191 | } |
| 8192 | + |
|
| 8193 | + /** |
|
| 8194 | + * @param TControl $control |
|
| 8195 | + */ |
|
| 7706 | 8196 | public function applyControlSkin($control) |
| 7707 | 8197 | { |
| 7708 | 8198 | if(($theme=$this->getTheme())!==null) |
@@ -7850,6 +8340,10 @@ discard block |
||
| 7850 | 8340 | { |
| 7851 | 8341 | $this->_postBackEventParameter=$value; |
| 7852 | 8342 | } |
| 8343 | + |
|
| 8344 | + /** |
|
| 8345 | + * @param boolean $beforeLoad |
|
| 8346 | + */ |
|
| 7853 | 8347 | protected function processPostData($postData,$beforeLoad) |
| 7854 | 8348 | { |
| 7855 | 8349 | $this->_isLoadingPostData=true; |
@@ -7938,6 +8432,10 @@ discard block |
||
| 7938 | 8432 | $this->getClientScript()->registerFocusControl($lastFocus); |
| 7939 | 8433 | $this->_inFormRender=false; |
| 7940 | 8434 | } |
| 8435 | + |
|
| 8436 | + /** |
|
| 8437 | + * @param TControl $value |
|
| 8438 | + */ |
|
| 7941 | 8439 | public function setFocus($value) |
| 7942 | 8440 | { |
| 7943 | 8441 | $this->_focus=$value; |
@@ -7983,6 +8481,10 @@ discard block |
||
| 7983 | 8481 | { |
| 7984 | 8482 | return $this->_clientState; |
| 7985 | 8483 | } |
| 8484 | + |
|
| 8485 | + /** |
|
| 8486 | + * @param string $state |
|
| 8487 | + */ |
|
| 7986 | 8488 | public function setClientState($state) |
| 7987 | 8489 | { |
| 7988 | 8490 | $this->_clientState=$state; |
@@ -8042,6 +8544,11 @@ discard block |
||
| 8042 | 8544 | { |
| 8043 | 8545 | $this->_pagePath=$value; |
| 8044 | 8546 | } |
| 8547 | + |
|
| 8548 | + /** |
|
| 8549 | + * @param string $context |
|
| 8550 | + * @param string $funcName |
|
| 8551 | + */ |
|
| 8045 | 8552 | public function registerCachingAction($context,$funcName,$funcParams) |
| 8046 | 8553 | { |
| 8047 | 8554 | if($this->_cachingStack) |
@@ -8064,13 +8571,27 @@ discard block |
||
| 8064 | 8571 | } |
| 8065 | 8572 | interface IPageStatePersister |
| 8066 | 8573 | { |
| 8574 | + /** |
|
| 8575 | + * @return TPage |
|
| 8576 | + */ |
|
| 8067 | 8577 | public function getPage(); |
| 8578 | + |
|
| 8579 | + /** |
|
| 8580 | + * @return void |
|
| 8581 | + */ |
|
| 8068 | 8582 | public function setPage(TPage $page); |
| 8583 | + |
|
| 8584 | + /** |
|
| 8585 | + * @return void |
|
| 8586 | + */ |
|
| 8069 | 8587 | public function save($state); |
| 8070 | 8588 | public function load(); |
| 8071 | 8589 | } |
| 8072 | 8590 | class TPageStateFormatter |
| 8073 | 8591 | { |
| 8592 | + /** |
|
| 8593 | + * @param TPage $page |
|
| 8594 | + */ |
|
| 8074 | 8595 | public static function serialize($page,$data) |
| 8075 | 8596 | { |
| 8076 | 8597 | $sm=$page->getApplication()->getSecurityManager(); |
@@ -8084,6 +8605,10 @@ discard block |
||
| 8084 | 8605 | $str=$sm->encrypt($str); |
| 8085 | 8606 | return base64_encode($str); |
| 8086 | 8607 | } |
| 8608 | + |
|
| 8609 | + /** |
|
| 8610 | + * @param TPage $page |
|
| 8611 | + */ |
|
| 8087 | 8612 | public static function unserialize($page,$data) |
| 8088 | 8613 | { |
| 8089 | 8614 | $str=base64_decode($data); |
@@ -8277,6 +8802,10 @@ discard block |
||
| 8277 | 8802 | { |
| 8278 | 8803 | $this->_cacheModuleID=$value; |
| 8279 | 8804 | } |
| 8805 | + |
|
| 8806 | + /** |
|
| 8807 | + * @param string $value |
|
| 8808 | + */ |
|
| 8280 | 8809 | public function setCacheKeyPrefix($value) |
| 8281 | 8810 | { |
| 8282 | 8811 | $this->_keyPrefix=$value; |
@@ -8327,10 +8856,18 @@ discard block |
||
| 8327 | 8856 | { |
| 8328 | 8857 | $this->_cachePostBack=TPropertyValue::ensureBoolean($value); |
| 8329 | 8858 | } |
| 8859 | + |
|
| 8860 | + /** |
|
| 8861 | + * @param TOutputCacheCheckDependencyEventParameter $param |
|
| 8862 | + */ |
|
| 8330 | 8863 | public function onCheckDependency($param) |
| 8331 | 8864 | { |
| 8332 | 8865 | $this->raiseEvent('OnCheckDependency',$this,$param); |
| 8333 | 8866 | } |
| 8867 | + |
|
| 8868 | + /** |
|
| 8869 | + * @param TOutputCacheCalculateKeyEventParameter $param |
|
| 8870 | + */ |
|
| 8334 | 8871 | public function onCalculateKey($param) |
| 8335 | 8872 | { |
| 8336 | 8873 | $this->raiseEvent('OnCalculateKey',$this,$param); |
@@ -8422,6 +8959,10 @@ discard block |
||
| 8422 | 8959 | $tplFile=dirname($class->getFileName()).DIRECTORY_SEPARATOR.$className.self::TEMPLATE_FILE_EXT; |
| 8423 | 8960 | return $this->getTemplateByFileName($tplFile); |
| 8424 | 8961 | } |
| 8962 | + |
|
| 8963 | + /** |
|
| 8964 | + * @param string $fileName |
|
| 8965 | + */ |
|
| 8425 | 8966 | public function getTemplateByFileName($fileName) |
| 8426 | 8967 | { |
| 8427 | 8968 | if(($fileName=$this->getLocalizedTemplate($fileName))!==null) |
@@ -8461,6 +9002,10 @@ discard block |
||
| 8461 | 9002 | else |
| 8462 | 9003 | return null; |
| 8463 | 9004 | } |
| 9005 | + |
|
| 9006 | + /** |
|
| 9007 | + * @return string |
|
| 9008 | + */ |
|
| 8464 | 9009 | protected function getLocalizedTemplate($filename) |
| 8465 | 9010 | { |
| 8466 | 9011 | if(($app=$this->getApplication()->getGlobalization(false))===null) |
@@ -8626,12 +9171,20 @@ discard block |
||
| 8626 | 9171 | $parentControl->addParsedObject($control); |
| 8627 | 9172 | } |
| 8628 | 9173 | } |
| 9174 | + |
|
| 9175 | + /** |
|
| 9176 | + * @param TControl $control |
|
| 9177 | + */ |
|
| 8629 | 9178 | protected function configureControl($control,$name,$value) |
| 8630 | 9179 | { |
| 8631 | 9180 | if(strncasecmp($name,'on',2)===0) $this->configureEvent($control,$name,$value,$control); |
| 8632 | 9181 | else if(($pos=strrpos($name,'.'))===false) $this->configureProperty($control,$name,$value); |
| 8633 | 9182 | else $this->configureSubProperty($control,$name,$value); |
| 8634 | 9183 | } |
| 9184 | + |
|
| 9185 | + /** |
|
| 9186 | + * @param TComponent $component |
|
| 9187 | + */ |
|
| 8635 | 9188 | protected function configureComponent($component,$name,$value) |
| 8636 | 9189 | { |
| 8637 | 9190 | if(strpos($name,'.')===false) $this->configureProperty($component,$name,$value); |
@@ -8941,6 +9494,11 @@ discard block |
||
| 8941 | 9494 | $tpl=$objects; |
| 8942 | 9495 | return $objects; |
| 8943 | 9496 | } |
| 9497 | + |
|
| 9498 | + /** |
|
| 9499 | + * @param string $str |
|
| 9500 | + * @param string $offset |
|
| 9501 | + */ |
|
| 8944 | 9502 | protected function parseAttributes($str,$offset) |
| 8945 | 9503 | { |
| 8946 | 9504 | if($str==='') |
@@ -8972,11 +9530,19 @@ discard block |
||
| 8972 | 9530 | } |
| 8973 | 9531 | return $attributes; |
| 8974 | 9532 | } |
| 9533 | + |
|
| 9534 | + /** |
|
| 9535 | + * @param string $content |
|
| 9536 | + */ |
|
| 8975 | 9537 | protected function parseTemplateProperty($content,$offset) |
| 8976 | 9538 | { |
| 8977 | 9539 | $line=$this->_startingLine+count(explode("\n",substr($this->_content,0,$offset)))-1; |
| 8978 | 9540 | return array(self::CONFIG_TEMPLATE,new TTemplate($content,$this->_contextPath,$this->_tplFile,$line,false)); |
| 8979 | 9541 | } |
| 9542 | + |
|
| 9543 | + /** |
|
| 9544 | + * @param string $value |
|
| 9545 | + */ |
|
| 8980 | 9546 | protected function parseAttribute($value) |
| 8981 | 9547 | { |
| 8982 | 9548 | if(($n=preg_match_all('/<%[#=].*?%>/msS',$value,$matches,PREG_OFFSET_CAPTURE))>0) |
@@ -9099,6 +9665,11 @@ discard block |
||
| 9099 | 9665 | { |
| 9100 | 9666 | return $this->_includedFiles; |
| 9101 | 9667 | } |
| 9668 | + |
|
| 9669 | + /** |
|
| 9670 | + * @param Exception $e |
|
| 9671 | + * @param integer $line |
|
| 9672 | + */ |
|
| 9102 | 9673 | protected function handleException($e,$line,$input=null) |
| 9103 | 9674 | { |
| 9104 | 9675 | $srcFile=$this->_tplFile; |
@@ -9155,6 +9726,10 @@ discard block |
||
| 9155 | 9726 | } |
| 9156 | 9727 | return $input; |
| 9157 | 9728 | } |
| 9729 | + |
|
| 9730 | + /** |
|
| 9731 | + * @param string $method |
|
| 9732 | + */ |
|
| 9158 | 9733 | protected function isClassBehaviorMethod(ReflectionClass $class,$method) |
| 9159 | 9734 | { |
| 9160 | 9735 | $component=new ReflectionClass('TComponent'); |
@@ -9237,6 +9812,10 @@ discard block |
||
| 9237 | 9812 | throw new TInvalidDataValueException('thememanager_basepath_invalid',$value); |
| 9238 | 9813 | } |
| 9239 | 9814 | } |
| 9815 | + |
|
| 9816 | + /** |
|
| 9817 | + * @return string |
|
| 9818 | + */ |
|
| 9240 | 9819 | public function getBaseUrl() |
| 9241 | 9820 | { |
| 9242 | 9821 | if($this->_baseUrl===null) |
@@ -9635,6 +10214,10 @@ discard block |
||
| 9635 | 10214 | { |
| 9636 | 10215 | return $this->_defaultPage; |
| 9637 | 10216 | } |
| 10217 | + |
|
| 10218 | + /** |
|
| 10219 | + * @param string $value |
|
| 10220 | + */ |
|
| 9638 | 10221 | public function setDefaultPage($value) |
| 9639 | 10222 | { |
| 9640 | 10223 | if($this->_initialized) |
@@ -9723,6 +10306,10 @@ discard block |
||
| 9723 | 10306 | $page->setSubProperty($name,$value); |
| 9724 | 10307 | $page->run($this->getResponse()->createHtmlWriter()); |
| 9725 | 10308 | } |
| 10309 | + |
|
| 10310 | + /** |
|
| 10311 | + * @param string $pagePath |
|
| 10312 | + */ |
|
| 9726 | 10313 | public function constructUrl($pagePath,$getParams=null,$encodeAmpersand=true,$encodeGetItems=true) |
| 9727 | 10314 | { |
| 9728 | 10315 | return $this->getRequest()->constructUrl($this->getID(),$pagePath,$getParams,$encodeAmpersand,$encodeGetItems); |
@@ -9794,11 +10381,20 @@ discard block |
||
| 9794 | 10381 | throw new TConfigurationException('pageserviceconf_file_invalid',$fname); |
| 9795 | 10382 | } |
| 9796 | 10383 | } |
| 10384 | + |
|
| 10385 | + /** |
|
| 10386 | + * @param string $configPath |
|
| 10387 | + */ |
|
| 9797 | 10388 | public function loadFromPhp($config,$configPath,$configPagePath) |
| 9798 | 10389 | { |
| 9799 | 10390 | $this->loadApplicationConfigurationFromPhp($config,$configPath); |
| 9800 | 10391 | $this->loadPageConfigurationFromPhp($config,$configPath,$configPagePath); |
| 9801 | 10392 | } |
| 10393 | + |
|
| 10394 | + /** |
|
| 10395 | + * @param TXmlDocument $dom |
|
| 10396 | + * @param string $configPath |
|
| 10397 | + */ |
|
| 9802 | 10398 | public function loadFromXml($dom,$configPath,$configPagePath) |
| 9803 | 10399 | { |
| 9804 | 10400 | $this->loadApplicationConfigurationFromXml($dom,$configPath); |
@@ -10055,6 +10651,10 @@ discard block |
||
| 10055 | 10651 | else |
| 10056 | 10652 | return $this->_basePath.DIRECTORY_SEPARATOR.$this->hash($path); |
| 10057 | 10653 | } |
| 10654 | + |
|
| 10655 | + /** |
|
| 10656 | + * @param string $path |
|
| 10657 | + */ |
|
| 10058 | 10658 | public function getPublishedUrl($path) |
| 10059 | 10659 | { |
| 10060 | 10660 | $path=realpath($path); |
@@ -10063,10 +10663,19 @@ discard block |
||
| 10063 | 10663 | else |
| 10064 | 10664 | return $this->_baseUrl.'/'.$this->hash($path); |
| 10065 | 10665 | } |
| 10666 | + |
|
| 10667 | + /** |
|
| 10668 | + * @param string $dir |
|
| 10669 | + */ |
|
| 10066 | 10670 | protected function hash($dir) |
| 10067 | 10671 | { |
| 10068 | 10672 | return sprintf('%x',crc32($dir.Prado::getVersion())); |
| 10069 | 10673 | } |
| 10674 | + |
|
| 10675 | + /** |
|
| 10676 | + * @param string $src |
|
| 10677 | + * @param string $dst |
|
| 10678 | + */ |
|
| 10070 | 10679 | protected function copyFile($src,$dst) |
| 10071 | 10680 | { |
| 10072 | 10681 | if(!is_dir($dst)) |
@@ -10080,6 +10689,11 @@ discard block |
||
| 10080 | 10689 | @copy($src,$dstFile); |
| 10081 | 10690 | } |
| 10082 | 10691 | } |
| 10692 | + |
|
| 10693 | + /** |
|
| 10694 | + * @param string $src |
|
| 10695 | + * @param string $dst |
|
| 10696 | + */ |
|
| 10083 | 10697 | public function copyDirectory($src,$dst) |
| 10084 | 10698 | { |
| 10085 | 10699 | if(!is_dir($dst)) |
@@ -10109,6 +10723,11 @@ discard block |
||
| 10109 | 10723 | throw new TInvalidDataValueException('assetmanager_source_directory_invalid', $src); |
| 10110 | 10724 | } |
| 10111 | 10725 | } |
| 10726 | + |
|
| 10727 | + /** |
|
| 10728 | + * @param string $tarfile |
|
| 10729 | + * @param string $md5sum |
|
| 10730 | + */ |
|
| 10112 | 10731 | public function publishTarFile($tarfile, $md5sum, $checkTimestamp=false) |
| 10113 | 10732 | { |
| 10114 | 10733 | if(isset($this->_published[$md5sum])) |
@@ -10131,6 +10750,10 @@ discard block |
||
| 10131 | 10750 | return $this->_published[$md5sum]=$this->_baseUrl.'/'.$dir; |
| 10132 | 10751 | } |
| 10133 | 10752 | } |
| 10753 | + |
|
| 10754 | + /** |
|
| 10755 | + * @param string $destination |
|
| 10756 | + */ |
|
| 10134 | 10757 | protected function deployTarFile($path,$destination) |
| 10135 | 10758 | { |
| 10136 | 10759 | if(($fullpath=realpath($path))===false || !is_file($fullpath)) |
@@ -10352,6 +10975,10 @@ discard block |
||
| 10352 | 10975 | $this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null)); |
| 10353 | 10976 | Prado::setPathOfAlias('Application',$this->_basePath); |
| 10354 | 10977 | } |
| 10978 | + |
|
| 10979 | + /** |
|
| 10980 | + * @param string $basePath |
|
| 10981 | + */ |
|
| 10355 | 10982 | protected function resolvePaths($basePath) |
| 10356 | 10983 | { |
| 10357 | 10984 | if(empty($basePath) || ($basePath=realpath($basePath))===false) |
@@ -10417,10 +11044,18 @@ discard block |
||
| 10417 | 11044 | { |
| 10418 | 11045 | return $this->_requestCompleted; |
| 10419 | 11046 | } |
| 11047 | + |
|
| 11048 | + /** |
|
| 11049 | + * @param integer $defaultValue |
|
| 11050 | + */ |
|
| 10420 | 11051 | public function getGlobalState($key,$defaultValue=null) |
| 10421 | 11052 | { |
| 10422 | 11053 | return isset($this->_globals[$key])?$this->_globals[$key]:$defaultValue; |
| 10423 | 11054 | } |
| 11055 | + |
|
| 11056 | + /** |
|
| 11057 | + * @param string $key |
|
| 11058 | + */ |
|
| 10424 | 11059 | public function setGlobalState($key,$value,$defaultValue=null,$forceSave=false) |
| 10425 | 11060 | { |
| 10426 | 11061 | $this->_stateChanged=true; |
@@ -10480,6 +11115,10 @@ discard block |
||
| 10480 | 11115 | { |
| 10481 | 11116 | return $this->_basePath; |
| 10482 | 11117 | } |
| 11118 | + |
|
| 11119 | + /** |
|
| 11120 | + * @param string $value |
|
| 11121 | + */ |
|
| 10483 | 11122 | public function setBasePath($value) |
| 10484 | 11123 | { |
| 10485 | 11124 | $this->_basePath=$value; |
@@ -10488,6 +11127,10 @@ discard block |
||
| 10488 | 11127 | { |
| 10489 | 11128 | return $this->_configFile; |
| 10490 | 11129 | } |
| 11130 | + |
|
| 11131 | + /** |
|
| 11132 | + * @param string $value |
|
| 11133 | + */ |
|
| 10491 | 11134 | public function setConfigurationFile($value) |
| 10492 | 11135 | { |
| 10493 | 11136 | $this->_configFile=$value; |
@@ -10496,6 +11139,10 @@ discard block |
||
| 10496 | 11139 | { |
| 10497 | 11140 | return $this->_configType; |
| 10498 | 11141 | } |
| 11142 | + |
|
| 11143 | + /** |
|
| 11144 | + * @param string $value |
|
| 11145 | + */ |
|
| 10499 | 11146 | public function setConfigurationType($value) |
| 10500 | 11147 | { |
| 10501 | 11148 | $this->_configType = $value; |
@@ -10535,6 +11182,10 @@ discard block |
||
| 10535 | 11182 | { |
| 10536 | 11183 | return $this->_runtimePath; |
| 10537 | 11184 | } |
| 11185 | + |
|
| 11186 | + /** |
|
| 11187 | + * @param string $value |
|
| 11188 | + */ |
|
| 10538 | 11189 | public function setRuntimePath($value) |
| 10539 | 11190 | { |
| 10540 | 11191 | $this->_runtimePath=$value; |
@@ -10546,6 +11197,10 @@ discard block |
||
| 10546 | 11197 | { |
| 10547 | 11198 | return $this->_service; |
| 10548 | 11199 | } |
| 11200 | + |
|
| 11201 | + /** |
|
| 11202 | + * @param IService $value |
|
| 11203 | + */ |
|
| 10549 | 11204 | public function setService($value) |
| 10550 | 11205 | { |
| 10551 | 11206 | $this->_service=$value; |
@@ -10826,6 +11481,10 @@ discard block |
||
| 10826 | 11481 | else |
| 10827 | 11482 | throw new THttpException(500,'application_service_unknown',$serviceID); |
| 10828 | 11483 | } |
| 11484 | + |
|
| 11485 | + /** |
|
| 11486 | + * @param Exception $param |
|
| 11487 | + */ |
|
| 10829 | 11488 | public function onError($param) |
| 10830 | 11489 | { |
| 10831 | 11490 | Prado::log($param->getMessage(),TLogger::ERROR,'System.TApplication'); |
@@ -46,8 +46,7 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $am=self::$_application->getAssetManager(); |
| 48 | 48 | $url=$am->publishFilePath(self::getPathOfNamespace('System.'.$logoName,'.gif')); |
| 49 | - } |
|
| 50 | - else |
|
| 49 | + } else |
|
| 51 | 50 | $url='http://pradosoft.github.io/docs/'.$logoName.'.gif'; |
| 52 | 51 | return '<a title="Powered by PRADO" href="https://github.com/pradosoft/prado" target="_blank"><img src="'.$url.'" style="border-width:0px;" alt="Powered by PRADO" /></a>'; |
| 53 | 52 | } |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | if(self::$_application!==null && ($errorHandler=self::$_application->getErrorHandler())!==null) |
| 72 | 71 | { |
| 73 | 72 | $errorHandler->handleError(null,$exception); |
| 74 | - } |
|
| 75 | - else |
|
| 73 | + } else |
|
| 76 | 74 | { |
| 77 | 75 | echo $exception; |
| 78 | 76 | } |
@@ -126,8 +124,7 @@ discard block |
||
| 126 | 124 | return $component; |
| 127 | 125 | break; |
| 128 | 126 | } |
| 129 | - } |
|
| 130 | - else |
|
| 127 | + } else |
|
| 131 | 128 | return new $type; |
| 132 | 129 | } |
| 133 | 130 | public static function using($namespace,$checkClassExistence=true) |
@@ -138,31 +135,27 @@ discard block |
||
| 138 | 135 | try |
| 139 | 136 | { |
| 140 | 137 | include_once($namespace.self::CLASS_FILE_EXT); |
| 141 | - } |
|
| 142 | - catch(Exception $e) |
|
| 138 | + } catch(Exception $e) |
|
| 143 | 139 | { |
| 144 | 140 | if($checkClassExistence && !class_exists($namespace,false)) |
| 145 | 141 | throw new TInvalidOperationException('prado_component_unknown',$namespace,$e->getMessage()); |
| 146 | 142 | else |
| 147 | 143 | throw $e; |
| 148 | 144 | } |
| 149 | - } |
|
| 150 | - else if(($path=self::getPathOfNamespace($namespace,self::CLASS_FILE_EXT))!==null) |
|
| 145 | + } else if(($path=self::getPathOfNamespace($namespace,self::CLASS_FILE_EXT))!==null) |
|
| 151 | 146 | { |
| 152 | 147 | $className=substr($namespace,$pos+1); |
| 153 | 148 | if($className==='*') { |
| 154 | 149 | self::$_usings[$namespace]=$path; |
| 155 | 150 | set_include_path(get_include_path().PATH_SEPARATOR.$path); |
| 156 | - } |
|
| 157 | - else { |
|
| 151 | + } else { |
|
| 158 | 152 | self::$_usings[$namespace]=$path; |
| 159 | 153 | if(!$checkClassExistence || !class_exists($className,false)) |
| 160 | 154 | { |
| 161 | 155 | try |
| 162 | 156 | { |
| 163 | 157 | include_once($path); |
| 164 | - } |
|
| 165 | - catch(Exception $e) |
|
| 158 | + } catch(Exception $e) |
|
| 166 | 159 | { |
| 167 | 160 | if($checkClassExistence && !class_exists($className,false)) |
| 168 | 161 | throw new TInvalidOperationException('prado_component_unknown',$className,$e->getMessage()); |
@@ -171,8 +164,7 @@ discard block |
||
| 171 | 164 | } |
| 172 | 165 | } |
| 173 | 166 | } |
| 174 | - } |
|
| 175 | - else |
|
| 167 | + } else |
|
| 176 | 168 | throw new TInvalidDataValueException('prado_using_invalid',$namespace); |
| 177 | 169 | } |
| 178 | 170 | public static function getPathOfNamespace($namespace, $ext='') |
@@ -208,8 +200,7 @@ discard block |
||
| 208 | 200 | self::$_aliases[$alias]=$rp; |
| 209 | 201 | else |
| 210 | 202 | throw new TInvalidDataValueException('prado_aliasname_invalid',$alias); |
| 211 | - } |
|
| 212 | - else |
|
| 203 | + } else |
|
| 213 | 204 | throw new TInvalidDataValueException('prado_alias_invalid',$alias,$path); |
| 214 | 205 | } |
| 215 | 206 | public static function fatalError($msg) |
@@ -246,8 +237,7 @@ discard block |
||
| 246 | 237 | echo "'". substr($str, 0, 70) . "...'"; |
| 247 | 238 | else |
| 248 | 239 | echo "'" . $str . "'"; |
| 249 | - } |
|
| 250 | - else if (is_int($item) || is_float($item)) |
|
| 240 | + } else if (is_int($item) || is_float($item)) |
|
| 251 | 241 | echo $item; |
| 252 | 242 | else if (is_object($item)) |
| 253 | 243 | echo get_class($item); |
@@ -316,8 +306,7 @@ discard block |
||
| 316 | 306 | if(isset($trace[0]['file']) && isset($trace[0]['line'])) |
| 317 | 307 | $msg.=" (line {$trace[0]['line']}, {$trace[0]['file']})"; |
| 318 | 308 | $level=TLogger::DEBUG; |
| 319 | - } |
|
| 320 | - else |
|
| 309 | + } else |
|
| 321 | 310 | $level=TLogger::INFO; |
| 322 | 311 | self::log($msg,$level,$category,$ctl); |
| 323 | 312 | } |
@@ -622,8 +611,7 @@ discard block |
||
| 622 | 611 | echo "<body><h1>Recursive Error</h1>\n"; |
| 623 | 612 | echo "<pre>".$exception->__toString()."</pre>\n"; |
| 624 | 613 | echo "</body></html>"; |
| 625 | - } |
|
| 626 | - else |
|
| 614 | + } else |
|
| 627 | 615 | { |
| 628 | 616 | error_log("Error happened while processing an existing error:\n".$exception->__toString()); |
| 629 | 617 | header('HTTP/1.0 500 Internal Error'); |
@@ -645,15 +633,13 @@ discard block |
||
| 645 | 633 | if($fileName==='') |
| 646 | 634 | $fileName='---embedded template---'; |
| 647 | 635 | $errorLine=$exception->getLineNumber(); |
| 648 | - } |
|
| 649 | - else |
|
| 636 | + } else |
|
| 650 | 637 | { |
| 651 | 638 | if(($trace=$this->getExactTrace($exception))!==null) |
| 652 | 639 | { |
| 653 | 640 | $fileName=$trace['file']; |
| 654 | 641 | $errorLine=$trace['line']; |
| 655 | - } |
|
| 656 | - else |
|
| 642 | + } else |
|
| 657 | 643 | { |
| 658 | 644 | $fileName=$exception->getFile(); |
| 659 | 645 | $errorLine=$exception->getLine(); |
@@ -712,8 +698,7 @@ discard block |
||
| 712 | 698 | $result=$trace[0]; |
| 713 | 699 | elseif(isset($trace[1])) |
| 714 | 700 | $result=$trace[1]; |
| 715 | - } |
|
| 716 | - else if($exception instanceof TInvalidOperationException) |
|
| 701 | + } else if($exception instanceof TInvalidOperationException) |
|
| 717 | 702 | { |
| 718 | 703 | if(($result=$this->getPropertyAccessTrace($trace,'__get'))===null) |
| 719 | 704 | $result=$this->getPropertyAccessTrace($trace,'__set'); |
@@ -745,8 +730,7 @@ discard block |
||
| 745 | 730 | { |
| 746 | 731 | $line=htmlspecialchars(sprintf("%04d: %s",$i+1,str_replace("\t",' ',$lines[$i]))); |
| 747 | 732 | $source.="<div class=\"error\">".$line."</div>"; |
| 748 | - } |
|
| 749 | - else |
|
| 733 | + } else |
|
| 750 | 734 | $source.=htmlspecialchars(sprintf("%04d: %s",$i+1,str_replace("\t",' ',$lines[$i]))); |
| 751 | 735 | } |
| 752 | 736 | return $source; |
@@ -810,11 +794,9 @@ discard block |
||
| 810 | 794 | { |
| 811 | 795 | array_splice($this->_d,$index,0,array($item)); |
| 812 | 796 | $this->_c++; |
| 813 | - } |
|
| 814 | - else |
|
| 797 | + } else |
|
| 815 | 798 | throw new TInvalidDataValueException('list_index_invalid',$index); |
| 816 | - } |
|
| 817 | - else |
|
| 799 | + } else |
|
| 818 | 800 | throw new TInvalidOperationException('list_readonly',get_class($this)); |
| 819 | 801 | } |
| 820 | 802 | public function remove($item) |
@@ -825,11 +807,9 @@ discard block |
||
| 825 | 807 | { |
| 826 | 808 | $this->removeAt($index); |
| 827 | 809 | return $index; |
| 828 | - } |
|
| 829 | - else |
|
| 810 | + } else |
|
| 830 | 811 | throw new TInvalidDataValueException('list_item_inexistent'); |
| 831 | - } |
|
| 832 | - else |
|
| 812 | + } else |
|
| 833 | 813 | throw new TInvalidOperationException('list_readonly',get_class($this)); |
| 834 | 814 | } |
| 835 | 815 | public function removeAt($index) |
@@ -847,11 +827,9 @@ discard block |
||
| 847 | 827 | array_splice($this->_d,$index,1); |
| 848 | 828 | return $item; |
| 849 | 829 | } |
| 850 | - } |
|
| 851 | - else |
|
| 830 | + } else |
|
| 852 | 831 | throw new TInvalidDataValueException('list_index_invalid',$index); |
| 853 | - } |
|
| 854 | - else |
|
| 832 | + } else |
|
| 855 | 833 | throw new TInvalidOperationException('list_readonly',get_class($this)); |
| 856 | 834 | } |
| 857 | 835 | public function clear() |
@@ -878,8 +856,7 @@ discard block |
||
| 878 | 856 | throw new TInvalidDataValueException('list_item_inexistent'); |
| 879 | 857 | $this->insertAt($index, $item); |
| 880 | 858 | return $index; |
| 881 | - } |
|
| 882 | - else |
|
| 859 | + } else |
|
| 883 | 860 | throw new TInvalidOperationException('list_readonly',get_class($this)); |
| 884 | 861 | } |
| 885 | 862 | public function insertAfter($baseitem, $item) |
@@ -890,8 +867,7 @@ discard block |
||
| 890 | 867 | throw new TInvalidDataValueException('list_item_inexistent'); |
| 891 | 868 | $this->insertAt($index + 1, $item); |
| 892 | 869 | return $index + 1; |
| 893 | - } |
|
| 894 | - else |
|
| 870 | + } else |
|
| 895 | 871 | throw new TInvalidOperationException('list_readonly',get_class($this)); |
| 896 | 872 | } |
| 897 | 873 | public function toArray() |
@@ -906,8 +882,7 @@ discard block |
||
| 906 | 882 | $this->clear(); |
| 907 | 883 | foreach($data as $item) |
| 908 | 884 | $this->add($item); |
| 909 | - } |
|
| 910 | - else if($data!==null) |
|
| 885 | + } else if($data!==null) |
|
| 911 | 886 | throw new TInvalidDataTypeException('list_data_not_iterable'); |
| 912 | 887 | } |
| 913 | 888 | public function mergeWith($data) |
@@ -916,8 +891,7 @@ discard block |
||
| 916 | 891 | { |
| 917 | 892 | foreach($data as $item) |
| 918 | 893 | $this->add($item); |
| 919 | - } |
|
| 920 | - else if($data!==null) |
|
| 894 | + } else if($data!==null) |
|
| 921 | 895 | throw new TInvalidDataTypeException('list_data_not_iterable'); |
| 922 | 896 | } |
| 923 | 897 | public function offsetExists($offset) |
@@ -1131,8 +1105,7 @@ discard block |
||
| 1131 | 1105 | { |
| 1132 | 1106 | if(($this->_recursiveLevel<0 || $level<$this->_recursiveLevel) && $this->validateDirectory($path)) |
| 1133 | 1107 | $timestamps=array_merge($this->generateTimestamps($path,$level+1)); |
| 1134 | - } |
|
| 1135 | - else if($this->validateFile($path)) |
|
| 1108 | + } else if($this->validateFile($path)) |
|
| 1136 | 1109 | $timestamps[$path]=filemtime($path); |
| 1137 | 1110 | } |
| 1138 | 1111 | closedir($dir); |
@@ -1393,8 +1366,7 @@ discard block |
||
| 1393 | 1366 | } |
| 1394 | 1367 | $this->removeAtIndexInPriority($p[1],$p[0]); |
| 1395 | 1368 | return $p[2]; |
| 1396 | - } |
|
| 1397 | - else |
|
| 1369 | + } else |
|
| 1398 | 1370 | throw new TInvalidDataValueException('list_item_inexistent'); |
| 1399 | 1371 | } |
| 1400 | 1372 | public function removeAt($index) |
@@ -1552,13 +1524,11 @@ discard block |
||
| 1552 | 1524 | foreach($data->itemsAtPriority($priority) as $index=>$item) |
| 1553 | 1525 | $this->insertAtIndexInPriority($item,false,$priority); |
| 1554 | 1526 | } |
| 1555 | - } |
|
| 1556 | - else if(is_array($data)||$data instanceof Traversable) |
|
| 1527 | + } else if(is_array($data)||$data instanceof Traversable) |
|
| 1557 | 1528 | { |
| 1558 | 1529 | foreach($data as $priority=>$item) |
| 1559 | 1530 | $this->add($item); |
| 1560 | - } |
|
| 1561 | - else if($data!==null) |
|
| 1531 | + } else if($data!==null) |
|
| 1562 | 1532 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 1563 | 1533 | } |
| 1564 | 1534 | public function offsetExists($offset) |
@@ -1649,11 +1619,9 @@ discard block |
||
| 1649 | 1619 | $value=$this->_d[$key]; |
| 1650 | 1620 | unset($this->_d[$key]); |
| 1651 | 1621 | return $value; |
| 1652 | - } |
|
| 1653 | - else |
|
| 1622 | + } else |
|
| 1654 | 1623 | return null; |
| 1655 | - } |
|
| 1656 | - else |
|
| 1624 | + } else |
|
| 1657 | 1625 | throw new TInvalidOperationException('map_readonly',get_class($this)); |
| 1658 | 1626 | } |
| 1659 | 1627 | public function clear() |
@@ -1677,8 +1645,7 @@ discard block |
||
| 1677 | 1645 | $this->clear(); |
| 1678 | 1646 | foreach($data as $key=>$value) |
| 1679 | 1647 | $this->add($key,$value); |
| 1680 | - } |
|
| 1681 | - else if($data!==null) |
|
| 1648 | + } else if($data!==null) |
|
| 1682 | 1649 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 1683 | 1650 | } |
| 1684 | 1651 | public function mergeWith($data) |
@@ -1687,8 +1654,7 @@ discard block |
||
| 1687 | 1654 | { |
| 1688 | 1655 | foreach($data as $key=>$value) |
| 1689 | 1656 | $this->add($key,$value); |
| 1690 | - } |
|
| 1691 | - else if($data!==null) |
|
| 1657 | + } else if($data!==null) |
|
| 1692 | 1658 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 1693 | 1659 | } |
| 1694 | 1660 | public function offsetExists($offset) |
@@ -1862,13 +1828,11 @@ discard block |
||
| 1862 | 1828 | if(!isset($this->_d[$priority])) { |
| 1863 | 1829 | $this->_d[$priority]=array($key=>$value); |
| 1864 | 1830 | $this->_o=false; |
| 1865 | - } |
|
| 1866 | - else |
|
| 1831 | + } else |
|
| 1867 | 1832 | $this->_d[$priority][$key]=$value; |
| 1868 | 1833 | $this->_c++; |
| 1869 | 1834 | $this->_fd=null; |
| 1870 | - } |
|
| 1871 | - else |
|
| 1835 | + } else |
|
| 1872 | 1836 | throw new TInvalidOperationException('map_readonly',get_class($this)); |
| 1873 | 1837 | return $priority; |
| 1874 | 1838 | } |
@@ -1896,8 +1860,7 @@ discard block |
||
| 1896 | 1860 | return $value; |
| 1897 | 1861 | } |
| 1898 | 1862 | return null; |
| 1899 | - } |
|
| 1900 | - else |
|
| 1863 | + } else |
|
| 1901 | 1864 | { |
| 1902 | 1865 | $priority=(string)round(TPropertyValue::ensureFloat($priority),$this->_p); |
| 1903 | 1866 | if(isset($this->_d[$priority])&&(isset($this->_d[$priority][$key])||array_key_exists($key,$this->_d[$priority]))) |
@@ -1911,12 +1874,10 @@ discard block |
||
| 1911 | 1874 | } |
| 1912 | 1875 | $this->_fd=null; |
| 1913 | 1876 | return $value; |
| 1914 | - } |
|
| 1915 | - else |
|
| 1877 | + } else |
|
| 1916 | 1878 | return null; |
| 1917 | 1879 | } |
| 1918 | - } |
|
| 1919 | - else |
|
| 1880 | + } else |
|
| 1920 | 1881 | throw new TInvalidOperationException('map_readonly',get_class($this)); |
| 1921 | 1882 | } |
| 1922 | 1883 | public function clear() |
@@ -1969,15 +1930,13 @@ discard block |
||
| 1969 | 1930 | $this->add($key,$value,$priority); |
| 1970 | 1931 | } |
| 1971 | 1932 | } |
| 1972 | - } |
|
| 1973 | - else if(is_array($data)||$data instanceof Traversable) |
|
| 1933 | + } else if(is_array($data)||$data instanceof Traversable) |
|
| 1974 | 1934 | { |
| 1975 | 1935 | if($this->getCount()>0) |
| 1976 | 1936 | $this->clear(); |
| 1977 | 1937 | foreach($data as $key=>$value) |
| 1978 | 1938 | $this->add($key,$value); |
| 1979 | - } |
|
| 1980 | - else if($data!==null) |
|
| 1939 | + } else if($data!==null) |
|
| 1981 | 1940 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 1982 | 1941 | } |
| 1983 | 1942 | public function mergeWith($data) |
@@ -1989,13 +1948,11 @@ discard block |
||
| 1989 | 1948 | foreach($data->itemsAtPriority($priority) as $key => $value) |
| 1990 | 1949 | $this->add($key,$value,$priority); |
| 1991 | 1950 | } |
| 1992 | - } |
|
| 1993 | - else if(is_array($data)||$data instanceof Traversable) |
|
| 1951 | + } else if(is_array($data)||$data instanceof Traversable) |
|
| 1994 | 1952 | { |
| 1995 | 1953 | foreach($data as $key=>$value) |
| 1996 | 1954 | $this->add($key,$value); |
| 1997 | - } |
|
| 1998 | - else if($data!==null) |
|
| 1955 | + } else if($data!==null) |
|
| 1999 | 1956 | throw new TInvalidDataTypeException('map_data_not_iterable'); |
| 2000 | 1957 | } |
| 2001 | 1958 | public function offsetExists($offset) |
@@ -2038,8 +1995,7 @@ discard block |
||
| 2038 | 1995 | $this->_d[]=$item; |
| 2039 | 1996 | ++$this->_c; |
| 2040 | 1997 | } |
| 2041 | - } |
|
| 2042 | - else if($data!==null) |
|
| 1998 | + } else if($data!==null) |
|
| 2043 | 1999 | throw new TInvalidDataTypeException('stack_data_not_iterable'); |
| 2044 | 2000 | } |
| 2045 | 2001 | public function clear() |
@@ -2224,13 +2180,11 @@ discard block |
||
| 2224 | 2180 | $str.=$element->toString($indent+1)."\n"; |
| 2225 | 2181 | $str.=$prefix."</{$this->_tagName}>"; |
| 2226 | 2182 | return $str; |
| 2227 | - } |
|
| 2228 | - else if(($value=$this->getValue())!=='') |
|
| 2183 | + } else if(($value=$this->getValue())!=='') |
|
| 2229 | 2184 | { |
| 2230 | 2185 | $value=$this->xmlEncode($value); |
| 2231 | 2186 | return $prefix."<{$this->_tagName}$attr>$value</{$this->_tagName}>"; |
| 2232 | - } |
|
| 2233 | - else |
|
| 2187 | + } else |
|
| 2234 | 2188 | return $prefix."<{$this->_tagName}$attr />"; |
| 2235 | 2189 | } |
| 2236 | 2190 | public function __toString() |
@@ -2327,8 +2281,7 @@ discard block |
||
| 2327 | 2281 | { |
| 2328 | 2282 | fwrite($fw,$this->saveToString()); |
| 2329 | 2283 | fclose($fw); |
| 2330 | - } |
|
| 2331 | - else |
|
| 2284 | + } else |
|
| 2332 | 2285 | throw new TIOException('xmldocument_file_write_failed',$file); |
| 2333 | 2286 | } |
| 2334 | 2287 | public function saveToString() |
@@ -2374,8 +2327,7 @@ discard block |
||
| 2374 | 2327 | if($item->getParent()!==null) |
| 2375 | 2328 | $item->getParent()->getElements()->remove($item); |
| 2376 | 2329 | $item->setParent($this->_o); |
| 2377 | - } |
|
| 2378 | - else |
|
| 2330 | + } else |
|
| 2379 | 2331 | throw new TInvalidDataTypeException('xmlelementlist_xmlelement_required'); |
| 2380 | 2332 | } |
| 2381 | 2333 | public function removeAt($index) |
@@ -2419,8 +2371,7 @@ discard block |
||
| 2419 | 2371 | { |
| 2420 | 2372 | $this->_everyone=true; |
| 2421 | 2373 | break; |
| 2422 | - } |
|
| 2423 | - else if($user==='?') |
|
| 2374 | + } else if($user==='?') |
|
| 2424 | 2375 | $this->_guest=true; |
| 2425 | 2376 | else if($user==='@') |
| 2426 | 2377 | $this->_authenticated=true; |
@@ -2530,8 +2481,7 @@ discard block |
||
| 2530 | 2481 | return ($decision>0); |
| 2531 | 2482 | } |
| 2532 | 2483 | return true; |
| 2533 | - } |
|
| 2534 | - else |
|
| 2484 | + } else |
|
| 2535 | 2485 | return false; |
| 2536 | 2486 | } |
| 2537 | 2487 | public function insertAt($index,$item) |
@@ -2661,8 +2611,7 @@ discard block |
||
| 2661 | 2611 | if($module===false) |
| 2662 | 2612 | throw new TNotSupportedException('securitymanager_mcryptextension_initfailed'); |
| 2663 | 2613 | return $module; |
| 2664 | - } |
|
| 2665 | - else |
|
| 2614 | + } else |
|
| 2666 | 2615 | throw new TNotSupportedException('securitymanager_mcryptextension_required'); |
| 2667 | 2616 | } |
| 2668 | 2617 | public function hashData($data) |
@@ -2802,8 +2751,7 @@ discard block |
||
| 2802 | 2751 | } |
| 2803 | 2752 | } |
| 2804 | 2753 | return '{'.$results.'}'; |
| 2805 | - } |
|
| 2806 | - else |
|
| 2754 | + } else |
|
| 2807 | 2755 | { |
| 2808 | 2756 | foreach($value as $v) |
| 2809 | 2757 | { |
@@ -2816,8 +2764,7 @@ discard block |
||
| 2816 | 2764 | } |
| 2817 | 2765 | return '['.$results.']'; |
| 2818 | 2766 | } |
| 2819 | - } |
|
| 2820 | - else if(is_integer($value)) |
|
| 2767 | + } else if(is_integer($value)) |
|
| 2821 | 2768 | return "$value"; |
| 2822 | 2769 | else if(is_float($value)) |
| 2823 | 2770 | { |
@@ -2837,8 +2784,7 @@ discard block |
||
| 2837 | 2784 | return str_replace($locale['decimal_point'], '.', "$value"); |
| 2838 | 2785 | break; |
| 2839 | 2786 | } |
| 2840 | - } |
|
| 2841 | - else if(is_object($value)) |
|
| 2787 | + } else if(is_object($value)) |
|
| 2842 | 2788 | if ($value instanceof TJavaScriptLiteral) |
| 2843 | 2789 | return $value->toJavaScriptLiteral(); |
| 2844 | 2790 | else |
@@ -2925,12 +2871,10 @@ discard block |
||
| 2925 | 2871 | $name=urlencode($name.'[]'); |
| 2926 | 2872 | foreach($value as $v) |
| 2927 | 2873 | $url.=$amp.$name.'='.urlencode($v); |
| 2928 | - } |
|
| 2929 | - else |
|
| 2874 | + } else |
|
| 2930 | 2875 | $url.=$amp.urlencode($name).'='.urlencode($value); |
| 2931 | 2876 | } |
| 2932 | - } |
|
| 2933 | - else |
|
| 2877 | + } else |
|
| 2934 | 2878 | { |
| 2935 | 2879 | foreach($getItems as $name=>$value) |
| 2936 | 2880 | { |
@@ -2938,8 +2882,7 @@ discard block |
||
| 2938 | 2882 | { |
| 2939 | 2883 | foreach($value as $v) |
| 2940 | 2884 | $url.=$amp.$name.'[]='.$v; |
| 2941 | - } |
|
| 2942 | - else |
|
| 2885 | + } else |
|
| 2943 | 2886 | $url.=$amp.$name.'='.$value; |
| 2944 | 2887 | } |
| 2945 | 2888 | } |
@@ -2977,14 +2920,12 @@ discard block |
||
| 2977 | 2920 | $getVariables[substr($name,0,$pos)][]=$value; |
| 2978 | 2921 | else |
| 2979 | 2922 | $getVariables[$name]=$value; |
| 2980 | - } |
|
| 2981 | - else |
|
| 2923 | + } else |
|
| 2982 | 2924 | $getVariables[$path]=''; |
| 2983 | 2925 | } |
| 2984 | 2926 | } |
| 2985 | 2927 | return $getVariables; |
| 2986 | - } |
|
| 2987 | - else |
|
| 2928 | + } else |
|
| 2988 | 2929 | return array(); |
| 2989 | 2930 | } |
| 2990 | 2931 | } |
@@ -3068,8 +3009,7 @@ discard block |
||
| 3068 | 3009 | $port=$_SERVER['SERVER_PORT']; |
| 3069 | 3010 | if(($port!=80 && !$secure) || ($port!=443 && $secure)) |
| 3070 | 3011 | $url.=':'.$port; |
| 3071 | - } |
|
| 3072 | - else |
|
| 3012 | + } else |
|
| 3073 | 3013 | $url.=$_SERVER['HTTP_HOST']; |
| 3074 | 3014 | $url.=$this->getRequestUri(); |
| 3075 | 3015 | $this->_url=new TUri($url); |
@@ -3139,8 +3079,7 @@ discard block |
||
| 3139 | 3079 | { |
| 3140 | 3080 | $this->_urlManager=new TUrlManager; |
| 3141 | 3081 | $this->_urlManager->init(null); |
| 3142 | - } |
|
| 3143 | - else |
|
| 3082 | + } else |
|
| 3144 | 3083 | { |
| 3145 | 3084 | $this->_urlManager=$this->getApplication()->getModule($this->_urlManagerID); |
| 3146 | 3085 | if($this->_urlManager===null) |
@@ -3205,8 +3144,7 @@ discard block |
||
| 3205 | 3144 | static $result; |
| 3206 | 3145 | if($result === null && function_exists('apache_request_headers')) { |
| 3207 | 3146 | $result = apache_request_headers(); |
| 3208 | - } |
|
| 3209 | - elseif($result === null) { |
|
| 3147 | + } elseif($result === null) { |
|
| 3210 | 3148 | $result = array(); |
| 3211 | 3149 | foreach($_SERVER as $key=>$value) { |
| 3212 | 3150 | if(strncasecmp($key, 'HTTP_', 5) !== 0) continue; |
@@ -3261,8 +3199,7 @@ discard block |
||
| 3261 | 3199 | try |
| 3262 | 3200 | { |
| 3263 | 3201 | return get_browser(); |
| 3264 | - } |
|
| 3265 | - catch(TPhpErrorException $e) |
|
| 3202 | + } catch(TPhpErrorException $e) |
|
| 3266 | 3203 | { |
| 3267 | 3204 | throw new TConfigurationException('httprequest_browscap_required'); |
| 3268 | 3205 | } |
@@ -3316,8 +3253,7 @@ discard block |
||
| 3316 | 3253 | if(($value=$sm->validateData($value))!==false) |
| 3317 | 3254 | $this->_cookies->add(new THttpCookie($key,$value)); |
| 3318 | 3255 | } |
| 3319 | - } |
|
| 3320 | - else |
|
| 3256 | + } else |
|
| 3321 | 3257 | { |
| 3322 | 3258 | foreach($_COOKIE as $key=>$value) |
| 3323 | 3259 | $this->_cookies->add(new THttpCookie($key,$value)); |
@@ -3420,8 +3356,7 @@ discard block |
||
| 3420 | 3356 | $value=$this->_items[$key]; |
| 3421 | 3357 | unset($this->_items[$key]); |
| 3422 | 3358 | return $value; |
| 3423 | - } |
|
| 3424 | - else |
|
| 3359 | + } else |
|
| 3425 | 3360 | return null; |
| 3426 | 3361 | } |
| 3427 | 3362 | public function clear() |
@@ -3468,8 +3403,7 @@ discard block |
||
| 3468 | 3403 | parent::insertAt($index,$item); |
| 3469 | 3404 | if($this->_o instanceof THttpResponse) |
| 3470 | 3405 | $this->_o->addCookie($item); |
| 3471 | - } |
|
| 3472 | - else |
|
| 3406 | + } else |
|
| 3473 | 3407 | throw new TInvalidDataTypeException('httpcookiecollection_httpcookie_required'); |
| 3474 | 3408 | } |
| 3475 | 3409 | public function removeAt($index) |
@@ -3599,8 +3533,7 @@ discard block |
||
| 3599 | 3533 | $this->_query=isset($ret['query'])?$ret['query']:''; |
| 3600 | 3534 | $this->_fragment=isset($ret['fragment'])?$ret['fragment']:''; |
| 3601 | 3535 | $this->_uri=$uri; |
| 3602 | - } |
|
| 3603 | - else |
|
| 3536 | + } else |
|
| 3604 | 3537 | { |
| 3605 | 3538 | throw new TInvalidDataValueException('uri_format_invalid',$uri); |
| 3606 | 3539 | } |
@@ -3772,7 +3705,7 @@ discard block |
||
| 3772 | 3705 | $status=TPropertyValue::ensureInteger($status); |
| 3773 | 3706 | if(isset(self::$HTTP_STATUS_CODES[$status])) { |
| 3774 | 3707 | $this->_reason=self::$HTTP_STATUS_CODES[$status]; |
| 3775 | - }else{ |
|
| 3708 | + } else{ |
|
| 3776 | 3709 | if($reason===null || $reason==='') { |
| 3777 | 3710 | throw new TInvalidDataValueException("response_status_reason_missing"); |
| 3778 | 3711 | } |
@@ -3836,8 +3769,7 @@ discard block |
||
| 3836 | 3769 | { |
| 3837 | 3770 | foreach($headers as $h) |
| 3838 | 3771 | header($h); |
| 3839 | - } |
|
| 3840 | - else |
|
| 3772 | + } else |
|
| 3841 | 3773 | { |
| 3842 | 3774 | header('Pragma: public'); |
| 3843 | 3775 | header('Expires: 0'); |
@@ -3900,13 +3832,11 @@ discard block |
||
| 3900 | 3832 | { |
| 3901 | 3833 | $this->_bufferOutput = false; |
| 3902 | 3834 | ob_end_flush(); |
| 3903 | - } |
|
| 3904 | - else |
|
| 3835 | + } else |
|
| 3905 | 3836 | ob_flush(); |
| 3906 | 3837 | flush(); |
| 3907 | 3838 | } |
| 3908 | - } |
|
| 3909 | - else |
|
| 3839 | + } else |
|
| 3910 | 3840 | flush(); |
| 3911 | 3841 | } |
| 3912 | 3842 | protected function ensureHttpHeaderSent() |
@@ -3992,8 +3922,7 @@ discard block |
||
| 3992 | 3922 | $cookie->getSecure(), |
| 3993 | 3923 | $cookie->getHttpOnly() |
| 3994 | 3924 | ); |
| 3995 | - } |
|
| 3996 | - else { |
|
| 3925 | + } else { |
|
| 3997 | 3926 | setcookie( |
| 3998 | 3927 | $cookie->getName(), |
| 3999 | 3928 | $cookie->getValue(), |
@@ -4173,13 +4102,11 @@ discard block |
||
| 4173 | 4102 | { |
| 4174 | 4103 | ini_set('session.use_cookies','0'); |
| 4175 | 4104 | ini_set('session.use_only_cookies','0'); |
| 4176 | - } |
|
| 4177 | - else if($value===THttpSessionCookieMode::Allow) |
|
| 4105 | + } else if($value===THttpSessionCookieMode::Allow) |
|
| 4178 | 4106 | { |
| 4179 | 4107 | ini_set('session.use_cookies','1'); |
| 4180 | 4108 | ini_set('session.use_only_cookies','0'); |
| 4181 | - } |
|
| 4182 | - else |
|
| 4109 | + } else |
|
| 4183 | 4110 | { |
| 4184 | 4111 | ini_set('session.use_cookies','1'); |
| 4185 | 4112 | ini_set('session.use_only_cookies','1'); |
@@ -4213,8 +4140,7 @@ discard block |
||
| 4213 | 4140 | { |
| 4214 | 4141 | ini_set('session.gc_probability',$value); |
| 4215 | 4142 | ini_set('session.gc_divisor','100'); |
| 4216 | - } |
|
| 4217 | - else |
|
| 4143 | + } else |
|
| 4218 | 4144 | throw new TInvalidDataValueException('httpsession_gcprobability_invalid',$value); |
| 4219 | 4145 | } |
| 4220 | 4146 | } |
@@ -4300,8 +4226,7 @@ discard block |
||
| 4300 | 4226 | $value=$_SESSION[$key]; |
| 4301 | 4227 | unset($_SESSION[$key]); |
| 4302 | 4228 | return $value; |
| 4303 | - } |
|
| 4304 | - else |
|
| 4229 | + } else |
|
| 4305 | 4230 | return null; |
| 4306 | 4231 | } |
| 4307 | 4232 | public function clear() |
@@ -4617,10 +4542,8 @@ discard block |
||
| 4617 | 4542 | return $this->_id; |
| 4618 | 4543 | else |
| 4619 | 4544 | return ($this->_uid=$prefix.self::ID_SEPARATOR.$this->_id); |
| 4620 | - } |
|
| 4621 | - else return $this->_id; |
|
| 4622 | - } |
|
| 4623 | - else |
|
| 4545 | + } else return $this->_id; |
|
| 4546 | + } else |
|
| 4624 | 4547 | return $this->_uid; |
| 4625 | 4548 | } |
| 4626 | 4549 | public function focus() |
@@ -4696,8 +4619,7 @@ discard block |
||
| 4696 | 4619 | if(!$control->getVisible(false)) |
| 4697 | 4620 | return false; |
| 4698 | 4621 | return true; |
| 4699 | - } |
|
| 4700 | - else |
|
| 4622 | + } else |
|
| 4701 | 4623 | return $this->getViewState('Visible',true); |
| 4702 | 4624 | } |
| 4703 | 4625 | public function setVisible($value) |
@@ -4712,8 +4634,7 @@ discard block |
||
| 4712 | 4634 | if(!$control->getViewState('Enabled',true)) |
| 4713 | 4635 | return false; |
| 4714 | 4636 | return true; |
| 4715 | - } |
|
| 4716 | - else |
|
| 4637 | + } else |
|
| 4717 | 4638 | return $this->getViewState('Enabled',true); |
| 4718 | 4639 | } |
| 4719 | 4640 | public function setEnabled($value) |
@@ -4771,8 +4692,7 @@ discard block |
||
| 4771 | 4692 | if($control->_flags & self::IS_DISABLE_VIEWSTATE) |
| 4772 | 4693 | return false; |
| 4773 | 4694 | return true; |
| 4774 | - } |
|
| 4775 | - else |
|
| 4695 | + } else |
|
| 4776 | 4696 | return !($this->_flags & self::IS_DISABLE_VIEWSTATE); |
| 4777 | 4697 | } |
| 4778 | 4698 | public function setEnableViewState($value) |
@@ -4810,8 +4730,7 @@ discard block |
||
| 4810 | 4730 | if(is_object($this->_tempState[$key]) && $this->_trackViewState) |
| 4811 | 4731 | $this->_viewState[$key]=$this->_tempState[$key]; |
| 4812 | 4732 | return $this->_tempState[$key]; |
| 4813 | - } |
|
| 4814 | - else |
|
| 4733 | + } else |
|
| 4815 | 4734 | return $defaultValue; |
| 4816 | 4735 | } |
| 4817 | 4736 | public function setViewState($key,$value,$defaultValue=null) |
@@ -4823,8 +4742,7 @@ discard block |
||
| 4823 | 4742 | unset($this->_viewState[$key]); |
| 4824 | 4743 | else |
| 4825 | 4744 | $this->_viewState[$key]=$value; |
| 4826 | - } |
|
| 4827 | - else |
|
| 4745 | + } else |
|
| 4828 | 4746 | { |
| 4829 | 4747 | unset($this->_viewState[$key]); |
| 4830 | 4748 | if($value===$defaultValue) |
@@ -4913,8 +4831,7 @@ discard block |
||
| 4913 | 4831 | $this->createChildControls(); |
| 4914 | 4832 | $this->_flags &= ~self::IS_CREATING_CHILD; |
| 4915 | 4833 | $this->_flags |= self::IS_CHILD_CREATED; |
| 4916 | - } |
|
| 4917 | - catch(Exception $e) |
|
| 4834 | + } catch(Exception $e) |
|
| 4918 | 4835 | { |
| 4919 | 4836 | $this->_flags &= ~self::IS_CREATING_CHILD; |
| 4920 | 4837 | $this->_flags |= self::IS_CHILD_CREATED; |
@@ -5038,8 +4955,9 @@ discard block |
||
| 5038 | 4955 | final protected function isDescendentOf($ancestor) |
| 5039 | 4956 | { |
| 5040 | 4957 | $control=$this; |
| 5041 | - while($control!==$ancestor && $control->_parent) |
|
| 5042 | - $control=$control->_parent; |
|
| 4958 | + while($control!==$ancestor && $control->_parent) { |
|
| 4959 | + $control=$control->_parent; |
|
| 4960 | + } |
|
| 5043 | 4961 | return $control===$ancestor; |
| 5044 | 4962 | } |
| 5045 | 4963 | public function addedControl($control) |
@@ -5067,8 +4985,7 @@ discard block |
||
| 5067 | 4985 | { |
| 5068 | 4986 | $state=$this->_rf[self::RF_CHILD_STATE][$control->_id]; |
| 5069 | 4987 | unset($this->_rf[self::RF_CHILD_STATE][$control->_id]); |
| 5070 | - } |
|
| 5071 | - else |
|
| 4988 | + } else |
|
| 5072 | 4989 | $state=null; |
| 5073 | 4990 | $control->loadStateRecursive($state,!($this->_flags & self::IS_DISABLE_VIEWSTATE)); |
| 5074 | 4991 | if($this->_stage>=self::CS_LOADED) |
@@ -5301,8 +5218,7 @@ discard block |
||
| 5301 | 5218 | { |
| 5302 | 5219 | $this->_rf[self::RF_CONTROLSTATE]=&$state[1]; |
| 5303 | 5220 | unset($state[1]); |
| 5304 | - } |
|
| 5305 | - else |
|
| 5221 | + } else |
|
| 5306 | 5222 | unset($this->_rf[self::RF_CONTROLSTATE]); |
| 5307 | 5223 | if($needViewState) |
| 5308 | 5224 | { |
@@ -5366,8 +5282,7 @@ discard block |
||
| 5366 | 5282 | { |
| 5367 | 5283 | $page->applyControlStyleSheet($this); |
| 5368 | 5284 | $this->_flags |= self::IS_STYLESHEET_APPLIED; |
| 5369 | - } |
|
| 5370 | - else if($this->_flags & self::IS_STYLESHEET_APPLIED) |
|
| 5285 | + } else if($this->_flags & self::IS_STYLESHEET_APPLIED) |
|
| 5371 | 5286 | throw new TInvalidOperationException('control_stylesheet_applied',get_class($this)); |
| 5372 | 5287 | } |
| 5373 | 5288 | private function clearCachedUniqueID($recursive) |
@@ -5430,8 +5345,7 @@ discard block |
||
| 5430 | 5345 | { |
| 5431 | 5346 | parent::insertAt($index,$item); |
| 5432 | 5347 | $this->_o->addedControl($item); |
| 5433 | - } |
|
| 5434 | - else if(is_string($item) || ($item instanceof IRenderable)) |
|
| 5348 | + } else if(is_string($item) || ($item instanceof IRenderable)) |
|
| 5435 | 5349 | parent::insertAt($index,$item); |
| 5436 | 5350 | else |
| 5437 | 5351 | throw new TInvalidDataTypeException('controlcollection_control_required'); |
@@ -5591,8 +5505,7 @@ discard block |
||
| 5591 | 5505 | else if($item[0]===self::TYPE_DATABINDING) |
| 5592 | 5506 | $this->_bindings[$id]=$item[1]; |
| 5593 | 5507 | $this->_items[$id]=''; |
| 5594 | - } |
|
| 5595 | - else |
|
| 5508 | + } else |
|
| 5596 | 5509 | $this->_items[$id]=$item; |
| 5597 | 5510 | } |
| 5598 | 5511 | } |
@@ -6739,8 +6652,7 @@ discard block |
||
| 6739 | 6652 | if(!isset(self::$_template[$class])) |
| 6740 | 6653 | self::$_template[$class]=$this->loadTemplate(); |
| 6741 | 6654 | return self::$_template[$class]; |
| 6742 | - } |
|
| 6743 | - else |
|
| 6655 | + } else |
|
| 6744 | 6656 | return $this->_localTemplate; |
| 6745 | 6657 | } |
| 6746 | 6658 | public function setTemplate($value) |
@@ -6814,8 +6726,7 @@ discard block |
||
| 6814 | 6726 | $controls=$placeholder->getParent()->getControls(); |
| 6815 | 6727 | $loc=$controls->remove($placeholder); |
| 6816 | 6728 | $controls->insertAt($loc,$content); |
| 6817 | - } |
|
| 6818 | - else |
|
| 6729 | + } else |
|
| 6819 | 6730 | throw new TConfigurationException('templatecontrol_placeholder_inexistent',$id); |
| 6820 | 6731 | } |
| 6821 | 6732 | protected function initRecursive($namingContainer=null) |
@@ -6832,8 +6743,7 @@ discard block |
||
| 6832 | 6743 | $master->ensureChildControls(); |
| 6833 | 6744 | foreach($this->_contents as $id=>$content) |
| 6834 | 6745 | $master->injectContent($id,$content); |
| 6835 | - } |
|
| 6836 | - else if(!empty($this->_contents)) |
|
| 6746 | + } else if(!empty($this->_contents)) |
|
| 6837 | 6747 | throw new TConfigurationException('templatecontrol_mastercontrol_required',get_class($this)); |
| 6838 | 6748 | parent::initRecursive($namingContainer); |
| 6839 | 6749 | } |
@@ -6853,8 +6763,7 @@ discard block |
||
| 6853 | 6763 | $control->Checked = (boolean) $arObj->{$key}; |
| 6854 | 6764 | elseif ($control instanceof TDatePicker) |
| 6855 | 6765 | $control->Date = $arObj->{$key}; |
| 6856 | - } |
|
| 6857 | - else |
|
| 6766 | + } else |
|
| 6858 | 6767 | { |
| 6859 | 6768 | foreach ($objAttrs["RELATIONS"] as $relKey => $relValues) |
| 6860 | 6769 | { |
@@ -6876,8 +6785,7 @@ discard block |
||
| 6876 | 6785 | } |
| 6877 | 6786 | break; |
| 6878 | 6787 | } |
| 6879 | - } |
|
| 6880 | - catch (Exception $ex) |
|
| 6788 | + } catch (Exception $ex) |
|
| 6881 | 6789 | { |
| 6882 | 6790 | if ($throwExceptions) |
| 6883 | 6791 | throw $ex; |
@@ -6900,8 +6808,7 @@ discard block |
||
| 6900 | 6808 | $arObj->{$key} = $control->Checked; |
| 6901 | 6809 | elseif ($control instanceof TDatePicker) |
| 6902 | 6810 | $arObj->{$key} = $control->Date; |
| 6903 | - } |
|
| 6904 | - catch (Exception $ex) |
|
| 6811 | + } catch (Exception $ex) |
|
| 6905 | 6812 | { |
| 6906 | 6813 | if ($throwExceptions) |
| 6907 | 6814 | throw $ex; |
@@ -6952,8 +6859,7 @@ discard block |
||
| 6952 | 6859 | $page->endFormRender($writer); |
| 6953 | 6860 | $cs->renderScriptFilesEnd($writer); |
| 6954 | 6861 | $cs->renderEndScripts($writer); |
| 6955 | - } |
|
| 6956 | - else |
|
| 6862 | + } else |
|
| 6957 | 6863 | { |
| 6958 | 6864 | $cs->renderHiddenFieldsBegin($writer); |
| 6959 | 6865 | $page->beginFormRender($writer); |
@@ -7111,8 +7017,7 @@ discard block |
||
| 7111 | 7017 | $base = $dir; |
| 7112 | 7018 | } |
| 7113 | 7019 | return array($assets->getPublishedPath($base), $assets->publishFilePath($base)); |
| 7114 | - } |
|
| 7115 | - else |
|
| 7020 | + } else |
|
| 7116 | 7021 | { |
| 7117 | 7022 | return array($assets->getBasePath().str_replace($assets->getBaseUrl(),'',$base), $base); |
| 7118 | 7023 | } |
@@ -7400,8 +7305,7 @@ discard block |
||
| 7400 | 7305 | { |
| 7401 | 7306 | foreach($value as $v) |
| 7402 | 7307 | $str.='<input type="hidden" name="'.$name.'[]" id="'.$id.'" value="'.THttpUtility::htmlEncode($value)."\" />\n"; |
| 7403 | - } |
|
| 7404 | - else |
|
| 7308 | + } else |
|
| 7405 | 7309 | { |
| 7406 | 7310 | $str.='<input type="hidden" name="'.$name.'" id="'.$id.'" value="'.THttpUtility::htmlEncode($value)."\" />\n"; |
| 7407 | 7311 | } |
@@ -7510,8 +7414,7 @@ discard block |
||
| 7510 | 7414 | $this->processCallbackRequest($writer); |
| 7511 | 7415 | else |
| 7512 | 7416 | $this->processPostBackRequest($writer); |
| 7513 | - } |
|
| 7514 | - else |
|
| 7417 | + } else |
|
| 7515 | 7418 | $this->processNormalRequest($writer); |
| 7516 | 7419 | $this->_writer = null; |
| 7517 | 7420 | } |
@@ -7657,8 +7560,7 @@ discard block |
||
| 7657 | 7560 | { |
| 7658 | 7561 | foreach($this->_validators as $validator) |
| 7659 | 7562 | $validator->validate(); |
| 7660 | - } |
|
| 7661 | - else |
|
| 7563 | + } else |
|
| 7662 | 7564 | { |
| 7663 | 7565 | foreach($this->_validators as $validator) |
| 7664 | 7566 | { |
@@ -7679,8 +7581,7 @@ discard block |
||
| 7679 | 7581 | return false; |
| 7680 | 7582 | } |
| 7681 | 7583 | return true; |
| 7682 | - } |
|
| 7683 | - else |
|
| 7584 | + } else |
|
| 7684 | 7585 | throw new TInvalidOperationException('page_isvalid_unknown'); |
| 7685 | 7586 | } |
| 7686 | 7587 | public function getTheme() |
@@ -7865,14 +7766,12 @@ discard block |
||
| 7865 | 7766 | { |
| 7866 | 7767 | if($control->loadPostData($key,$postData)) |
| 7867 | 7768 | $this->_controlsPostDataChanged[]=$control; |
| 7868 | - } |
|
| 7869 | - else if($control instanceof IPostBackEventHandler && |
|
| 7769 | + } else if($control instanceof IPostBackEventHandler && |
|
| 7870 | 7770 | empty($this->_postData[self::FIELD_POSTBACK_TARGET])) |
| 7871 | 7771 | { |
| 7872 | 7772 | $this->_postData->add(self::FIELD_POSTBACK_TARGET,$key); } |
| 7873 | 7773 | unset($this->_controlsRequiringPostData[$key]); |
| 7874 | - } |
|
| 7875 | - else if($beforeLoad) |
|
| 7774 | + } else if($beforeLoad) |
|
| 7876 | 7775 | $this->_restPostData->add($key,$value); |
| 7877 | 7776 | } |
| 7878 | 7777 | foreach($this->_controlsRequiringPostData as $key=>$value) |
@@ -7883,8 +7782,7 @@ discard block |
||
| 7883 | 7782 | { |
| 7884 | 7783 | if($control->loadPostData($key,$this->_postData)) |
| 7885 | 7784 | $this->_controlsPostDataChanged[]=$control; |
| 7886 | - } |
|
| 7887 | - else |
|
| 7785 | + } else |
|
| 7888 | 7786 | throw new TInvalidDataValueException('page_postbackcontrol_invalid',$key); |
| 7889 | 7787 | unset($this->_controlsRequiringPostData[$key]); |
| 7890 | 7788 | } |
@@ -7933,8 +7831,7 @@ discard block |
||
| 7933 | 7831 | else |
| 7934 | 7832 | $focus=$this->_focus; |
| 7935 | 7833 | $this->getClientScript()->registerFocusControl($focus); |
| 7936 | - } |
|
| 7937 | - else if($this->_postData && ($lastFocus=$this->_postData->itemAt(self::FIELD_LASTFOCUS))!==null) |
|
| 7834 | + } else if($this->_postData && ($lastFocus=$this->_postData->itemAt(self::FIELD_LASTFOCUS))!==null) |
|
| 7938 | 7835 | $this->getClientScript()->registerFocusControl($lastFocus); |
| 7939 | 7836 | $this->_inFormRender=false; |
| 7940 | 7837 | } |
@@ -8100,8 +7997,7 @@ discard block |
||
| 8100 | 7997 | { |
| 8101 | 7998 | if(($str=$sm->validateData($str))!==false) |
| 8102 | 7999 | return unserialize($str); |
| 8103 | - } |
|
| 8104 | - else |
|
| 8000 | + } else |
|
| 8105 | 8001 | return unserialize($str); |
| 8106 | 8002 | } |
| 8107 | 8003 | return null; |
@@ -8142,8 +8038,7 @@ discard block |
||
| 8142 | 8038 | $this->_cache=$this->getApplication()->getModule($this->_cacheModuleID); |
| 8143 | 8039 | if(!($this->_cache instanceof ICache)) |
| 8144 | 8040 | throw new TConfigurationException('outputcache_cachemoduleid_invalid',$this->_cacheModuleID); |
| 8145 | - } |
|
| 8146 | - else |
|
| 8041 | + } else |
|
| 8147 | 8042 | $this->_cache=$this->getApplication()->getCache(); |
| 8148 | 8043 | if($this->_cache!==null) |
| 8149 | 8044 | { |
@@ -8155,8 +8050,7 @@ discard block |
||
| 8155 | 8050 | $param->setCacheTime(isset($data[3])?$data[3]:0); |
| 8156 | 8051 | $this->onCheckDependency($param); |
| 8157 | 8052 | $this->_dataCached=$param->getIsValid(); |
| 8158 | - } |
|
| 8159 | - else |
|
| 8053 | + } else |
|
| 8160 | 8054 | $this->_dataCached=false; |
| 8161 | 8055 | if($this->_dataCached) |
| 8162 | 8056 | list($this->_contents,$this->_state,$this->_actions,$this->_cacheTime)=$data; |
@@ -8172,8 +8066,7 @@ discard block |
||
| 8172 | 8066 | $stack->push($this); |
| 8173 | 8067 | parent::initRecursive($namingContainer); |
| 8174 | 8068 | $stack->pop(); |
| 8175 | - } |
|
| 8176 | - else |
|
| 8069 | + } else |
|
| 8177 | 8070 | parent::initRecursive($namingContainer); |
| 8178 | 8071 | } |
| 8179 | 8072 | protected function loadRecursive() |
@@ -8184,8 +8077,7 @@ discard block |
||
| 8184 | 8077 | $stack->push($this); |
| 8185 | 8078 | parent::loadRecursive(); |
| 8186 | 8079 | $stack->pop(); |
| 8187 | - } |
|
| 8188 | - else |
|
| 8080 | + } else |
|
| 8189 | 8081 | { |
| 8190 | 8082 | if($this->_dataCached) |
| 8191 | 8083 | $this->performActions(); |
@@ -8214,8 +8106,7 @@ discard block |
||
| 8214 | 8106 | $stack->push($this); |
| 8215 | 8107 | parent::preRenderRecursive(); |
| 8216 | 8108 | $stack->pop(); |
| 8217 | - } |
|
| 8218 | - else |
|
| 8109 | + } else |
|
| 8219 | 8110 | parent::preRenderRecursive(); |
| 8220 | 8111 | } |
| 8221 | 8112 | protected function loadStateRecursive(&$state,$needViewState=true) |
@@ -8351,8 +8242,7 @@ discard block |
||
| 8351 | 8242 | $content=$textwriter->flush(); |
| 8352 | 8243 | $data=array($content,$this->_state,$this->_actions,time()); |
| 8353 | 8244 | $this->_cache->set($this->getCacheKey(),$data,$this->getDuration(),$this->getCacheDependency()); |
| 8354 | - } |
|
| 8355 | - else |
|
| 8245 | + } else |
|
| 8356 | 8246 | parent::render($writer); |
| 8357 | 8247 | } |
| 8358 | 8248 | } |
@@ -8457,8 +8347,7 @@ discard block |
||
| 8457 | 8347 | $cache->set(self::TEMPLATE_CACHE_PREFIX.$fileName,array($template,$timestamps)); |
| 8458 | 8348 | return $template; |
| 8459 | 8349 | } |
| 8460 | - } |
|
| 8461 | - else |
|
| 8350 | + } else |
|
| 8462 | 8351 | return null; |
| 8463 | 8352 | } |
| 8464 | 8353 | protected function getLocalizedTemplate($filename) |
@@ -8578,8 +8467,7 @@ discard block |
||
| 8578 | 8467 | $component->createdOnTemplate($parent); |
| 8579 | 8468 | if($component->getAllowChildControls()) |
| 8580 | 8469 | $controls[$key]=$component; |
| 8581 | - } |
|
| 8582 | - else if($component instanceof TComponent) |
|
| 8470 | + } else if($component instanceof TComponent) |
|
| 8583 | 8471 | { |
| 8584 | 8472 | $controls[$key]=$component; |
| 8585 | 8473 | if(isset($properties['id'])) |
@@ -8597,8 +8485,7 @@ discard block |
||
| 8597 | 8485 | else |
| 8598 | 8486 | $component->createdOnTemplate($parent); |
| 8599 | 8487 | } |
| 8600 | - } |
|
| 8601 | - else |
|
| 8488 | + } else |
|
| 8602 | 8489 | { |
| 8603 | 8490 | if($object[1] instanceof TCompositeLiteral) |
| 8604 | 8491 | { |
@@ -8608,8 +8495,7 @@ discard block |
||
| 8608 | 8495 | $directChildren[]=$o; |
| 8609 | 8496 | else |
| 8610 | 8497 | $parent->addParsedObject($o); |
| 8611 | - } |
|
| 8612 | - else |
|
| 8498 | + } else |
|
| 8613 | 8499 | { |
| 8614 | 8500 | if($parent===$parentControl) |
| 8615 | 8501 | $directChildren[]=$object[1]; |
@@ -8680,8 +8566,7 @@ discard block |
||
| 8680 | 8566 | default: throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); |
| 8681 | 8567 | break; |
| 8682 | 8568 | } |
| 8683 | - } |
|
| 8684 | - else |
|
| 8569 | + } else |
|
| 8685 | 8570 | { |
| 8686 | 8571 | if (substr($name,0,2)=='js') |
| 8687 | 8572 | if ($value and !($value instanceof TJavaScriptLiteral)) |
@@ -8717,8 +8602,7 @@ discard block |
||
| 8717 | 8602 | default: throw new TConfigurationException('template_tag_unexpected',$name,$value[1]); |
| 8718 | 8603 | break; |
| 8719 | 8604 | } |
| 8720 | - } |
|
| 8721 | - else |
|
| 8605 | + } else |
|
| 8722 | 8606 | $component->setSubProperty($name,$value); |
| 8723 | 8607 | } |
| 8724 | 8608 | protected function parse($input) |
@@ -8755,8 +8639,7 @@ discard block |
||
| 8755 | 8639 | $stack[] = $type; |
| 8756 | 8640 | $container=$c-1; |
| 8757 | 8641 | } |
| 8758 | - } |
|
| 8759 | - else if(strpos($str,'</com:')===0) { |
|
| 8642 | + } else if(strpos($str,'</com:')===0) { |
|
| 8760 | 8643 | if($expectPropEnd) |
| 8761 | 8644 | continue; |
| 8762 | 8645 | if($matchStart>$textStart) |
@@ -8772,8 +8655,7 @@ discard block |
||
| 8772 | 8655 | throw new TConfigurationException('template_closingtag_expected',$tag); |
| 8773 | 8656 | } |
| 8774 | 8657 | $container=$tpl[$container][0]; |
| 8775 | - } |
|
| 8776 | - else if(strpos($str,'<%@')===0) { |
|
| 8658 | + } else if(strpos($str,'<%@')===0) { |
|
| 8777 | 8659 | if($expectPropEnd) |
| 8778 | 8660 | continue; |
| 8779 | 8661 | if($matchStart>$textStart) |
@@ -8782,8 +8664,7 @@ discard block |
||
| 8782 | 8664 | if(isset($tpl[0]) || $this->_directive!==null) |
| 8783 | 8665 | throw new TConfigurationException('template_directive_nonunique'); |
| 8784 | 8666 | $this->_directive=$this->parseAttributes($match[4][0],$match[4][1]); |
| 8785 | - } |
|
| 8786 | - else if(strpos($str,'<%')===0) { |
|
| 8667 | + } else if(strpos($str,'<%')===0) { |
|
| 8787 | 8668 | if($expectPropEnd) |
| 8788 | 8669 | continue; |
| 8789 | 8670 | if($matchStart>$textStart) |
@@ -8805,8 +8686,7 @@ discard block |
||
| 8805 | 8686 | $literal=strtr(trim(substr($literal,0,strlen($literal)-1)),array("'"=>"\'","\\"=>"\\\\")); |
| 8806 | 8687 | $tpl[$c++]=array($container,array(TCompositeLiteral::TYPE_EXPRESSION,"Prado::localize('$literal')")); |
| 8807 | 8688 | } |
| 8808 | - } |
|
| 8809 | - else if(strpos($str,'<prop:')===0) { |
|
| 8689 | + } else if(strpos($str,'<prop:')===0) { |
|
| 8810 | 8690 | if(strrpos($str,'/>')===strlen($str)-2) { |
| 8811 | 8691 | if($expectPropEnd) |
| 8812 | 8692 | continue; |
@@ -8826,8 +8706,7 @@ discard block |
||
| 8826 | 8706 | throw new TConfigurationException('template_property_duplicated',$name); |
| 8827 | 8707 | $tpl[$container][2][$name]=$value; |
| 8828 | 8708 | } |
| 8829 | - } |
|
| 8830 | - else { |
|
| 8709 | + } else { |
|
| 8831 | 8710 | $prop=strtolower($match[3][0]); |
| 8832 | 8711 | $stack[] = '@'.$prop; |
| 8833 | 8712 | if(!$expectPropEnd) |
@@ -8838,8 +8717,7 @@ discard block |
||
| 8838 | 8717 | $expectPropEnd=true; |
| 8839 | 8718 | } |
| 8840 | 8719 | } |
| 8841 | - } |
|
| 8842 | - else if(strpos($str,'</prop:')===0) { |
|
| 8720 | + } else if(strpos($str,'</prop:')===0) { |
|
| 8843 | 8721 | $prop=strtolower($match[3][0]); |
| 8844 | 8722 | if(empty($stack)) |
| 8845 | 8723 | throw new TConfigurationException('template_closingtag_unexpected',"</prop:$prop>"); |
@@ -8865,21 +8743,18 @@ discard block |
||
| 8865 | 8743 | if(isset($tpl[$container][2][$prop])) |
| 8866 | 8744 | throw new TConfigurationException('template_property_duplicated',$prop); |
| 8867 | 8745 | $tpl[$container][2][$prop]=$value; |
| 8868 | - } |
|
| 8869 | - else $this->_directive[$prop]=$value; |
|
| 8746 | + } else $this->_directive[$prop]=$value; |
|
| 8870 | 8747 | $textStart=$matchEnd+1; |
| 8871 | 8748 | } |
| 8872 | 8749 | $expectPropEnd=false; |
| 8873 | 8750 | } |
| 8874 | - } |
|
| 8875 | - else if(strpos($str,'<!--')===0) { |
|
| 8751 | + } else if(strpos($str,'<!--')===0) { |
|
| 8876 | 8752 | if($expectPropEnd) |
| 8877 | 8753 | throw new TConfigurationException('template_comments_forbidden'); |
| 8878 | 8754 | if($matchStart>$textStart) |
| 8879 | 8755 | $tpl[$c++]=array($container,substr($input,$textStart,$matchStart-$textStart)); |
| 8880 | 8756 | $textStart=$matchEnd+1; |
| 8881 | - } |
|
| 8882 | - else |
|
| 8757 | + } else |
|
| 8883 | 8758 | throw new TConfigurationException('template_matching_unexpected',$match); |
| 8884 | 8759 | } |
| 8885 | 8760 | if(!empty($stack)) |
@@ -8890,8 +8765,7 @@ discard block |
||
| 8890 | 8765 | } |
| 8891 | 8766 | if($textStart<strlen($input)) |
| 8892 | 8767 | $tpl[$c++]=array($container,substr($input,$textStart)); |
| 8893 | - } |
|
| 8894 | - catch(Exception $e) |
|
| 8768 | + } catch(Exception $e) |
|
| 8895 | 8769 | { |
| 8896 | 8770 | if(($e instanceof TException) && ($e instanceof TTemplateException)) |
| 8897 | 8771 | throw $e; |
@@ -8921,14 +8795,12 @@ discard block |
||
| 8921 | 8795 | { |
| 8922 | 8796 | $parent=null; |
| 8923 | 8797 | $objects[$id]=$object; |
| 8924 | - } |
|
| 8925 | - else |
|
| 8798 | + } else |
|
| 8926 | 8799 | { |
| 8927 | 8800 | $parent=$object[0]; |
| 8928 | 8801 | $merged=array($parent,array($object[1])); |
| 8929 | 8802 | } |
| 8930 | - } |
|
| 8931 | - else |
|
| 8803 | + } else |
|
| 8932 | 8804 | $merged[1][]=$object[1]; |
| 8933 | 8805 | } |
| 8934 | 8806 | if($parent!==null) |
@@ -8961,8 +8833,7 @@ discard block |
||
| 8961 | 8833 | $attributes[$name]=$this->parseTemplateProperty(substr($value,1,strlen($value)-2),$match[2][1]+1); |
| 8962 | 8834 | else |
| 8963 | 8835 | $attributes[$name]=$this->parseTemplateProperty($value,$match[2][1]); |
| 8964 | - } |
|
| 8965 | - else |
|
| 8836 | + } else |
|
| 8966 | 8837 | { |
| 8967 | 8838 | if($value[0]==='\'' || $value[0]==='"') |
| 8968 | 8839 | $attributes[$name]=$this->parseAttribute(substr($value,1,strlen($value)-2)); |
@@ -9004,8 +8875,7 @@ discard block |
||
| 9004 | 8875 | return array(self::CONFIG_DATABIND,ltrim($expr,'.')); |
| 9005 | 8876 | else |
| 9006 | 8877 | return array(self::CONFIG_EXPRESSION,ltrim($expr,'.')); |
| 9007 | - } |
|
| 9008 | - else if(preg_match('/\\s*(<%~.*?%>|<%\\$.*?%>|<%\\[.*?\\]%>|<%\/.*?%>)\\s*/msS',$value,$matches) && $matches[0]===$value) |
|
| 8878 | + } else if(preg_match('/\\s*(<%~.*?%>|<%\\$.*?%>|<%\\[.*?\\]%>|<%\/.*?%>)\\s*/msS',$value,$matches) && $matches[0]===$value) |
|
| 9009 | 8879 | { |
| 9010 | 8880 | $value=$matches[1]; |
| 9011 | 8881 | if($value[2]==='~') |
@@ -9018,8 +8888,7 @@ discard block |
||
| 9018 | 8888 | $literal = trim(substr($value,3,strlen($value)-5)); |
| 9019 | 8889 | return array(self::CONFIG_EXPRESSION,"rtrim(dirname(\$this->getApplication()->getRequest()->getApplicationUrl()), '/').'/$literal'"); |
| 9020 | 8890 | } |
| 9021 | - } |
|
| 9022 | - else |
|
| 8891 | + } else |
|
| 9023 | 8892 | return $value; |
| 9024 | 8893 | } |
| 9025 | 8894 | protected function validateAttributes($type,$attributes) |
@@ -9039,15 +8908,13 @@ discard block |
||
| 9039 | 8908 | $subname=substr($name,0,$pos); |
| 9040 | 8909 | if(!$class->hasMethod('get'.$subname)) |
| 9041 | 8910 | throw new TConfigurationException('template_property_unknown',$type,$subname); |
| 9042 | - } |
|
| 9043 | - else if(strncasecmp($name,'on',2)===0) |
|
| 8911 | + } else if(strncasecmp($name,'on',2)===0) |
|
| 9044 | 8912 | { |
| 9045 | 8913 | if(!$class->hasMethod($name)) |
| 9046 | 8914 | throw new TConfigurationException('template_event_unknown',$type,$name); |
| 9047 | 8915 | else if(!is_string($att)) |
| 9048 | 8916 | throw new TConfigurationException('template_eventhandler_invalid',$type,$name); |
| 9049 | - } |
|
| 9050 | - else |
|
| 8917 | + } else |
|
| 9051 | 8918 | { |
| 9052 | 8919 | if (! ($class->hasMethod('set'.$name) || $class->hasMethod('setjs'.$name) || $this->isClassBehaviorMethod($class,'set'.$name)) ) |
| 9053 | 8920 | { |
@@ -9055,8 +8922,7 @@ discard block |
||
| 9055 | 8922 | throw new TConfigurationException('template_property_readonly',$type,$name); |
| 9056 | 8923 | else |
| 9057 | 8924 | throw new TConfigurationException('template_property_unknown',$type,$name); |
| 9058 | - } |
|
| 9059 | - else if(is_array($att) && $att[0]!==self::CONFIG_EXPRESSION) |
|
| 8925 | + } else if(is_array($att) && $att[0]!==self::CONFIG_EXPRESSION) |
|
| 9060 | 8926 | { |
| 9061 | 8927 | if(strcasecmp($name,'id')===0) |
| 9062 | 8928 | throw new TConfigurationException('template_controlid_invalid',$type); |
@@ -9065,8 +8931,7 @@ discard block |
||
| 9065 | 8931 | } |
| 9066 | 8932 | } |
| 9067 | 8933 | } |
| 9068 | - } |
|
| 9069 | - else if(is_subclass_of($className,'TComponent') || $className==='TComponent') |
|
| 8934 | + } else if(is_subclass_of($className,'TComponent') || $className==='TComponent') |
|
| 9070 | 8935 | { |
| 9071 | 8936 | foreach($attributes as $name=>$att) |
| 9072 | 8937 | { |
@@ -9077,8 +8942,7 @@ discard block |
||
| 9077 | 8942 | $subname=substr($name,0,$pos); |
| 9078 | 8943 | if(!$class->hasMethod('get'.$subname)) |
| 9079 | 8944 | throw new TConfigurationException('template_property_unknown',$type,$subname); |
| 9080 | - } |
|
| 9081 | - else if(strncasecmp($name,'on',2)===0) |
|
| 8945 | + } else if(strncasecmp($name,'on',2)===0) |
|
| 9082 | 8946 | throw new TConfigurationException('template_event_forbidden',$type,$name); |
| 9083 | 8947 | else |
| 9084 | 8948 | { |
@@ -9091,8 +8955,7 @@ discard block |
||
| 9091 | 8955 | } |
| 9092 | 8956 | } |
| 9093 | 8957 | } |
| 9094 | - } |
|
| 9095 | - else |
|
| 8958 | + } else |
|
| 9096 | 8959 | throw new TConfigurationException('template_component_required',$type); |
| 9097 | 8960 | } |
| 9098 | 8961 | public function getIncludedFiles() |
@@ -9112,8 +8975,7 @@ discard block |
||
| 9112 | 8975 | $line=$line-$this->_includeAtLine[$i]+1; |
| 9113 | 8976 | $srcFile=$this->_includedFiles[$i]; |
| 9114 | 8977 | break; |
| 9115 | - } |
|
| 9116 | - else |
|
| 8978 | + } else |
|
| 9117 | 8979 | $line=$line-$this->_includeLines[$i]+1; |
| 9118 | 8980 | } |
| 9119 | 8981 | } |
@@ -9299,8 +9161,7 @@ discard block |
||
| 9299 | 9161 | closedir($dir); |
| 9300 | 9162 | if($cacheValid) |
| 9301 | 9163 | $this->_skins=$skins; |
| 9302 | - } |
|
| 9303 | - else |
|
| 9164 | + } else |
|
| 9304 | 9165 | { |
| 9305 | 9166 | $cacheValid=true; |
| 9306 | 9167 | $this->_cssFiles=$cssFiles; |
@@ -9425,19 +9286,15 @@ discard block |
||
| 9425 | 9286 | { |
| 9426 | 9287 | $setter='set'.$name; |
| 9427 | 9288 | $control->$setter($value); |
| 9428 | - } |
|
| 9429 | - else |
|
| 9289 | + } else |
|
| 9430 | 9290 | throw new TConfigurationException('theme_property_readonly',$type,$name); |
| 9431 | - } |
|
| 9432 | - else |
|
| 9291 | + } else |
|
| 9433 | 9292 | throw new TConfigurationException('theme_property_undefined',$type,$name); |
| 9434 | - } |
|
| 9435 | - else $control->setSubProperty($name,$value); |
|
| 9293 | + } else $control->setSubProperty($name,$value); |
|
| 9436 | 9294 | } |
| 9437 | 9295 | } |
| 9438 | 9296 | return true; |
| 9439 | - } |
|
| 9440 | - else |
|
| 9297 | + } else |
|
| 9441 | 9298 | return false; |
| 9442 | 9299 | } |
| 9443 | 9300 | public function getStyleSheetFiles() |
@@ -9530,8 +9387,7 @@ discard block |
||
| 9530 | 9387 | $pageConfig->loadPageConfigurationFromXml($config,$application->getBasePath(),''); |
| 9531 | 9388 | } |
| 9532 | 9389 | $pageConfig->loadFromFiles($this->getBasePath()); |
| 9533 | - } |
|
| 9534 | - else |
|
| 9390 | + } else |
|
| 9535 | 9391 | { |
| 9536 | 9392 | $configCached=true; |
| 9537 | 9393 | $currentTimestamp=array(); |
@@ -9548,8 +9404,7 @@ discard block |
||
| 9548 | 9404 | $currentTimestamp[0]=$appConfigFile===null?0:@filemtime($appConfigFile); |
| 9549 | 9405 | if($currentTimestamp[0]>$timestamp || ($timestamp>0 && !$currentTimestamp[0])) |
| 9550 | 9406 | $configCached=false; |
| 9551 | - } |
|
| 9552 | - else |
|
| 9407 | + } else |
|
| 9553 | 9408 | { |
| 9554 | 9409 | $currentTimestamp[$fileName]=@filemtime($fileName); |
| 9555 | 9410 | if($currentTimestamp[$fileName]>$timestamp || ($timestamp>0 && !$currentTimestamp[$fileName])) |
@@ -9557,8 +9412,7 @@ discard block |
||
| 9557 | 9412 | } |
| 9558 | 9413 | } |
| 9559 | 9414 | } |
| 9560 | - } |
|
| 9561 | - else |
|
| 9415 | + } else |
|
| 9562 | 9416 | { |
| 9563 | 9417 | $configCached=false; |
| 9564 | 9418 | $paths=explode('.',$pagePath); |
@@ -9701,8 +9555,7 @@ discard block |
||
| 9701 | 9555 | $className=basename($path); |
| 9702 | 9556 | if(!class_exists($className,false)) |
| 9703 | 9557 | include_once($path.Prado::CLASS_FILE_EXT); |
| 9704 | - } |
|
| 9705 | - else |
|
| 9558 | + } else |
|
| 9706 | 9559 | { |
| 9707 | 9560 | $className=$this->getBasePageClass(); |
| 9708 | 9561 | Prado::using($className); |
@@ -9784,8 +9637,7 @@ discard block |
||
| 9784 | 9637 | { |
| 9785 | 9638 | $fcontent = include $fname; |
| 9786 | 9639 | $this->loadFromPhp($fcontent,dirname($fname),$configPagePath); |
| 9787 | - } |
|
| 9788 | - else |
|
| 9640 | + } else |
|
| 9789 | 9641 | { |
| 9790 | 9642 | $dom=new TXmlDocument; |
| 9791 | 9643 | if($dom->loadFromFile($fname)) |
@@ -10028,8 +9880,7 @@ discard block |
||
| 10028 | 9880 | if(!is_file($dst.DIRECTORY_SEPARATOR.$fileName) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance) |
| 10029 | 9881 | $this->copyFile($fullpath,$dst); |
| 10030 | 9882 | return $this->_published[$path]=$this->_baseUrl.'/'.$dir.'/'.$fileName; |
| 10031 | - } |
|
| 10032 | - else |
|
| 9883 | + } else |
|
| 10033 | 9884 | { |
| 10034 | 9885 | $dir=$this->hash($fullpath); |
| 10035 | 9886 | if(!is_dir($this->_basePath.DIRECTORY_SEPARATOR.$dir) || $checkTimestamp || $this->getApplication()->getMode()!==TApplicationMode::Performance) |
@@ -10100,8 +9951,7 @@ discard block |
||
| 10100 | 9951 | @copy($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file); |
| 10101 | 9952 | @chmod($dst.DIRECTORY_SEPARATOR.$file, PRADO_CHMOD); |
| 10102 | 9953 | } |
| 10103 | - } |
|
| 10104 | - else |
|
| 9954 | + } else |
|
| 10105 | 9955 | $this->copyDirectory($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file); |
| 10106 | 9956 | } |
| 10107 | 9957 | closedir($folder); |
@@ -10230,8 +10080,7 @@ discard block |
||
| 10230 | 10080 | throw new TConfigurationException('globalization_source_path_failed', |
| 10231 | 10081 | $config['source']); |
| 10232 | 10082 | chmod($config['source'], PRADO_CHMOD); } |
| 10233 | - } |
|
| 10234 | - else |
|
| 10083 | + } else |
|
| 10235 | 10084 | { |
| 10236 | 10085 | throw new TConfigurationException("invalid source dir '{$config['source']}'"); |
| 10237 | 10086 | } |
@@ -10362,8 +10211,7 @@ discard block |
||
| 10362 | 10211 | { |
| 10363 | 10212 | $configFile=$basePath; |
| 10364 | 10213 | $basePath=dirname($configFile); |
| 10365 | - } |
|
| 10366 | - else |
|
| 10214 | + } else |
|
| 10367 | 10215 | $configFile=null; |
| 10368 | 10216 | $runtimePath=$basePath.DIRECTORY_SEPARATOR.self::RUNTIME_PATH; |
| 10369 | 10217 | if(is_writable($runtimePath)) |
@@ -10380,8 +10228,7 @@ discard block |
||
| 10380 | 10228 | } |
| 10381 | 10229 | $this->setBasePath($basePath); |
| 10382 | 10230 | $this->setRuntimePath($runtimePath); |
| 10383 | - } |
|
| 10384 | - else |
|
| 10231 | + } else |
|
| 10385 | 10232 | throw new TConfigurationException('application_runtimepath_invalid',$runtimePath); |
| 10386 | 10233 | } |
| 10387 | 10234 | public function run() |
@@ -10402,8 +10249,7 @@ discard block |
||
| 10402 | 10249 | $this->$method(); |
| 10403 | 10250 | $this->_step++; |
| 10404 | 10251 | } |
| 10405 | - } |
|
| 10406 | - catch(Exception $e) |
|
| 10252 | + } catch(Exception $e) |
|
| 10407 | 10253 | { |
| 10408 | 10254 | $this->onError($e); |
| 10409 | 10255 | } |
@@ -10747,8 +10593,7 @@ discard block |
||
| 10747 | 10593 | foreach($parameter[1] as $name=>$value) |
| 10748 | 10594 | $component->setSubProperty($name,$value); |
| 10749 | 10595 | $this->_parameters->add($id,$component); |
| 10750 | - } |
|
| 10751 | - else |
|
| 10596 | + } else |
|
| 10752 | 10597 | $this->_parameters->add($id,$parameter); |
| 10753 | 10598 | } |
| 10754 | 10599 | $modules=array(); |
@@ -10789,8 +10634,7 @@ discard block |
||
| 10789 | 10634 | $config->loadFromFile($this->_configFile); |
| 10790 | 10635 | if($this->_cacheFile!==null) |
| 10791 | 10636 | file_put_contents($this->_cacheFile,serialize($config),LOCK_EX); |
| 10792 | - } |
|
| 10793 | - else |
|
| 10637 | + } else |
|
| 10794 | 10638 | $config=unserialize(file_get_contents($this->_cacheFile)); |
| 10795 | 10639 | $this->applyConfiguration($config,false); |
| 10796 | 10640 | } |
@@ -10822,8 +10666,7 @@ discard block |
||
| 10822 | 10666 | $this->applyConfiguration($config,true); |
| 10823 | 10667 | } |
| 10824 | 10668 | $service->init($configElement); |
| 10825 | - } |
|
| 10826 | - else |
|
| 10669 | + } else |
|
| 10827 | 10670 | throw new THttpException(500,'application_service_unknown',$serviceID); |
| 10828 | 10671 | } |
| 10829 | 10672 | public function onError($param) |
@@ -10915,8 +10758,7 @@ discard block |
||
| 10915 | 10758 | { |
| 10916 | 10759 | $fcontent = include $fname; |
| 10917 | 10760 | $this->loadFromPhp($fcontent,dirname($fname)); |
| 10918 | - } |
|
| 10919 | - else |
|
| 10761 | + } else |
|
| 10920 | 10762 | { |
| 10921 | 10763 | $dom=new TXmlDocument; |
| 10922 | 10764 | $dom->loadFromFile($fname); |
@@ -11023,8 +10865,7 @@ discard block |
||
| 11023 | 10865 | if(isset($this->_aliases[$id])) |
| 11024 | 10866 | throw new TConfigurationException('appconfig_alias_redefined',$id); |
| 11025 | 10867 | $this->_aliases[$id]=$p; |
| 11026 | - } |
|
| 11027 | - else |
|
| 10868 | + } else |
|
| 11028 | 10869 | throw new TConfigurationException('appconfig_alias_invalid'); |
| 11029 | 10870 | $this->_empty=false; |
| 11030 | 10871 | break; |
@@ -11079,8 +10920,7 @@ discard block |
||
| 11079 | 10920 | else |
| 11080 | 10921 | $this->_modules[$id]=array($type,$properties->toArray(),$element); |
| 11081 | 10922 | $this->_empty=false; |
| 11082 | - } |
|
| 11083 | - else |
|
| 10923 | + } else |
|
| 11084 | 10924 | throw new TConfigurationException('appconfig_modules_invalid',$element->getTagName()); |
| 11085 | 10925 | } |
| 11086 | 10926 | } |
@@ -11112,8 +10952,7 @@ discard block |
||
| 11112 | 10952 | $element->setParent(null); |
| 11113 | 10953 | $this->_services[$id]=array($type,$properties->toArray(),$element); |
| 11114 | 10954 | $this->_empty=false; |
| 11115 | - } |
|
| 11116 | - else |
|
| 10955 | + } else |
|
| 11117 | 10956 | throw new TConfigurationException('appconfig_services_invalid',$element->getTagName()); |
| 11118 | 10957 | } |
| 11119 | 10958 | } |
@@ -11131,8 +10970,7 @@ discard block |
||
| 11131 | 10970 | $properties['id'] = $id; |
| 11132 | 10971 | $this->_parameters[$id] = array($type,$properties); |
| 11133 | 10972 | } |
| 11134 | - } |
|
| 11135 | - else |
|
| 10973 | + } else |
|
| 11136 | 10974 | { |
| 11137 | 10975 | $this->_parameters[$id] = $parameter; |
| 11138 | 10976 | } |
@@ -11153,12 +10991,10 @@ discard block |
||
| 11153 | 10991 | $this->_parameters[$id]=$element; |
| 11154 | 10992 | else |
| 11155 | 10993 | $this->_parameters[$id]=$value; |
| 11156 | - } |
|
| 11157 | - else |
|
| 10994 | + } else |
|
| 11158 | 10995 | $this->_parameters[$id]=array($type,$properties->toArray()); |
| 11159 | 10996 | $this->_empty=false; |
| 11160 | - } |
|
| 11161 | - else |
|
| 10997 | + } else |
|
| 11162 | 10998 | throw new TConfigurationException('appconfig_parameters_invalid',$element->getTagName()); |
| 11163 | 10999 | } |
| 11164 | 11000 | } |