本文整理汇总了PHP中Xml::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::__construct方法的具体用法?PHP Xml::__construct怎么用?PHP Xml::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml::__construct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Start the stream reader/writer as if it is a XML document.
*
* @param \Hoa\Stream\IStream\In $stream Stream to
* read/write.
* @param bool $initializeNamespace Whether we
* initialize
* namespaces.
* @param mixed $entityResolver Entity resolver.
* @param bool $autoSave Whether we
* should
* auto-save.
* @return void
* @throws \Hoa\Xml\Exception
*/
public function __construct(Stream\IStream\In $stream, $initializeNamespace = true, $entityResolver = null, $autoSave = true)
{
if (true === $autoSave && !$stream instanceof Stream\IStream\Out) {
throw new Exception('The stream %s (that has opened %s) must implement ' . '\\Hoa\\Stream\\IStream\\In and \\Hoa\\Stream\\IStream\\Out interfaces.', 0, [get_class($stream), $stream->getStreamName()]);
}
parent::__construct('\\Hoa\\Xml\\Element\\ReadWrite', $stream, $initializeNamespace, $entityResolver);
if (true === $autoSave) {
event('hoa://Event/Stream/' . $stream->getStreamName() . ':close-before')->attach(xcallable($this, '_close'));
}
$this->_autoSave = $autoSave;
return;
}
示例2: __construct
/**
* Start the stream reader as if it is a XML document.
*
* @param \Hoa\Stream\IStream\In $stream Stream to read.
* @param bool $initializeNamespace Whether we
* initialize
* namespaces.
* @param mixed $entityResolver Entity resolver.
* @return void
*/
public function __construct(Stream\IStream\In $stream, $initializeNamespace = true, $entityResolver = null)
{
parent::__construct('\\Hoa\\Xml\\Element\\Read', $stream, $initializeNamespace, $entityResolver);
return;
}
示例3: __construct
/**
* Start the stream reader/writer as if it is a XML document.
*
* @param \Hoa\Stream\IStream\Out $stream Stream to
* read/write.
* @param bool $initializeNamespace Whether we
* initialize
* namespaces.
* @param mixed $entityResolver Entity resolver.
* @return void
*/
public function __construct(Stream\IStream\Out $stream, $initializeNamespace = true, $entityResolver = null)
{
parent::__construct('\\Hoa\\Xml\\Element\\Write', $stream, $initializeNamespace, $entityResolver);
event('hoa://Event/Stream/' . $stream->getStreamName() . ':close-before')->attach(xcallable($this, '_close'));
return;
}