Skip to content

Commit

Permalink
Add artisan:optimize:clear to Laravel recipe (#1837)
Browse files Browse the repository at this point in the history
* Add artisan:optimize:clear for Laravel recipe

* Update artisan:optimize to run on newer versions of Laravel
  • Loading branch information
adevade authored and antonmedv committed May 6, 2019
1 parent eec0204 commit ef55283
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,9 +7,11 @@
### Added
- Added `git_clone_dissociate` option, defaults to true; when set to false git-clone doesn't dissociate the eventual reference repository after clone, useful when using git-lfs [#1820]
- Added `writable_recursive` option (default: true) used in all writable modes (chmod, chown, chgrp, acl) [#1822]
- Added `artisan:optimize:clear` task for Laravel 5.7 and above

### Changed
- Add lock and unlock task to flow_framework receipe
- Updated `artisan:optimize` to run for Laravel 5.7 and above, since [it got added back](https://github.com/laravel/framework/commit/fe1cbdf3b51ce1235b8c91f5e603f1e9306e4f6f) last year. It still doesn't run for 5.5 and below.

### Fixed
- Fix rsync upload honor become option for host [#1796]
Expand Down
16 changes: 15 additions & 1 deletion recipe/laravel.php
Expand Up @@ -111,13 +111,27 @@
desc('Execute artisan optimize');
task('artisan:optimize', function () {
$deprecatedVersion = 5.5;
$readdedInVersion = 5.7;
$currentVersion = get('laravel_version');

if (version_compare($currentVersion, $deprecatedVersion, '<')) {
if (
version_compare($currentVersion, $deprecatedVersion, '<') ||
version_compare($currentVersion, $readdedInVersion, '>=')
) {
run('{{bin/php}} {{release_path}}/artisan optimize');
}
});

desc('Execute artisan optimize:clear');
task('artisan:optimize:clear', function () {
$needsVersion = 5.7;
$currentVersion = get('laravel_version');

if (version_compare($currentVersion, $needsVersion, '>=')) {
run('{{bin/php}} {{release_path}}/artisan optimize:clear');
}
});

desc('Execute artisan queue:restart');
task('artisan:queue:restart', function () {
run('{{bin/php}} {{release_path}}/artisan queue:restart');
Expand Down

0 comments on commit ef55283

Please sign in to comment.