function _xautoload_test_2_early_boot_observations in X Autoload 7.3
Same name and namespace in other branches
- 7.5 tests/test_2/xautoload_test_2.module \_xautoload_test_2_early_boot_observations()
- 7.4 tests/test_2/xautoload_test_2.module \_xautoload_test_2_early_boot_observations()
Test the current state, and remember it.
2 calls to _xautoload_test_2_early_boot_observations()
- xautoload_test_2_boot in tests/
test_2/ xautoload_test_2.module - Implements hook_boot()
- _xautoload_test_2_json in tests/
test_2/ xautoload_test_2.module - Page callback for "xautoload-example/json"
File
- tests/
test_2/ xautoload_test_2.module, line 18
Code
function _xautoload_test_2_early_boot_observations($phase = NULL) {
static $all = array();
if (!isset($phase)) {
$return = $all;
foreach ($return as $phase => &$observations) {
// Turn callbacks into strings, so they survive json_decode().
foreach ($observations['spl_autoload_functions'] as &$callback) {
// At this point in time we can be fairly sure
// that xautoload_Util is available.
$callback = xautoload_Util::callbackToString($callback);
}
}
return $return;
}
// Test that all classes are available immediately at boot time.
foreach (array(
'Drupal\\xautoload_test_2\\ExampleClass',
'xautoload_test_2_ExampleClass',
) as $class) {
$observations[$class] = class_exists($class);
}
// Check variable_get().
$observations['xautoload_cache_mode'] = variable_get('xautoload_cache_mode');
$observations['db_connection_info'] = Database::getConnectionInfo();
$observations['spl_autoload_functions'] = spl_autoload_functions();
$all[$phase] = $observations;
}