public function checkWritableI18nDirectory($dir)
    {
        if (file_exists($dir)) {
            return is_writable($dir);
        }

        $parentDir = dirname($dir);

        return file_exists($parentDir) && is_writable($parentDir);
    }
public function checkWritableI18nDirectory($dir)
    {
        if (file_exists($dir)) {
            return is_writable($dir);
        }

        $parentDir = dirname($dir);

        return file_exists($parentDir) && is_writable($parentDir);
    }
public function checkWritableI18nDirectory ( $ dir ) { if ( file_exists ( $ dir ) ) { return is_writable ( $ dir ) ; } $ parentDir = dirname ( $ dir ) ; return file_exists ( $ parentDir ) && is_writable ( $ parentDir ) ; }
Check if a directory is writable or if the parent directory is writable

@param string $dir   the directory to test
@return boolean      return true if the directory is writable otr if the parent dir is writable.
Check if a directory is writable or if the parent directory is writable