public static function checkDirectoriesWritable($directoriesToCheck)
    {
        $resultCheck = array();
        foreach ($directoriesToCheck as $directoryToCheck) {
            if (!preg_match('/^' . preg_quote(PIWIK_USER_PATH, '/') . '/', $directoryToCheck)) {
                $directoryToCheck = PIWIK_USER_PATH . $directoryToCheck;
            }

            Filesystem::mkdir($directoryToCheck);

            $directory = Filesystem::realpath($directoryToCheck);
            if ($directory !== false) {
                $resultCheck[$directory] = is_writable($directoryToCheck);
            }
        }
        return $resultCheck;
    }
public static function checkDirectoriesWritable($directoriesToCheck)
    {
        $resultCheck = array();
        foreach ($directoriesToCheck as $directoryToCheck) {
            if (!preg_match('/^' . preg_quote(PIWIK_USER_PATH, '/') . '/', $directoryToCheck)) {
                $directoryToCheck = PIWIK_USER_PATH . $directoryToCheck;
            }

            Filesystem::mkdir($directoryToCheck);

            $directory = Filesystem::realpath($directoryToCheck);
            if ($directory !== false) {
                $resultCheck[$directory] = is_writable($directoryToCheck);
            }
        }
        return $resultCheck;
    }
public static function checkDirectoriesWritable ( $ directoriesToCheck ) { $ resultCheck = array ( ) ; foreach ( $ directoriesToCheck as $ directoryToCheck ) { if ( ! preg_match ( '/^' . preg_quote ( PIWIK_USER_PATH , '/' ) . '/' , $ directoryToCheck ) ) { $ directoryToCheck = PIWIK_USER_PATH . $ directoryToCheck ; } Filesystem :: mkdir ( $ directoryToCheck ) ; $ directory = Filesystem :: realpath ( $ directoryToCheck ) ; if ( $ directory !== false ) { $ resultCheck [ $ directory ] = is_writable ( $ directoryToCheck ) ; } } return $ resultCheck ; }
Checks if directories are writable and create them if they do not exist.

@param array $directoriesToCheck array of directories to check - if not given default Piwik directories that needs write permission are checked
@return array  directory name => true|false (is writable)
Checks if directories are writable and create them if they do not exist .