Skip to content

Commit

Permalink
Fix cachetool PHP 7 compatibility, fixes #2836 (#2837)
Browse files Browse the repository at this point in the history
* Fix cachetool PHP 7 compatibility, fixes #2836
* Update cachetool.php

Create configuration option to change cachetool version

* Update doc

Co-authored-by: Fabian Blechschmidt <github@fabian-blechschmidt.de>
Co-authored-by: Fabian Blechschmidt <blechschmidt@fabian-blechschmidt.de>
  • Loading branch information
3 people committed Dec 14, 2021
1 parent 2d16b6d commit 32a63ec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion contrib/cachetool.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@
namespace Deployer;

set('cachetool', '');
set('cachetool_url', 'https://github.com/gordalina/cachetool/releases/download/7.0.0/cachetool.phar');
set('cachetool_args', '');
set('bin/cachetool', function () {
if (!test('[ -f {{release_or_current_path}}/cachetool.phar ]')) {
run("cd {{release_or_current_path}} && curl -sLO https://github.com/gordalina/cachetool/releases/latest/download/cachetool.phar");
run("cd {{release_or_current_path}} && curl -sLO {{cachetool_url}}");
}
return '{{release_or_current_path}}/cachetool.phar';
});
Expand Down
22 changes: 16 additions & 6 deletions docs/contrib/cachetool.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,32 @@ http://gordalina.github.io/cachetool/



### cachetool_args
### cachetool_url
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L54)



```php title="Default value"
'https://github.com/gordalina/cachetool/releases/download/7.0.0/cachetool.phar'
```


### bin/cachetool
### cachetool_args
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L55)





### bin/cachetool
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L56)





### cachetool_options
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L61)
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L62)



Expand All @@ -90,23 +100,23 @@ http://gordalina.github.io/cachetool/
## Tasks

### cachetool:clear:opcache
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L78)
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L79)

Clears OPcode cache.

Clear opcache cache


### cachetool:clear:apcu
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L86)
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L87)

Clears APCu system cache.

Clear APCU cache


### cachetool:clear:stat
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L94)
[Source](https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L95)

Clears file status and realpath caches.

Expand Down

0 comments on commit 32a63ec

Please sign in to comment.