Version: current

# Class ManifestBuilder

The ManifestBuilder class generates the manifest file and keeps it fresh.

The manifest file is a PHP include that contains global variables that represent the collected contents of the application: - all classes (`__autoload()`) - all templates (`SSViewer`) - all _config.php files

Traversing the filesystem to collect this information on everypage. This information is cached so that it need not be regenerated on every pageview.

Package: sapphire\core
See: main.php, ``__autoload()``, ``SSViewer``, ``Requirements::themedCSS()``
Used by: ``ClassInfo::classes_for_file()``
Located at sapphire/core/ManifestBuilder.php

## Methods summary

`public static` | # `include_manifest( )` Include the manifest, regenerating it if necessary Include the manifest, regenerating it if necessary
`public static` | # `load_test_manifest( )` Load a copy of the manifest with tests/ folders included. Only loads the ClassInfo and __autoload() globals; this assumes that _config.php files are already included. Load a copy of the manifest with tests/ folders included. Only loads the ClassInfo and __autoload() globals; this assumes that _config.php files are already included.
`public static` | # `load_all_classes( )` Loads all PHP class files - actually opening them and executing them. Loads all PHP class files - actually opening them and executing them.
`public static` | # `create_manifest_file( )` Generates a new manifest file and saves it to MANIFEST_FILE. Generates a new manifest file and saves it to MANIFEST_FILE.
`public static` | # `generate_php_file( mixed $manifestInfo )` Turn an array produced by get_manifest_info() into the content of the manifest PHP include Turn an array produced by get_manifest_info() into the content of the manifest PHP include
`public static` | # `process_manifest( mixed $manifestInfo )` Parse the $manifestInfo array, updating the appropriate globals and loading the appropriate _config files. Parse the $manifestInfo array, updating the appropriate globals and loading the appropriate _config files.
`public static array` | # `get_themes( string $baseDir = null, boolean $includeSubThemes = false )` Get themes from a particular directory. Get themes from a particular directory. #### Parameters $baseDir string $baseDir Optional: Absolute path to theme directory for testing e.g. "/Users/sharvey/Sites/test24/themes" $includeSubThemes boolean $includeSubThemes If set to TRUE, sub-themes such as "blackcandy_blog" are included too #### Returns `array` Listing of theme directories
`public static` | # `get_manifest_info( mixed $baseDir, mixed $excludedFolders = array() )` Return an array containing information for the manifest Return an array containing information for the manifest #### Parameters $baseDir $baseDir The root directory to analyse $excludedFolders $excludedFolders An array folder names to exclude. These don't care about where the folder appears in the hierarchy, so be careful
`public static `TokenisedRegularExpression`` | # `getClassDefParser( )` Returns a `TokenisedRegularExpression` object that will parse class definitions Returns a `TokenisedRegularExpression` object that will parse class definitions #### Returns ``TokenisedRegularExpression`` TokenisedRegularExpression
`public static `TokenisedRegularExpression`` | # `getInterfaceDefParser( )` Returns a `TokenisedRegularExpression` object that will parse class definitions Returns a `TokenisedRegularExpression` object that will parse class definitions #### Returns ``TokenisedRegularExpression`` TokenisedRegularExpression
`public static `Boolean`` | # `has_been_included( )` Returns if the Manifest has been included Returns if the Manifest has been included #### Returns ``Boolean`` Boolean
`public static` | # `up_children( string $class )` Returns a flat array with all children of a given class Returns a flat array with all children of a given class #### Parameters $class string $class

### Magic methods summary

## Properties summary

`public static array` | $restrict_to_modules | #
`public static array` | $extendsArray | #
`public static array` | $classArray | #
`public static array` | $implementsArray | #
`public static array` | $ignore_files | # $ignore_files Full filenames (without directory-path) which should be ignored by the manifest. $ignore_files Full filenames (without directory-path) which should be ignored by the manifest.
`public static array` | $ignore_folders | # $ignore_folders Foldernames (without path) which should be ignored by the manifest. $ignore_folders Foldernames (without path) which should be ignored by the manifest.

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -