Giter VIP home page Giter VIP logo

phalcon-bootstrap's Introduction

Bootstrap component for Phalcon Build Status Dependency Status

This component is used as a basis for Pherlin. I recommend to use it instead of this bootstrap.

Run application

To launch the application, you need to execute code:

$app = new Bootstrap(new FactoryDefault());
echo $app->run();

Pass true into a method app(), if you do not want to run the handler:

$app = new Bootstrap(new FactoryDefault());
echo $app->run(true);

Configuration file

By default, the configuration file is here ../app/config/config_%environment%.ini. %environment% - environment under which the application is running.

To change the configuration file, you must use the method setPathConfig():

$app = new Bootstrap(new FactoryDefault());
$app->setPathConfig('config/config.%environment%.yml');
echo $app->run();

Environment

By default, the environment is set to `` `dev ```. To change it, pass the second parameter name of the desired environment.

$app = new Bootstrap(new FactoryDefault(), 'prod');

Сaching

Bootstrap allows you to cache the application configuration. When creating object of class Bootstrap, there is check the presence of apc or apcu. If APC(u) is found, the configuration will be cached. To disable caching, you should report it:

$app = new Bootstrap(new FactoryDefault(), 'prod');
$app->setCacheable(false);

// check
echo $app->isCacheable();
// print: false

Loader

If you need the autoloader (Phalcon\Loader), you can request it from the bootstrap:

$app = new Bootstrap(new FactoryDefault(), 'prod');

/**
* @var $loader Phalcon\Loader
*/
$loader = $app->getLoader();

phalcon-bootstrap's People

Contributors

jimmdigrizli avatar

Watchers

 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.