2017 © Pedro Peláez
 

library silex-pdo-boilerplate

A Boilerplate for Silex 2 using PDO

image

jguyomard/silex-pdo-boilerplate

A Boilerplate for Silex 2 using PDO

  • Sunday, April 17, 2016
  • by jguyomard
  • Repository
  • 1 Watchers
  • 0 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Silex 2 with PDO - Boilerplate

This boilerplate is a fully functional Silex Application. You can use it for your new applications., (*1)

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)., (*2)

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., (*3)

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., (*4)

Config is in ./config directory., (*5)

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:, (*6)

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

To build js/sass files:, (*7)

npm install
gulp build

To run this app with PHP built-in web server:, (*8)

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

About this boilerplate

This Silex Boilerplate is configured with:, (*9)

Service Providers

Front-End

This Gulp version is also configured with :, (*10)

You can run :, (*11)

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:, (*12)

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., (*13)

Contributing

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

The Versions