PHP code example of stadline / execution-cache-bundle

1. Go to this page and download the library: Download stadline/execution-cache-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stadline / execution-cache-bundle example snippets



// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Stadline\ExecutionCacheBundle\StadlineExecutionCacheBundle(),
        );

        // ...
    }

    // ...
}



namespace AcmeBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Stadline\ExecutionCacheBundle\Annotation\ExecutionCache;

class BrandController extends Controller
{
    /**
     * @ExecutionCache(lifetime=3600)
     */
    public function indexAction(Request $request)
    {
        // do some heavy stuff
    }
}