本文整理匯總了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;
}