Q:

How to call Doctrine CacheProvider function in Laravel 4 Controller

I have seen some useful functions like the following in 
vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php of laravel 4 installation.
public function flushAll()
{
    return $this->doFlush();
}

How can I call this function from my controller.

A:

This question was asked in Laravel Forum and here also, but no response!
Luckily I have derived solution for my question.
The Composer vendor have a class autoload map file which have an array with all class names with their namespace.
This file will be updated in all instance of composer install or composer update which will be prepeded by composer dump-autoload command.
If I am making a class somewhere, I have to execute the php artisan dump-autoload command to properly auto-load them.
So here in vendor/composer/autoload_classmap.php, we have reference to all vendor classes including Symfony and Doctrine.
And the entry for the Doctrine Cache Provider will be,
'Doctrine\\Common\\Cache\\CacheProvider' => $vendorDir . '/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php'

Here I can see which file it is, and what will be the namespace.
Now we can call functions by using the namespace,
use Doctrine\Common\Cache\CacheProvider as DoctrineCache;

DoctrineCache::flushAll();

And also we can add this in providers array with app.php

