Download the PHP package anahkiasen/flatten without Composer

On this page you can find all versions of the php package anahkiasen/flatten. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flatten

Flatten

Build Status Latest Stable Version Total Downloads Scrutinizer Quality Score Code Coverage Dependency Status Support via Gittip

Flatten is a powerful cache system for caching pages at runtime. What it does is quite simple : you tell him which page are to be cached, when the cache is to be flushed, and from there Flatten handles it all. It will quietly flatten your pages to plain HTML and store them. That whay if an user visit a page that has already been flattened, all the PHP is highjacked to instead display a simple HTML page. This will provide an essential boost to your application's speed, as your page's cache only gets refreshed when a change is made to the data it displays.

Setup

Installation

Flatten installs just like any other package, via Composer : composer require anahkiasen/flatten.

Then if you're using Laravel, add Flatten's Service Provider to you config/app.php file :

And its facade :

Configuration

All the options are explained in the config.php configuration file. You can publish it via artisan vendor:publish.

Usage

The pages are cached according to two parameters : their path and their method. Only GET requests get cached as all the other methods are dynamic by nature. All of the calls you'll make, will be to the Flatten\Facades\Flatten facade. Query strings are taken into account in the cache and pages will different query strings will have different caches.

Building

Flatten can cache all authorized pages in your application via the artisan flatten:build command. It will crawl your application and go from page to page, caching all the pages you allowed him to.

Flushing

Sometimes you may want to flush a specific page or pattern. If per example you cache your users's profiles, you may want to flush those when the user edit its informations. You can do so via the following methods :

You can also directly inject the responsible class, in a model observer class per example:

Runtime caching

You don't have to cache all of a page, you can fine-tune your cache in smaller cached sections.

In PHP you'd do it like this :

You can also specify for how long you want that section to be cached by adding an argument to section :

Flatten also hooks into the Blade templating engine for a leaner syntax. Let's rewrite our above example :

Kickstarting

You can speed up Flatten even more by using the Flatten::kickstart method. It requires a little more boilerplate code but can enhance performances dramatically. Basically you want to call that before everything else (ie. before even loading Composer). On Laravel you'd put that code at the top of bootstrap/autoload.php.

You use it like that :

If you have things in your saltshaker, you'll need to find faster raw methods to get these and pass the salts as arguments :

Using outside of Laravel

Flatten can easily be used outside of Laravel, for this you'll basically only ever use two methods. What you basically want to do is call Flatten::start at the top of the page, and Flatten::end at the bottom.


All versions of flatten with dependencies

PHP Build Version
Package Version
Requires illuminate/container Version 5.0.*|5.1.*
illuminate/support Version 5.0.*|5.1.*
illuminate/cache Version 5.0.*|5.1.*
illuminate/config Version 5.0.*|5.1.*
illuminate/http Version 5.0.*|5.1.*
illuminate/contracts Version 5.0.*|5.1.*
mrclay/minify Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package anahkiasen/flatten contains the following files

Loading the files please wait ....