mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-12 05:22:35 +09:00
Issue 2759: Update code comments for database classes
git-svn-id: http://xe-core.googlecode.com/svn/branches/luminous@12416 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
9d9914ff3b
commit
d2872f1ac4
1 changed files with 104 additions and 91 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
if(!defined('__XE_LOADED_XML_CLASS__')){
|
/**
|
||||||
|
* File containing the XE 1.5 XmlQueryParserClass
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(!defined('__XE_LOADED_XML_CLASS__')){
|
||||||
define('__XE_LOADED_XML_CLASS__', 1);
|
define('__XE_LOADED_XML_CLASS__', 1);
|
||||||
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/query/QueryTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/query/QueryTag.class.php');
|
||||||
|
|
@ -32,31 +36,24 @@
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/SortQueryArgument.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/SortQueryArgument.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/DefaultValue.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/DefaultValue.class.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New XmlQueryParser class
|
* New XmlQueryParser class
|
||||||
* @author NHN (developers@xpressengine.com)
|
* Parses XE XML query files
|
||||||
* @brief case to parse XE xml query
|
|
||||||
* @version 0.1
|
|
||||||
*
|
*
|
||||||
* @todo need to support extend query such as subquery, union
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
* @todo include info about column types for parsing user input
|
* @package dbclasses
|
||||||
*/
|
*/
|
||||||
class XmlQueryParser extends XmlParser {
|
class XmlQueryParser extends XmlParser {
|
||||||
/**
|
|
||||||
* constructor
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function XmlQueryParser(){
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create XmlQueryParser instance for Singleton
|
* Create XmlQueryParser instance for Singleton
|
||||||
* @return XmlQueryParser object
|
* @return XmlQueryParser object
|
||||||
*/
|
*/
|
||||||
function &getInstance(){
|
function &getInstance()
|
||||||
static $theInstance = null;
|
{
|
||||||
|
static $theInstance = NULL;
|
||||||
if(!isset($theInstance)){
|
if(!isset($theInstance)){
|
||||||
$theInstance = new XmlQueryParser();
|
$theInstance = new XmlQueryParser();
|
||||||
}
|
}
|
||||||
|
|
@ -64,9 +61,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1. Read xml file<br />
|
* Parses an XML query file
|
||||||
* 2. Check the action<br />
|
*
|
||||||
* 3. Parsing and write a cache file<br />
|
* 1. Read xml file <br />
|
||||||
|
* 2. Check the action <br />
|
||||||
|
* 3. Parse and write cache file <br />
|
||||||
|
*
|
||||||
|
* @param $query_id
|
||||||
|
* @param $xml_file
|
||||||
|
* @param $cache_file
|
||||||
|
*
|
||||||
* @return QueryParser object
|
* @return QueryParser object
|
||||||
*/
|
*/
|
||||||
function &parse_xml_query($query_id, $xml_file, $cache_file)
|
function &parse_xml_query($query_id, $xml_file, $cache_file)
|
||||||
|
|
@ -86,8 +90,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query XML file parsing
|
* Override for parent "parse" method
|
||||||
* @return QueryParser object
|
*
|
||||||
|
* @param null $query_id
|
||||||
|
* @param null $xml_file
|
||||||
|
* @param null $cache_file
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
function parse($query_id = NULL, $xml_file = NULL, $cache_file = NULL)
|
function parse($query_id = NULL, $xml_file = NULL, $cache_file = NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -95,15 +104,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return XML file content
|
* Returns XML file contents as an object
|
||||||
* @return array|NULL Returns a resultant data object or NULL in case of error
|
* or NULL in case of error
|
||||||
|
*
|
||||||
|
* @param $xml_file
|
||||||
|
* @return array|NULL
|
||||||
*/
|
*/
|
||||||
function getXmlFileContent($xml_file){
|
function getXmlFileContent($xml_file)
|
||||||
|
{
|
||||||
$buff = FileHandler::readFile($xml_file);
|
$buff = FileHandler::readFile($xml_file);
|
||||||
$xml_obj = parent::parse($buff);
|
$xml_obj = parent::parse($buff);
|
||||||
if(!$xml_obj) return;
|
if(!$xml_obj) return;
|
||||||
unset($buff);
|
unset($buff);
|
||||||
return $xml_obj;
|
return $xml_obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue