framework = $framework; $this->composerInstalled = $composerInstalled; } /** * Return Phacil Framework version or composer package version * * @param string $package (Optional) If empty, return the current framework version * * @return string|false */ public function get($package = null) { return (!$package) ? $this->framework : $this->getPackageVersion($package); //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 string $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; } }