Piwik\Filesystem::mkdir PHP Méthode

mkdir() public static méthode

_Note: This function does **not** create directories recursively._
public static mkdir ( string $path )
$path string The path of the directory to create.
    public static function mkdir($path)
    {
        if (!is_dir($path)) {
            // the mode in mkdir is modified by the current umask
            @mkdir($path, self::getChmodForPath($path), $recursive = true);
        }
        // try to overcome restrictive umask (mis-)configuration
        if (!is_writable($path)) {
            @chmod($path, 0755);
            if (!is_writable($path)) {
                @chmod($path, 0775);
                // enough! we're not going to make the directory world-writeable
            }
        }
        self::createIndexFilesToPreventDirectoryListing($path);
    }

Usage Example

 private function createFolderWithinPluginIfNotExists($pluginName, $folder)
 {
     $pluginPath = $this->getPluginPath($pluginName);
     if (!file_exists($pluginName . $folder)) {
         Filesystem::mkdir($pluginPath . $folder, true);
     }
 }
All Usage Examples Of Piwik\Filesystem::mkdir