jguyomard/silex-pdo-boilerplate

A Boilerplate for Silex 2 using PDO

dev-master/gulp / 2.0.x-dev 2016-04-17 11:57 UTC

This package is not auto-updated.

Last update: 2024-04-24 22:16:36 UTC


README

This boilerplate is a fully functional Silex Application. You can use it for your new applications.

This boilerplate is configured with PDO Service Provider (instead of Doctrine, for instance) and Twig. It also comes with Gulp to build js/sass files (but you can find a version without gulp on master/no-npm branch if you prefer).

Note: I only make this boilerplate for my quick and fun projects. It's configured with Silex 2.0@dev. Use it at your own risk.

Code Organization

I like organizing my app in terms of features. For instance, all Controllers/Repositories/Entities/Tests/Views and CSS/JS related to the "Blog" module can be found in ./src/Blog directory tree.

Config is in ./config directory.

Creating a new Silex Application

composer create-project jguyomard/silex-pdo-boilerplate ./myapp 2.0.x-dev
cd ./myapp

Running

Create a sql database, import boilerplate.sql and update ./config/dev.config.php width information required to connect to the database. With mysql:

mysql -u ... < boilerplate.sql
vi ./config/dev.config.php

To build js/sass files:

npm install
gulp build

To run this app with PHP built-in web server:

APP_ENV=dev php -S localhost:8080 -t web/ web/index.php

About this boilerplate

This Silex Boilerplate is configured with:

Service Providers

Front-End

This Gulp version is also configured with :

You can run :

gulp build                  // to build js/sass files with sourcemaps
gulp build --production     // to build js/sass files
gulp watch                  // to watch for files changes

Testing

To run the test suite, you need PHPUnit:

phpunit

Issues

If you have any problems with or questions about this boilerplate, please contact me through a GitHub issue. If the issue is related to Silex itself, or any configured packages, please leave an issue on their official repository.

Contributing

You are invited to contribute new features, fixes or updates to this container, through a Github Pull Request.