class bbn\Cdn documentation in
(Static) content delivery system through requests using filesystem and internal DB for libraries.
Generates in a cache directory a javascript or CSS file based on the request received.
The cdn class will be using all the classes in bbn\Cdn in order to
treat a request URL, and return the appropriate content.
- First it will parse the URL and make a first configuration array out of it,
from which a hash will be calculated
- Then it will serve a cache file if it exists and create one otherwise by:
- Making a full configuration array using libraries database with all the needed file(s)
- Then it will compile these files into a single file that will be put in cache
- This file should be of type js or css
- If files are both types the content returned will be JS which will call the css files
Request can have the following forms:
Example
$cdn = new \bbn\Cdn($_SERVER['REQUEST_URI']);
$cdn->process();
if ( $cdn->check() ){
$cdn->output();
}
(Static) content delivery system through requests using filesystem and internal DB for libraries. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way