Пример #1
0
 /**
  * Get mysql database information array
  *
  * @return array
  */
 public function getInformationArray()
 {
     $array = Config::get('connections')['mysql'];
     return $array;
 }
Пример #2
0
 /**
  * Database class factory
  *
  * @param Symfony\Component\Console\Output\OutputInterface $output
  * @return PronouncePHP\Database\Databases\(DatabaseClass)
  */
 public function buildDatabaseClass(OutputInterface $output)
 {
     $database_type = Config::get('database');
     if ($database_type === '4D') {
         $database_type = 'FourD';
     }
     $database_class = 'PronouncePHP\\Database\\Databases\\' . ucfirst($database_type) . 'Database';
     if (!class_exists($database_class)) {
         $output->writeln("<error>Database type not found!</error>");
         $output->writeln("<comment>Please ensure that the database type is specified and that it is supported</comment>");
         $GLOBALS['status'] = 1;
         exit;
     }
     return new $database_class();
 }