@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | * It reads the CacheModule property. |
| 51 | 51 | * @param TXmlElement module configuration |
| 52 | 52 | */ |
| 53 | - public function init($config) |
|
| 54 | - { |
|
| 53 | + public function init($config) |
|
| 54 | + { |
|
| 55 | 55 | if($this->_cacheModuleID==='') |
| 56 | 56 | throw new TConfigurationException('cachesession_cachemoduleid_required'); |
| 57 | 57 | else if(($cache=$this->getApplication()->getModule($this->_cacheModuleID))===null) |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | throw new TConfigurationException('cachesession_cachemodule_invalid',$this->_cacheModuleID); |
| 63 | 63 | $this->setUseCustomStorage(true); |
| 64 | 64 | parent::init($config); |
| 65 | - } |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * @return string the ID of the cache module. |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | */ |
| 96 | 96 | public function _read($id) |
| 97 | 97 | { |
| 98 | - return $this->_cache->get($this->calculateKey($id)); |
|
| 98 | + return $this->_cache->get($this->calculateKey($id)); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | public function _destroy($id) |
| 119 | 119 | { |
| 120 | - return $this->_cache->delete($this->calculateKey($id)); |
|
| 120 | + return $this->_cache->delete($this->calculateKey($id)); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -125,15 +125,15 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function getKeyPrefix() |
| 127 | 127 | { |
| 128 | - return $this->_prefix; |
|
| 128 | + return $this->_prefix; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * @param string prefix of session variable name to avoid conflict with other cache data |
|
| 133 | - */ |
|
| 132 | + * @param string prefix of session variable name to avoid conflict with other cache data |
|
| 133 | + */ |
|
| 134 | 134 | public function setKeyPrefix($value) |
| 135 | 135 | { |
| 136 | - $this->_prefix=$value; |
|
| 136 | + $this->_prefix=$value; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | protected function calculateKey($id) |
| 144 | 144 | { |
| 145 | - return $this->_prefix.':'.$id; |
|
| 145 | + return $this->_prefix.':'.$id; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | if($this->_cacheModuleID==='') |
| 56 | 56 | throw new TConfigurationException('cachesession_cachemoduleid_required'); |
| 57 | 57 | else if(($cache=$this->getApplication()->getModule($this->_cacheModuleID))===null) |
| 58 | - throw new TConfigurationException('cachesession_cachemodule_inexistent',$this->_cacheModuleID); |
|
| 58 | + throw new TConfigurationException('cachesession_cachemodule_inexistent', $this->_cacheModuleID); |
|
| 59 | 59 | else if($cache instanceof ICache) |
| 60 | 60 | $this->_cache=$cache; |
| 61 | 61 | else |
| 62 | - throw new TConfigurationException('cachesession_cachemodule_invalid',$this->_cacheModuleID); |
|
| 62 | + throw new TConfigurationException('cachesession_cachemodule_invalid', $this->_cacheModuleID); |
|
| 63 | 63 | $this->setUseCustomStorage(true); |
| 64 | 64 | parent::init($config); |
| 65 | 65 | } |
@@ -104,9 +104,9 @@ discard block |
||
| 104 | 104 | * @param string session data |
| 105 | 105 | * @return boolean whether session write is successful |
| 106 | 106 | */ |
| 107 | - public function _write($id,$data) |
|
| 107 | + public function _write($id, $data) |
|
| 108 | 108 | { |
| 109 | - return $this->_cache->set($this->calculateKey($id),$data,$this->getTimeout()); |
|
| 109 | + return $this->_cache->set($this->calculateKey($id), $data, $this->getTimeout()); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * TService class file. |
|
| 4 | - * |
|
| 5 | - * @author Qiang Xue <[email protected]> |
|
| 6 | - * @link https://github.com/pradosoft/prado |
|
| 7 | - * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | - * @package System |
|
| 10 | - */ |
|
| 3 | + * TService class file. |
|
| 4 | + * |
|
| 5 | + * @author Qiang Xue <[email protected]> |
|
| 6 | + * @link https://github.com/pradosoft/prado |
|
| 7 | + * @copyright Copyright © 2005-2015 The PRADO Group |
|
| 8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
| 9 | + * @package System |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | 13 | * TService class. |
@@ -113,6 +113,7 @@ |
||
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | 115 | * @param string button caption |
| 116 | + * @param string $value |
|
| 116 | 117 | */ |
| 117 | 118 | public function setButtonText($value) |
| 118 | 119 | { |
@@ -36,46 +36,46 @@ |
||
| 36 | 36 | class TWsatService extends TPageService |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - private $_pass = ''; |
|
| 39 | + private $_pass = ''; |
|
| 40 | 40 | |
| 41 | - public function init($config) |
|
| 42 | - { |
|
| 43 | - if ($this->getApplication()->getMode() === TApplicationMode::Performance || $this->getApplication()->getMode() === TApplicationMode::Normal) |
|
| 44 | - throw new TInvalidOperationException("You should not use Prado WSAT in any of the production modes."); |
|
| 41 | + public function init($config) |
|
| 42 | + { |
|
| 43 | + if ($this->getApplication()->getMode() === TApplicationMode::Performance || $this->getApplication()->getMode() === TApplicationMode::Normal) |
|
| 44 | + throw new TInvalidOperationException("You should not use Prado WSAT in any of the production modes."); |
|
| 45 | 45 | |
| 46 | - if (empty($this->_pass)) |
|
| 47 | - throw new TConfigurationException("You need to specify the Password attribute."); |
|
| 46 | + if (empty($this->_pass)) |
|
| 47 | + throw new TConfigurationException("You need to specify the Password attribute."); |
|
| 48 | 48 | |
| 49 | - $this->setDefaultPage("TWsatHome"); |
|
| 50 | - $this->_startThemeManager(); |
|
| 51 | - parent::init($config); |
|
| 52 | - } |
|
| 49 | + $this->setDefaultPage("TWsatHome"); |
|
| 50 | + $this->_startThemeManager(); |
|
| 51 | + parent::init($config); |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - public function getBasePath() |
|
| 55 | - { |
|
| 56 | - $basePath = Prado::getPathOfNamespace("System.Wsat.pages"); |
|
| 57 | - return realpath($basePath); |
|
| 58 | - } |
|
| 54 | + public function getBasePath() |
|
| 55 | + { |
|
| 56 | + $basePath = Prado::getPathOfNamespace("System.Wsat.pages"); |
|
| 57 | + return realpath($basePath); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - private function _startThemeManager() |
|
| 61 | - { |
|
| 62 | - $themeManager = new TThemeManager; |
|
| 63 | - $themeManager->BasePath = "System.Wsat.themes"; |
|
| 64 | - $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat')); |
|
| 65 | - $themeManager->BaseUrl = "$url/themes"; |
|
| 60 | + private function _startThemeManager() |
|
| 61 | + { |
|
| 62 | + $themeManager = new TThemeManager; |
|
| 63 | + $themeManager->BasePath = "System.Wsat.themes"; |
|
| 64 | + $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat')); |
|
| 65 | + $themeManager->BaseUrl = "$url/themes"; |
|
| 66 | 66 | |
| 67 | - $themeManager->init(null); |
|
| 68 | - $this->setThemeManager($themeManager); |
|
| 69 | - } |
|
| 67 | + $themeManager->init(null); |
|
| 68 | + $this->setThemeManager($themeManager); |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - public function getPassword() |
|
| 72 | - { |
|
| 73 | - return $this->_pass; |
|
| 74 | - } |
|
| 71 | + public function getPassword() |
|
| 72 | + { |
|
| 73 | + return $this->_pass; |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - public function setPassword($_pass) |
|
| 77 | - { |
|
| 78 | - $this->_pass = $_pass; |
|
| 79 | - } |
|
| 76 | + public function setPassword($_pass) |
|
| 77 | + { |
|
| 78 | + $this->_pass = $_pass; |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | 81 | } |
| 82 | 82 | \ No newline at end of file |
@@ -36,14 +36,14 @@ discard block |
||
| 36 | 36 | class TWsatService extends TPageService |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - private $_pass = ''; |
|
| 39 | + private $_pass=''; |
|
| 40 | 40 | |
| 41 | 41 | public function init($config) |
| 42 | 42 | { |
| 43 | - if ($this->getApplication()->getMode() === TApplicationMode::Performance || $this->getApplication()->getMode() === TApplicationMode::Normal) |
|
| 43 | + if($this->getApplication()->getMode()===TApplicationMode::Performance || $this->getApplication()->getMode()===TApplicationMode::Normal) |
|
| 44 | 44 | throw new TInvalidOperationException("You should not use Prado WSAT in any of the production modes."); |
| 45 | 45 | |
| 46 | - if (empty($this->_pass)) |
|
| 46 | + if(empty($this->_pass)) |
|
| 47 | 47 | throw new TConfigurationException("You need to specify the Password attribute."); |
| 48 | 48 | |
| 49 | 49 | $this->setDefaultPage("TWsatHome"); |
@@ -53,16 +53,16 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public function getBasePath() |
| 55 | 55 | { |
| 56 | - $basePath = Prado::getPathOfNamespace("System.Wsat.pages"); |
|
| 56 | + $basePath=Prado::getPathOfNamespace("System.Wsat.pages"); |
|
| 57 | 57 | return realpath($basePath); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | private function _startThemeManager() |
| 61 | 61 | { |
| 62 | - $themeManager = new TThemeManager; |
|
| 63 | - $themeManager->BasePath = "System.Wsat.themes"; |
|
| 64 | - $url = Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat')); |
|
| 65 | - $themeManager->BaseUrl = "$url/themes"; |
|
| 62 | + $themeManager=new TThemeManager; |
|
| 63 | + $themeManager->BasePath="System.Wsat.themes"; |
|
| 64 | + $url=Prado::getApplication()->getAssetManager()->publishFilePath(Prado::getPathOfNamespace('System.Wsat')); |
|
| 65 | + $themeManager->BaseUrl="$url/themes"; |
|
| 66 | 66 | |
| 67 | 67 | $themeManager->init(null); |
| 68 | 68 | $this->setThemeManager($themeManager); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function setPassword($_pass) |
| 77 | 77 | { |
| 78 | - $this->_pass = $_pass; |
|
| 78 | + $this->_pass=$_pass; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | } |
| 82 | 82 | \ No newline at end of file |
@@ -14,69 +14,69 @@ |
||
| 14 | 14 | class TWsatBaseGenerator |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * @return TDbMetaData for retrieving metadata information, such as |
|
| 19 | - * table and columns information, from a database connection. |
|
| 20 | - */ |
|
| 21 | - protected $_dbMetaData; |
|
| 17 | + /** |
|
| 18 | + * @return TDbMetaData for retrieving metadata information, such as |
|
| 19 | + * table and columns information, from a database connection. |
|
| 20 | + */ |
|
| 21 | + protected $_dbMetaData; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Output folder where AR classes will be saved. |
|
| 25 | - */ |
|
| 26 | - protected $_opFile; |
|
| 23 | + /** |
|
| 24 | + * Output folder where AR classes will be saved. |
|
| 25 | + */ |
|
| 26 | + protected $_opFile; |
|
| 27 | 27 | |
| 28 | - function __construct() |
|
| 29 | - { |
|
| 30 | - if (!class_exists("TActiveRecordManager", false)) |
|
| 31 | - throw new Exception("You need to enable the ActiveRecord module in your application configuration file."); |
|
| 32 | - $ar_manager = TActiveRecordManager::getInstance(); |
|
| 33 | - $_conn = $ar_manager->getDbConnection(); |
|
| 34 | - $_conn->Active = true; |
|
| 35 | - $this->_dbMetaData = TDbMetaData::getInstance($_conn); |
|
| 36 | - } |
|
| 28 | + function __construct() |
|
| 29 | + { |
|
| 30 | + if (!class_exists("TActiveRecordManager", false)) |
|
| 31 | + throw new Exception("You need to enable the ActiveRecord module in your application configuration file."); |
|
| 32 | + $ar_manager = TActiveRecordManager::getInstance(); |
|
| 33 | + $_conn = $ar_manager->getDbConnection(); |
|
| 34 | + $_conn->Active = true; |
|
| 35 | + $this->_dbMetaData = TDbMetaData::getInstance($_conn); |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - public function setOpFile($op_file_namespace) |
|
| 39 | - { |
|
| 40 | - $op_file = Prado::getPathOfNamespace($op_file_namespace); |
|
| 41 | - if (empty($op_file)) |
|
| 42 | - throw new Exception("You need to fix your output folder namespace."); |
|
| 43 | - if (!is_dir($op_file)) |
|
| 44 | - mkdir($op_file, 0777, true); |
|
| 45 | - $this->_opFile = $op_file; |
|
| 46 | - } |
|
| 38 | + public function setOpFile($op_file_namespace) |
|
| 39 | + { |
|
| 40 | + $op_file = Prado::getPathOfNamespace($op_file_namespace); |
|
| 41 | + if (empty($op_file)) |
|
| 42 | + throw new Exception("You need to fix your output folder namespace."); |
|
| 43 | + if (!is_dir($op_file)) |
|
| 44 | + mkdir($op_file, 0777, true); |
|
| 45 | + $this->_opFile = $op_file; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - public function renderAllTablesInformation() |
|
| 49 | - { |
|
| 50 | - foreach ($this->getAllTableNames() as $table_name) |
|
| 51 | - { |
|
| 52 | - echo $table_name . "<br>"; |
|
| 53 | - $tableInfo = $this->_dbMetaData->getTableInfo($table_name); |
|
| 54 | - echo "Table info:" . "<br>"; |
|
| 55 | - echo "<pre>"; |
|
| 56 | - print_r($tableInfo); |
|
| 57 | - echo "</pre>"; |
|
| 58 | - } |
|
| 59 | - } |
|
| 48 | + public function renderAllTablesInformation() |
|
| 49 | + { |
|
| 50 | + foreach ($this->getAllTableNames() as $table_name) |
|
| 51 | + { |
|
| 52 | + echo $table_name . "<br>"; |
|
| 53 | + $tableInfo = $this->_dbMetaData->getTableInfo($table_name); |
|
| 54 | + echo "Table info:" . "<br>"; |
|
| 55 | + echo "<pre>"; |
|
| 56 | + print_r($tableInfo); |
|
| 57 | + echo "</pre>"; |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - public function getAllTableNames() |
|
| 62 | - { |
|
| 63 | - $tableNames = $this->_dbMetaData->findTableNames(); |
|
| 64 | - $index = array_search('pradocache', $tableNames); |
|
| 65 | - if ($index) |
|
| 66 | - array_splice($tableNames, $index, 1); |
|
| 67 | - return $tableNames; |
|
| 68 | - } |
|
| 61 | + public function getAllTableNames() |
|
| 62 | + { |
|
| 63 | + $tableNames = $this->_dbMetaData->findTableNames(); |
|
| 64 | + $index = array_search('pradocache', $tableNames); |
|
| 65 | + if ($index) |
|
| 66 | + array_splice($tableNames, $index, 1); |
|
| 67 | + return $tableNames; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - public static function pr($data) |
|
| 71 | - { |
|
| 72 | - echo "<pre>"; |
|
| 73 | - print_r($data); |
|
| 74 | - echo "</pre>"; |
|
| 75 | - } |
|
| 70 | + public static function pr($data) |
|
| 71 | + { |
|
| 72 | + echo "<pre>"; |
|
| 73 | + print_r($data); |
|
| 74 | + echo "</pre>"; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - protected function eq($data) |
|
| 78 | - { |
|
| 79 | - return '"' . $data . '"'; |
|
| 80 | - } |
|
| 77 | + protected function eq($data) |
|
| 78 | + { |
|
| 79 | + return '"' . $data . '"'; |
|
| 80 | + } |
|
| 81 | 81 | |
| 82 | 82 | } |
@@ -27,31 +27,31 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | function __construct() |
| 29 | 29 | { |
| 30 | - if (!class_exists("TActiveRecordManager", false)) |
|
| 30 | + if(!class_exists("TActiveRecordManager", false)) |
|
| 31 | 31 | throw new Exception("You need to enable the ActiveRecord module in your application configuration file."); |
| 32 | - $ar_manager = TActiveRecordManager::getInstance(); |
|
| 33 | - $_conn = $ar_manager->getDbConnection(); |
|
| 34 | - $_conn->Active = true; |
|
| 35 | - $this->_dbMetaData = TDbMetaData::getInstance($_conn); |
|
| 32 | + $ar_manager=TActiveRecordManager::getInstance(); |
|
| 33 | + $_conn=$ar_manager->getDbConnection(); |
|
| 34 | + $_conn->Active=true; |
|
| 35 | + $this->_dbMetaData=TDbMetaData::getInstance($_conn); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function setOpFile($op_file_namespace) |
| 39 | 39 | { |
| 40 | - $op_file = Prado::getPathOfNamespace($op_file_namespace); |
|
| 41 | - if (empty($op_file)) |
|
| 40 | + $op_file=Prado::getPathOfNamespace($op_file_namespace); |
|
| 41 | + if(empty($op_file)) |
|
| 42 | 42 | throw new Exception("You need to fix your output folder namespace."); |
| 43 | - if (!is_dir($op_file)) |
|
| 43 | + if(!is_dir($op_file)) |
|
| 44 | 44 | mkdir($op_file, 0777, true); |
| 45 | - $this->_opFile = $op_file; |
|
| 45 | + $this->_opFile=$op_file; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function renderAllTablesInformation() |
| 49 | 49 | { |
| 50 | - foreach ($this->getAllTableNames() as $table_name) |
|
| 50 | + foreach($this->getAllTableNames() as $table_name) |
|
| 51 | 51 | { |
| 52 | - echo $table_name . "<br>"; |
|
| 53 | - $tableInfo = $this->_dbMetaData->getTableInfo($table_name); |
|
| 54 | - echo "Table info:" . "<br>"; |
|
| 52 | + echo $table_name."<br>"; |
|
| 53 | + $tableInfo=$this->_dbMetaData->getTableInfo($table_name); |
|
| 54 | + echo "Table info:"."<br>"; |
|
| 55 | 55 | echo "<pre>"; |
| 56 | 56 | print_r($tableInfo); |
| 57 | 57 | echo "</pre>"; |
@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | public function getAllTableNames() |
| 62 | 62 | { |
| 63 | - $tableNames = $this->_dbMetaData->findTableNames(); |
|
| 64 | - $index = array_search('pradocache', $tableNames); |
|
| 65 | - if ($index) |
|
| 63 | + $tableNames=$this->_dbMetaData->findTableNames(); |
|
| 64 | + $index=array_search('pradocache', $tableNames); |
|
| 65 | + if($index) |
|
| 66 | 66 | array_splice($tableNames, $index, 1); |
| 67 | 67 | return $tableNames; |
| 68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | protected function eq($data) |
| 78 | 78 | { |
| 79 | - return '"' . $data . '"'; |
|
| 79 | + return '"'.$data.'"'; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | } |
@@ -14,59 +14,59 @@ |
||
| 14 | 14 | class TWsatScaffolding extends TPage |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - public function onInit($param) |
|
| 18 | - { |
|
| 19 | - parent::onInit($param); |
|
| 20 | - $this->startVisual(); |
|
| 21 | - } |
|
| 17 | + public function onInit($param) |
|
| 18 | + { |
|
| 19 | + parent::onInit($param); |
|
| 20 | + $this->startVisual(); |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - private function startVisual() |
|
| 24 | - { |
|
| 25 | - $scf_generator = new TWsatScaffoldingGenerator(); |
|
| 26 | - foreach ($scf_generator->getAllTableNames() as $tableName) |
|
| 27 | - { |
|
| 28 | - $dynChb = new TCheckBox(); |
|
| 29 | - $dynChb->ID = "cb_$tableName"; |
|
| 30 | - $dynChb->Text = ucfirst($tableName); |
|
| 31 | - $dynChb->Checked = true; |
|
| 32 | - $this->registerObject("cb_$tableName", $dynChb); |
|
| 33 | - $this->tableNames->getControls()->add($dynChb); |
|
| 34 | - $this->tableNames->getControls()->add("</br>"); |
|
| 35 | - } |
|
| 36 | - } |
|
| 23 | + private function startVisual() |
|
| 24 | + { |
|
| 25 | + $scf_generator = new TWsatScaffoldingGenerator(); |
|
| 26 | + foreach ($scf_generator->getAllTableNames() as $tableName) |
|
| 27 | + { |
|
| 28 | + $dynChb = new TCheckBox(); |
|
| 29 | + $dynChb->ID = "cb_$tableName"; |
|
| 30 | + $dynChb->Text = ucfirst($tableName); |
|
| 31 | + $dynChb->Checked = true; |
|
| 32 | + $this->registerObject("cb_$tableName", $dynChb); |
|
| 33 | + $this->tableNames->getControls()->add($dynChb); |
|
| 34 | + $this->tableNames->getControls()->add("</br>"); |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Generate Scaffolding code for selected tables |
|
| 40 | - * @param type $sender |
|
| 41 | - */ |
|
| 42 | - public function generate($sender) |
|
| 43 | - { |
|
| 44 | - if ($this->IsValid) |
|
| 45 | - { |
|
| 46 | - try |
|
| 47 | - { |
|
| 48 | - $scf_generator = new TWsatScaffoldingGenerator(); |
|
| 49 | - $scf_generator->setOpFile($this->output_folder->Text); |
|
| 50 | - foreach ($scf_generator->getAllTableNames() as $tableName) |
|
| 51 | - { |
|
| 52 | - $id = "cb_$tableName"; |
|
| 53 | - $obj = $this->tableNames->findControl($id); |
|
| 54 | - if($obj!==null && $obj->Checked) |
|
| 55 | - { |
|
| 56 | - $scf_generator->generateCRUD($tableName); |
|
| 57 | - } |
|
| 58 | - } |
|
| 38 | + /** |
|
| 39 | + * Generate Scaffolding code for selected tables |
|
| 40 | + * @param type $sender |
|
| 41 | + */ |
|
| 42 | + public function generate($sender) |
|
| 43 | + { |
|
| 44 | + if ($this->IsValid) |
|
| 45 | + { |
|
| 46 | + try |
|
| 47 | + { |
|
| 48 | + $scf_generator = new TWsatScaffoldingGenerator(); |
|
| 49 | + $scf_generator->setOpFile($this->output_folder->Text); |
|
| 50 | + foreach ($scf_generator->getAllTableNames() as $tableName) |
|
| 51 | + { |
|
| 52 | + $id = "cb_$tableName"; |
|
| 53 | + $obj = $this->tableNames->findControl($id); |
|
| 54 | + if($obj!==null && $obj->Checked) |
|
| 55 | + { |
|
| 56 | + $scf_generator->generateCRUD($tableName); |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - $this->feedback_panel->CssClass = "green_panel"; |
|
| 61 | - $this->generation_msg->Text = "The code has been generated successfully."; |
|
| 62 | - } catch (Exception $ex) |
|
| 63 | - { |
|
| 64 | - $this->feedback_panel->CssClass = "red_panel"; |
|
| 65 | - $this->generation_msg->Text = $ex->getMessage(); |
|
| 66 | - } |
|
| 67 | - $this->feedback_panel->Visible = true; |
|
| 68 | - } |
|
| 60 | + $this->feedback_panel->CssClass = "green_panel"; |
|
| 61 | + $this->generation_msg->Text = "The code has been generated successfully."; |
|
| 62 | + } catch (Exception $ex) |
|
| 63 | + { |
|
| 64 | + $this->feedback_panel->CssClass = "red_panel"; |
|
| 65 | + $this->generation_msg->Text = $ex->getMessage(); |
|
| 66 | + } |
|
| 67 | + $this->feedback_panel->Visible = true; |
|
| 68 | + } |
|
| 69 | 69 | |
| 70 | - // $scf_generator->renderAllTablesInformation(); |
|
| 71 | - } |
|
| 70 | + // $scf_generator->renderAllTablesInformation(); |
|
| 71 | + } |
|
| 72 | 72 | } |
| 73 | 73 | \ No newline at end of file |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | private function startVisual() |
| 24 | 24 | { |
| 25 | - $scf_generator = new TWsatScaffoldingGenerator(); |
|
| 26 | - foreach ($scf_generator->getAllTableNames() as $tableName) |
|
| 25 | + $scf_generator=new TWsatScaffoldingGenerator(); |
|
| 26 | + foreach($scf_generator->getAllTableNames() as $tableName) |
|
| 27 | 27 | { |
| 28 | - $dynChb = new TCheckBox(); |
|
| 29 | - $dynChb->ID = "cb_$tableName"; |
|
| 30 | - $dynChb->Text = ucfirst($tableName); |
|
| 31 | - $dynChb->Checked = true; |
|
| 28 | + $dynChb=new TCheckBox(); |
|
| 29 | + $dynChb->ID="cb_$tableName"; |
|
| 30 | + $dynChb->Text=ucfirst($tableName); |
|
| 31 | + $dynChb->Checked=true; |
|
| 32 | 32 | $this->registerObject("cb_$tableName", $dynChb); |
| 33 | 33 | $this->tableNames->getControls()->add($dynChb); |
| 34 | 34 | $this->tableNames->getControls()->add("</br>"); |
@@ -41,30 +41,30 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function generate($sender) |
| 43 | 43 | { |
| 44 | - if ($this->IsValid) |
|
| 44 | + if($this->IsValid) |
|
| 45 | 45 | { |
| 46 | 46 | try |
| 47 | 47 | { |
| 48 | - $scf_generator = new TWsatScaffoldingGenerator(); |
|
| 48 | + $scf_generator=new TWsatScaffoldingGenerator(); |
|
| 49 | 49 | $scf_generator->setOpFile($this->output_folder->Text); |
| 50 | - foreach ($scf_generator->getAllTableNames() as $tableName) |
|
| 50 | + foreach($scf_generator->getAllTableNames() as $tableName) |
|
| 51 | 51 | { |
| 52 | - $id = "cb_$tableName"; |
|
| 53 | - $obj = $this->tableNames->findControl($id); |
|
| 52 | + $id="cb_$tableName"; |
|
| 53 | + $obj=$this->tableNames->findControl($id); |
|
| 54 | 54 | if($obj!==null && $obj->Checked) |
| 55 | 55 | { |
| 56 | 56 | $scf_generator->generateCRUD($tableName); |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - $this->feedback_panel->CssClass = "green_panel"; |
|
| 61 | - $this->generation_msg->Text = "The code has been generated successfully."; |
|
| 62 | - } catch (Exception $ex) |
|
| 60 | + $this->feedback_panel->CssClass="green_panel"; |
|
| 61 | + $this->generation_msg->Text="The code has been generated successfully."; |
|
| 62 | + } catch(Exception $ex) |
|
| 63 | 63 | { |
| 64 | - $this->feedback_panel->CssClass = "red_panel"; |
|
| 65 | - $this->generation_msg->Text = $ex->getMessage(); |
|
| 64 | + $this->feedback_panel->CssClass="red_panel"; |
|
| 65 | + $this->generation_msg->Text=$ex->getMessage(); |
|
| 66 | 66 | } |
| 67 | - $this->feedback_panel->Visible = true; |
|
| 67 | + $this->feedback_panel->Visible=true; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // $scf_generator->renderAllTablesInformation(); |
@@ -14,44 +14,44 @@ |
||
| 14 | 14 | class TWsatGenerateAR extends TPage |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - public function generate($sender) |
|
| 18 | - { |
|
| 19 | - if ($this->IsValid) |
|
| 20 | - { |
|
| 21 | - $tableName = $this->table_name->Text; |
|
| 22 | - $outputFolderNs = $this->output_folder->Text; |
|
| 23 | - $classPrefix = $this->class_prefix->Text; |
|
| 24 | - $classSuffix = $this->class_suffix->Text; |
|
| 25 | - |
|
| 26 | - try |
|
| 27 | - { |
|
| 28 | - $ar_generator = new TWsatARGenerator(); |
|
| 29 | - $ar_generator->setOpFile($outputFolderNs); |
|
| 30 | - $ar_generator->setClasPrefix($classPrefix); |
|
| 31 | - $ar_generator->setClassSufix($classSuffix); |
|
| 32 | - |
|
| 33 | - if ($this->build_rel->Checked) |
|
| 34 | - $ar_generator->buildRelations(); |
|
| 35 | - |
|
| 36 | - if ($tableName != "*") |
|
| 37 | - $ar_generator->generate($tableName); |
|
| 38 | - else |
|
| 39 | - $ar_generator->generateAll(); |
|
| 40 | - |
|
| 41 | - $this->feedback_panel->CssClass = "green_panel"; |
|
| 42 | - $this->generation_msg->Text = "The code has been generated successfully."; |
|
| 43 | - } catch (Exception $ex) |
|
| 44 | - { |
|
| 45 | - $this->feedback_panel->CssClass = "red_panel"; |
|
| 46 | - $this->generation_msg->Text = $ex->getMessage(); |
|
| 47 | - } |
|
| 48 | - $this->feedback_panel->Visible = true; |
|
| 49 | - } |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - public function preview($sender) |
|
| 53 | - { |
|
| 54 | - throw new THttpException(500, "Not implemented yet."); |
|
| 55 | - } |
|
| 17 | + public function generate($sender) |
|
| 18 | + { |
|
| 19 | + if ($this->IsValid) |
|
| 20 | + { |
|
| 21 | + $tableName = $this->table_name->Text; |
|
| 22 | + $outputFolderNs = $this->output_folder->Text; |
|
| 23 | + $classPrefix = $this->class_prefix->Text; |
|
| 24 | + $classSuffix = $this->class_suffix->Text; |
|
| 25 | + |
|
| 26 | + try |
|
| 27 | + { |
|
| 28 | + $ar_generator = new TWsatARGenerator(); |
|
| 29 | + $ar_generator->setOpFile($outputFolderNs); |
|
| 30 | + $ar_generator->setClasPrefix($classPrefix); |
|
| 31 | + $ar_generator->setClassSufix($classSuffix); |
|
| 32 | + |
|
| 33 | + if ($this->build_rel->Checked) |
|
| 34 | + $ar_generator->buildRelations(); |
|
| 35 | + |
|
| 36 | + if ($tableName != "*") |
|
| 37 | + $ar_generator->generate($tableName); |
|
| 38 | + else |
|
| 39 | + $ar_generator->generateAll(); |
|
| 40 | + |
|
| 41 | + $this->feedback_panel->CssClass = "green_panel"; |
|
| 42 | + $this->generation_msg->Text = "The code has been generated successfully."; |
|
| 43 | + } catch (Exception $ex) |
|
| 44 | + { |
|
| 45 | + $this->feedback_panel->CssClass = "red_panel"; |
|
| 46 | + $this->generation_msg->Text = $ex->getMessage(); |
|
| 47 | + } |
|
| 48 | + $this->feedback_panel->Visible = true; |
|
| 49 | + } |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + public function preview($sender) |
|
| 53 | + { |
|
| 54 | + throw new THttpException(500, "Not implemented yet."); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | } |
| 58 | 58 | \ No newline at end of file |
@@ -16,36 +16,36 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function generate($sender) |
| 18 | 18 | { |
| 19 | - if ($this->IsValid) |
|
| 19 | + if($this->IsValid) |
|
| 20 | 20 | { |
| 21 | - $tableName = $this->table_name->Text; |
|
| 22 | - $outputFolderNs = $this->output_folder->Text; |
|
| 23 | - $classPrefix = $this->class_prefix->Text; |
|
| 24 | - $classSuffix = $this->class_suffix->Text; |
|
| 21 | + $tableName=$this->table_name->Text; |
|
| 22 | + $outputFolderNs=$this->output_folder->Text; |
|
| 23 | + $classPrefix=$this->class_prefix->Text; |
|
| 24 | + $classSuffix=$this->class_suffix->Text; |
|
| 25 | 25 | |
| 26 | 26 | try |
| 27 | 27 | { |
| 28 | - $ar_generator = new TWsatARGenerator(); |
|
| 28 | + $ar_generator=new TWsatARGenerator(); |
|
| 29 | 29 | $ar_generator->setOpFile($outputFolderNs); |
| 30 | 30 | $ar_generator->setClasPrefix($classPrefix); |
| 31 | 31 | $ar_generator->setClassSufix($classSuffix); |
| 32 | 32 | |
| 33 | - if ($this->build_rel->Checked) |
|
| 33 | + if($this->build_rel->Checked) |
|
| 34 | 34 | $ar_generator->buildRelations(); |
| 35 | 35 | |
| 36 | - if ($tableName != "*") |
|
| 36 | + if($tableName!="*") |
|
| 37 | 37 | $ar_generator->generate($tableName); |
| 38 | 38 | else |
| 39 | 39 | $ar_generator->generateAll(); |
| 40 | 40 | |
| 41 | - $this->feedback_panel->CssClass = "green_panel"; |
|
| 42 | - $this->generation_msg->Text = "The code has been generated successfully."; |
|
| 43 | - } catch (Exception $ex) |
|
| 41 | + $this->feedback_panel->CssClass="green_panel"; |
|
| 42 | + $this->generation_msg->Text="The code has been generated successfully."; |
|
| 43 | + } catch(Exception $ex) |
|
| 44 | 44 | { |
| 45 | - $this->feedback_panel->CssClass = "red_panel"; |
|
| 46 | - $this->generation_msg->Text = $ex->getMessage(); |
|
| 45 | + $this->feedback_panel->CssClass="red_panel"; |
|
| 46 | + $this->generation_msg->Text=$ex->getMessage(); |
|
| 47 | 47 | } |
| 48 | - $this->feedback_panel->Visible = true; |
|
| 48 | + $this->feedback_panel->Visible=true; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -8,29 +8,29 @@ |
||
| 8 | 8 | class TWsatLayout extends TTemplateControl |
| 9 | 9 | { |
| 10 | 10 | |
| 11 | - public function onLoad($param) |
|
| 12 | - { |
|
| 13 | - parent::onLoad($param); |
|
| 14 | - $this->validateSecurity(); |
|
| 15 | - } |
|
| 11 | + public function onLoad($param) |
|
| 12 | + { |
|
| 13 | + parent::onLoad($param); |
|
| 14 | + $this->validateSecurity(); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - private function validateSecurity() |
|
| 18 | - { |
|
| 19 | - if ($this->Session["wsat_password"] !== $this->getService()->getPassword()) |
|
| 20 | - { |
|
| 21 | - if (!$this->getPage() instanceof TWsatLogin) |
|
| 22 | - { |
|
| 23 | - $url = $this->Service->constructUrl('TWsatLogin'); |
|
| 24 | - $this->Response->redirect($url); |
|
| 25 | - } |
|
| 26 | - } |
|
| 27 | - } |
|
| 17 | + private function validateSecurity() |
|
| 18 | + { |
|
| 19 | + if ($this->Session["wsat_password"] !== $this->getService()->getPassword()) |
|
| 20 | + { |
|
| 21 | + if (!$this->getPage() instanceof TWsatLogin) |
|
| 22 | + { |
|
| 23 | + $url = $this->Service->constructUrl('TWsatLogin'); |
|
| 24 | + $this->Response->redirect($url); |
|
| 25 | + } |
|
| 26 | + } |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - public function logout() |
|
| 30 | - { |
|
| 31 | - $this->Session["wsat_password"] = ""; |
|
| 32 | - $url = $this->Service->constructUrl('TWsatLogin'); |
|
| 33 | - $this->Response->redirect($url); |
|
| 34 | - } |
|
| 29 | + public function logout() |
|
| 30 | + { |
|
| 31 | + $this->Session["wsat_password"] = ""; |
|
| 32 | + $url = $this->Service->constructUrl('TWsatLogin'); |
|
| 33 | + $this->Response->redirect($url); |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | } |
| 37 | 37 | \ No newline at end of file |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | private function validateSecurity() |
| 18 | 18 | { |
| 19 | - if ($this->Session["wsat_password"] !== $this->getService()->getPassword()) |
|
| 19 | + if($this->Session["wsat_password"]!==$this->getService()->getPassword()) |
|
| 20 | 20 | { |
| 21 | - if (!$this->getPage() instanceof TWsatLogin) |
|
| 21 | + if(!$this->getPage() instanceof TWsatLogin) |
|
| 22 | 22 | { |
| 23 | - $url = $this->Service->constructUrl('TWsatLogin'); |
|
| 23 | + $url=$this->Service->constructUrl('TWsatLogin'); |
|
| 24 | 24 | $this->Response->redirect($url); |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | public function logout() |
| 30 | 30 | { |
| 31 | - $this->Session["wsat_password"] = ""; |
|
| 32 | - $url = $this->Service->constructUrl('TWsatLogin'); |
|
| 31 | + $this->Session["wsat_password"]=""; |
|
| 32 | + $url=$this->Service->constructUrl('TWsatLogin'); |
|
| 33 | 33 | $this->Response->redirect($url); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -12,21 +12,21 @@ |
||
| 12 | 12 | class TWsatLogin extends TPage |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - public function login() |
|
| 16 | - { |
|
| 17 | - if ($this->IsValid) |
|
| 18 | - { |
|
| 19 | - $this->Session["wsat_password"] = $this->getService()->getPassword(); |
|
| 20 | - $url = $this->Service->constructUrl('TWsatHome'); |
|
| 21 | - $this->Response->redirect($url); |
|
| 22 | - } |
|
| 23 | - } |
|
| 15 | + public function login() |
|
| 16 | + { |
|
| 17 | + if ($this->IsValid) |
|
| 18 | + { |
|
| 19 | + $this->Session["wsat_password"] = $this->getService()->getPassword(); |
|
| 20 | + $url = $this->Service->constructUrl('TWsatHome'); |
|
| 21 | + $this->Response->redirect($url); |
|
| 22 | + } |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - public function validatePassword($sender, $param) |
|
| 26 | - { |
|
| 27 | - $config_pass = $this->Service->Password; |
|
| 28 | - $user_pass = $this->password->Text; |
|
| 29 | - $param->IsValid = $user_pass === $config_pass; |
|
| 30 | - } |
|
| 25 | + public function validatePassword($sender, $param) |
|
| 26 | + { |
|
| 27 | + $config_pass = $this->Service->Password; |
|
| 28 | + $user_pass = $this->password->Text; |
|
| 29 | + $param->IsValid = $user_pass === $config_pass; |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | } |
| 33 | 33 | \ No newline at end of file |
@@ -14,19 +14,19 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function login() |
| 16 | 16 | { |
| 17 | - if ($this->IsValid) |
|
| 17 | + if($this->IsValid) |
|
| 18 | 18 | { |
| 19 | - $this->Session["wsat_password"] = $this->getService()->getPassword(); |
|
| 20 | - $url = $this->Service->constructUrl('TWsatHome'); |
|
| 19 | + $this->Session["wsat_password"]=$this->getService()->getPassword(); |
|
| 20 | + $url=$this->Service->constructUrl('TWsatHome'); |
|
| 21 | 21 | $this->Response->redirect($url); |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function validatePassword($sender, $param) |
| 26 | 26 | { |
| 27 | - $config_pass = $this->Service->Password; |
|
| 28 | - $user_pass = $this->password->Text; |
|
| 29 | - $param->IsValid = $user_pass === $config_pass; |
|
| 27 | + $config_pass=$this->Service->Password; |
|
| 28 | + $user_pass=$this->password->Text; |
|
| 29 | + $param->IsValid=$user_pass===$config_pass; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | } |
| 33 | 33 | \ No newline at end of file |
@@ -62,31 +62,31 @@ |
||
| 62 | 62 | class_exists("DOMDocument",false), |
| 63 | 63 | 'DOM extension check', |
| 64 | 64 | 'DOM extension required'), |
| 65 | - array( |
|
| 66 | - true, |
|
| 67 | - extension_loaded("SPL"), |
|
| 68 | - 'SPL extension check', |
|
| 69 | - 'SPL extension required'), |
|
| 70 | - array( |
|
| 71 | - true, |
|
| 72 | - extension_loaded("CType"), |
|
| 73 | - 'CType extension check', |
|
| 74 | - 'CType extension required'), |
|
| 75 | - array( |
|
| 76 | - true, |
|
| 77 | - extension_loaded("pcre"), |
|
| 78 | - 'PCRE extension check', |
|
| 79 | - 'PCRE extension required'), |
|
| 80 | - array( |
|
| 81 | - true, |
|
| 82 | - extension_loaded("json"), |
|
| 83 | - 'JSON extension check', |
|
| 84 | - 'JSON extension required'), |
|
| 85 | - array( |
|
| 86 | - false, |
|
| 87 | - class_exists("PDO",false), |
|
| 88 | - 'PDO extension check', |
|
| 89 | - 'PDO extension optional'), |
|
| 65 | + array( |
|
| 66 | + true, |
|
| 67 | + extension_loaded("SPL"), |
|
| 68 | + 'SPL extension check', |
|
| 69 | + 'SPL extension required'), |
|
| 70 | + array( |
|
| 71 | + true, |
|
| 72 | + extension_loaded("CType"), |
|
| 73 | + 'CType extension check', |
|
| 74 | + 'CType extension required'), |
|
| 75 | + array( |
|
| 76 | + true, |
|
| 77 | + extension_loaded("pcre"), |
|
| 78 | + 'PCRE extension check', |
|
| 79 | + 'PCRE extension required'), |
|
| 80 | + array( |
|
| 81 | + true, |
|
| 82 | + extension_loaded("json"), |
|
| 83 | + 'JSON extension check', |
|
| 84 | + 'JSON extension required'), |
|
| 85 | + array( |
|
| 86 | + false, |
|
| 87 | + class_exists("PDO",false), |
|
| 88 | + 'PDO extension check', |
|
| 89 | + 'PDO extension optional'), |
|
| 90 | 90 | array( |
| 91 | 91 | false, |
| 92 | 92 | function_exists("iconv"), |
@@ -70,8 +70,7 @@ |
||
| 70 | 70 | |
| 71 | 71 | echo "\n\n** PDF file quickstart.pdf created **\n\n"; |
| 72 | 72 | |
| 73 | - } |
|
| 74 | - else |
|
| 73 | + } else |
|
| 75 | 74 | { |
| 76 | 75 | echo " Unable to find pdfLatex executable $pdflatexExec"; |
| 77 | 76 | } |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * @var array List of requirements (required or not, check item, hint) |
| 29 | 29 | */ |
| 30 | -$requirements = array( |
|
| 30 | +$requirements=array( |
|
| 31 | 31 | array( |
| 32 | 32 | true, |
| 33 | - version_compare(PHP_VERSION,"5.3.3",">="), |
|
| 34 | - 'PHP version check','PHP 5.3.3 or higher required'), |
|
| 33 | + version_compare(PHP_VERSION, "5.3.3", ">="), |
|
| 34 | + 'PHP version check', 'PHP 5.3.3 or higher required'), |
|
| 35 | 35 | array( |
| 36 | 36 | true, |
| 37 | 37 | isset($_SERVER["HTTP_ACCEPT"]), |
@@ -49,17 +49,17 @@ discard block |
||
| 49 | 49 | 'REQUEST_URI required'), |
| 50 | 50 | array( |
| 51 | 51 | true, |
| 52 | - isset($_SERVER["PATH_INFO"]) || strpos($_SERVER["PHP_SELF"],$_SERVER["SCRIPT_NAME"])===0, |
|
| 52 | + isset($_SERVER["PATH_INFO"]) || strpos($_SERVER["PHP_SELF"], $_SERVER["SCRIPT_NAME"])===0, |
|
| 53 | 53 | '$_SERVER["PATH_INFO"] check', |
| 54 | 54 | 'PATH_INFO required'), |
| 55 | 55 | array( |
| 56 | 56 | true, |
| 57 | - class_exists('Reflection',false), |
|
| 57 | + class_exists('Reflection', false), |
|
| 58 | 58 | 'Reflection extension check', |
| 59 | 59 | 'Reflection extension required'), |
| 60 | 60 | array( |
| 61 | 61 | true, |
| 62 | - class_exists("DOMDocument",false), |
|
| 62 | + class_exists("DOMDocument", false), |
|
| 63 | 63 | 'DOM extension check', |
| 64 | 64 | 'DOM extension required'), |
| 65 | 65 | array( |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | 'JSON extension required'), |
| 85 | 85 | array( |
| 86 | 86 | false, |
| 87 | - class_exists("PDO",false), |
|
| 87 | + class_exists("PDO", false), |
|
| 88 | 88 | 'PDO extension check', |
| 89 | 89 | 'PDO extension optional'), |
| 90 | 90 | array( |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | 'SOAP extension optional'), |
| 150 | 150 | ); |
| 151 | 151 | |
| 152 | -$results = "<table class=\"result\">\n"; |
|
| 153 | -$conclusion = 0; |
|
| 152 | +$results="<table class=\"result\">\n"; |
|
| 153 | +$conclusion=0; |
|
| 154 | 154 | foreach($requirements as $requirement) |
| 155 | 155 | { |
| 156 | - list($required,$expression,$aspect,$hint)=$requirement; |
|
| 156 | + list($required, $expression, $aspect, $hint)=$requirement; |
|
| 157 | 157 | //eval('$ret='.$expression.';'); |
| 158 | 158 | $ret=$expression; |
| 159 | 159 | if($required) |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | } |
| 180 | 180 | $results.="<tr class=\"$ret\"><td class=\"$ret\">".lmessage($aspect)."</td><td class=\"$ret\">".lmessage($hint)."</td></tr>\n"; |
| 181 | 181 | } |
| 182 | -$results .= '</table>'; |
|
| 182 | +$results.='</table>'; |
|
| 183 | 183 | if($conclusion===0) |
| 184 | 184 | $conclusion=lmessage('all passed'); |
| 185 | 185 | else if($conclusion===1) |
@@ -187,11 +187,11 @@ discard block |
||
| 187 | 187 | else |
| 188 | 188 | $conclusion=lmessage('passed with warnings'); |
| 189 | 189 | |
| 190 | -$tokens = array( |
|
| 190 | +$tokens=array( |
|
| 191 | 191 | '%%Conclusion%%' => $conclusion, |
| 192 | 192 | '%%Details%%' => $results, |
| 193 | 193 | '%%Version%%' => $_SERVER['SERVER_SOFTWARE'].' <a href="https://github.com/pradosoft/prado">PRADO</a>/'.getPradoVersion(), |
| 194 | - '%%Time%%' => @strftime('%Y-%m-%d %H:%m',time()), |
|
| 194 | + '%%Time%%' => @strftime('%Y-%m-%d %H:%m', time()), |
|
| 195 | 195 | ); |
| 196 | 196 | |
| 197 | 197 | $lang=getPreferredLanguage(); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | die("Unable to open template file '$templateFile'."); |
| 203 | 203 | |
| 204 | 204 | header('Content-Type: text/html; charset=UTF-8'); |
| 205 | -echo strtr($content,$tokens); |
|
| 205 | +echo strtr($content, $tokens); |
|
| 206 | 206 | |
| 207 | 207 | /** |
| 208 | 208 | * Returns a localized message according to user preferred language. |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | static $messages=null; |
| 215 | 215 | if($messages===null) |
| 216 | 216 | { |
| 217 | - $lang = getPreferredLanguage(); |
|
| 217 | + $lang=getPreferredLanguage(); |
|
| 218 | 218 | $msgFile=dirname(__FILE__)."/messages-$lang.txt"; |
| 219 | 219 | if(!is_file($msgFile)) |
| 220 | 220 | $msgFile=dirname(__FILE__).'/messages.txt'; |
@@ -222,12 +222,12 @@ discard block |
||
| 222 | 222 | { |
| 223 | 223 | foreach($entries as $entry) |
| 224 | 224 | { |
| 225 | - @list($code,$message)=explode('=',$entry,2); |
|
| 225 | + @list($code, $message)=explode('=', $entry, 2); |
|
| 226 | 226 | $messages[trim($code)]=trim($message); |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | - return isset($messages[$token])?$messages[$token]:$token; |
|
| 230 | + return isset($messages[$token]) ? $messages[$token] : $token; |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -243,10 +243,10 @@ discard block |
||
| 243 | 243 | if($languages===null) |
| 244 | 244 | { |
| 245 | 245 | $languages=array(); |
| 246 | - foreach(explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language) |
|
| 246 | + foreach(explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $language) |
|
| 247 | 247 | { |
| 248 | - $array=explode(';q=',trim($language)); |
|
| 249 | - $languages[trim($array[0])]=isset($array[1])?(float)$array[1]:1.0; |
|
| 248 | + $array=explode(';q=', trim($language)); |
|
| 249 | + $languages[trim($array[0])]=isset($array[1]) ? (float) $array[1] : 1.0; |
|
| 250 | 250 | } |
| 251 | 251 | arsort($languages); |
| 252 | 252 | $languages=array_keys($languages); |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | if($language===null) |
| 267 | 267 | { |
| 268 | 268 | $langs=getUserLanguages(); |
| 269 | - $lang=explode('-',$langs[0]); |
|
| 269 | + $lang=explode('-', $langs[0]); |
|
| 270 | 270 | if(empty($lang[0]) || !function_exists('ctype_alpha') || !ctype_alpha($lang[0])) |
| 271 | 271 | $language='en'; |
| 272 | 272 | else |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | { |
| 286 | 286 | $contents=file_get_contents($coreFile); |
| 287 | 287 | $matches=array(); |
| 288 | - if(preg_match('/public static function getVersion.*?return \'(.*?)\'/ms',$contents,$matches)>0) |
|
| 288 | + if(preg_match('/public static function getVersion.*?return \'(.*?)\'/ms', $contents, $matches) > 0) |
|
| 289 | 289 | return $matches[1]; |
| 290 | 290 | } |
| 291 | 291 | return ''; |