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; }
/** * @depricated * @param $filename * @return bool */ function is_includeable($filename) { return Pimcore_File::isIncludeable($filename); }
/** * @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); }