Пример #1
0
 /**
  * Constructor
  *
  * @param string $path Path to file
  * @param bool $create Create file if it does not exist (if true)
  * @param int $mode Mode to apply to the folder holding the file
  */
 public function __construct($path, $create = false, $mode = 0755)
 {
     parent::__construct($path, $create, $mode);
     if (!static::$_ffprobe) {
         static::$_ffprobe = new FFProbe();
     }
     $this->_driver = new FFMpegDriver();
 }
Пример #2
0
 /**
  * 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
  */
 public function __construct($path, $originalName, $mimeType = null, $size = null, $error = null, $test = false)
 {
     $this->_originalName = $originalName;
     $this->_mimeType = $mimeType ?: 'application/octet-stream';
     $this->_size = $size;
     $this->_error = $error ?: UPLOAD_ERR_OK;
     $this->_test = (bool) $test;
     parent::__construct($path);
 }