private function injectConstantInYamlarh() { if ($this->sphring->getYamlarh() === null) { return; } $this->sphring->getYamlarh()->addAccessibleVariable(SphringYamlarhConstantEnum::ROOTPROJECT, $this->sphring->getRootProject()); $this->sphring->getYamlarh()->addAccessibleVariable(SphringYamlarhConstantEnum::SERVER, $_SERVER); $this->sphring->getYamlarh()->addAccessibleVariable(SphringYamlarhConstantEnum::POST, $_POST); $this->sphring->getYamlarh()->addAccessibleVariable(SphringYamlarhConstantEnum::GET, $_GET); }
public function initReader() { LoggerSphring::getInstance()->info("Initiating registering annotation"); $file = $this->sphring->getRootProject() . DIRECTORY_SEPARATOR . SphringComposerEnum::AUTLOADER_FILE; if (!is_file($file)) { $file = $this->sphring->getContextRoot() . DIRECTORY_SEPARATOR . SphringComposerEnum::AUTLOADER_FILE; } if (!is_file($file)) { $file = $this->getAutoloaderFromLibrary(); } if (!is_file($file)) { $file = $_SERVER['CONTEXT_DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . SphringComposerEnum::AUTLOADER_FILE; } if (!is_file($file)) { $file = dirname($this->composerManager->getComposerLockFile()) . DIRECTORY_SEPARATOR . SphringComposerEnum::AUTLOADER_FILE; } if (!is_file($file)) { throw new SphringAnnotationException("Can't found autoloader for annotation reading."); } $loader = (require $file); AnnotationRegistry::registerLoader(array($loader, 'loadClass')); }