Download the PHP package lacockj/phi without Composer

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

Build Status

Phi

Phi is a fast, easy-to-use micro-framework for PHP that endeavors to be the perfect balance between the speed of core PHP functions, the convenience of class methods, and the security of coding best-practices.

Phi includes handy methods for

Read the full documentation on the Phi Wiki


Request Routing

Have nice, clean URLs!

Turn this: /api.php?type=user&id=12345

Into this: /users/12345

Clean URLs look better for webpage addresses, and are easier to use and understand for APIs. Phi can extract parameters from the URL for use in your code, like the user ID in the example above.

You create a list of URL patterns and request methods, and map them to whatever function or class method you want to handle the request. When a request matches a listed pattern, the handler function is called, receiving the URL parameters and input data. Input data could be GET query parameters, POST form data, or php://input.

Phi automatically responds to requests that don't match a URL pattern with the appropriate 404 "Not Found" status code. Similarly, an unexpected request method automatically gets a 405 "Method Not Allowed" status code and the Allow: response header with a list of the methods you do have in the list, in accordance with RFC 2616.


Response Formatting

Provide more context to your script's output. In one line of code, you can set the status code, status text, content type, and output your data in the selected format.

Using the headers and status codes makes it easier for your API's consumers to know when a request succeded or failed in a standarized way, and handle the response appropriately. All this information is already part of the HTTP definition, why not use it?


Database Queries

Databases are probably the most useful, and at the same time most troublesome tools in your web service. There is a constant struggle between making each request as fast as possible, and as secure as possible.

The number one best thing you can do to secure your database is use parameterized queries. But this normally requires a five step process to prepare the query, bind the query parameters, execute the query, bind the result variables, and then fetch and use the results.

With Phi, you can execute a parameterized database query in one line of code. Better still, you get back a result you can iterate like an array.

Impact to the script's speed is minimal; the results are not all loaded into memory at once but as they are accessed, which is especially useful for very large result sets. There is no loss of security using Phi's convenient query method, and it greatly improves the code readability.


Testing


All versions of phi with dependencies

PHP Build Version
Package Version
Requires php Version ^7 || ^8
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 lacockj/phi contains the following files

Loading the files please wait ....