framework = $framework; $this->composerInstalled = $composerInstalled; } /** * Return Phacil Framework version * * @return string|false */ public function get() { return $this->framework; //return file_get_contents(\Phacil\Framework\Config::DIR_SYSTEM() . "engine/VERSION"); } /** * Alias for get method * @return string|false */ public function getFrameworkVersion() { return $this->get(); } /** * Alias for get method * @return string|false */ public function getPhacilVersion() { return $this->get(); } /** * * @return string|false */ public function getPHPVersion() { return phpversion(); } /** @return string[] */ public function getComposerPackages() { //return call_user_func(array($this->composerInstalled, 'getInstalledPackages')); $composerInstalled = $this->composerInstalled; return $composerInstalled::getInstalledPackages(); } /** * * @param mixed $package * @return string|null * @throws \Phacil\Framework\Exception\OutOfBoundsException */ public function getPackageVersion($package) { //return call_user_func(array($this->composerInstalled, 'getVersion'), $package); $composerInstalled = $this->composerInstalled; try { return $composerInstalled::getVersion($package); } catch (\OutOfBoundsException $ob) { $notFind = new \Phacil\Framework\Exception\OutOfBoundsException($ob->getMessage(), $ob->getCode(), $ob); $notFind->setObject($ob); } return null; } }