本文整理汇总了PHP中SplFileInfo::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP SplFileInfo::__construct方法的具体用法?PHP SplFileInfo::__construct怎么用?PHP SplFileInfo::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SplFileInfo
的用法示例。
在下文中一共展示了SplFileInfo::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: next
function next()
{
$this->entry = $this->dirObject->read();
if ($this->entry) {
parent::__construct($this->entry);
}
}
示例2: __construct
/**
* Constructs a new file from the given path.
*
* @param string $path The path to the file
*
* @throws FileNotFoundException If the given path is not a file
*
* @api
*/
public function __construct($path)
{
if (!is_file($path)) {
throw new FileNotFoundException($path);
}
parent::__construct($path);
}
示例3: __construct
/**
* Constructs a new file from the given path.
*
* @param string $path The path to the file
*/
public function __construct($path)
{
if (!is_file($path)) {
throw new \RuntimeException(sprintf('Runtime Error: File Not Found: "%s"', $path));
}
parent::__construct($path);
}
示例4: __construct
/**
* File constructor.
*
* @param string $fileName
* @param FileSystem $fileSystem
* @param bool $fileNameCpFs
*/
public function __construct($fileName, FileSystem $fileSystem, $fileNameCpFs = false)
{
$this->fileSystem = $fileSystem;
if (!$fileNameCpFs) {
}
parent::__construct($fileName);
}
示例5: __construct
/**
* @param string $filename
* @return void
*/
public function __construct($filename)
{
if (substr($filename, 0, 1) == '~') {
$filename = getenv('HOME') . substr($filename, 1);
}
parent::__construct($filename);
}
示例6: __construct
/**
* Constructs a new file from the given path.
*
* @param string $path The path to the file
* @param boolean $check Whether to check the path or not
*
* @throws \OutOfRangeException If the given path is not a file
*/
public function __construct($path, $check = true)
{
if ($check && !is_file($path)) {
throw new \OutOfRangeException("path {$path} is not a file");
}
parent::__construct($path);
}
示例7: __construct
/**
* Constructor
*
* @param string $filePathname Absolute path to uploaded file on disk
* @param string $newName Desired file name (with extension) of uploaded file
*/
public function __construct($filePathname, $newName = null)
{
$desiredName = is_null($newName) ? $filePathname : $newName;
$this->name = pathinfo($desiredName, PATHINFO_FILENAME);
$this->extension = strtolower(pathinfo($desiredName, PATHINFO_EXTENSION));
parent::__construct($filePathname);
}
示例8: __construct
public function __construct($fileName, $delimiter = self::DEFAULT_DELIMITER, $enclosure = self::DEFAULT_ENCLOSURE, $escapedBy = "")
{
parent::__construct($fileName);
$this->_escapedBy = $escapedBy;
$this->_setDelimiter($delimiter);
$this->_setEnclosure($enclosure);
}
示例9: __construct
/**
* Constructs a new file from the given path.
* @param $path The path to the file
* @param bool $checkPath Whether to check the path or not
* @throws FileNotFoundException If the given path is not a file
*/
public function __construct($path, $checkPath = true)
{
if ($checkPath && !is_file($path)) {
throw new FileNotFoundException($path);
}
parent::__construct($path);
}
示例10: __construct
/**
* Constructor
*
* @param string $filename
* @param string $openMode
*/
public function __construct($filename, $openMode = 'r')
{
$this->_file = @fopen($filename, $openMode);
if (!$this->_file) {
throw new \RuntimeException("Error opening file '{$filename}', mode '{$openMode}'");
}
parent::__construct($filename);
}
示例11: __construct
/**
* Create new uploaded file
*
* @param string $path Local filesystem path to uploaded file
* @param string $originalName The original file name provided by the HTTP client
*
* @throws \InvalidArgumentException If file path is not a valid uploaded file
*/
public function __construct($path, $originalName = null)
{
if (!$this->isUploadedFile($path)) {
throw new \InvalidArgumentException('File path is not a valid uploaded file');
}
$this->originalName = $originalName;
parent::__construct($path);
}
示例12: __construct
public function __construct($file_name)
{
$this->fs = DefaultFileSystem::getFileSystem();
$path = $this->fs->fromURIPath(new String($file_name));
$this->path = $this->fs->normalize($path);
$this->prefixLength = $this->fs->prefixLength($this->path);
parent::__construct($this->path);
}
示例13: __construct
public function __construct(array $uploadedFile)
{
parent::__construct($uploadedFile['tmp_name']);
$this->setFilename($uploadedFile['name']);
$this->setMimeType();
$this->setMd5();
$this->setExtension();
}
示例14: __construct
/**
* @param string $prefix prefix to uniqid()
* @throws \pharext\Exception
*/
public function __construct($prefix)
{
$temp = new Tempname($prefix);
if (!is_dir($temp) && !mkdir($temp, 0700, true)) {
throw new Exception("Could not create tempdir: " . error_get_last()["message"]);
}
parent::__construct($temp);
}
示例15: __construct
public function __construct($name, $isDir, $isWritable)
{
parent::__construct($name);
$this->fname = $name;
$this->pathInfo = pathinfo($this->fname);
$this->isDir = $isDir;
$this->isWritable = $isWritable;
}