awurth/silex

Silex Micro-Framework skeleton


README

SensioLabsInsight Scrutinizer Code Quality

This is an app skeleton for the Silex PHP Micro-Framework to get started quickly

Features

Installation

Create project using Composer

$ composer create-project awurth/silex [project-name]

Setup environment variables

Copy .env.dist to a .env file and change the values to your needs. This file is ignored by Git so all developers working on the project can have their own configuration.

Download front-end dependencies

$ yarn

Or if you use npm:

$ npm install

Generate assets

If you just want to generate the default CSS and JS that comes with this skeleton, run the following command

$ yarn run encore dev

Or if you don't use yarn:

$ ./node_modules/.bin/encore dev

If you want to run a watcher and begin coding, just add the --watch option

$ yarn run encore dev --watch

See the documentation

Setup cache files permissions

The skeleton uses a cache system for Twig templates, translations, Doctrine, the web profiler and the Monolog library for logging, so you have to make sure that PHP has write permissions on the var/cache/ and var/log/ directories.

Update your database schema

$ php bin/console doctrine:database:create
$ php bin/console doctrine:schema:update --force

If you're using Oh My Zsh, you can install the symfony2 plugin, which provides an alias and autocompletion:

# Without Symfony2 plugin
$ php bin/console doctrine:database:create

# With Symfony2 plugin
$ sf doctrine:database:create