org\bovigo\vfs\vfsStreamAbstractContent::__construct PHP 메소드

__construct() 공개 메소드

constructor
public __construct ( string $name, integer $permissions = null )
$name string
$permissions integer optional
    public function __construct($name, $permissions = null)
    {
        $this->name = "{$name}";
        $time = time();
        if (null === $permissions) {
            $permissions = $this->getDefaultPermissions() & ~vfsStream::umask();
        }
        $this->lastAccessed = $time;
        $this->lastAttributeModified = $time;
        $this->lastModified = $time;
        $this->permissions = $permissions;
        $this->user = vfsStream::getCurrentUser();
        $this->group = vfsStream::getCurrentGroup();
    }

Usage Example

예제 #1
0
 /**
  * constructor
  *
  * @param  string  $name
  * @param  int     $permissions  optional
  */
 public function __construct($name, $permissions = null)
 {
     $this->content = new StringBasedFileContent(null);
     $this->type = vfsStreamContent::TYPE_FILE;
     parent::__construct($name, $permissions);
 }