Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6214333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:51:28+00:00 2026-05-24T06:51:28+00:00

I am just getting started with a big Zend Framework project. One thing confuses

  • 0

I am just getting started with a big Zend Framework project. One thing confuses me so far: much of the configuration seems to be stored in a single file at application/configs/application.ini. This file includes various things essential to the application’s function such as app namespace, controller plugins, etc. and also the database login details. I have some external contractors that I need to get working on this project, but I don’t want them to have all my database details. In Zend how do you separate the environment info such as db logins (which may be different for different developers) from the application config (which will be the same for everyone)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:51:30+00:00Added an answer on May 24, 2026 at 6:51 am

    I agree that this is more difficult in ZF than it should be, hopefully it’s an area that will be improved in future versions.

    In the meantime, it is quite easy to merge two config files with Zend_Config, and this is something you can use to your advantage. If you open public/index.php you’ll see a section near the bottom where it creates an instance of Zend_Application. By default the second parameter is the full path to your config file, but you can pass in an existing Zend_Config object instead. So you create two config objects: application.ini and environment.ini (call this whatever you like), merge them together, and then pass this to Zend_Application:

    $config = new Zend_Config_Ini(
        APPLICATION_PATH.'/configs/application.ini', 
        APPLICATION_ENV, 
        array('allowModifications' => true)
    );
    $environment = new Zend_Config_Ini(
        APPLICATION_PATH.'/configs/environment.ini', 
        APPLICATION_ENV
    );
    
    $config->merge($environment);
    
    $application = new Zend_Application(APPLICATION_ENV, $config);
    $application->bootstrap()
                ->run();
    

    With this approach, you keep all the standard stuff in application.ini and move your database stuff to environment.ini. You then keep application.ini in source control, add environment.ini to gitignore/svn:ignore, and create a dummy environment.ini.dist which your other developers can use to setup their local projects.

    Note: If you have commented out the require_once calls in ZF’s library files for performance reasons, you may need to require in some of the Zend_Config classes in public/index.php to get this to work. This should be obvious from the errors though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just getting started with MVC, and it seems like it will be
I am just getting started with Silverlight and have recently added a Silverlight project
Just getting started with jQuery, and I've had some success so far. I've created
Our team is just getting started with Mercurial. One of the first things we've
I'm just getting started with cakePHP, and things aren't going so well so far.
I'm just getting started on a new MVC project, and like a good boy
I'm just getting started in PowerShell and one of my sysadmins told me that
Im just getting started on this whole WPF thing, and need to understand some
Just getting started with backbone.js, and one of the things I've noticed is that
Just getting started in xcode 4 and svn, opened my project (had been using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.