@@ -28,6 +28,10 @@ |
||
| 28 | 28 | $function = new \Twig_SimpleFunction('I','I'); |
| 29 | 29 | $this->twig->addFunction($function); |
| 30 | 30 | } |
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * @param string $name |
|
| 34 | + */ |
|
| 31 | 35 | protected function assign($name, $value = '') |
| 32 | 36 | { |
| 33 | 37 | if (is_array($name)) { |
@@ -62,6 +62,10 @@ |
||
| 62 | 62 | self::param(); |
| 63 | 63 | self::exec($class,ACTION_NAME); |
| 64 | 64 | } |
| 65 | + |
|
| 66 | + /** |
|
| 67 | + * @param string $function |
|
| 68 | + */ |
|
| 65 | 69 | static public function exec($class,$function){ |
| 66 | 70 | $method = new \ReflectionMethod($class, $function); |
| 67 | 71 | if ($method->isPublic() && !$method->isStatic()) { |
@@ -46,8 +46,8 @@ |
||
| 46 | 46 | * |
| 47 | 47 | * pass values when class is istantiated |
| 48 | 48 | * |
| 49 | - * @param numeric $_perPage sets the number of iteems per page |
|
| 50 | - * @param numeric $_instance sets the instance for the GET parameter |
|
| 49 | + * @param numeric $perPage sets the number of iteems per page |
|
| 50 | + * @param numeric $instance sets the instance for the GET parameter |
|
| 51 | 51 | */ |
| 52 | 52 | public function __construct($perPage,$instance){ |
| 53 | 53 | $this->_instance = $instance; |
@@ -1098,7 +1098,7 @@ discard block |
||
| 1098 | 1098 | * @access protected |
| 1099 | 1099 | * @param string $value 字段值 |
| 1100 | 1100 | * @param mixed $rule 验证规则 |
| 1101 | - * @return mixed |
|
| 1101 | + * @return boolean |
|
| 1102 | 1102 | */ |
| 1103 | 1103 | protected function allowIp($value, $rule) |
| 1104 | 1104 | { |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | * @access protected |
| 1111 | 1111 | * @param string $value 字段值 |
| 1112 | 1112 | * @param mixed $rule 验证规则 |
| 1113 | - * @return mixed |
|
| 1113 | + * @return boolean |
|
| 1114 | 1114 | */ |
| 1115 | 1115 | protected function denyIp($value, $rule) |
| 1116 | 1116 | { |
@@ -1121,8 +1121,8 @@ discard block |
||
| 1121 | 1121 | * 使用正则验证数据 |
| 1122 | 1122 | * @access protected |
| 1123 | 1123 | * @param mixed $value 字段值 |
| 1124 | - * @param mixed $rule 验证规则 正则规则或者预定义正则名 |
|
| 1125 | - * @return mixed |
|
| 1124 | + * @param string $rule 验证规则 正则规则或者预定义正则名 |
|
| 1125 | + * @return boolean |
|
| 1126 | 1126 | */ |
| 1127 | 1127 | protected function regex($value, $rule) |
| 1128 | 1128 | { |
@@ -1140,7 +1140,7 @@ discard block |
||
| 1140 | 1140 | * 验证表单令牌 |
| 1141 | 1141 | * @access protected |
| 1142 | 1142 | * @param mixed $value 字段值 |
| 1143 | - * @param mixed $rule 验证规则 |
|
| 1143 | + * @param string $rule 验证规则 |
|
| 1144 | 1144 | * @param array $data 数据 |
| 1145 | 1145 | * @return bool |
| 1146 | 1146 | */ |
@@ -58,6 +58,10 @@ |
||
| 58 | 58 | public function update($data){ |
| 59 | 59 | return $this->db->update($this->table,$data); |
| 60 | 60 | } |
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * @param string $field |
|
| 64 | + */ |
|
| 61 | 65 | public function field($field){ |
| 62 | 66 | $this->field=$field; |
| 63 | 67 | return $this; |
@@ -50,6 +50,10 @@ |
||
| 50 | 50 | $this->restoreTimezone(); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | + /** |
|
| 54 | + * @param integer $past |
|
| 55 | + * @param integer $now |
|
| 56 | + */ |
|
| 53 | 57 | public function inStamp($past, $now = null) { |
| 54 | 58 | if($now==null){ |
| 55 | 59 | $now=time(); |
@@ -57,6 +57,9 @@ discard block |
||
| 57 | 57 | $this->msg=$this->prefix.str_replace( '%%%%', $this->url, $this->msg); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | + /** |
|
| 61 | + * @param string $url |
|
| 62 | + */ |
|
| 60 | 63 | function setChacha($url ){ |
| 61 | 64 | $url = strtolower($url); |
| 62 | 65 | $arr = array( |
@@ -114,6 +117,10 @@ discard block |
||
| 114 | 117 | } |
| 115 | 118 | |
| 116 | 119 | //随机把一个字符转为拼音 |
| 120 | + |
|
| 121 | + /** |
|
| 122 | + * @param string $str |
|
| 123 | + */ |
|
| 117 | 124 | function setPinyin($str) { |
| 118 | 125 | $py = mt_rand(0, iconv_strlen( $str, 'UTF-8' )-1); |
| 119 | 126 | $t_str = iconv_substr( $str, $py, 1, 'UTF-8'); |
@@ -146,6 +153,10 @@ discard block |
||
| 146 | 153 | } |
| 147 | 154 | |
| 148 | 155 | //随机插入不影响阅读的字符 |
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * @param string $str |
|
| 159 | + */ |
|
| 149 | 160 | function setBlankness($str) { |
| 150 | 161 | $blankness = array(" ", ' ', '҉','̅̅','̲','̲̲','̅','̲̲̅̅'); |
| 151 | 162 | $len = iconv_strlen( $str, 'UTF-8' ); |
@@ -72,8 +72,7 @@ discard block |
||
| 72 | 72 | /** |
| 73 | 73 | * 创建类的实例 |
| 74 | 74 | * @access public |
| 75 | - * @param string $class 类名或者标识 |
|
| 76 | - * @param array $args 变量 |
|
| 75 | + * @param array $vars 变量 |
|
| 77 | 76 | * @return object |
| 78 | 77 | */ |
| 79 | 78 | public function make($abstract, $vars = []) |
@@ -98,7 +97,7 @@ discard block |
||
| 98 | 97 | /** |
| 99 | 98 | * 执行函数或者闭包方法 支持参数调用 |
| 100 | 99 | * @access public |
| 101 | - * @param string|array|\Closure $function 函数或者闭包 |
|
| 100 | + * @param \Closure $function 函数或者闭包 |
|
| 102 | 101 | * @param array $vars 变量 |
| 103 | 102 | * @return mixed |
| 104 | 103 | */ |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | /** |
| 96 | 96 | * session管理函数 |
| 97 | - * @param string|array $name session名称 如果为数组则表示进行session设置 |
|
| 97 | + * @param string $name session名称 如果为数组则表示进行session设置 |
|
| 98 | 98 | * @param mixed $value session值 |
| 99 | 99 | * @return mixed |
| 100 | 100 | */ |
@@ -407,6 +407,11 @@ discard block |
||
| 407 | 407 | $value .= ' '; |
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | +/** |
|
| 411 | + * @param string $name |
|
| 412 | + * |
|
| 413 | + * @return string|null |
|
| 414 | + */ |
|
| 410 | 415 | function config($name=null,$value=null,$default=null){ |
| 411 | 416 | $config=\puck\Conf::load(); |
| 412 | 417 | if ($name===null){ |