/** * Returns module folder name * * @param string $componentName Component Name * @param string $componentType Component Type * @param boolean $allowCustomizing Check for the customizing folder * * @return string module folder name */ private function getModuleFolder($componentName, $componentType, $allowCustomizing = true) { $basepath = ASCMS_DOCUMENT_ROOT . \Cx\Core\Core\Model\Entity\SystemComponent::getPathForType($componentType); $componentPath = $basepath . '/' . $componentName; if (!$allowCustomizing) { return $componentPath; } return \Env::get('cx')->getClassLoader()->getFilePath($componentPath); }
/** * Returns wheter this component exists or not in the system * Note : It not depends the component type * * @param boolean $allowCustomizing (optional) Set to false if you want to ignore customizings * @return boolean True if it exists, false otherwise */ public function exists($allowCustomizing = true) { foreach (self::$componentTypes as $componentType) { $basepath = ASCMS_DOCUMENT_ROOT . \Cx\Core\Core\Model\Entity\SystemComponent::getPathForType($componentType); $componentPath = $basepath . '/' . $this->componentName; if (!$allowCustomizing) { if (file_exists($componentPath)) { return true; } } if (\Env::get('cx')->getClassLoader()->getFilePath($componentPath)) { return true; } } return false; }