application = $app; } /** * Get information about the script installed under $path. Guessing classes ("oracles") try to figure out what * kind of CMS/script is installed and its database settings. * * @param string $path The path to scan * * @return array */ public function getCmsInfo($path) { // Initialise $ret = array( 'cms' => 'generic', 'installer' => 'angie-generic', 'database' => array( 'driver' => 'mysqli', 'host' => '', 'port' => '', 'username' => '', 'password' => '', 'name' => '', 'prefix' => '', ), 'extradirs' => array() ); // Get a list of all the CMS guessing classes $dummy = array(); $fs = new File($dummy); $files = $fs->directoryFiles(__DIR__ . '/Oracle', '.php'); if (empty($files)) { return $ret; } foreach ($files as $file) { $className = '\\Solo\\Pythia\\Oracle\\' . ucfirst(basename($file, '.php')); /** @var OracleInterface $o */ $o = new $className($path); if ($o->isRecognised()) { $ret['cms'] = $o->getName(); $ret['installer'] = $o->getInstaller(); $ret['database'] = $o->getDbInformation(); $ret['extradirs'] = $o->getExtradirs(); return $ret; } } return $ret; } }