當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SplFileInfo::__construct方法代碼示例

本文整理匯總了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);
     }
 }
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:7,代碼來源:DirectoryIterator.php

示例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);
 }
開發者ID:robertowest,項目名稱:CuteFlow-V4,代碼行數:16,代碼來源:File.php

示例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);
 }
開發者ID:phpalchemy,項目名稱:phpalchemy,代碼行數:12,代碼來源:File.php

示例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);
 }
開發者ID:mepatek,項目名稱:application,代碼行數:14,代碼來源:File.php

示例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);
 }
開發者ID:huxtable,項目名稱:core,代碼行數:11,代碼來源:File.php

示例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);
 }
開發者ID:gjerokrsteski,項目名稱:pimf-framework,代碼行數:15,代碼來源:File.php

示例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);
 }
開發者ID:prabhatse,項目名稱:olx_hack,代碼行數:13,代碼來源:FileInfo.php

示例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);
 }
開發者ID:schpill,項目名稱:thin,代碼行數:7,代碼來源:Csv.php

示例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);
 }
開發者ID:manyoubaby123,項目名稱:imshop,代碼行數:13,代碼來源:File.php

示例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);
 }
開發者ID:hschletz,項目名稱:braintacle,代碼行數:14,代碼來源:FileObject.php

示例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);
 }
開發者ID:edblighter,項目名稱:uploads,代碼行數:16,代碼來源:UploadedFile.php

示例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);
 }
開發者ID:phpj,項目名稱:phpj,代碼行數:8,代碼來源:File.php

示例13: __construct

 public function __construct(array $uploadedFile)
 {
     parent::__construct($uploadedFile['tmp_name']);
     $this->setFilename($uploadedFile['name']);
     $this->setMimeType();
     $this->setMd5();
     $this->setExtension();
 }
開發者ID:alex-moreno-costa,項目名稱:upload,代碼行數:8,代碼來源:UploadedFile.php

示例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);
 }
開發者ID:m6w6,項目名稱:pharext,代碼行數:12,代碼來源:Tempdir.php

示例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;
 }
開發者ID:gitter-badger,項目名稱:diamantedesk-application,代碼行數:8,代碼來源:FileInfoStub.php


注:本文中的SplFileInfo::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。