2017 © Pedro Peláez
 

library zf-composer-autoloading

Sets up Composer-based autoloading for your Zend Framework modules

image

zfcampus/zf-composer-autoloading

Sets up Composer-based autoloading for your Zend Framework modules

  • Friday, May 4, 2018
  • by zendframework
  • Repository
  • 3 Watchers
  • 9 Stars
  • 162,436 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 7 Versions
  • 21 % Grown

The README.md

zf-composer-autoloading

Repository abandoned 2019-12-31

This repository has moved to laminas/laminas-composer-autoloading., (*1)

Build Status Coverage Status, (*2)

Introduction

The zf-composer-autoloading package provides a single vendor binary, zf-composer-autoloading, which provides following commands:, (*3)

  • enable - add the named module to the project autoloading rules defined in composer.json, and
  • disable - remove autoloading rules for the module from composer.json

Both commands also dump the autoloading rules on completion., (*4)

Upgrading

If you were using the v1 series of this component, the script previously exposed was autoload-module-via-composer. That script is now renamed to zf-composer-autoloading., (*5)

Installation

Run the following composer command:, (*6)

$ composer require --dev "zfcampus/zf-composer-autoloading"

Note the --dev flag; this tool is intended for use in development only., (*7)

Usage

$ ./vendor/bin/zf-composer-autoloading \
> enable|disable \
> [help|--help|-h] \
> [--composer|-c <composer path>] \
> [--type|-t <psr0|psr4>] \
> [--modules-path|-p <path>] \
> modulename

Commands

  • enable - enables composer-based autoloading for the module.
  • disable - disables composer-based autoloading for the module.

Arguments

  • help, --help, and -h each display the script's help message.
  • --composer and -c each allow you to specify the path to the Composer binary, if it is not in your $PATH.
  • --type and -t allow you to specify the autoloading type, which should be one of psr-0 or psr-4; if not provided, the script will attempt to auto-determine the value based on the directory structure of the module.
  • --modules-path and -p allow you to specify the path to the modules directory; default to module.
  • modulename is the name of the module for which to setup Composer-based autoloading.

Notes

  • Modules are assumed to have a src/ directory. If they do not, the autoloading generated will be incorrect.
  • If unable to determine the autoloading type, PSR-0 will be assumed.
  • On enabling autoloading, if the Module class file for the module is in the module root, it will be moved to the module's src/ directory (zend-mvc applications only).

Examples

  1. Autodetect a module's autoloading type, and generate a Composer autoloading entry for "Status" module., (*8)

    $ ./vendor/bin/zf-composer-autoloading enable Status
    
  2. Autodetect a module's autoloading type, and remove a Composer autoloading entry for "Status" module., (*9)

    $ ./vendor/bin/zf-composer-autoloading disable Status
    
  3. Specify PSR-0 for the module type, and generate a Composer autoloading entry for "Status" module., (*10)

    $ ./vendor/bin/zf-composer-autoloading enable --type psr0 Status
    
  4. Specify PSR-4 for the module type, and generate a Composer autoloading entry for "Status" module., (*11)

    $ ./vendor/bin/zf-composer-autoloading enable --type psr4 Status
    
  5. Specify the path to the composer binary when generating autoloading entry for "Status" module:, (*12)

    $ ./vendor/bin/zf-composer-autoloading enable -c composer.phar Status
    
  6. Specify the path to modules directory, and generate a Composer autoloading entry for "Status" module., (*13)

    $ ./vendor/bin/zf-composer-autoloading enable -p src Status
    

The Versions

04/05 2018

dev-develop

dev-develop http://apigility.org/

Sets up Composer-based autoloading for your Zend Framework modules

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework console zendframework zf autoloading

04/05 2018

dev-master

9999999-dev http://apigility.org/

Sets up Composer-based autoloading for your Zend Framework modules

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework console zendframework zf autoloading

04/05 2018

2.1.0

2.1.0.0 http://apigility.org/

Sets up Composer-based autoloading for your Zend Framework modules

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework console zendframework zf autoloading

22/02 2017

2.0.0

2.0.0.0 http://apigility.org/

Sets up Composer-based autoloading for your Zend Framework modules

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

framework console zendframework autoloading

22/02 2017

1.1.1

1.1.1.0 http://apigility.org/

Sets up Composer-based autoloading for your Zend Framework modules

  Sources   Download

BSD-3-Clause

The Development Requires

framework console zf2 zendframework autoloading

16/02 2017

1.1.0

1.1.0.0 http://apigility.org/

Sets up Composer-based autoloading for your Zend Framework modules

  Sources   Download

BSD-3-Clause

The Development Requires

framework console zf2 zendframework autoloading

12/08 2016

1.0.0

1.0.0.0 http://apigility.org/

Sets up Composer-based autoloading for your Zend Framework modules

  Sources   Download

BSD-3-Clause

The Development Requires

framework console zf2 zendframework autoloading