Skip to content

Commit

Permalink
1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ctf0 committed Sep 13, 2019
1 parent 1919ad7 commit bae7d18
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# PackageChangeLog

[![Latest Stable Version](https://img.shields.io/packagist/v/ctf0/package-changelog.svg)](https://packagist.org/packages/ctf0/package-changelog) [![Total Downloads](https://img.shields.io/packagist/dt/ctf0/package-changelog.svg)](https://packagist.org/packages/ctf0/package-changelog)
<h1 align="center">
PackageChangeLog
<br>
<a href="https://packagist.org/packages/ctf0/package-changelog"><img src="https://img.shields.io/packagist/v/ctf0/package-changelog.svg" alt="Latest Stable Version" /></a> <a href="https://packagist.org/packages/ctf0/package-changelog"><img src="https://img.shields.io/packagist/dt/ctf0/package-changelog.svg" alt="Total Downloads" /></a>
</h1>

usually when a package gets updated, the package owner could possibly add/change/remove something from the configuration file,
or could add a new feature that he/she didn't have time to add to the read me yet,
Expand All @@ -18,15 +20,15 @@ Therefor **PackageChangeLog** was made, to help developers keep their packages a

- (Laravel < 5.5) add the service provider to `config/app.php`

```php
'providers' => [
ctf0\PackageChangeLog\PackageChangeLogServiceProvider::class,
]
```
```php
'providers' => [
ctf0\PackageChangeLog\PackageChangeLogServiceProvider::class,
]
```

- after installation, package will auto-register ["Why we need that ?"](https://getcomposer.org/doc/articles/scripts.md#what-is-a-script-)
+ `App\\Providers\\EventServiceProvider::postAutoloadDump` @**composer.json**
+ `postAutoloadDump` @**App\Providers\EventServiceProvider**
+ `App\\Providers\\EventServiceProvider::postAutoloadDump` @**composer.json**
+ `postAutoloadDump` @**App\Providers\EventServiceProvider**

<br>

Expand All @@ -36,25 +38,25 @@ Therefor **PackageChangeLog** was made, to help developers keep their packages a
+ add the package as a dependency
+ add `"changeLog": "log_folder_name"` to extra

```js
"require": {
// ...
"ctf0/package-changelog": "^1.0"
},
"extra": {
// ...
"changeLog": "logs"
}
```
```js
"require": {
// ...
"ctf0/package-changelog": "^1.0"
},
"extra": {
// ...
"changeLog": "logs"
}
```

- inside that folder add the log files

> the version have to be equal "==" to the release tag because we check against that version b4 showing the log.
> this is useful in-case you didn't add a changeLog for the current published version.

| release tag | log file name |
|-------------|---------------|
| v1.0.0 | v1.0.0.txt |
| release tag | log file name |
|-------------|---------------|
| v1.0.0 | v1.0.0.txt |

<br>

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
}
],
"require": {
"illuminate/support": "~5.0",
"php" : "~7.0"
"php": "~7.0",
"illuminate/support": "5.0 - 6.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/PackageChangeLogServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class PackageChangeLogServiceProvider extends ServiceProvider
{
public function boot()
{
if (file_exists(base_path() . '/composer.json') &&
if (file_exists(base_path() . '/composer.json') &&
!$this->app['cache']->store('file')->has('ct-pcl')
) {
$this->autoReg();
Expand Down Expand Up @@ -55,7 +55,7 @@ public static function postAutoloadDump(\Composer\Script\Event $event)
$data = 'App\\Providers\\' . $search;
$res = json_decode(file_get_contents($comp_file), true);

if (array_get($res, 'scripts.post-autoload-dump')) {
if ($res['scripts']['post-autoload-dump']) {
array_push($res['scripts']['post-autoload-dump'], $data);
$json = json_encode($res, JSON_PRETTY_PRINT);
$final = str_replace('\/', '/', $json);
Expand Down

0 comments on commit bae7d18

Please sign in to comment.