Skip to content

v8: Invalid type hint found for "htaccess", expected "string" got "boolean" for leveldb driver. #840

Closed
@nitz

Description

@nitz

Configuration

  • PhpFastCache version: "8.0 (via composer require)
  • PhpFastCache API version: 3.0.0.
  • PHP version: 7.4.12
  • Operating system: Linux 4.9.207 (Debian 9)

Describe the bug

Freshly installed phpfastcache via composer, attempting to use an unmodified (sans require path) leveldb example produces the error:

[Sun Nov 07 15:22:56.106595 2021] [fcgid:warn] [pid 3096559:tid 140172737914624] [client 108.253.163.97:65297] mod_fcgid: stderr: PHP Fatal error:  Uncaught Phpfastcache\\Exceptions\\PhpfastcacheInvalidConfigurationException: Invalid type hint found for "htaccess", expected "string" got "boolean" in /path/to/www/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Config/ConfigurationOption.php:144
[Sun Nov 07 15:22:56.106744 2021] [fcgid:warn] [pid 3096559:tid 140172737914624] [client 108.253.163.97:65297] mod_fcgid: stderr: Stack trace:
[Sun Nov 07 15:22:56.106773 2021] [fcgid:warn] [pid 3096559:tid 140172737914624] [client 108.253.163.97:65297] mod_fcgid: stderr: #0 /path/to/www/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/CacheManager.php(189): Phpfastcache\\Config\\ConfigurationOption->__construct(Array)
[Sun Nov 07 15:22:56.106796 2021] [fcgid:warn] [pid 3096559:tid 140172737914624] [client 108.253.163.97:65297] mod_fcgid: stderr: #1 /path/to/www/index.php(30): Phpfastcache\\CacheManager::getInstance('Leveldb')
[Sun Nov 07 15:22:56.106816 2021] [fcgid:warn] [pid 3096559:tid 140172737914624] [client 108.253.163.97:65297] mod_fcgid: stderr: #2 {main}
[Sun Nov 07 15:22:56.106834 2021] [fcgid:warn] [pid 3096559:tid 140172737914624] [client 108.253.163.97:65297] mod_fcgid: stderr:   thrown in /path/to/www/vendor/phpfastcache/phpfastcache/lib/Phpfastcache/Config/ConfigurationOption.php on line 144

To Reproduce
Steps to reproduce the behavior:

  1. Create a new directory on a publicly accessible website.
  2. In that directory, composer require phpfastcache/phpfastcache (respond 'n' if asked to use a parent directory composer.json)
  3. Create index.php with the contents of docs/examples/leveldb.php.
    3.a. Modify index.php to adjust the include path to point to the vendor folder composer created.
  4. Access that directory through a web browser.
  5. Observe 500 error.
  6. View server error logs, observe error similar to one shown above.

Expected behavior
The leveldb example to run.

Screenshots
N/A

Additional context
I'm not sure if this is something fixed in v9. I'm not on PHP 8 yet, so I can't try the newer version.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions