createDirectory() public static method

Creates the passed directory.
public static createDirectory ( string $directoryToCreate, integer $mode = 509, boolean $recursive = false ) : void
$directoryToCreate string The directory that should be created
$mode integer The mode to create the directory with
$recursive boolean TRUE if the directory has to be created recursively, else FALSE
return void
コード例 #1
0
 /**
  * Creates the passed directory recursively with the umask specified in the system
  * configuration and sets the user permissions.
  *
  * @param \SplFileInfo $directoryToCreate The directory that should be created
  * @param integer      $mode              The mode to create the directory with
  * @param boolean      $recursively       TRUE if the directory has to be created recursively, else FALSE
  * @param string       $user              The user that has to own the passed directory
  * @param string       $group             The group that has to own the passed directory
  * @param integer      $umask             The new umask to set
  *
  * @return void
  * @throws \Exception Is thrown if the directory can't be created
  */
 public function createDirectory(\SplFileInfo $directoryToCreate, $mode = 0775, $recursively = true, $user = null, $group = null, $umask = null)
 {
     // set the umask that is necessary to create the directory
     $this->initUmask($umask);
     // create the directory itself
     FileSystem::createDirectory($directoryToCreate, $mode, $recursively);
     // load the deployment service
     $this->setUserRights($directoryToCreate, $user, $group);
 }