GithubHelp home page GithubHelp logo

temistokles / bootstrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nette/bootstrap

0.0 2.0 0.0 402 KB

Bootstrap of your application

Home Page: http://nette.org

License: Other

PHP 100.00%

bootstrap's Introduction

Nette Bootstrap

Downloads this Month Build Status Latest Stable Version License

File bootstrap.php loads Nette Framework and all libraries that we depend on:

require __DIR__ . '/../vendor/autoload.php';

Class Configurator creates so called DI container and handles application initialization.

$configurator = new Nette\Configurator;

Activates Tracy in strict mode:

//$configurator->setDebugMode(TRUE);
$configurator->enableDebugger(__DIR__ . '/../log');

Setup directory for temporary files

$configurator->setTempDirectory(__DIR__ . '/../temp');

Activate autoloading, that will automatically load all the files with our classes:

$configurator->createRobotLoader()
	->addDirectory(__DIR__)
	->addDirectory(__DIR__ . '/../vendor/others')
	->register();

And according to the configuration files it generates a DI container. Everything else depends on it.

We will return this DI Container as a result of calling app/boostrap.php

$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');
return $configurator->createContainer();

and we will store it as local variable in www/index.php and run the application:

$container = require __DIR__ . '/../app/bootstrap.php';
$container->getService('application')->run();

That's it.

bootstrap's People

Contributors

dg avatar fprochazka avatar jantvrdik avatar xificurk avatar matej21 avatar vrtak-cz avatar hrach avatar juzna avatar jakubkulhan avatar vrana avatar vasekpurchart avatar paveljurasek avatar milo avatar ondrejslamecka avatar radekdostal avatar besanek avatar greeny avatar tomasvotruba avatar tomaswindsor avatar unlink avatar vojtech-dobes avatar accgit avatar raxtor avatar mikulas avatar mishak87 avatar majkl578 avatar kravco avatar martinsadovy avatar enumag avatar jsmitka avatar

Watchers

James Cloos avatar Juraj 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.