Ejemplo n.º 1
0
 /**
  * @internal
  */
 public function getConfig()
 {
     // Static configuration part
     $config = array('service_manager' => array('abstract_factories' => array('Database\\Service\\AbstractTableFactory'), 'factories' => array('Db' => 'Zend\\Db\\Adapter\\AdapterServiceFactory', 'Database\\Nada' => 'Database\\Service\\NadaFactory', 'Database\\SchemaManager' => 'Database\\Service\\SchemaManagerFactory')));
     if (\Library\Application::isTest()) {
         // Test setup with in-memory database
         $config['db'] = array('driver' => 'Pdo_Sqlite');
     } else {
         // Merge database configuration from config file
         $configFileContent = \Library\Application::getConfig();
         if (!is_array($configFileContent['database'])) {
             throw new \RuntimeException('Config file has no "database" section');
         }
         $config['db'] = $configFileContent['database'];
     }
     $config['db']['charset'] = 'utf8';
     return $config;
 }
Ejemplo n.º 2
0
 /**
  * @internal
  */
 public function getConfig()
 {
     $config = array('controller_plugins' => array('invokables' => array('_' => 'Library\\Mvc\\Controller\\Plugin\\TranslationHelper', 'RedirectToRoute' => 'Library\\Mvc\\Controller\\Plugin\\RedirectToRoute', 'UrlFromRoute' => 'Library\\Mvc\\Controller\\Plugin\\UrlFromRoute')), 'service_manager' => array('factories' => array('\\Library\\Logger' => 'Library\\Log\\LoggerServiceFactory'), 'invokables' => array('Library\\ArchiveManager' => 'Library\\ArchiveManager', 'Library\\Now' => 'DateTime', 'Library\\Random' => 'Library\\Random'), 'shared' => array('Library\\Now' => false)), 'translator_plugins' => array('invokables' => array('Po' => 'Library\\I18n\\Translator\\Loader\\Po')), 'view_helpers' => array('factories' => array('formYesNo' => 'Library\\View\\Helper\\Service\\FormYesNoFactory', 'htmlTag' => 'Library\\View\\Helper\\Service\\HtmlTagFactory'), 'invokables' => array('formSelectSimple' => 'Library\\View\\Helper\\FormSelectSimple', 'formSelectUntranslated' => 'Library\\View\\Helper\\FormSelectUntranslated')));
     $config += Application::getTranslationConfig(static::getPath('data/i18n'));
     if (\Locale::getPrimaryLanguage(\Locale::getDefault()) != 'en') {
         $zfTranslations = @($appConfig = Application::getConfig()['paths']['Zend translations']);
         if (is_dir($zfTranslations)) {
             $locale = \Locale::getDefault();
             $translationFile = "{$zfTranslations}/{$locale}/Zend_Validate.php";
             if (!is_file($translationFile)) {
                 $locale = \Locale::getPrimaryLanguage($locale);
                 $translationFile = "{$zfTranslations}/{$locale}/Zend_Validate.php";
                 if (!is_file($translationFile)) {
                     $translationFile = null;
                 }
             }
             if ($translationFile) {
                 $config['translator']['translation_files'][] = array('type' => 'phparray', 'filename' => $translationFile, 'text_domain' => 'Zend');
             }
         }
     }
     return $config;
 }