/** * @internal */ public function __invoke(\Interop\Container\ContainerInterface $container, $requestedName, array $options = null) { $applicationConfig = $container->get('ApplicationConfig'); if (isset($applicationConfig['Library\\UserConfig'])) { return $applicationConfig['Library\\UserConfig']; } else { $reader = new \Zend\Config\Reader\Ini(); return $reader->fromFile(getenv('BRAINTACLE_CONFIG') ?: \Library\Application::getPath('user_config/braintacle.ini')); } }
/** * Get path to module directory * * @param string $path Optional path component that is appended to the module root path * @return string Absolute path to requested file/directory (directories without trailing slash) */ public static function getPath($path = '') { return \Library\Application::getPath('module/Model/' . $path); }
/** * Get path to module directory * * @param string $path Optional path component that is appended to the module root path * @return string Absolute path to requested file/directory (directories without trailing slash) */ static function getPath($path = '') { return \Library\Application::getPath('module/Console/' . $path); }
public function testGetApplicationConfigWithTestEnvironment() { $this->assertEquals(array_merge_recursive(require Application::getPath('config/application.config.php'), array('modules' => array('moduleName'), 'module_listener_options' => array('module_paths' => array(realpath(__DIR__ . '/../..'))), 'Library\\UserConfig' => array('debug' => array('display backtrace' => true, 'report missing translations' => true)))), Application::getApplicationConfig('moduleName', true)); }