/** * Get an array of prefixes <-> namespaces * * @return return an associative array of namespace prefixes and their base URI */ public static function getNamespaces() { $coreNamespaces = get_class_vars('\\StructuredDynamics\\structwsf\\framework\\Namespaces'); unset($coreNamespaces['namespaces']); // Read custom namespaces $namespaces = array(); if (($handle = @fopen(realpath(dirname(__FILE__)) . "/namespaces.csv", "r")) !== FALSE) { while (($namespace = fgetcsv($handle)) !== FALSE) { // Ensure we have two columns if (count($namespace) == 2) { // Only keep valie IRI if (Namespaces::isValidIRI($namespace[1])) { $namespaces[$namespace[0]] = $namespace[1]; } } } fclose($handle); } $namespaces += $coreNamespaces; return $namespaces; }
/** * Initializes the namespace of Application * Unity Screen Concept (USD) * * @return void */ private function initializeApplicationUnityNamespace() { // init namespaces Namespaces::destroyNSPApplication('NSP_Application'); // Request Object $req = $this->objectManager->getObject('Request'); // Hidden Field of Unity $FL_APPL_UNITY = $req->getPost($this->registry->hiddenfieldsUnity); // if KAY then GET (Ajax) if ($req->getGet('kay') == 'GMPXMJUFHPFTBKBY' && empty($FL_APPL_UNITY)) { // Hidden Field of Unity $FL_APPL_UNITY = $req->getGet('unity'); } // Validate value of hidden field $Validate = $this->objectManager->getObject('StringValidator'); // Pfad zur Unity $FL_APPL_SCAN = FL_PATH_TO_UNITY . $FL_APPL_UNITY; // Pfad OK if (isset($FL_APPL_UNITY) && $Validate->isValid($FL_APPL_UNITY)) { if (FL_MODE === 'PROD') { // Cache Object $oCache = new Cache(FL_PATH_CACHE); // FileName with sha1 $sCacheName = 'FlexiNSP:AppOnlyScan:eac257e56aec2'; // Daten in Cache ? if (($aStaticUserData = $oCache->readCache($sCacheName)) === false || $this->ResetFrameworkCache === true) { // Namespace from Framework to Object $aStaticUserData = NameSpaces::array2Object(ResourcesNameSpaces::getNamespaces($FL_APPL_SCAN, true)); // Object of Namespace in Cache (serialize) one year $oCache->writeCache($sCacheName, $aStaticUserData, 60 * 60 * 24 * 365); } // Namespace registry NameSpaces::setNamespaceObject('NSP_Application', $aStaticUserData); } else { // Namespace der Unity NameSpaces::setNamespaceToObject('NSP_Application', ResourcesNameSpaces::getNamespaces($FL_APPL_SCAN, true)); } } else { // Standard Unity $FL_APPL_SCAN = FL_PATH_TO_UNITY . $this->registry->standardUnity . '/'; if (FL_MODE === 'PROD') { // Cache Object $oCache = new Cache(FL_PATH_CACHE); // FileName with sha1 $sCacheName = 'FlexiNSP:AppOnlyScan:eac257e56aec7'; // Daten in Cache ? if (($aStaticUserData = $oCache->readCache($sCacheName)) === false || $this->ResetFrameworkCache === true) { // Namespace from Framework to Object $aStaticUserData = NameSpaces::array2Object(ResourcesNameSpaces::getNamespaces($FL_APPL_SCAN, true)); // Object of Namespace in Cache (serialize) one year $oCache->writeCache($sCacheName, $aStaticUserData, 60 * 60 * 24 * 365); } // Namespace registry NameSpaces::setNamespaceObject('NSP_Application', $aStaticUserData); } else { // Namespace der Standard Unity NameSpaces::setNamespaceToObject('NSP_Application', ResourcesNameSpaces::getNamespaces($FL_APPL_SCAN, true)); } } $this->unity = $FL_APPL_UNITY; }
/** * @return String */ public function short() { return new String(Namespaces::shortClassName($this->value)); }