Download the PHP
package hxgf/xprss without Composer
On this page you can find all versions of the php package
hxgf/xprss. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
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.
XPRSS — A fast, unopinionated, minimalist web framework for PHP.
This is almost a direct clone of express-php, which tries to clone the NodeJS ExpressJS framework writing style. It does not have an event loop, it just mimics the method and helpers names that ExpressJS offers.
Install
Requirements: PHP >= 7.0 and Apache.
Then, copy the .htaccess to the root of your site:
(if you don't want to copy, put this in a new .htaccess file)
(you can also do it for nginx)
Usage / DEMO example init
here's a quick example of how to initialize. if you're interested in more boilerplate check out [the docs] for more options and also the [index.php file in the app] contains a full example and also also [create-xprss-app] for a reasonable boilerplate starter kit thing
Routes
Routes are handled using a Router instance, for example:
You can handle post requests as well using post() instead of get(). Same for put() and delete().
Route with dynamic parameters
You can route dynamic URL using parameters, for example:
Responses
If you're developing an API for example, you can send json simply doing:
You can also send a custom http response code using:
TIP: There are a few more examples in the index.php file in this repository.
Static files
If you wish to serve static files (likes images, html only) you can use:
Template engines
You're on your own for templating...at some point we'll have a guide for how to support various template engines (jade/pug, handlebars, twig, etc)
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 hxgf/xprss contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.