systemPackager

Compiles all specified classes into a single file ready for inclusion. Recommended for production systems to increase performance of the framework. systemPackager will remove most of the comments and white space from the classes and will remove any calls to include / require in the libraries.

Example usage:

// define some classes to package
$classes = array(
    'system', 'systemAutoload', 'systemConfigBase', 'systemConfig',
);

// creates bootstrap.php in /tmp
systemPackager::package($classes, '/tmp/', 'bootstrap');

This code is borrowed from the Symfony 2 ClassCollectionLoader code.

Originally by and copyright:

(c) Fabien Potencier

This source file is subject to the MIT license that is bundled with this source code in the file LICENSE.


Methods

public static package($classes, $cacheDir, $name)

Compiles $classes into a single file called $name.php in $cacheDir

protected static writeCacheFile($file, $content)

Creates a cache file

public static stripComments($source)

Strips comments from PHP source code

public static getCoreFiles()

Returns an array of critical core files

public static getMvcFiles()

Returns an array of critical core files and the MVC system

<  1  >