Download the PHP package yidas/codeigniter-psr4-autoload without Composer

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

CodeIgniter PSR-4 Autoload


CodeIgniter 3 PSR-4 Autoloader for Application

Latest Stable Version License Total Downloads Monthly Downloads

This PSR-4 extension is collected into yidas/codeigniter-pack which is a complete solution for Codeigniter framework.

FEATURES


OUTLINE

DEMONSTRATION

By default, all PSR-4 namespace with app prefix in Codeigniter would relates to application directory.


REQUIREMENTS

This library requires the following:


INSTALLATION

Run Composer in your Codeigniter project under the folder \application:

composer require yidas/codeigniter-psr4-autoload

Check Codeigniter application/config/config.php:

You could customize the vendor path into $config['composer_autoload']


USAGE

After installation, the namespace prefix app is used for the current Codeigniter application directory.

Static Class

Create a hepler with PSR-4 namespace with a new helpers folder under application directory, for eaxmple \application\helpers\:

Then call it in Controller action:

Extending Class

Create a class with PSR-4 namespace under application directory, for eaxmple application/model/BaseModel.php:

Then define a class to extend above class, for eaxmple application/model/My_model.php:

In this case, Codeigniter My_model could not use PSR-4 namespace.

Interface

Create a interface with a new interface folder under application directory, for eaxmple application/interface/CarInterface.php:

Then apply the interface to a class, for eaxmple application/libraries/Car.php:

In this case, the Car lib could be called by using new \app\libraries\Car;.

Trait

Create a trait under application directory, for eaxmple application/libraries/LogTrait.php:

Then inject the trait into a class, for eaxmple application/controller/Blog.php:

Abstract

Create an abstract under application directory, for eaxmple application/libraries/BaseController.php:

Then define a class to extend above abstract class, for eaxmple application/libraries/BaseController.php:


CONCEPTION

Codeigniter Loader is a good practice for loading one time instantiated component just like Yii2 Application Components, but it's lacking of Class mapping, which makes inconvenience to load classes including interfaces, traits, abstracts or extending classes.

Thus, You could defind classes with PSR-4 Namespace while these classes are not component kind, even Helpers which you may want use static method and customized class name.


LIMITATIONS

Namespace Class No Longer Support CI_Loader

The called class need to define namespace to support PSR-4 Autoload only, which means it would not support Built-in CI_Loader anymore.


All versions of codeigniter-psr4-autoload with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 yidas/codeigniter-psr4-autoload contains the following files

Loading the files please wait ....