GithubHelp home page GithubHelp logo

mtymek / zf-development-mode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zfcampus/zf-development-mode

0.0 2.0 0.0 141 KB

ZF2 development mode module

License: BSD 3-Clause "New" or "Revised" License

zf-development-mode's Introduction

zf-development-mode

This ZF2 "development mode" module allows you to specify configuration and modules that should only be enabled when in development, and not when in production.

Requirements

Please see the composer.json file.

Installation with Composer

  1. Add "zfcampus/zf-development-mode": "2.*" to the "require" section your composer.json file and run php composer.phar update.

  2. Copy development.config.php.dist to your application's config/ directory, without renaming the file, and edit as required. Commit this file to your version control system.

  3. Add any development modules to the "require-dev" section of your application's composer.json. e.g:

         "zendframework/zend-developer-tools": "dev-master",
         "zendframework/zftool": "dev-master"

    and run composer.update.

  4. If you're using Zend Developer Tools, Copy ./vendor/zendframework/zend-developer-tools/config/zenddevelopertools.local.php.dist to ./config/autoload/zenddevelopertools.local.php. Change any settings in it according to your needs.

  5. Add 'ZF\DevelopmentMode' to the list of Modules in your application's config/application.config.php file.

  6. In your application's public/index.php, replace these lines:

         // Run the application!
         Zend\Mvc\Application::init(require 'config/application.config.php')->run();

    with

         // Run the application!
         // Config
         $appConfig = include 'config/application.config.php';
    
         if (file_exists('config/development.config.php')) {
             $appConfig = Zend\Stdlib\ArrayUtils::merge($appConfig, include 'config/development.config.php');
         }
    
         // Run the application!
         Zend\Mvc\Application::init($appConfig)->run();

To enable development mode

cd path/to/install
php public/index.php development enable

To disable development mode

cd path/to/install
php public/index.php development disable

Note: Don't run development mode on your production server.

zf-development-mode's People

Contributors

akrabat avatar baghayi avatar martinezdelariva avatar ojhaujjwal avatar samsonasik avatar thadafinser avatar weierophinney avatar ydyachenko avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.