Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: A directory that does not exist when using a prefix and with empty data #14725

Closed
ekmst opened this issue Jan 17, 2020 · 1 comment
Closed

Comments

@ekmst
Copy link
Contributor

@ekmst ekmst commented Jan 17, 2020

If we call the Stream::getKeys() method with empty data and using a prefix, we get an exception. The following is an example for this behavior:

$serializer = new \Phalcon\Storage\SerializerFactory();

$adapter = new \Phalcon\Cache\Adapter\Stream(
    $serializer,
    [
        'storageDir' => '/tmp/',
        'prefix'     => 'pref-',       // The '/tmp/pref-' directory will not be created until we have written any data
    ]
);
$adapter->getKeys();  // Throws an exception

We get an exception:

Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(/tmp/pref-/): failed to open dir: No such file or directory in ...

Details

  • Phalcon version: 4.0.2
  • PHP Version: 7.4.1
@ekmst ekmst mentioned this issue Jan 17, 2020
4 of 5 tasks complete
@ekmst

This comment has been minimized.

Copy link
Contributor Author

@ekmst ekmst commented Jan 17, 2020

Fixed in #14721

@ruudboon ruudboon added this to Current Sprint (Ends January 24th) in Phalcon Roadmap Jan 17, 2020
@niden niden closed this Jan 17, 2020
Phalcon Roadmap automation moved this from Current Sprint (Ends January 24th) to Implemented Jan 17, 2020
@niden niden moved this from Implemented to Released in Phalcon Roadmap Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Phalcon Roadmap
  
Released
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.