Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Phalcon\Loader can't load class from phar?

$loader = new Phalcon\Loader();
$loader->registerDirs( array( 'phar:///path/to/phar/predis_0.8.5.phar' ) );

that can't load \Predis\Client but the Client.php file in predis_0.8.5.phar package /Predis



84.4k

I don't think you need an autoloader, I think only requiring the file would make the classes there available for the aplication:

require "path/to/phar/predis_0.8.5.phar";


84.4k
Accepted
answer

Also, it seems that library has its own autoloader:

require 'Predis/Autoloader.php';

Predis\Autoloader::register();

https://github.com/nrk/predis#loading-the-library