Skip to content

A simple PHP script to generate a composer package structure.

License

Notifications You must be signed in to change notification settings

lcherone/composer-package-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composer Package Generator

This very simple PHP script will generate the following structure, ready to start creating your composer package.

 ┐
 ├── src
 ├── tests
 │   ├── fixtures
 │   ├── VendorPackageTest.php (generated based upon your namespace)
 │   └── bootstrap.php
 ├── .gitignore
 ├── .scrutinizer.yml
 ├── .styleci.yml
 ├── .travis.yml
 ├── CONTRIBUTING.md
 ├── LICENSE
 ├── phpunit.xml
 ├── README.md
 └── composer.json

Install

Git clone this project:

$ git clone [email protected]:lcherone/composer-package-generator.git .

Don't forget to delete the .git/ folder!

Generate your project files, like a boss!

Open up and edit setup.php, enter your details in the following array:

/**
 * Define the package settings
 */
$package = [
    'name' => 'vendor/package',
    'title' => 'My Package',
    'description' => 'This is my package, description.',
    'type' => 'library',
    'keywords' => [
        'example', 'project', 'boilerplate', 'package'
    ],
    'homepage' => 'http://github.com/vendor/package',
    'authors' => [
        [
            'name' => 'Your Name',
            'email' => '[email protected]',
            'homepage' => 'http://github.com/vendor',
            'role' => 'Owner'
        ]
    ],
    'autoload' => [
        'psr-4' => [
            'Vendor\\Package\\' => 'src',
        ]
    ],
    'autoload-dev' => [
        'psr-4' => [
            'Vendor\\Package\\Tests\\' => 'tests',
        ]
    ]
];

Once you edited the array, save the file and then run the following to generate your project files:

$ php setup.php

Examine the generated files and make your tweeks, especially the README.md which your need to finish off.

Badges:

Markdown links and images will have been added to the README.md and should work once you push your project and enable the project on these 3rd party sites.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Releases

No releases published

Packages

No packages published

Languages