A simple silex skeleton application for writing RESTful API. Developed and maintained by Alessandro Arnodo.
Continuous Integration is provided by Travis-CI.
Install as a project via composer:
curl -s http://getcomposer.org/installer | php
php composer.phar create-project vesparny/silex-simple-rest
or just download the tarball from github and install dependencies via composer:
php composer.phar install
- Configure
RewriteBase /path/to/appin/web/.htaccess - Create a database (an example mysql database is provided in
/docs/folder). - Configure database access information in
/app/config/dev.json.
Take a look to /src/boot.php to see how does it works.
Every files in the project follows PSR-0 standards.
In order to don't screw up autoloading it's important naming and declaring classes in StudlyCaps.
- Every route file place in
/app/Classes/Routes/is automatically loaded. (an example Api.php Route class is provided) - Same thing for file places in
/app/Classes/Business/. /app/config/default.jsonis overwritten by any configuration you place in/app/config/$env.json.- A logging file is created in
/app/logs/, every day a new file is created (logging level is configurable).
phpunit is required for the tests, place your own in /tests/ folder, following the namespace structure.
phpunit
Refer to single package documentation for more accurate support.
"silex/silex": "1.0.*",
"symfony/browser-kit": "2.1.*",
"symfony/css-selector": "2.1.*",
"symfony/finder": "2.1.*",
"symfony/process": "2.1.*",
"monolog/monolog": "1.2.*",
"symfony/validator": "2.1.*",
"igorw/config-service-provider": "1.0",
"doctrine/dbal": "2.2.*"
Fell free to contribute, fork, pull request, hack. Thanks!
####Alessandro Arnodo
see LICENSE file.
