protected function getThemes() { $themes = array(); $dir = $this->container->getParameter('kernel.root_dir') . '/../web/themes'; $finder = new Finder(); foreach ($finder->directories()->in($dir)->depth('== 0') as $directory) { $theme = $this->getTheme($directory->getBasename()); if ($theme) { $themes[] = $theme; } } return $themes; }
/** * @return array */ public static function getInstalledPhps() { static $phps; if (!isset($phps)) { $phps = []; $finder = new Finder(); $finder->directories()->in('/opt/phpbrew/php')->depth('== 0'); foreach ($finder as $file) { $phpbin = $file->getPathname() . '/bin/php'; if (!file_exists($phpbin)) { continue; } $phps[] = $file->getFilename(); } } return $phps; }