You are here

xautoload_test_3.module in X Autoload 7.4

Same filename and directory in other branches
  1. 7.5 tests/test_3/xautoload_test_3.module

File

tests/test_3/xautoload_test_3.module
View source
<?php

use Drupal\xautoload\Tests\EnvironmentSnapshotMaker;
xautoload()
  ->registerModulePsr4(__FILE__, 'lib');

/**
 * Implements hook_boot()
 *
 * This turns xautoload_test_2 into a boot module.
 */
function xautoload_test_3_boot() {
  _xautoload_test_3_early_boot_observations('boot');
}
_xautoload_test_3_early_boot_observations('early');

/**
 * Test the current state, and remember it.
 */
function _xautoload_test_3_early_boot_observations($phase = NULL) {
  EnvironmentSnapshotMaker::takeSnapshot('xautoload_test_3', $phase, array(
    'Drupal\\xautoload_test_3\\ExampleClass',
  ));
}

/**
 * Implements hook_menu()
 */
function xautoload_test_3_menu() {
  return array(
    'xautoload_test_3.json' => array(
      'page callback' => '_xautoload_test_3_json',
      'access callback' => TRUE,
      'type' => MENU_CALLBACK,
    ),
  );
}

/**
 * Page callback for "xautoload-example/json"
 */
function _xautoload_test_3_json() {
  $all = EnvironmentSnapshotMaker::getSnapshots('xautoload_test_3');
  drupal_json_output($all);
  exit;
}

Functions

Namesort descending Description
xautoload_test_3_boot Implements hook_boot()
xautoload_test_3_menu Implements hook_menu()
_xautoload_test_3_early_boot_observations Test the current state, and remember it.
_xautoload_test_3_json Page callback for "xautoload-example/json"