Download the PHP package lucatume/klein52 without Composer

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

klein.php is a lightning fast router for PHP 5.3+; klein52 is its port to PHP 5.2 compatible code. This version is a fork of klein.php v. 1.2.0 that has been modified to run in PHP 5.2; this is not up to date with klein.php latest version.
All kudos to the original author.

Getting started

  1. PHP 5.2.17 is required
  2. Setup URL rewriting so that all requests are handled by index.php
  3. Use <?php require 'klein_load.php';
  4. use the klein_load() function to load a PHP 5.2+ compatible, not namespaced version of klein (as the original) or use klein_wp_load() to load a klein_ prefixed, PHP 5.2+ and WordPress compatible version of the library
  5. (Optional) Throw in some APC for good measure; the version of the library loaded with klein_wp_load() will rely on WordPress caching functions

Example

In all the examples below the the not prefixed functions and class names from the not version of the library loaded with klein_load() are shown; add a klein_ prefix to each function and class name if the library was loaded using klein_wp_load.
Only exception to the above rule: the inNamespace() function of the default library transalates to the klein_with function in the WordPress compatible version of the library.

Example 1.1 - Respond to all requests (PHP 5.3 syntax)

Example 1.2 - Respond to all requests (PHP 5.2 syntax)

Note: in all of the examples below I will use PHP 5.3+ compatible code for brevity; to make any example work with PHP 5.2 compatible syntax replace any closure with a named function (see Example 1.2).

Example 2 - Named parameters

Example 3 - So RESTful

Example 4 - Sending objects / files

Example 5 - All together

Route namespaces

Lazy services

Services can be stored lazily, meaning that they are only instantiated on first use.

Validators

To add a custom validator use addValidator($method, $callback)

You can validate parameters using is<$method>() or not<$method>(), e.g.

Validation methods are chainable, and a custom exception message can be specified for if/when validation fails

Routing

[ match_type : param_name ]

Some examples

*                    // Match all request URIs
[i]                  // Match an integer
[i:id]               // Match an integer as 'id'
[a:action]           // Match alphanumeric characters as 'action'
[h:key]              // Match hexadecimal characters as 'key'
[:action]            // Match anything up to the next / or end of the URI as 'action'
[create|edit:action] // Match either 'create' or 'edit' as 'action'
[*]                  // Catch all (lazy)
[*:trailing]         // Catch all as 'trailing' (lazy)
[**:trailing]        // Catch all (possessive - will match the rest of the URI)
.[:format]?          // Match an optional parameter 'format' - a / or . before the block is also optional

Some more complicated examples

/posts/[*:title][i:id]     // Matches "/posts/this-is-a-title-123"
/output.[xml|json:format]? // Matches "/output", "output.xml", "output.json"
/[:controller]?/[:action]? // Matches the typical /controller/action format

Note - all routes that match the request URI are called - this allows you to incorporate complex conditional logic such as user authentication or view layouts. e.g. as a basic example, the following code will wrap other routes with a header and footer

Routes automatically match the entire request URI. If you need to match only a part of the request URI or use a custom regular expression, use the @ operator. If you need to negate a route, use the ! operator

Views

You can send properties or helpers to the view by assigning them to the $response object, or by using the second arg of $response->render()

myview.phtml

Views are compiled and run in the scope of $response so all response methods can be accessed with $this

-## API

More information

See the wiki for more information

Contributors

License

(MIT License)

Copyright (c) 2010 Chris O'Hara [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of klein52 with dependencies

PHP Build Version
Package Version
Requires php Version >=5.2.17
xrstf/composer-php52 Version 1.*
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 lucatume/klein52 contains the following files

Loading the files please wait ....