예제 #1
0
 /**
  * Load cache file. Built it if it doesn't exists
  *
  * @param $file
  * @return fs\file
  */
 protected function loadCache(fs\file $file, $bUpdate = null)
 {
     if (!$file->checkRights(\Sylma::MODE_EXECUTE)) {
         $this->launchException('Unauthorized access', get_defined_vars());
     }
     if (!($result = $this->getCache($file, $bUpdate)) && $this->getControler('user')->isPrivate()) {
         if ($bUpdate !== false) {
             $result = $this->build($file, $file->getParent());
         }
     }
     return $result;
 }
예제 #2
0
 protected function readFile(fs\file $file)
 {
     return $file->checkRights(\Sylma::MODE_EXECUTE) ? $file->execute() : $file->read();
 }