Download the PHP package silktide/lazy-boy without Composer

On this page you can find all versions of the php package silktide/lazy-boy. 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 lazy-boy

lazy-boy

A skeleton REST API application, using Silex and Syringe with support for Puzzle-DI

Summary

Older versions of this project will make templates. Version 5 just works within the constraints of providing the Lazy Boy will create a skeleton Silex framework, so you can create REST APIs without having to bother with boilerplate code.

It is packaged with a route loader and uses Syringe, which allows you to define both your routes and services in configuration files, rather than PHP

(The rest of this Readme is probably nonsense)

Requirements

Installation

install using composer:

composer require silktide/lazy-boy:^2.0

Lazy Boy will automatically generate several files from templates, whenever composer update or composer install is run. You are free to make modifications; Lazy Boy will not overwrite a file which already exists, so committing those changes to a VCS is safe. Having your VCS ignore the files will mean they are generated when you install vendors on a freshly cloned repository.

If you want to disable automatic file generation, so you can use the FrontController or RouteLoader perhaps, add the following to your composer file:

All that is left to do is create a vhost or otherwise point requests to web/index.php.

Routing

Routes

If you are using the standard Lazy-Boy route loader, you can define your routes in configuration files, using YAML or JSON. Each route is defined as follows:

routes is an associative array of routes that you want to allow access to.

In this case, a HTTP request that was POSTed to /sub/directory, would access a service in the container called test-controller and call it's method doSomething. This route could be referenced as route-name when using the router.

For each route, the url and action parameters are required, but method is optional and defaults to GET.

You can also use the assert parameter to overwrite the default regex for parameter of a route. For example

The URL /user/56 would match and the id parameter would come back as 56. The URL /user/56/foo would not match.

Going to the URL /user/56 would match and again, the my_wildcard parameter would come back as 56. Going the the URL /user/56/foo would match and the my_wildcard parameter would return 56/foo

Groups

If you have many routes with similar URLs, such as:

you can use a group to wrap them with a common url prefix.

Imports

if you have a lot of routes, it can be convenient to separate related routes into different files. In this case, you can import files into a parent file by using the imports array:

Imported files are merged into a single configuration array before routes and groups are processed. Where route naming conflicts arise, the latter import will overwrite the former and the importing file will take precedence over any imported routes.

Custom Templates

Lazy Boy uses a simple template system to create standard config and entry point files. It is possible to hook into this system to extend Lazy Boy and install custom templates.

The extending library should be used as Lazy Boy is; required into an application as a composer dependency. The library itself should require Lazy Boy as normal, but then add extra data to the composer.json file to configure the templates:

As in the example config, you can replace an existing template with a custom one by using the same template name. You can choose to override the template and/or the output file location.

Currently the following templates are predefined

Template Name Output Location
bootstrap * app/bootstrap.php
services app/config/services.yml
routes app/config/routes.yml
console ** app/console.php
index web/index.php
htaccess web/htaccess

* This template is protected and cannot be overridden

* This template depends on the symfony/console library being present in the package list*

Usage In Applications

In order to prevent dependencies from installing templated files ad hoc, Lazy Boy requires that you whitelist the package name in your application, before it will install any custom templates. This is done by adding the following code to the applications composer.json file

Contributing

If you have improvements you would like to see, open an issue in this github project or better yet, fork the project, implement your changes and create a pull request.

The project uses PSR-2 code styles and we insist that these are strictly adhered to. Also, please make sure that your code works with php 5.4, so things like generators, finally, empty(someFunction()), etc... should be avoided

Why "Lazy Boy"

Because it likes REST, of course :)


All versions of lazy-boy with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
silex/silex Version ^2.0
silktide/syringe Version ~3
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 silktide/lazy-boy contains the following files

Loading the files please wait ....