I use something based on the following, merging the configs also
allows the admin to extend (override) the default config production
settings, e.g. in the default module the session.name might be 'app'
and in the admin it might be set to 'admin-app', but the rest of the
session settings as speficied in the default config would be used
(only the session name is overridden).

file: /config.ini

[production]
default.module = 'default'
session.name = 'app'
session.domain = 'test.com'
database.name = 'app_prod'

[development]
database.name = 'app_dev'




file: /admin/config.ini

[production]
default.module = 'admin'
session.name = 'admin-app'

[development]


file: /index.php
<?php

        // Env and Paths
    require '../application/application.php';

    require_once 'Zend/Application.php';

    $application = new Zend_Application(
        APPLICATION_ENV,
        new Zend_Config_Ini(APPLICATION_PATH.'/configs/application.ini',
APPLICATION_BOOTSTRAP_MODE)
    );

    $application->setBootstrap(APPLICATION_PATH.'/bootstrap/Bootstrap.php',
'Bootstrap')
                ->bootstrap()
                ->run();

file: /admin/index.php
<?php

        // Env and Paths
    require '../../application/application.php';

    require_once 'Zend/Application.php';

    $config = new Zend_Config_Ini(
        APPLICATION_PATH.'/configs/application.ini',
        APPLICATION_BOOTSTRAP_MODE, true);

    $config->merge(new Zend_Config_Ini(
                    APPLICATION_PATH.'/configs/admin/application.ini',
                    APPLICATION_BOOTSTRAP_MODE));

    $application = new Zend_Application(APPLICATION_ENV, $config);

    $application->setBootstrap(APPLICATION_PATH.'/bootstrap/Bootstrap.php',
'Bootstrap')
                ->bootstrap()
                ->run();

Reply via email to