Download the PHP package libertyphp/libertyphp without Composer

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

Liberty PHP

Fast and extensible micro framework for PHP. Liberty PHP helps you build RESTful web applications quickly and easily.

Philosophy of the project =========================

Installation and quick start

Install

Install Liberty PHP with composer

Make directories like this:

Class autoload

Append to autoload rule:

Error handler

Create file with content:

DI container

Set up a container for HTTP request. Create file with content:

Core file

Create file with content:

Layout view

Create view file with content:

Index page

Create view file with content:

Controller with many actions is bad solution (violates the Single Responsibility Principle). Each action must be in separated class. Create action controller file with content:

Router

Create file with content:

Public script

Create public file with content:

Nginx configuration

Use this template for Nginx configuration:

Summary

At the end there will be such a directory and file structure:

Now you can open the project in the browser.

Data Access Layer

To work with relational databases, we recommend using Liberty PHP Datamapper

Logging

There is only one logger implementation available in the LibertyPHP - SimpleLogger (PSR LoggerInterface implementation). Append this code to :

Logger usage example:

Routing

Route rules example to demonstrate the possibilities of routing:

Use of middlewares (PSR MiddlewareInterface implementation) in routes is available:

Views

The easiest way to render view content is to use the class . Example:

Base view

Instance of class allows adding stylesheets and scripts files at render time.

Code example in controller:

Code example in view:

Layout view

Instance of class allows adding title, keywords and description. Rendering of layout view requires content view. First, the content view will be rendered, then the layout will be.

Code example in controller:

Code example in layout view:

Pagination

The Liberty PHP allows to quickly create a classic pagination. Example code in controller:

Example code in view:

Utils

Randomizer

The Liberty PHP allows generating cryptographically secure UUID v4. Example:

And cryptographically secure hex. Example:

List by key

It often happens that from a list of arrays or from an list of objects you need to create an associative array, in which the key will be the value of the array column or the property of the object. Simple way to do it:

Copyright

Copyright (c) 2018-2022 Vladimir Lila. See LICENSE for details.


All versions of libertyphp with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
psr/log Version ^1.1.4
psr/container Version ^2.0.2
psr/http-message Version ^1.0.1
psr/http-server-middleware Version ^1.0.1
guzzlehttp/psr7 Version ^2.4.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 libertyphp/libertyphp contains the following files

Loading the files please wait ....