Esempio n. 1
0
 protected function determineResourceClass($className)
 {
     $fileToInclude = str_replace("_", "/", $className) . ".php";
     if (Pimcore_File::isIncludeable($fileToInclude)) {
         include_once $fileToInclude;
         if (Pimcore_Tool::classExists($className)) {
             return $className;
         }
     } else {
         Logger::debug("Couldn't find resource implementation " . $className . " for " . get_class($this));
     }
     return;
 }
Esempio n. 2
0
/**
 * @depricated
 * @param  $filename
 * @return bool
 */
function is_includeable($filename)
{
    return Pimcore_File::isIncludeable($filename);
}
Esempio n. 3
0
 /**
  * @throws Exception
  * @param $method
  * @param $arguments
  * @return mixed|string|Tag
  */
 public function __call($method, $arguments)
 {
     $class = "Document_Tag_" . ucfirst(strtolower($method));
     $tagFile = str_replace("_", "/", $class) . ".php";
     if (Pimcore_File::isIncludeable($tagFile)) {
         include_once $tagFile;
         if (@Pimcore_Tool::classExists($class)) {
             if (!isset($arguments[0])) {
                 throw new Exception("You have to set a name for the called tag (editable): " . $method);
             }
             // set default if there is no editable configuration provided
             if (!isset($arguments[1])) {
                 $arguments[1] = array();
             }
             return $this->tag($method, $arguments[0], $arguments[1]);
         }
     }
     if ($this->document instanceof Document) {
         if (method_exists($this->document, $method)) {
             return call_user_func_array(array($this->document, $method), $arguments);
         }
     }
     return parent::__call($method, $arguments);
 }