Download the PHP package vesparny/silex-simple-rest without Composer

On this page you can find all versions of the php package vesparny/silex-simple-rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silex-simple-rest

Silex Simple REST

Latest Stable Version Total Downloads Build Status

A simple silex skeleton application for writing RESTful API. Developed and maintained by Alessandro Arnodo.

This project wants to be a starting point to writing scalable and maintainable REST api with Silex PHP micro-framework

Continuous Integration is provided by Travis-CI.

How do I run it?

After download the last release, from the root folder of the project, run the following commands to install the php dependencies, import some data, and run a local php server.

You need at least php **5.5.9* with SQLite extension enabled and Composer**

composer install 
sqlite3 app.db < resources/sql/schema.sql
php -S 0:9001 -t web/

You can install the project also as a composer project

    composer create-project vesparny/silex-simple-rest

Your api is now available at http://localhost:9001/api/v1.

Run tests

Some tests were written, and all CRUD operations are fully tested :)

From the root folder run the following command to run tests.

vendor/bin/phpunit 

What you will get

The api will respond to

GET  ->   http://localhost:9001/api/v1/notes
GET  ->   http://localhost:9001/api/v1/notes/{id}
POST ->   http://localhost:9001/api/v1/notes
PUT ->   http://localhost:9001/api/v1/notes/{id}
DELETE -> http://localhost:9001/api/v1/notes/{id}

Your request should have 'Content-Type: application/json' header. Your api is CORS compliant out of the box, so it's capable of cross-domain communication.

Try with curl:

#GET (collection)
curl http://localhost:9001/api/v1/notes -H 'Content-Type: application/json' -w "\n"

#GET (single item with id 1)
curl http://localhost:9001/api/v1/notes/1 -H 'Content-Type: application/json' -w "\n"

#POST (insert)
curl -X POST http://localhost:9001/api/v1/notes -d '{"note":"Hello World!"}' -H 'Content-Type: application/json' -w "\n"

#PUT (update)
curl -X PUT http://localhost:9001/api/v1/notes/1 -d '{"note":"Uhauuuuuuu!"}' -H 'Content-Type: application/json' -w "\n"

#DELETE
curl -X DELETE http://localhost:9001/api/v1/notes/1 -H 'Content-Type: application/json' -w "\n"

What's under the hood

Take a look at the source code, it's self explanatory :) More documentation and info about the code will be available soon.

Under the resources folder you can find a .htaccess file to put the api in production.

Contributing

Fell free to contribute, fork, pull request, hack. Thanks!

Author

License

see LICENSE file.


All versions of silex-simple-rest with dependencies

PHP Build Version
Package Version
Requires silex/silex Version ~2.0
monolog/monolog Version ~1.11
doctrine/dbal Version ~2.5
nesbot/carbon Version ~1.21
euskadi31/cors-service-provider Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vesparny/silex-simple-rest contains the following files

Loading the files please wait ....