Exemple #1
0
 public static function write($_file, $_contents)
 {
     $file = self::_get_file($_file, 'wb');
     if (!$file) {
         SurStudioPluginTranslatorRevolutionLiteConfig::setCacheFlag(false);
         return false;
     }
     $result = fwrite($file, $_contents);
     fflush($file);
     self::_unlock($_file);
     return $result;
 }
Exemple #2
0
 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);
     }
 }