public static function areFolderFilesWritable($_folder) { if (!SurStudioPluginTranslatorRevolutionLiteConfig::verifyCacheWritable()) { return true; } $contents = @scandir($_folder); foreach ($contents as $name) { $file = $_folder . '/' . $name; if (self::endsWith($name, '.xml') && @is_file($file) && !@is_writable($file)) { return $name; } } return true; }
protected function _cache_file_validate() { if (!SurStudioPluginTranslatorRevolutionLiteConfig::verifyCacheWritable()) { return true; } $path = SurStudioPluginTranslatorRevolutionLiteCommon::getCacheLocation(); $folder = SurStudioPluginTranslatorRevolutionLiteCommon::isFolderWritable($path); if ($folder !== true) { throw new Exception('Resource not writable: ' . $folder); } $files = SurStudioPluginTranslatorRevolutionLiteCommon::areFolderFilesWritable($path); if ($files !== true) { throw new Exception('Resource not writable: ' . $files); } }