diff --git a/classes/httprequest/XEHttpRequest.class.php b/classes/httprequest/XEHttpRequest.class.php
index 621676cf5..05cb3c271 100644
--- a/classes/httprequest/XEHttpRequest.class.php
+++ b/classes/httprequest/XEHttpRequest.class.php
@@ -1,21 +1,32 @@
__construct($xml_path);
}
+ /**
+ * @constructor
+ * @param string $xml_path
+ * @return void
+ */
function __construct($xml_path='') {
$this->_rules = array();
$this->_filters = array();
@@ -42,6 +83,10 @@ class Validator
$this->setCacheDir('./files/cache');
}
+ /**
+ * @destructor
+ * @return void
+ */
function __destruct() {
$this->_rules = null;
$this->_filters = null;
@@ -49,7 +94,8 @@ class Validator
/**
* Load a xml file
- * @param[in] string $xml_path A file name to be loaded
+ * @param string $xml_path A file name to be loaded
+ * @return boolean
*/
function load($xml_path) {
$this->_xml_ruleset = null;
@@ -116,7 +162,8 @@ class Validator
/**
* Set root cache directory
- * @param[in] string $cache_dir Root cache directory
+ * @param string $cache_dir Root cache directory
+ * @return void
*/
function setCacheDir($cache_dir){
if(is_dir($cache_dir)) {
@@ -126,8 +173,8 @@ class Validator
/**
* Validate the fields. If the fields aren't passed, validation will be execute on the Context variables.
- * @param[in] (optional) array $fields Target fields. The keys of the array represents field's name, its values represents field's value.
- * @return bool True if it is valid, FALSE otherwise.
+ * @param array $fields Target fields. The keys of the array represents field's name, its values represents field's value.
+ * @return boolean TRUE if it is valid, FALSE otherwise.
*/
function validate($fields_=null) {
if(is_array($fields_)) {
@@ -245,6 +292,8 @@ class Validator
/**
* apply trim recursive
+ * @param string|array $array
+ * @return string|array
*/
function arrayTrim($array)
{
@@ -260,8 +309,8 @@ class Validator
/**
* Log an error
- * @param[in] $msg error message
- * @return always false
+ * @param $msg error message
+ * @return boolean always false
*/
function error($field, $msg){
$lang_filter = Context::getLang('filter');
@@ -283,8 +332,9 @@ class Validator
/**
* Add a new rule
- * @param[in] string $name rule name
- * @param[in] mixed $rule
+ * @param string $name rule name
+ * @param mixed $rule
+ * @return void
*/
function addRule($name, $rule=''){
if(is_array($name)) $args = $name;
@@ -305,12 +355,19 @@ class Validator
/**
* Remove a rule
- * @param[in] string $name rule name
+ * @param string $name rule name
+ * @return void
*/
function removeRule($name){
unset($this->_rules[$name]);
}
+ /**
+ * add filter to filter list
+ * @param string $name rule name
+ * @param string $filter filter
+ * @return void
+ */
function addFilter($name, $filter='') {
if(is_array($name)) $args = $name;
else $args = array($name=>$filter);
@@ -331,15 +388,20 @@ class Validator
}
}
+ /**
+ * remove filter from filter list
+ * @param string $name rule name
+ * @return void
+ */
function removeFilter($name) {
unset($this->_filters[$name]);
}
/**
* Find whether the field is valid with the rule
- * @param[in] string $name rule name
- * @param[in] string $value a value to be validated
- * @return bool TRUE if the field is valid, FALSE otherwise.
+ * @param string $name rule name
+ * @param string $value a value to be validated
+ * @return boolean TRUE if the field is valid, FALSE otherwise.
*/
function applyRule($name, $value){
$rule = $this->_rules[$name];
@@ -365,7 +427,9 @@ class Validator
}
/**
- * Return
+ * if not supported 'mb_strlen' function, this method can use.
+ * @param string $str
+ * @return int
*/
function mbStrLen($str){
$arr = count_chars($str);
@@ -411,7 +475,7 @@ class Validator
/**
* Compile a ruleset to a javascript file
- * @private
+ * @return string
*/
function _compile2js() {
global $lang;
diff --git a/classes/xml/GeneralXmlParser.class.php b/classes/xml/GeneralXmlParser.class.php
index becf581d4..a4421c28d 100644
--- a/classes/xml/GeneralXmlParser.class.php
+++ b/classes/xml/GeneralXmlParser.class.php
@@ -1,18 +1,23 @@
output;
}
- /**
- * @brief start element handler
- * @param[in] $parse an instance of parser
- * @param[in] $node_name a name of node
- * @param[in] $attrs attributes to be set
- */
+ /**
+ * Start element handler
+ * @param resource $parser an instance of parser
+ * @param string $node_name a name of node
+ * @param array $attrs attributes to be set
+ * @return void
+ */
function _tagOpen($parser, $node_name, $attrs) {
$obj->node_name = strtolower($node_name);
$obj->attrs = $attrs;
@@ -42,23 +48,25 @@
array_push($this->output, $obj);
}
- /**
- * @brief character data handler
- * variable in the last element of this->output
- * @param[in] $parse an instance of parser
- * @param[in] $body a data to be added
- */
+ /**
+ * Character data handler
+ * Variable in the last element of this->output
+ * @param resource $parse an instance of parser
+ * @param string $body a data to be added
+ * @return void
+ */
function _tagBody($parser, $body) {
//if(!trim($body)) return;
$this->output[count($this->output)-1]->body .= $body;
}
- /**
- * @brief end element handler
- * @param[in] $parse an instance of parser
- * @param[in] $node_name name of xml node
- */
+ /**
+ * End element handler
+ * @param resource $parse an instance of parser
+ * @param string $node_name name of xml node
+ * @return void
+ */
function _tagClosed($parser, $node_name) {
$node_name = strtolower($node_name);
$cur_obj = array_pop($this->output);
@@ -79,5 +87,5 @@
}
}
- }
+}
?>
diff --git a/classes/xml/XmlGenerator.class.php b/classes/xml/XmlGenerator.class.php
index 5956c2bea..dbe221773 100644
--- a/classes/xml/XmlGenerator.class.php
+++ b/classes/xml/XmlGenerator.class.php
@@ -1,7 +1,16 @@
\n";
@@ -11,6 +20,11 @@ class XmlGenerator{
return $buff;
}
+ /**
+ * object change to xml
+ * @param object $node node in xml object
+ * @return string
+ */
function _makexml($node){
$body = '';
foreach($node as $key => $value){
diff --git a/classes/xml/XmlJsFilter.class.php b/classes/xml/XmlJsFilter.class.php
index db1bae032..7f1c2190f 100644
--- a/classes/xml/XmlJsFilter.class.php
+++ b/classes/xml/XmlJsFilter.class.php
@@ -1,13 +1,10 @@
{
*
{
* - syntax description of