{"id":24764076,"url":"https://github.com/stillat/php-package","last_synced_at":"2026-05-13T07:10:02.577Z","repository":{"id":57059968,"uuid":"47011706","full_name":"Stillat/php-package","owner":"Stillat","description":"A PHP package template for the NewUp generator.","archived":false,"fork":false,"pushed_at":"2015-11-28T23:33:32.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T21:39:10.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Stillat.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-28T05:41:06.000Z","updated_at":"2015-11-28T05:41:50.000Z","dependencies_parsed_at":"2022-08-24T14:53:29.343Z","dependency_job_id":null,"html_url":"https://github.com/Stillat/php-package","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stillat%2Fphp-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stillat%2Fphp-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stillat%2Fphp-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stillat%2Fphp-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stillat","download_url":"https://codeload.github.com/Stillat/php-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122329,"owners_count":20564284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-28T21:32:27.007Z","updated_at":"2026-05-13T07:10:02.507Z","avatar_url":"https://github.com/Stillat.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Package\n\nPHP Package is a template for the [NewUp](https://github.com/newup/newup) package generator. The NewUp generator is a general-purpose tool for creating things from templates; PHP Package is a template that provides you with a starting point for your PHP projects.\n\n* [Installation](#installation)\n* [General Usage](#usage)\n* [Specifying a PHP Version](#phpv)\n* [PSR-0 / PSR-4](#psr)\n* [PHPUnit Integration](#phpunit)\n* [TravisCI Integration](#travis)\n* [License](#license)\n\n\u003ca name=\"installation\"\u003e\u003c/a\u003e\n## Installation\n\nFirst, make sure you have [NewUp](https://github.com/newup/newup) installed and configured. Afterwards, you can run this command:\n\n`newup template:install stillat/php-package`\n\nNewUp will then install and configure everything it needs to internally for the `php-package` template.\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## General Usage\n\nAfter you have installed the `php-package` template, we are ready to create a new PHP Package:\n\n`newup a stillat/php-package vendor/package \u003coutput_directory\u003e`\n\nIn the above example, replace `vendor/package` with the vendor and package name of your new package (for example `stillat/php-package`) and replace `\u003coutput_directory\u003e` with the directory you want the package to be created in.\n\nUsed with no options, PHP Package will create a directory/file structure similar to the following:\n\n~~~\nsrc/\n.gitignore\ncomposer.json\n~~~\n\nThe `src/` directory is where you will create your new package/library. It is empty so you have a fresh starting point. This directory will be autoloaded by Composer using the `psr-0` autoloader.\n\nThe `.gitignore` file contains quite a few options set for you by default, with instructions on how to remove configured options and where to find more.\n\nThe `composer.json` file is your standard `composer.json` file. If you configured NewUp with your name and email address, the authors field will already be filled in for you.\n\n\u003ca name=\"phpv\"\u003e\u003c/a\u003e\n## Specifying a PHP version\n\nYou can specify a PHP version that your package requires by providing an extra parameter when generating your package:\n\n`newup a stillat/php-package vendor/package \u003coutput_directory\u003e \u003cphp_version\u003e`\n\nBy default, the PHP version is set to `\u003e=5.5.9`.\n\nFor example, we could easily state that our package needs at least PHP 5.6 when creating our package (pay special attention to the quotes!):\n\n`newup a stillat/php-package vendor/package \u003coutput_directory\u003e \"\u003e=5.6\"`\n\n\u003ca name=\"psr\"\u003e\u003c/a\u003e\n## PSR-0 / PSR-4\n\nYou can choose which autoloader to use by supplying a value for the `--psr` option. The following table lists the valid values you can use:\n\n| Autoloader | Value | Example |\n|---|---|---|\n| PSR-0 | `psr0` | `newup a stillat/php-package \u003coutput_dir\u003e vendor/package --psr=psr0` |\n| PSR-4 | `psr4` | `newup a stillat/php-package \u003coutput_dir\u003e vendor/package --psr=psr4` |\n\nThe PSR-4 autoloader is selected by default.\n\nWhen choosing to use the PSR-0 autoloader, directory scaffolding will automatically be created for you. For example, if the package name was `stillat/test`, the following directory structure would be created when using the PSR-0 autoloader:\n\n~~~\n\u003coutput_directory\u003e/\n│── src/\n│   ├── Stillat/\n│   │   ├────── Test/\n├── composer.json\n├── .gitignore\n~~~\n\nThis is different that when using the PSR-4 autoloader, as the `src/` directory would just be empty.\n\n\n\u003ca name=\"phpunit\"\u003e\u003c/a\u003e\n## PHPUnit Integration\n\nTo enable PHPUnit support on your generated package, just add the \"--phpunit\" switch to the end of the command:\n\n`newup a stillat/php-package vendor/package \u003coutput_directory\u003e --phpunit`\n\nThe following additional directories/files will be created for you:\n\n~~~\ntests/\ntests/ExampleTest.php\nphpunit.xml\n~~~\n\nThe `tests/` directory will be where your tests will live. An example test (`tests/ExampleTest.php` is already included in this directory (this can be safely deleted).\n\nThe `phpunit.xml` file contains the configuration for PHPUnit. It is already configured with sensible defaults and features a customized test suite name.\n\nIn addition to creating new directories and files for you, opting in to PHPUnit integration will also update your generated `composer.json` file to include `mockery/mockery` and `phpunit/phpunit` automatically.\n\n\u003ca name=\"travis\"\u003e\u003c/a\u003e\n## TravisCI Integration\n\nIf you would like to rapidly configure TravisCI for your project, just add the `--travis` switch to the end of the command:\n\n`newup a stillat/php-package vendor/package \u003coutput_directory\u003e --travis`\n\nYou will see interactive prompts that will guide you through the configuration process. An example session might look something like this:\n\n~~~\nWould you like to add a PHP version to test? [Y/n] Y\nWhich PHP version would you like to test? 5.5.9\nDo you want to allow failures for PHP version 5.5.9? [y/N] N\n\nWould you like to add a PHP version to test? [Y/n] Y\nWhich PHP version would you like to test? 5.6\nDo you want to allow failures for PHP version 5.6? [y/N] N\n\nWould you like to add a PHP version to test? [Y/n] Y\nWhich PHP version would you like to test? 7.0\nDo you want to allow failures for PHP version 7.0? [y/N] Y\n\nWould you like to add a PHP version to test? [Y/n] Y\nWhich PHP version would you like to test? hhvm\nDo you want to allow failures for PHP version hhvm? [y/N] N\n\nWould you like to add a PHP version to test? [Y/n] N\n~~~\n\nThis would generate a `.travis.yml` file similar to the following:\n\n~~~\nlanguage: php\n\nphp:\n  - 5.5.9\n  - 5.6\n  - 7.0\n  - hhvm\n\nmatrix:\n    allow_failures:\n        - php: 7.0\n\nsudo: false\n\ninstall: travis_retry composer install --no-interaction --prefer-source\n~~~\n\n### TravisCI and PHPUnit\n\nIf you specify both the `--travis` and the `--phpunit` flags, the following script will be added to the end of your `.travis.yml` file automatically for you:\n\n`script: vendor/bin/phpunit`\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n## License\n\nLicensed under the MIT License. Enjoy!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstillat%2Fphp-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstillat%2Fphp-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstillat%2Fphp-package/lists"}