@@ -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"), |
@@ -740,89 +740,89 @@ discard block |
||
740 | 740 | */ |
741 | 741 | class PradoCommandLineActiveRecordGenAll extends PradoCommandLineAction { |
742 | 742 | |
743 | - protected $action = 'generateAll'; |
|
744 | - protected $parameters = array('output'); |
|
745 | - protected $optional = array('directory', 'soap', 'overwrite', 'prefix', 'postfix'); |
|
746 | - protected $description = "Generate Active Record skeleton for all Tables to <output> file using application.xml in [directory]. May also generate [soap] properties.\nGenerated Classes are named like the Table with optional [Prefix] and/or [Postfix]. [Overwrite] is used to overwrite existing Files."; |
|
747 | - private $_soap = false; |
|
748 | - private $_prefix = ''; |
|
749 | - private $_postfix = ''; |
|
750 | - private $_overwrite = false; |
|
751 | - |
|
752 | - public function performAction($args) { |
|
753 | - $app_dir = count($args) > 2 ? $this->getAppDir($args[2]) : $this->getAppDir(); |
|
754 | - $this->_soap = count($args) > 3 ? ($args[3] == "soap" || $args[3] == "true" ? true : false) : false; |
|
755 | - $this->_overwrite = count($args) > 4 ? ($args[4] == "overwrite" || $args[4] == "true" ? true : false) : false; |
|
756 | - $this->_prefix = count($args) > 5 ? $args[5] : ''; |
|
757 | - $this->_postfix = count($args) > 6 ? $args[6] : ''; |
|
758 | - |
|
759 | - if ($app_dir !== false) { |
|
760 | - $config = $this->getActiveRecordConfig($app_dir); |
|
761 | - |
|
762 | - $manager = TActiveRecordManager::getInstance(); |
|
763 | - $con = $manager->getDbConnection(); |
|
764 | - $con->Active = true; |
|
765 | - $command = $con->createCommand("Show Tables"); |
|
766 | - $dataReader = $command->query(); |
|
767 | - $dataReader->bindColumn(1, $table); |
|
768 | - $generator = new PHP_Shell_Extensions_ActiveRecord(); |
|
769 | - $tables = array(); |
|
770 | - while ($dataReader->read() !== false) { |
|
771 | - $tables[] = $table; |
|
772 | - } |
|
773 | - $con->Active = False; |
|
774 | - foreach ($tables as $key => $table) { |
|
775 | - $output = $args[1] . "." . $this->_prefix . ucfirst($table) . $this->_postfix; |
|
776 | - if ($config !== false && $output !== false) { |
|
777 | - $generator->generate("generate " . $table . " " . $output . " " . $this->_soap . " " . $this->_overwrite); |
|
778 | - } |
|
779 | - } |
|
780 | - } |
|
781 | - return true; |
|
782 | - } |
|
783 | - |
|
784 | - protected function getAppDir($dir=".") { |
|
785 | - if (is_dir($dir)) |
|
786 | - return realpath($dir); |
|
787 | - if (false !== ($app_dir = realpath($dir . '/protected/')) && is_dir($app_dir)) |
|
788 | - return $app_dir; |
|
789 | - echo '** Unable to find directory "' . $dir . "\".\n"; |
|
790 | - return false; |
|
791 | - } |
|
792 | - |
|
793 | - protected function getXmlFile($app_dir) { |
|
794 | - if (false !== ($xml = realpath($app_dir . '/application.xml')) && is_file($xml)) |
|
795 | - return $xml; |
|
796 | - if (false !== ($xml = realpath($app_dir . '/protected/application.xml')) && is_file($xml)) |
|
797 | - return $xml; |
|
798 | - echo '** Unable to find application.xml in ' . $app_dir . "\n"; |
|
799 | - return false; |
|
800 | - } |
|
801 | - |
|
802 | - protected function getActiveRecordConfig($app_dir) { |
|
803 | - if (false === ($xml = $this->getXmlFile($app_dir))) |
|
804 | - return false; |
|
805 | - if (false !== ($app = $this->initializePradoApplication($app_dir))) { |
|
806 | - Prado::using('System.Data.ActiveRecord.TActiveRecordConfig'); |
|
807 | - foreach ($app->getModules() as $module) |
|
808 | - if ($module instanceof TActiveRecordConfig) |
|
809 | - return $module; |
|
810 | - echo '** Unable to find TActiveRecordConfig module in ' . $xml . "\n"; |
|
811 | - } |
|
812 | - return false; |
|
813 | - } |
|
814 | - |
|
815 | - protected function getOutputFile($app_dir, $namespace) { |
|
816 | - if (is_file($namespace) && strpos($namespace, $app_dir) === 0) |
|
817 | - return $namespace; |
|
818 | - $file = Prado::getPathOfNamespace($namespace, ""); |
|
819 | - if ($file !== null && false !== ($path = realpath(dirname($file))) && is_dir($path)) { |
|
820 | - if (strpos($path, $app_dir) === 0) |
|
821 | - return $file; |
|
822 | - } |
|
823 | - echo '** Output file ' . $file . ' must be within directory ' . $app_dir . "\n"; |
|
824 | - return false; |
|
825 | - } |
|
743 | + protected $action = 'generateAll'; |
|
744 | + protected $parameters = array('output'); |
|
745 | + protected $optional = array('directory', 'soap', 'overwrite', 'prefix', 'postfix'); |
|
746 | + protected $description = "Generate Active Record skeleton for all Tables to <output> file using application.xml in [directory]. May also generate [soap] properties.\nGenerated Classes are named like the Table with optional [Prefix] and/or [Postfix]. [Overwrite] is used to overwrite existing Files."; |
|
747 | + private $_soap = false; |
|
748 | + private $_prefix = ''; |
|
749 | + private $_postfix = ''; |
|
750 | + private $_overwrite = false; |
|
751 | + |
|
752 | + public function performAction($args) { |
|
753 | + $app_dir = count($args) > 2 ? $this->getAppDir($args[2]) : $this->getAppDir(); |
|
754 | + $this->_soap = count($args) > 3 ? ($args[3] == "soap" || $args[3] == "true" ? true : false) : false; |
|
755 | + $this->_overwrite = count($args) > 4 ? ($args[4] == "overwrite" || $args[4] == "true" ? true : false) : false; |
|
756 | + $this->_prefix = count($args) > 5 ? $args[5] : ''; |
|
757 | + $this->_postfix = count($args) > 6 ? $args[6] : ''; |
|
758 | + |
|
759 | + if ($app_dir !== false) { |
|
760 | + $config = $this->getActiveRecordConfig($app_dir); |
|
761 | + |
|
762 | + $manager = TActiveRecordManager::getInstance(); |
|
763 | + $con = $manager->getDbConnection(); |
|
764 | + $con->Active = true; |
|
765 | + $command = $con->createCommand("Show Tables"); |
|
766 | + $dataReader = $command->query(); |
|
767 | + $dataReader->bindColumn(1, $table); |
|
768 | + $generator = new PHP_Shell_Extensions_ActiveRecord(); |
|
769 | + $tables = array(); |
|
770 | + while ($dataReader->read() !== false) { |
|
771 | + $tables[] = $table; |
|
772 | + } |
|
773 | + $con->Active = False; |
|
774 | + foreach ($tables as $key => $table) { |
|
775 | + $output = $args[1] . "." . $this->_prefix . ucfirst($table) . $this->_postfix; |
|
776 | + if ($config !== false && $output !== false) { |
|
777 | + $generator->generate("generate " . $table . " " . $output . " " . $this->_soap . " " . $this->_overwrite); |
|
778 | + } |
|
779 | + } |
|
780 | + } |
|
781 | + return true; |
|
782 | + } |
|
783 | + |
|
784 | + protected function getAppDir($dir=".") { |
|
785 | + if (is_dir($dir)) |
|
786 | + return realpath($dir); |
|
787 | + if (false !== ($app_dir = realpath($dir . '/protected/')) && is_dir($app_dir)) |
|
788 | + return $app_dir; |
|
789 | + echo '** Unable to find directory "' . $dir . "\".\n"; |
|
790 | + return false; |
|
791 | + } |
|
792 | + |
|
793 | + protected function getXmlFile($app_dir) { |
|
794 | + if (false !== ($xml = realpath($app_dir . '/application.xml')) && is_file($xml)) |
|
795 | + return $xml; |
|
796 | + if (false !== ($xml = realpath($app_dir . '/protected/application.xml')) && is_file($xml)) |
|
797 | + return $xml; |
|
798 | + echo '** Unable to find application.xml in ' . $app_dir . "\n"; |
|
799 | + return false; |
|
800 | + } |
|
801 | + |
|
802 | + protected function getActiveRecordConfig($app_dir) { |
|
803 | + if (false === ($xml = $this->getXmlFile($app_dir))) |
|
804 | + return false; |
|
805 | + if (false !== ($app = $this->initializePradoApplication($app_dir))) { |
|
806 | + Prado::using('System.Data.ActiveRecord.TActiveRecordConfig'); |
|
807 | + foreach ($app->getModules() as $module) |
|
808 | + if ($module instanceof TActiveRecordConfig) |
|
809 | + return $module; |
|
810 | + echo '** Unable to find TActiveRecordConfig module in ' . $xml . "\n"; |
|
811 | + } |
|
812 | + return false; |
|
813 | + } |
|
814 | + |
|
815 | + protected function getOutputFile($app_dir, $namespace) { |
|
816 | + if (is_file($namespace) && strpos($namespace, $app_dir) === 0) |
|
817 | + return $namespace; |
|
818 | + $file = Prado::getPathOfNamespace($namespace, ""); |
|
819 | + if ($file !== null && false !== ($path = realpath(dirname($file))) && is_dir($path)) { |
|
820 | + if (strpos($path, $app_dir) === 0) |
|
821 | + return $file; |
|
822 | + } |
|
823 | + echo '** Output file ' . $file . ' must be within directory ' . $app_dir . "\n"; |
|
824 | + return false; |
|
825 | + } |
|
826 | 826 | |
827 | 827 | } |
828 | 828 | |
@@ -830,20 +830,20 @@ discard block |
||
830 | 830 | if(class_exists('PHP_Shell_Commands', false)) |
831 | 831 | { |
832 | 832 | class PHP_Shell_Extensions_ActiveRecord implements PHP_Shell_Extension { |
833 | - public function register() |
|
834 | - { |
|
833 | + public function register() |
|
834 | + { |
|
835 | 835 | |
836 | - $cmd = PHP_Shell_Commands::getInstance(); |
|
836 | + $cmd = PHP_Shell_Commands::getInstance(); |
|
837 | 837 | if(Prado::getApplication() !== null) |
838 | 838 | { |
839 | - $cmd->registerCommand('#^generate#', $this, 'generate', 'generate <table> <output> [soap]', |
|
840 | - 'Generate Active Record skeleton for <table> to <output> file using'.PHP_EOL. |
|
841 | - ' application.xml in [directory]. May also generate [soap] properties.'); |
|
839 | + $cmd->registerCommand('#^generate#', $this, 'generate', 'generate <table> <output> [soap]', |
|
840 | + 'Generate Active Record skeleton for <table> to <output> file using'.PHP_EOL. |
|
841 | + ' application.xml in [directory]. May also generate [soap] properties.'); |
|
842 | 842 | } |
843 | - } |
|
843 | + } |
|
844 | 844 | |
845 | - public function generate($l) |
|
846 | - { |
|
845 | + public function generate($l) |
|
846 | + { |
|
847 | 847 | $input = explode(" ", trim($l)); |
848 | 848 | if(count($input) > 2) |
849 | 849 | { |
@@ -860,12 +860,12 @@ discard block |
||
860 | 860 | { |
861 | 861 | echo "\n Usage: generate table_name Application.pages.RecordClassName\n"; |
862 | 862 | } |
863 | - } |
|
863 | + } |
|
864 | 864 | } |
865 | 865 | |
866 | 866 | $__shell_exts = PHP_Shell_Extensions::getInstance(); |
867 | 867 | $__shell_exts->registerExtensions(array( |
868 | - "active-record" => new PHP_Shell_Extensions_ActiveRecord)); /* the :set command */ |
|
868 | + "active-record" => new PHP_Shell_Extensions_ActiveRecord)); /* the :set command */ |
|
869 | 869 | |
870 | 870 | include_once(realpath(dirname(dirname(__FILE__))).'/framework/3rdParty/PhpShell/php-shell-cmd.php'); |
871 | 871 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function __construct($control) |
63 | 63 | { |
64 | - $this->setControl($control); |
|
64 | + $this->setControl($control); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function setControl($control) |
73 | 73 | { |
74 | 74 | if(!$control instanceof IJuiOptions) |
75 | - throw new THttpException(500,'juioptions_control_invalid',$control->ID); |
|
75 | + throw new THttpException(500,'juioptions_control_invalid',$control->ID); |
|
76 | 76 | $this->_control=$control; |
77 | 77 | } |
78 | 78 |
@@ -120,11 +120,11 @@ discard block |
||
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
123 | - /** |
|
124 | - * Clears all existing selections on the client side. |
|
125 | - */ |
|
126 | - public function clearSelection() |
|
127 | - { |
|
123 | + /** |
|
124 | + * Clears all existing selections on the client side. |
|
125 | + */ |
|
126 | + public function clearSelection() |
|
127 | + { |
|
128 | 128 | if($this->canUpdateClientSide()) |
129 | 129 | { |
130 | 130 | $this->updateListItems(); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $this->getPage()->getCallbackClient()->select($this->getControl(), 'Clear'); |
138 | 138 | } |
139 | 139 | } |
140 | - } |
|
140 | + } |
|
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Update the client-side list options. |
@@ -78,8 +78,8 @@ |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
81 | - * Publish the ajax script |
|
82 | - */ |
|
81 | + * Publish the ajax script |
|
82 | + */ |
|
83 | 83 | public function onPreRender($param) |
84 | 84 | { |
85 | 85 | parent::onPreRender($param); |
@@ -173,15 +173,15 @@ |
||
173 | 173 | { |
174 | 174 | if(($forControl=$this->getForControl())==='') |
175 | 175 | throw new TConfigurationException('keyboard_forcontrol_required'); |
176 | - if(($target=$this->findControl($forControl))===null) |
|
177 | - throw new TConfigurationException('keyboard_forcontrol_invalid',$forControl); |
|
176 | + if(($target=$this->findControl($forControl))===null) |
|
177 | + throw new TConfigurationException('keyboard_forcontrol_invalid',$forControl); |
|
178 | 178 | |
179 | - $options['ID'] = $this->getClientID(); |
|
180 | - $options['ForControl'] = $target->getClientID(); |
|
181 | - $options['AutoHide'] = $this->getAutoHide(); |
|
182 | - $options['CssClass'] = $this->getKeyboardCssClass(); |
|
179 | + $options['ID'] = $this->getClientID(); |
|
180 | + $options['ForControl'] = $target->getClientID(); |
|
181 | + $options['AutoHide'] = $this->getAutoHide(); |
|
182 | + $options['CssClass'] = $this->getKeyboardCssClass(); |
|
183 | 183 | |
184 | - return $options; |
|
184 | + return $options; |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 |
@@ -19,7 +19,6 @@ |
||
19 | 19 | * |
20 | 20 | * The following property is provided by TDataRenderer: |
21 | 21 | * - {@link getData Data}: data associated with this renderer. |
22 | - |
|
23 | 22 | * @author Qiang Xue <[email protected]> |
24 | 23 | * @package System.Web.UI.WebControls |
25 | 24 | * @since 3.1.2 |
@@ -463,14 +463,14 @@ |
||
463 | 463 | */ |
464 | 464 | public function getIsValid() |
465 | 465 | { |
466 | - return $this->_isValid; |
|
466 | + return $this->_isValid; |
|
467 | 467 | } |
468 | 468 | /** |
469 | 469 | * @param bool wether this control is valid. |
470 | 470 | */ |
471 | 471 | public function setIsValid($value) |
472 | 472 | { |
473 | - $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
473 | + $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /** |
@@ -463,14 +463,14 @@ |
||
463 | 463 | */ |
464 | 464 | public function getIsValid() |
465 | 465 | { |
466 | - return $this->_isValid; |
|
466 | + return $this->_isValid; |
|
467 | 467 | } |
468 | 468 | /** |
469 | 469 | * @param bool wether this control is valid. |
470 | 470 | */ |
471 | 471 | public function setIsValid($value) |
472 | 472 | { |
473 | - $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
473 | + $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /** |