/silex-api-boilerplate

Learning by doing. An attempt to create a RESTful API with Silex. Silex is a micro MVC framework built using the Symfony Components.

Primary LanguagePHP

silex-api-boilerplate

Learning by doing. An attempt to create a RESTful API using Silex.

Getting Started

Must have PHP machine setup for development PHP 5.3.x. A DocumentRoot pointed to silex-api-boilerplate/web.

Installation

To get the source. Clone this repository locally or download.

# clone and name application
git clone git@github.com:nesbert/silex-api-boilerplate.git
cd silex-api-boilerplate

All commands relative silex-api-boilerplate directory.

Get Dependencies

composer.sh install

Set Permissions

rm -rf app/cache/*
rm -rf app/logs/*
APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\  -f1`
sudo chmod +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs

Run Functional Tests

../vendor/bin/phpunit

Sample Endpoints

http://localhost being a local domain.

http://localhost/
http://localhost/test/users
http://localhost/test/users/1

OSS <3

License

MIT

Contribute

Pull Requests always welcome, as well as any feedback or issues.