diff --git a/framework/control.class.php b/framework/control.class.php index 790c16393f..41322fb2bd 100755 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -207,9 +207,9 @@ class control /** * Load the model file of one module. * - * @param string $methodName The method name, if empty, use current module's name. + * @param string $methodName The method name, if empty, use current module's name. * @access public - * @return void + * @return object|bool If no model file, return false. Else return the model object. */ public function loadModel($moduleName = '') { @@ -255,10 +255,10 @@ class control /** * Set the view file, thus can use fetch other module's page. * - * @param string $moduleName module name - * @param string $methodName method name + * @param string $moduleName module name + * @param string $methodName method name * @access private - * @return string the view file + * @return string the view file */ private function setViewFile($moduleName, $methodName) { @@ -284,7 +284,7 @@ class control * * @param string $viewFile * @access public - * @return string + * @return string|bool If extension view file exists, return the path. Else return fasle. */ public function getExtViewFile($viewFile) { @@ -295,6 +295,7 @@ class control helper::cd($extPath); return $extViewFile; } + return false; } /** @@ -324,10 +325,10 @@ class control /** * Parse view file. * - * @param string $moduleName module name, if empty, use current module. - * @param string $methodName method name, if empty, use current method. + * @param string $moduleName module name, if empty, use current module. + * @param string $methodName method name, if empty, use current method. * @access public - * @return the parsed result. + * @return string the parsed result. */ public function parse($moduleName = '', $methodName = '') { @@ -407,7 +408,7 @@ class control * @param string $methodName method name. * @param array $params params. * @access public - * @return string + * @return string the parsed html. */ public function fetch($moduleName = '', $methodName = '', $params = array()) { @@ -469,12 +470,12 @@ class control /** * Create a link to one method of one module. * - * @param string $moduleName module name - * @param string $methodName method name - * @param mixed $vars the params passwd, can be array(key=>value) or key1=value1&key2=value2 - * @param string $viewType the view type + * @param string $moduleName module name + * @param string $methodName method name + * @param string|array $vars the params passed, can be array(key=>value) or key1=value1&key2=value2 + * @param string $viewType the view type * @access public - * @return string + * @return string the link string. */ public function createLink($moduleName, $methodName = 'index', $vars = array(), $viewType = '') { @@ -485,11 +486,11 @@ class control /** * Create a link to the inner method of current module. * - * @param string $methodName method name - * @param mixed $vars the params passwd, can be array(key=>value) or key1=value1&key2=value2 - * @param string $viewType the view type + * @param string $methodName method name + * @param string|array $vars the params passed, can be array(key=>value) or key1=value1&key2=value2 + * @param string $viewType the view type * @access public - * @return string + * @return string the link string. */ public function inlink($methodName = 'index', $vars = array(), $viewType = '') { diff --git a/framework/helper.class.php b/framework/helper.class.php index 0fa824bc4b..ed1447f34b 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -29,7 +29,7 @@ class helper * @param mixed $value the value to be set. * @static * @access public - * @return void + * @return bool */ static public function setMember($objName, $key, $value) { @@ -39,6 +39,7 @@ class helper $value = serialize($value); $code = ("\$${objName}->{$key}=unserialize(<< 'value1', 'var2' => 'value2'); * ?> * - * @param string $moduleName module name - * @param string $methodName method name - * @param mixed $vars the params passed to the method, can be array('key' => 'value') or key1=value1&key2=value2) or key1=value1&key2=value2 - * @param string $viewType the view type + * @param string $moduleName module name + * @param string $methodName method name + * @param string|array $vars the params passed to the method, can be array('key' => 'value') or key1=value1&key2=value2) or key1=value1&key2=value2 + * @param string $viewType the view type * @static * @access public - * @return string + * @return string the link string. */ static public function createLink($moduleName, $methodName = 'index', $vars = '', $viewType = '') { @@ -139,10 +140,10 @@ class helper /** * Set the model file of one module. If there's an extension file, merge it with the main model file. * - * @param string $moduleName the module name + * @param string $moduleName the module name * @static * @access public - * @return string the model file + * @return string the model file */ static public function setModelFile($moduleName) { @@ -202,10 +203,10 @@ class helper /** * Create the in('a', 'b') string. * - * @param misc $ids the id lists, can be a array or a string with ids joined with comma. + * @param string|array $ids the id lists, can be a array or a string with ids joined with comma. * @static * @access public - * @return string + * @return string the string like IN('a', 'b'). */ static public function dbIN($ids) { @@ -219,7 +220,7 @@ class helper * @param string $string the string to encode. * @static * @access public - * @return string + * @return string encoded string. */ static public function safe64Encode($string) { @@ -232,7 +233,7 @@ class helper * @param string $string the string to decode * @static * @access public - * @return string + * @return string decoded string. */ static public function safe64Decode($string) { @@ -245,7 +246,7 @@ class helper * @param date $date1 the first date. * @param date $date2 the sencode date. * @access public - * @return string the diff of the two days. + * @return int the diff of the two days. */ static public function diffDate($date1, $date2) { @@ -278,7 +279,7 @@ class helper * Judge a date is zero or not. * * @access public - * @return date today + * @return bool */ static public function isZeroDate($date) { @@ -313,10 +314,10 @@ class helper /** * The short alias of helper::createLink() method. * - * @param string $methodName the method name - * @param mixed $vars the vars to passed - * @param string $viewType - * @return string + * @param string $methodName the method name + * @param string|array $vars the params passed to the method, can be array('key' => 'value') or key1=value1&key2=value2) + * @param string $viewType + * @return string the link string. */ function inLink($methodName = 'index', $vars = '', $viewType = '') { @@ -342,7 +343,7 @@ function cycle($items) * Get current microtime. * * @access protected - * @return float current time. + * @return float current time. */ function getTime() { diff --git a/framework/model.class.php b/framework/model.class.php index 87ec8ce215..c5c8414133 100755 --- a/framework/model.class.php +++ b/framework/model.class.php @@ -137,7 +137,7 @@ class model * loaded by loadModel() so we must get the module name of thie model. * * @access protected - * @return string the module name. + * @return string the module name. */ protected function getModuleName() { @@ -168,7 +168,7 @@ class model * * @param string $moduleName * @access public - * @return object the model object + * @return object|bool the model object or false if model file not exists. */ public function loadModel($moduleName) { diff --git a/framework/router.class.php b/framework/router.class.php index 50c35c14d5..2836eeb2c4 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -832,7 +832,7 @@ class router * * @param string $varName PATH_INFO, ORIG_PATH_INFO * @access private - * @return string the PATH_INFO + * @return string the PATH_INFO */ private function getPathInfo($varName) { @@ -867,7 +867,7 @@ class router /** * Get the $URL * - * @param bool $full true, the URI contains the webRoot, else only hte URI. + * @param bool $full true, the URI contains the webRoot, else only hte URI. * @access public * @return string */ @@ -902,7 +902,7 @@ class router * This method should called manually in the router file(www/index.php) after the $lang, $config, $dbh loadde. * * @access public - * @return object + * @return object|bool the common control object or false if not exits. */ public function loadCommon() { @@ -966,9 +966,9 @@ class router /** * Get the path of one module. * - * @param string $moduleName the module name + * @param string $moduleName the module name * @access public - * @return string the module path + * @return string the module path */ public function getModulePath($moduleName = '') { @@ -979,10 +979,10 @@ class router /** * Get extension path of one module. * - * @param mixed $moduleName the module name - * @param mixed $ext the extension type, can be control|model|view|lang|config - * @access public - * @return string the extension path. + * @param string $moduleName the module name + * @param string $ext the extension type, can be control|model|view|lang|config + * @access public + * @return string the extension path. */ public function getModuleExtPath($moduleName, $ext) { @@ -1066,7 +1066,7 @@ class router * 4. call the method by call_user_function_array * * @access public - * @return void + * @return bool|object if the module object of die. */ public function loadModule() { @@ -1172,7 +1172,7 @@ class router * @param array $defaultParams the default params defined by the method. * @param array $passedParams the params passed in through url. * @access private - * @return array + * @return array the merged params. */ private function mergeParams($defaultParams, $passedParams) { @@ -1292,10 +1292,10 @@ class router * * First search in $appLibRoot, then $coreLibRoot. * - * @param mixed $className the class name - * @param mixed $static statis class or not - * @access public - * @return object the instance of the class + * @param string $className the class name + * @param bool $static statis class or not + * @access public + * @return object|bool the instance of the class or just true. */ public function loadClass($className, $static = false) { @@ -1318,7 +1318,7 @@ class router helper::import($classFile); /* If staitc, return. */ - if($static) return; + if($static) return true; /* Instance it. */ global $$className; @@ -1332,10 +1332,10 @@ class router * * If the module is common, search in $configRoot, else in $modulePath. * - * @param mixed $moduleName module name - * @param bool $exitIfNone exit or not - * @access public - * @return object + * @param string $moduleName module name + * @param bool $exitIfNone exit or not + * @access public + * @return object|bool the config object or false. */ public function loadConfig($moduleName, $exitIfNone = true) { @@ -1357,7 +1357,7 @@ class router if(!file_exists($mainConfigFile)) { if($exitIfNone) self::error("config file $mainConfigFile not found", __FILE__, __LINE__, true); - if(empty($extConfigFiles)) return; // and no extension file, exit. + if(empty($extConfigFiles)) return false; // and no extension file, exit. $configFiles = $extConfigFiles; } else @@ -1402,9 +1402,9 @@ class router /** * Load lang and return it as the global lang object. * - * @param mixed $moduleName the module name - * @access public - * @return void + * @param string $moduleName the module name + * @access public + * @return bool|ojbect the lang object or false. */ public function loadLang($moduleName) { @@ -1416,7 +1416,7 @@ class router /* Set the files to includ. */ if(!file_exists($mainLangFile)) { - if(empty($extLangFiles)) return; // also no extension file. + if(empty($extLangFiles)) return false; // also no extension file. $langFiles = $extLangFiles; } else @@ -1443,13 +1443,13 @@ class router * Connect to database. * * @access public - * @return object + * @return object|bool the database handler. */ public function connectDB() { global $config, $dbh; if(!isset($config->db->driver)) self::error('no pdo driver defined, it should be mysql or sqlite', __FILE__, __LINE__, $exit = true); - if(!isset($config->db->user)) return; + if(!isset($config->db->user)) return false; if($config->db->driver == 'mysql') { $dsn = "mysql:host={$config->db->host}; port={$config->db->port}; dbname={$config->db->name}"; @@ -1525,10 +1525,10 @@ class language /** * Show a member * - * @param mixed $obj the object - * @param mixed $key the key - * @access public - * @return void + * @param object $obj the object + * @param string $key the key + * @access public + * @return void */ public function show($obj, $key) { @@ -1547,9 +1547,9 @@ class super /** * Construct, set the var scope. * - * @param mixed $scope the score, can be server, post, get, cookie, session, global - * @access public - * @return void + * @param string $scope the score, can be server, post, get, cookie, session, global + * @access public + * @return void */ public function __construct($scope) { @@ -1559,10 +1559,10 @@ class super /** * Set one member value. * - * @param mixed $key the key - * @param mixed $value the value - * @access public - * @return void + * @param string the key + * @param mixed $value the value + * @access public + * @return void */ public function set($key, $value) { @@ -1599,9 +1599,9 @@ class super /** * The magic get method. * - * @param mixed $key the key + * @param string $key the key * @access public - * @return mixed + * @return mixed|bool return the value of the key or false. */ public function __get($key) {