本文整理汇总了PHP中Stream::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Stream::__construct方法的具体用法?PHP Stream::__construct怎么用?PHP Stream::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stream
的用法示例。
在下文中一共展示了Stream::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($streamData)
{
parent::__construct($streamData);
$unpackFormat = ['vprocessorArchitecture', 'vprocessorLevel', 'vprocessorRevision', 'CnumberOfProcessors', 'CproductType', 'VmajorVersion', 'VminorVersion', 'VbuildNumber', 'VplatformId', 'VCSDVersionRVA', 'vsuiteMask', 'vreserved', 'V3vendorId', 'VversionInformation', 'VfeatureInformation', 'VamdExtendedCPUFeatures'];
foreach (unpack(implode('/', $unpackFormat), $streamData) as $variable => $value) {
$this->{$variable} = $value;
}
}
示例2: __construct
/**
*
* @param string $filename
* @param string $mode
*/
public function __construct($filename, $mode = null)
{
if ($mode === null) {
$mode = 'a+b';
}
$resource = fopen($filename, $mode);
parent::__construct($resource);
}
示例3: __construct
/**
*
* @param string $hostname
* @param int $port
*/
public function __construct($hostname, $port = null)
{
if ($port === null) {
$port = -1;
}
$resource = fsockopen($hostname, $port);
parent::__construct($resource);
}
示例4:
function __construct()
{
parent::__construct();
$this->moudleId = -1;
$this->id = -1;
$this->isResult = -1;
$this->headerIsReaded = false;
}
示例5: __construct
/**
*
* @param string $data Initial data
* @param int $memSize Memory limit
* @param string $mode Open mode
*/
public function __construct($data = null, $memSize = null, $mode = 'w+')
{
$memSize = \intval($memSize);
$file = 'php://';
if ($memSize > 0) {
$file .= "temp/maxmemory:{$memSize}";
} else {
$file .= 'memory';
}
$stream = Stream::open($file, $mode, false);
parent::__construct($stream);
$this->write($data);
}
示例6: __construct
/**
* Wraps around the specified stream.
*
* @param resource $stream The stream to wrap around.
*/
public function __construct($stream)
{
parent::__construct($stream, true);
}
示例7: __construct
/**
*
*/
public function __construct()
{
$stream = Stream::open('php://output', 'w', false);
parent::__construct($stream);
}
示例8: __construct
public function __construct(string $content)
{
$resource = fopen('php://temp', 'r+');
fwrite($resource, $content);
parent::__construct($resource);
}
示例9: __construct
/**
* PhpInputStream constructor.
*
* @param string $stream
* @param string $mode
*/
public function __construct($stream = 'php://input', $mode = 'r')
{
parent::__construct($stream, $mode);
}
示例10: __construct
public function __construct()
{
$this->path = sys_get_temp_dir() . '/' . uniqid(time() . '_');
$this->handle = fopen($this->path, 'w');
parent::__construct($this->handle);
}
示例11: __construct
/**
* @param string $string String to write in the stream
*/
public function __construct($string = '')
{
parent::__construct(fopen('php://temp', 'w+'));
'' === $string or $this->write($string);
}
示例12: __construct
public function __construct()
{
parent::__construct(fopen('php://input', 'r'));
}
示例13: __construct
/**
*
* @param string $data Initial data
* @param string $mode Open mode
*/
public function __construct($data = null, $mode = 'r+')
{
$stream = Stream::open('php://temp', $mode, false);
parent::__construct($stream);
$this->write($data);
}
示例14: __construct
public function __construct($handle = null)
{
parent::__construct($handle);
$this->current_content = '';
}
示例15:
/**
* Default aggregate helper
* @param mixed $stream
*/
function __construct($stream = null)
{
parent::__construct($stream);
}