2017 © Pedro Peláez
 

library custom-static-caching

Custom static caching

image

andreizakharkin/custom-static-caching

Custom static caching

  • Tuesday, June 20, 2017
  • by andreizakharkin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Custom Static Cache

Custom static cache, (*1)

Laravel compatibility

Laravel 5 is released!!, (*2)

Laravel custom-static-caching
5.2.x dev-master

Installation

Composer

Download via composer., (*3)

composer require andreizakharkin/custom-static-caching:dev-master

Laravel

Register the service provider with your application., (*4)

Open config/app.php and find the providers key. Add CustomStaticCacheServiceProvider to the array., (*5)

    ...
    Zakharkin\CustomStaticCache\CustomStaticCacheServiceProvider::class,
    ...

Publish vendor config, (*6)

    php artisan vendor:publish --provider="Zakharkin\CustomStaticCache\CustomStaticCacheServiceProvider" --tag="config"

Usage

There are two main functions that helps you to use static caching., (*7)

checkAndShow() - function that can check and render the cache file, (*8)

save() - function that saves a cache file, (*9)

You can use this functions in anywhere places of your application. The only rule is need to be followed is that the checkAndShow() function must be triggered, after the autoload is completed, (*10)

Example usage in public/index.php


... require __DIR__.'/../bootstrap/autoload.php'; \Zakharkin\CustomStaticCache\CustomStaticCache::getInstance()->checkAndShow(); ... $kernel->terminate($request, $response); \Zakharkin\CustomStaticCache\CustomStaticCache::getInstance()->save();

The Versions

20/06 2017

dev-master

9999999-dev

Custom static caching

  Sources   Download

MIT

The Requires

 

by Andrei Zakharkin

php caching