Giter Club home page Giter Club logo

zf2-components-list-generator's Introduction

zf2-components-list-generator

Build Status Total Downloads License

Generates a list of Zend Framework 2 components used by a project.

In your composer.json file instead of using "zendframework/zendframework" : "2.5.*" and so requiring the whole framework, use this script to get a list of used components, and require only those. Better yet, specify your composer file and the script will replace your "zendframework/zendframework" : "2.5.*" with the components used by your application.

For more info on why you should do this in your module/application read this blog post.

Table of contents

Installation

  1. Add this package to your composer.json file, in the require-dev section
    {
        "require-dev": {
            "robertboloc/zf2-components-list-generator": "dev-master"
        }
    }
  1. Run composer update

This will install the script into vendor/bin/zf2_components_list_generator.php

Usage

Execute the CLI script providing some/all of the following options :

--help | -h Get usage information.
--project | -p Path of the project to be scanned.
--composer | -c Path to the composer.json file to be updated. If not specified the output will be printed to the standard output.
--version | -v Use a specific version for the output.

For example calling the script using only the -p option:

php vendor/bin/zf2_components_list_generator.php -p /projects/MyProject/

Will output something like:

Replace "zendframework/zendframework" in your composer.json file with :
"zendframework/zend-mvc": "2.5.*",
"zendframework/zend-form": "2.5.*",
"zendframework/zend-db": "2.5.*",
"zendframework/zend-inputfilter": "2.5.*",
"zendframework/zend-view": "2.5.*",
"zendframework/zend-servicemanager": "2.5.*",
"zendframework/zend-loader": "2.5.*",
"zendframework/zend-stdlib": "2.5.*"

You can copy and paste this information directly into your composer file. If the -c option was used, the composer file will be updated automatically and the message will be :

/projects/MyProject/composer.json updated

Roadmap

  • Detect canonicalized components

zf2-components-list-generator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zf2-components-list-generator's Issues

CLI script does not work

This is the error stack:

vendor/bin/zf2_components_list_generator.php: line 1: ?php: No such file or directory
vendor/bin/zf2_components_list_generator.php: line 3: syntax error near unexpected token `__DIR__'
vendor/bin/zf2_components_list_generator.php: line 3: `if (file_exists(__DIR__ . '/../autoload.php')) {'

I think it could depends by the missing shebang line at the start of the script.

Sort components alphabetically

When the components list is generated the components should be in alphabetical order to facilitate scanning through the list for components.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.