private function getAllExtensionManifests($directory) { $returnValue = array(); $dir = new DirectoryIterator($directory); foreach ($dir as $fileinfo) { if ($fileinfo->isDir() && !$fileinfo->isDot() && substr($fileinfo->getBasename(), 0, 1) != '.') { $extId = $fileinfo->getBasename(); $manifestPath = $fileinfo->getRealPath() . DIRECTORY_SEPARATOR . 'manifest.php'; if (file_exists($manifestPath)) { $manifest = new common_ext_Manifest($manifestPath); if ($extId == $manifest->getName()) { $returnValue[$extId] = $manifest; } else { throw new common_exception_InconsistentData('Manifest name "' . $manifest->getName() . '" does not match containing directory "' . $extId . '"'); } } } } return $returnValue; }
private function getAllModelFiles(common_ext_Manifest $manifest) { $returnValue = array(); $localesPath = dirname($manifest->getFilePath()) . DIRECTORY_SEPARATOR . 'locales' . DIRECTORY_SEPARATOR; foreach ($manifest->getInstallModelFiles() as $rdfpath) { $returnValue[] = $rdfpath; if (file_exists($localesPath)) { $fileName = basename($rdfpath); foreach (new DirectoryIterator($localesPath) as $fileinfo) { if (!$fileinfo->isDot() && $fileinfo->isDir() && $fileinfo->getFilename() != '.svn' && $fileinfo->getFilename() != 'en-US') { $candidate = $fileinfo->getPathname() . DIRECTORY_SEPARATOR . $fileName; if (file_exists($candidate)) { $returnValue[] = $candidate; } } } } } return $returnValue; }
/** * returns the name of the extension * * @access public * @author firstname and lastname of author, <*****@*****.**> * @return string */ public function getName() { return (string) $this->manifest->getName(); }
public static function getRawChecks($extensionIds) { $checks = array(); // resolve dependencies $toCheck = array(); while (!empty($extensionIds)) { $ext = array_pop($extensionIds); $manifestPath = dirname(__FILE__) . '/../../../' . $ext . '/manifest.php'; $dependencies = common_ext_Manifest::extractDependencies($manifestPath); $extensionIds = array_unique(array_merge($extensionIds, array_diff($dependencies, $toCheck))); $toCheck[] = $ext; } // We extract the checks to perform from the manifests // depending on the distribution. $checkArray = array(); // merge of all arrays describing checks in the manifests. $componentArray = array(); // array of Component instances. array keys are the IDs. foreach ($toCheck as $ext) { $manifestPath = dirname(__FILE__) . '/../../../' . $ext . '/manifest.php'; $checks = array_merge($checks, common_ext_Manifest::extractChecks($manifestPath)); } return $checks; }
/** * returns the name of the extension * * @access public * @author firstname and lastname of author, <*****@*****.**> * @return string */ public function getName() { $returnValue = (string) ''; $returnValue = $this->manifest->getName(); return (string) $returnValue; }