We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

using caching with Phalcon\Mvc\Model

I am following ORM caching to implement cache with micro app but

    $app->get('/getCompanies', function() use ($app, $di) {

        $companies = Company::find();

        $companies = Company::find(array(
            'columns' => 'company_id, company_name',
            'cache'   => array(
                'key' => 'my-cache'
            )
        ));

        $companies->toArray();

always stuck with error

PHP Fatal error: Class 'memcache' not found

and for now I think this module has not yet available within then anonymouse function but don't know how to fix that. Can anyone pls advise? Thanks



817
Accepted
answer

I figure it out myself, just miss the php module memcache since I have installed memcached on my machine. Thanks for your attention. :)