Skip to content

Commit

Permalink
fix: run cachetool without args (#3742)
Browse files Browse the repository at this point in the history
fixes a regression bug introduced with 266554d
  • Loading branch information
infabo authored Dec 8, 2023
1 parent 507f54c commit 11cef74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions contrib/cachetool.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
## Configuration
- **cachetool** *(optional)*: accepts a *string* or an *array* of strings with the unix socket or ip address to php-fpm. If `cachetool` is not given, then the application will look for a `cachetool.yml` file and read the configuration from there.
- **cachetool** *(optional)*: accepts a *string* or an *array* of strings with the unix socket or ip address to php-fpm. If `cachetool` is not given, then the application will look for a configuration file. The file must be named .cachetool.yml or .cachetool.yaml. CacheTool will look for this file on the current directory and in any parent directory until it finds one. If the paths above fail it will try to load /etc/cachetool.yml or /etc/cachetool.yaml configuration file.
```php
set('cachetool', '/var/run/php-fpm.sock');
// or
set('cachetool', '127.0.0.1:9000');
// or
set('cachetool', ['/var/run/php-fpm.sock', '/var/run/php-fpm-other.sock]);
set('cachetool', ['/var/run/php-fpm.sock', '/var/run/php-fpm-other.sock']);
```
You can also specify different cachetool settings for each host:
Expand Down Expand Up @@ -72,13 +72,13 @@
$return = [$fullOptions];
} elseif (count($options) > 0) {
foreach ($options as $option) {
if ($option !== '') {
if (is_string($option) && $option !== '') {
$return[] = "--fcgi={$option}";
}
}
}

return $return;
return $return ?: [''];
});

/**
Expand All @@ -93,7 +93,7 @@
});

/**
* Clear APCU cache
* Clear APCu cache
*/
desc('Clears APCu system cache');
task('cachetool:clear:apcu', function () {
Expand Down
6 changes: 3 additions & 3 deletions docs/contrib/cachetool.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ require 'contrib/cachetool.php';

## Configuration

- **cachetool** *(optional)*: accepts a *string* or an *array* of strings with the unix socket or ip address to php-fpm. If `cachetool` is not given, then the application will look for a `cachetool.yml` file and read the configuration from there.
- **cachetool** *(optional)*: accepts a *string* or an *array* of strings with the unix socket or ip address to php-fpm. If `cachetool` is not given, then the application will look for a configuration file. The file must be named .cachetool.yml or .cachetool.yaml. CacheTool will look for this file on the current directory and in any parent directory until it finds one. If the paths above fail it will try to load /etc/cachetool.yml or /etc/cachetool.yaml configuration file.

```php
set('cachetool', '/var/run/php-fpm.sock');
// or
set('cachetool', '127.0.0.1:9000');
// or
set('cachetool', ['/var/run/php-fpm.sock', '/var/run/php-fpm-other.sock]);
set('cachetool', ['/var/run/php-fpm.sock', '/var/run/php-fpm-other.sock']);
```

You can also specify different cachetool settings for each host:
Expand Down Expand Up @@ -127,7 +127,7 @@ Clear opcache cache

Clears APCu system cache.

Clear APCU cache
Clear APCu cache


### cachetool:clear:stat
Expand Down

0 comments on commit 11cef74

Please sign in to comment.