Sinergi Framework Project bootstrap

3.0.2 2014-08-08 19:08 UTC


Build Status Latest Stable Version License

Sinergi Framework is a PHP framework built for developers who want control on which package they use in their application.

It is built to really leverage the advantages of Composer, and offers a very flexible structure.

It also includes a bootstrap for Compass (SCSS) and JavaScript development as well as a turnkey development environment (Vagrant).

  1. Requirements
  2. Features
  3. Documentation
  4. Installation
  5. Usage
  6. Optimization for production


  • TextEditor
  • Git
  • Vagrant
  • VirtualBox



Sinergi includes Composer packages for the following features, each package can be replaced by your favorite one:


Sinergi includes a ready to go Vagrant development environment.

  • CentOS 6.5
  • PHP 5.5
  • MySQL 5.5
  • nginx 1.6
  • Gearman 1.0
  • Xdebug 2.2


Sinergi includes a JavaScript development directory that can be concatenated and minimized by Grunt.

Get started with Grunt

Your JavaScript source code resides in the javascripts directory. The Vagrant development VM will load files in this directory instead of the files in the public/javascripts directory so you can see your changes in real-time.

To compile the JavaScript source code into the final production code, use the following commands:

# Run this command only the first time
npm install --save-dev
# Then, run this command everytime you want to compile your JavaScript

You can also use Bower to manage dependencies and you should consider using RequireJS to autoload your JavaScript dependencies.

Compass (SCSS)

Sinergi is already configured to be able to compile SCSS code.

Get started with Compass

Compass will concatenate and minimize the files in the scss directory and put them in the public/stylesheets directory.


For specific documentation on the different packages used by Sinergi, please refer to the packages documentation:


It is recommended that you install the Sinergi Framework through composer. To do so, consider the following command:

composer create-project sinergi/sinergi

Alternatively, you can simply download the most recent release.


Getting started

To get started, boot your Vagrant VM with the following command:

vagrant up

You can then access this VM in your browser by typing in the address bar.

Note to Windows users, the Windows firewall can cause problems with Xdebug and the site may not be accessible, you may have to edit your firewall settings to use Xdebug.


To register a router in your app, edit the bin/router.php file and add your router:

new \DemoApp\Main\MainRouter($app->getRegistry());


To register a command in your app, edit the bin/command.php file and add your command:

$application->add(new DemoApp\Example\ExampleCommand($app->getRegistry()));

To use a command found in your app, enter the following command in a terminal:

php bin/command example


To use the Doctrine Console, simply enter the following command:

php bin/doctrine --list


To use the Gearman commands, simply enter the following command:

sudo php bin/gearman start

Optimization for production

This section will be more detailed later.

These optimizations will make your application blazing fast in production:

  • Setup Twig cache
  • Setup Doctrine cache
  • Setup Autoloading with Composer
  • Execute Grunt