Exemple #1
0
 protected function setFilePermissions($filePath)
 {
     if (is_dir($filePath)) {
         $chmod = 0750;
         if (self::$taskConfig->getDirectoryChmod()) {
             $chmod = octdec(self::$taskConfig->getDirectoryChmod());
         }
         KalturaLog::debug("chmod({$filePath}, {$chmod})");
         @chmod($filePath, $chmod);
         $dir = dir($filePath);
         while (false !== ($file = $dir->read())) {
             if ($file[0] != '.') {
                 $this->setFilePermissions($filePath . DIRECTORY_SEPARATOR . $file);
             }
         }
         $dir->close();
     } else {
         $chmod = 0640;
         if (self::$taskConfig->getChmod()) {
             $chmod = octdec(self::$taskConfig->getChmod());
         }
         KalturaLog::debug("chmod({$filePath}, {$chmod})");
         @chmod($filePath, $chmod);
     }
 }