当前位置: 首页>>代码示例>>PHP>>正文


PHP File::__construct方法代码示例

本文整理汇总了PHP中File::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP File::__construct方法的具体用法?PHP File::__construct怎么用?PHP File::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在File的用法示例。


在下文中一共展示了File::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($filename, $originalFilename = null, $mimeType = null, $error = null)
 {
     $this->originalFilename = basename($originalFilename);
     $this->mimeType = $mimeType;
     $this->error = $error ?: UPLOAD_ERR_OK;
     return parent::__construct($filename);
 }
开发者ID:ephigenia,项目名称:ephframe,代码行数:7,代码来源:UploadedFile.php

示例2:

 /**
  * @param Title|string|bool $title
  * @param ForeignApiRepo $repo
  * @param array $info
  * @param bool $exists
  */
 function __construct($title, $repo, $info, $exists = false)
 {
     parent::__construct($title, $repo);
     $this->mInfo = $info;
     $this->mExists = $exists;
     $this->assertRepoDefined();
 }
开发者ID:Gomyul,项目名称:mediawiki,代码行数:13,代码来源:ForeignAPIFile.php

示例3: __construct

 public function __construct($path, $sharedItem, $isLink = false)
 {
     parent::__construct($sharedItem->getPath());
     $this->sharedItem = $sharedItem;
     $this->linkPath = $path;
     $this->isLink = $isLink;
 }
开发者ID:BertLasker,项目名称:Catch-design,代码行数:7,代码来源:SharedFile.php

示例4: __construct

 /**
  * Constructor
  *
  * @param string $content_id Content id     */
 protected function __construct($content_id)
 {
     $db = AbstractDb::getObject();
     // Init values
     $row = null;
     parent::__construct($content_id);
     $content_id = $db->escapeString($content_id);
     $sql = "SELECT * FROM content_file_image WHERE pictures_id='{$content_id}'";
     $db->execSqlUniqueRes($sql, $row, false);
     if ($row == null) {
         /*
          * Since the parent Content exists, the necessary data in
          * content_group had not yet been created
          */
         $sql = "INSERT INTO content_file_image (pictures_id) VALUES ('{$content_id}')";
         $db->execSqlUpdate($sql, false);
         $sql = "SELECT * FROM content_file_image WHERE pictures_id='{$content_id}'";
         $db->execSqlUniqueRes($sql, $row, false);
         if ($row == null) {
             throw new Exception(_("The content with the following id could not be found in the database: ") . $content_id);
         }
     }
     $this->mBd =& $db;
     $this->pictures_row = $row;
     $this->configEnableEditFilename(false);
     $this->configEnableEditMimeType(false);
 }
开发者ID:soitun,项目名称:wifidog-auth,代码行数:31,代码来源:Picture.php

示例5: __construct

 public function __construct(\stdClass $data)
 {
     parent::__construct($data);
     $this->receiveData("thumb", null, "PhotoSize", true);
     $this->checkData("file_name", false, true);
     $this->checkData("mime_type", false, true);
 }
开发者ID:Garyao,项目名称:TelegramLibrary,代码行数:7,代码来源:Document.php

示例6: __construct

	/**
	 * Construct a new CSV object for the specified file.
	 *
	 * The specified path needn't exist and can be a relative or an absolute path.
	 * The field separator is set to ',', the char the values are enclosed with is set to '"'.
	 * Excel compatibility mode is turned off by default. Default mode for read and write access is
	 * Unicode.
	 *
	 * FTP fallback is activated automatically for this class.
	 *
	 * @param string Path to a CSV file
	 * @param boolean Shall we read/write header data? true = yes, false = no
	 */
	public function __construct($file, $headers = false) {
		parent::__construct($file, true);
		$this->headers = (boolean) $headers;
		$this->sep = ',';
		$this->quote = '"';
		$this->compat = false;
		$this->setFileMode();
	}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:21,代码来源:class.FileCSV.php

示例7: __construct

 /**
  * @param	string	$filename
  * @return	void
  */
 public function __construct($filename)
 {
     parent::__construct($filename);
     // Don't extend all these great directory features to lowly files
     if ($this->isFile()) {
         throw new \Exception("Invalid directory '{$filename}'");
     }
 }
开发者ID:huxtable,项目名称:core,代码行数:12,代码来源:Directory.php

