Skip to content

Instantly share code, notes, and snippets.

@sunnysideup
Created July 19, 2016 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunnysideup/460437b3e0db275b88653455d3709d6c to your computer and use it in GitHub Desktop.
Save sunnysideup/460437b3e0db275b88653455d3709d6c to your computer and use it in GitHub Desktop.
retrieve all statics from a silverstripe module / project ....
<?php
/**
* PSEUDO CODE!
*
*/
$returnArray = array();
foreach($allClasses as $class) {
// see: http://php.net/manual/en/reflectionclass.getstaticproperties.php
$statics = ReflectionClass::getStaticProperties()
foreach($statics as $static) {
//here we filter out standard ones and irrelevant items
$returnArray[$className][$static] = Config::inst()->get($class, $static);
}
}
return $returnArray;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment