zend-config

prevent merging two module config in Zend Framework 2

送分小仙女□ 提交于 2020-01-06 03:02:09
问题 I have two module in my ZF2 application, both module have different configuration for themself, and both module have different Module.php with different configruation inside it. I have a login process for Admin, which is defined in Module.php like below: in onBootstrap funtion: public function onBootstrap($e) { $e->getApplication()->getEventManager()->getSharedManager()->attach('Zend\Mvc\Controller\AbstractActionController', 'dispatch', function($e) { $controller = $e->getTarget();

Zend framework 2 accessing global config in model class

自古美人都是妖i 提交于 2020-01-04 03:19:16
问题 I have a model class which does not extend any core Zend module . This model was imported from my previous Zend framework 1 application . I am able to call its methods by converting it to namespace . The problem what I have is in reading global configuration in side the methods defined . In case of controller I was able to access global configuration using below code $config = $this->getServiceLocator()->get('config'); // This gives a union of global configuration along with module

Zend framework 2 accessing global config in model class

扶醉桌前 提交于 2020-01-04 03:18:29
问题 I have a model class which does not extend any core Zend module . This model was imported from my previous Zend framework 1 application . I am able to call its methods by converting it to namespace . The problem what I have is in reading global configuration in side the methods defined . In case of controller I was able to access global configuration using below code $config = $this->getServiceLocator()->get('config'); // This gives a union of global configuration along with module

ZF: Disable Resource Plugin in application.ini

徘徊边缘 提交于 2020-01-02 16:18:49
问题 How can I disable cache in the cli enviroment? Reason being, the system user that executes the script is not allowed to write to the cache directory, thus the script is unable to execute. In my application.ini I have [production] resources.cachemanager.database.frontend.name = Core resources.cachemanager.database.frontend.customFrontendNaming = false resources.cachemanager.database.frontend.options.lifetime = 7200 resources.cachemanager.database.frontend.options.automatic_serialization = true

Zend keep front controller from blocking image requests

荒凉一梦 提交于 2019-12-11 19:49:01
问题 Anytime I use an <img> tag in my Zend Framework application, no image is displayed. When I type the absolute path into the address bar, the front controller attempts to find an "images" controller. There HAS to be a way I can use <img src="/public/images/logo.png"> in Zend Framework right? I've tried it from within views, layouts, and helpers, and no luck. I've also used the $this->baseURL() technique, and the serverURL() technique by getting the info from the Front Controller, but it still

How to retrieve parameters from Zend application.ini file during the session? [duplicate]

你离开我真会死。 提交于 2019-12-09 15:18:10
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How could read application.ini on controller using zend framework application.ini is a configuration file in ZF. I have there some more settings than just those defaults that ZF manual writes about. But how may I retrieve those parameters from it from my action controllers for example? And where is it better to store this config during the session? The Bootstrap_Abstract class has getOptions() method which

Fatal exception in loading ini file

筅森魡賤 提交于 2019-12-07 20:37:14
问题 My project folder is demo, inside which I have the folders application, library and public. Inside the application folder, I have a folder named configs, inside which I have a file 'application.ini', which contains my database parameters. So, in the bootstrap.php which is in application directory, I set my database in Zend registry in a function called _initDbAdapter : $config = new Zend_Config_Ini('/demo/application/configs/application.ini', 'development'); Zend_Registry::set('config',

ZF: Disable Resource Plugin in application.ini

折月煮酒 提交于 2019-12-06 10:39:51
How can I disable cache in the cli enviroment? Reason being, the system user that executes the script is not allowed to write to the cache directory, thus the script is unable to execute. In my application.ini I have [production] resources.cachemanager.database.frontend.name = Core resources.cachemanager.database.frontend.customFrontendNaming = false resources.cachemanager.database.frontend.options.lifetime = 7200 resources.cachemanager.database.frontend.options.automatic_serialization = true resources.cachemanager.database.backend.name = File resources.cachemanager.database.backend

Fatal exception in loading ini file

牧云@^-^@ 提交于 2019-12-06 09:33:24
My project folder is demo, inside which I have the folders application, library and public. Inside the application folder, I have a folder named configs, inside which I have a file 'application.ini', which contains my database parameters. So, in the bootstrap.php which is in application directory, I set my database in Zend registry in a function called _initDbAdapter : $config = new Zend_Config_Ini('/demo/application/configs/application.ini', 'development'); Zend_Registry::set('config', $config); $db = Zend_Db::factory($config, $config->resources->db->params->asArray()); Zend_register('db',

How to preserve application.ini paths using Zend_Config_Writer_Ini

徘徊边缘 提交于 2019-12-06 08:07:20
问题 I'm currently working on a build system in Phing that takes a Zend Framework project template and configures it according to Phing parameters. One problem that I've come across is when using Zend_Config_Writer_Ini. My Phing task takes a pre-populated file from the repo called application.default.ini and modifies this using Zend_Config_Ini to add parameters from the build file (db details, etc). It then writes it to application.ini ready for the project to use. A simplified version of the