DrupalSystem.php in X Autoload 7.4
File
lib/DrupalSystem/DrupalSystem.php
View source
<?php
namespace Drupal\xautoload\DrupalSystem;
class DrupalSystem implements DrupalSystemInterface {
function __construct() {
if (!function_exists('drupal_get_filename')) {
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
echo "\n\n";
throw new \Exception("This class works only within a working Drupal environment.");
}
}
function variableGet($name, $default = NULL) {
return variable_get($name, $default);
}
function drupalGetFilename($type, $name) {
return DRUPAL_ROOT . '/' . drupal_get_filename($type, $name);
}
function getExtensionTypes($extension_names) {
$q = db_select('system');
$q
->condition('name', $extension_names);
$q
->fields('system', array(
'name',
'type',
));
return $q
->execute()
->fetchAllKeyed();
}
function getActiveExtensions() {
return db_query("SELECT name, type from {system} WHERE status = 1")
->fetchAllKeyed();
}
}