https://github.com/sohelamin/package-boilerplate
PHP Package Boilerplate
https://github.com/sohelamin/package-boilerplate
Last synced: 8 months ago
JSON representation
PHP Package Boilerplate
- Host: GitHub
- URL: https://github.com/sohelamin/package-boilerplate
- Owner: sohelamin
- Created: 2015-08-13T11:32:52.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-08-14T17:56:53.000Z (about 10 years ago)
- Last Synced: 2025-01-06T19:40:03.575Z (9 months ago)
- Language: PHP
- Size: 117 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Package Boilerplate
PHP Package Boilerplate## Installation
1. Make your vendor directory under your project's main vendor directory.
```
cd vendor
mkdir my-vendor
```
2. Clone the package's boilerplate from github repo into your vendor's package directory.
```
git clone https://github.com/sohelamin/package-boilerplate.git my-package
cd my-package
```3. Add your package dir to your project's main **composer.json** file.
```
"psr-4": {
"App\\": "app/",
"MyVendor\\MyPackage\\": "vendor/my-vendor/my-package/src"
}
```
Note: When you will submit your package to **packagist.org** for composer package then you don't need to follow above instruction #3.
4. Navigate to your project directory and run.
```
composer dump-autoload
composer update
```## Usage
See the bellow snippets.
```php
\MyVendor\MyPackage\MyPackageClass::sayHi();// OR
use MyVendor\MyPackage;
MyPackageClass::sayHi();
```##Author