Download the PHP package statical/slim-static without Composer

On this page you can find all versions of the php package statical/slim-static. 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 slim-static

SlimStatic

Scrutinizer Code Quality Build Status

Slim PHP static proxy library.

Contents

About

SlimStatic provides a simple static interface to various features in the Slim micro framework. Turn this:

into this:

This library is based on Slim-Facades from Miroslav Rigler, but uses Statical to provide the static proxy interface.

Usage

Install via composer

Create your Slim app and boot SlimStatic:

Now you can start using the static proxies listed below. In addition there is a proxy to Statical itself, aliased as Statical and available in any namespace, so you can easily use the library to add your own proxies (see Customizing) or define namespaces.

If your app is namespaced you can avoid syntax like \App::method or use statements by employing the namespacing feature:

API

The following static proxies are available:

Statical Alias Proxy
App to Slim instance
Config calling the Slim config method
Container to Slim container instance
Input to Slim\Http\Request instance
Log to Slim\Log instance
Request to Slim\Http\Request instance
Response to Slim\Http\Response instance
Route calling Slim route-matching methods
View to Slim\View instance

App

Proxy to the Slim instance. Note that you cannot use the built-in resource locator statically, because App::foo = 'bar' is not a method call. Use the Container proxy instead.

Config

Sugar for Slim config, using the following methods:

Container

Proxy to the Slim container instance. Use this to access the built-in resource locator.

Input

Proxy to the Slim\Http\Request instance with an additional method:

Log

Proxy to the Slim\Log instance.

Request

Proxy to the Slim\Http\Request instance.

Response

Proxy to the Slim\Http\Response instance.

Route

Sugar for the following Slim instance route-mapping methods:

Note that because these methods call the Slim instance you can also invoke them with App::get, App::post etc.

View

Proxy to the Slim\View instance

Customizing

Since Statical is already loaded, you can use it to create your own static proxies. Let's take a PaymentService class as an example, that you want to alias as Payment.

The first step is to create a proxy class that extends the Statical\BaseProxy class. It is normally empty and you can name it whatever you wish:

You must then register this with Statical, using addProxyInstance if you use a class instance, or addProxyService if you want to use the Slim container. Using a class instance:

Using the Slim container:

Note that for namespaced code, the namespace must be included in the $proxy param.

License

SlimStatic is licensed under the MIT License - see the LICENSE file for details


All versions of slim-static with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
slim/slim Version ~2.3
statical/statical 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 statical/slim-static contains the following files

Loading the files please wait ....