本文整理汇总了PHP中XML_Parser::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP XML_Parser::__construct方法的具体用法?PHP XML_Parser::__construct怎么用?PHP XML_Parser::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XML_Parser
的用法示例。
在下文中一共展示了XML_Parser::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct($variables, $fail_on_invalid_names = true, $structure = false, $valid_types = array(), $force_defaults = true)
{
// force ISO-8859-1 due to different defaults for PHP4 and PHP5
// todo: this probably needs to be investigated some more andcleaned up
parent::__construct('ISO-8859-1');
$this->variables = $variables;
$this->structure = $structure;
// $this->val = new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
}
示例2: unset
/**
* Constructor.
*
* @param string $outputMode
*/
function __construct($outputMode = 'text')
{
$conf = $GLOBALS['_MAX']['CONF'];
parent::__construct();
// The configuration file holds all the defined table names.
// HACK: The parser currently gets very confused when it encounters 'category' fields
// if there is a table defined with that name.
$configured_tables = $conf['table'];
unset($configured_tables['category']);
$this->aTables = array_keys($configured_tables);
$this->aDataset = array();
$this->outputMode = $outputMode;
}
示例3: XML_Parser
/**
* Creates an XML parser.
*
* This is needed for PHP4 compatibility, it will
* call the constructor, when a new instance is created.
*
* @param string $srcenc source charset encoding, use NULL (default) to use
* whatever the document specifies
* @param string $mode how this parser object should work, "event" for
* startelement/endelement-type events, "func"
* to have it call functions named after elements
* @param string $tgenc a valid target encoding
*/
function XML_Parser($srcenc = null, $mode = 'event', $tgtenc = null)
{
XML_Parser::__construct($srcenc, $mode, $tgtenc);
}
示例4:
function __construct()
{
parent::__construct();
}
示例5:
/**
* Creates an XML parser.
*
* This is needed for PHP4 compatibility, it will
* call the constructor, when a new instance is created.
*
* @param string $srcenc source charset encoding, use NULL (default) to use
* whatever the document specifies
* @param string $mode how this parser object should work, "event" for
* handleElement(), "func" to have it call functions
* named after elements (handleElement_$name())
* @param string $tgenc a valid target encoding
*/
function __construct($srcenc = null, $mode = 'event', $tgtenc = null)
{
parent::__construct($srcenc, $mode, $tgtenc);
}
示例6:
/**
* Constructor
*
* @access public
* @param mixed File pointer, name of the RSS file, or an RSS string.
* @param string Source charset encoding, use null (default) to use
* default encoding (ISO-8859-1)
* @param string Target charset encoding, use null (default) to use
* default encoding (ISO-8859-1)
* @return void
*/
function __construct($handle = '', $srcenc = null, $tgtenc = null)
{
if ($srcenc === null && $tgtenc === null) {
parent::__construct();
} else {
parent::__construct($srcenc, 'event', $tgtenc);
}
$this->setInput($handle);
if ($handle == '') {
$this->customRaiseError('No input passed.');
}
}
示例7:
/**
* Parses the data of the given configuration file
*
* @access public
* @param string $datasrc path to the configuration file
* @param object $obj reference to a config object
* @return mixed returns a PEAR_ERROR, if error occurs or true if ok
*/
function &parseDatasrc($datasrc, &$obj)
{
$this->folding = false;
$this->cdata = null;
parent::__construct($this->options['encoding'], 'event');
$this->containers[0] =& $obj->container;
if (is_string($datasrc)) {
if ($this->options['isFile']) {
$err = $this->setInputFile($datasrc);
if (PEAR::isError($err)) {
return $err;
}
$err = $this->parse();
} else {
$err = $this->parseString($datasrc, true);
}
} else {
$this->setInput($datasrc);
$err = $this->parse();
}
if (PEAR::isError($err)) {
return $err;
}
return true;
}
示例8:
function __construct()
{
parent::__construct('ISO-8859-1');
//$this->__construct();
}
示例9:
/**
* Maps an XML string to an XML_Tree.
*
* @return mixed The XML tree root (an XML_Tree_Node), or PEAR_Error upon error.
* @access public
*/
function &getTreeFromString($str)
{
$this->i = null;
$this->folding = false;
parent::__construct(null, 'event');
$this->cdata = null;
$err = $this->parseString($str);
if (PEAR::isError($err)) {
return $err;
}
return $this->root;
}
示例10:
/**
* Constructor
*
* @access public
* @param mixed File pointer or name of the RDF file.
* @return void
*/
function __construct($handle = '')
{
parent::__construct();
if (!empty($handle)) {
$this->setInput($handle);
} else {
$this->raiseError('No filename passed.');
}
}
示例11:
/**
* Constructor
*
* @access public
* @return void
*/
function XML_Feed()
{
parent::__construct();
}