示例8: __construct

 /**
  *
  * @param string $path
  * @param string $prefix 
  */
 public function __construct($path = null, $prefix = 'cassea_')
 {
     $path = !is_null($path) & is_writable($path) ? $path : (is_writable($s = sys_get_temp_dir()) ? $s : (is_writable($p = ini_get('upload_tmp_dir')) ? $p : Config::get('root_dir') . Config::get('temp_dir')));
     if (!is_writable($path)) {
         throw new FileSystemException('Temporary directory not writable: ' . $path);
     }
     parent::__construct(tempnam($path, $prefix), true);
 }
开发者ID:point,项目名称:cassea,代码行数:13,代码来源:TempFile.php

示例9: array

 function __construct($parent, $id, $args = array())
 {
     if (!isset($args['accept_types'])) {
         $args['accept_types'] = array('jpg', 'jpeg', 'png', 'gif');
     }
     $this->special_args('versions', $args, true);
     parent::__construct($parent, $id, $args);
 }
开发者ID:pcbrsites,项目名称:leeflets,代码行数:8,代码来源:image.php

示例10: __construct

 public function __construct($path)
 {
     parent::__construct($path);
     //make sure log file and parent directory exists
     if (!$this->exists()) {
         $this->touch(true);
     }
 }
开发者ID:ajaboa,项目名称:crmpuan,代码行数:8,代码来源:LogFile.php

示例11: __construct

 protected function __construct($path, $mimetype = null)
 {
     parent::__construct($path, $mimetype);
     $this->set_quality(self::$_DEFAULT_QUALITY);
     $this->_tmp_path = tempnam(sys_get_temp_dir(), 'image');
     $this->_image = imagecreatefromstring(file_get_contents($this->_path));
     $this->_update_temp_file();
 }
开发者ID:zentefi,项目名称:zentefi-laravel,代码行数:8,代码来源:ImageFile.php

示例12: __construct

 public function __construct()
 {
     $handle = tmpfile();
     $metaDatas = stream_get_meta_data($handle);
     $tmpFilename = $metaDatas['uri'];
     parent::__construct($tmpFilename);
     $this->handle = $handle;
 }
开发者ID:sbuberl,项目名称:fSQL,代码行数:8,代码来源:TempFile.php

示例13: __construct

 /**
  * Accepts the information of the uploaded file as provided by the PHP global $_FILES.
  *
  * The file object is only created when the uploaded file is valid (i.e. when the
  * isValid() method returns true). Otherwise the only methods that could be called
  * on an UploadedFile instance are:
  *
  *   * getClientOriginalName,
  *   * getClientMimeType,
  *   * isValid,
  *   * getError.
  *
  * Calling any other method on an non-valid instance will cause an unpredictable result.
  *
  * @param string $path         The full temporary path to the file
  * @param string $originalName The original file name
  * @param string $mimeType     The type of the file as provided by PHP
  * @param int    $size         The file size
  * @param int    $error        The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants)
  * @param bool   $test         Whether the test mode is active
  *
  * @throws FileException         If file_uploads is disabled
  * @throws FileNotFoundException If the file does not exist
  */
 public function __construct($path, $originalName, $mimeType = null, $size = null, $error = null, $test = false)
 {
     $this->originalName = $this->getName($originalName);
     $this->mimeType = $mimeType ?: 'application/octet-stream';
     $this->size = $size;
     $this->error = $error ?: UPLOAD_ERR_OK;
     $this->test = (bool) $test;
     parent::__construct($path, UPLOAD_ERR_OK === $this->error);
 }
开发者ID:bearlord,项目名称:kantphp2,代码行数:33,代码来源:UploadedFile.php

示例14: __construct

 /**
  * TemporaryFile constructor.
  *
  * @param string $folderPath テンポラリフォルダを作成するフォルダパス。指定されなければテンポラリフォルダを作成する
  */
 public function __construct($folderPath = null)
 {
     if ($folderPath === null) {
         $this->_tmpFolder = new TemporaryFolder();
         $folderPath = $this->_tmpFolder->path;
     }
     $fileName = Security::hash(mt_rand() . microtime(), 'md5');
     register_shutdown_function(array($this, 'delete'));
     parent::__construct($folderPath . DS . $fileName, true);
 }
开发者ID:s-nakajima,项目名称:files,代码行数:15,代码来源:TemporaryFile.php

示例15: __construct

 public function __construct(array $data)
 {
     if (!isset($data['name'])) {
         throw new \InvalidArgumentException("Input array does not contain the 'name' key");
     }
     if (!isset($data['tmp_name'])) {
         throw new \InvalidArgumentException("Input array does not contain the 'tmp_name' key");
     }
     parent::__construct($data['name'], $data['tmp_name']);
 }
开发者ID:radnan,项目名称:rdn-upload,代码行数:10,代码来源:Input.php


注:本文中的File::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。