diff --git a/core/lib/Drupal/Core/Extension/ExtensionBase.php b/core/lib/Drupal/Core/Extension/ExtensionBase.php new file mode 100644 index 0000000..0d3d19f --- /dev/null +++ b/core/lib/Drupal/Core/Extension/ExtensionBase.php @@ -0,0 +1,47 @@ +get('name'); + } + + /** + * {@inheritdoc} + */ + public function getVersion() { + return $this->get('version'); + } + + /** + * {@inheritdoc} + */ + public function getDescription() { + return $this->get('description'); + } + + /** + * {@inheritdoc} + */ + public function getDependencies() { + return $this->get('dependencies') ?: array(); + } + +} diff --git a/core/lib/Drupal/Core/Extension/ExtensionInterface.php b/core/lib/Drupal/Core/Extension/ExtensionInterface.php new file mode 100644 index 0000000..63668aa --- /dev/null +++ b/core/lib/Drupal/Core/Extension/ExtensionInterface.php @@ -0,0 +1,51 @@ +get('status'); + } + +} diff --git a/core/lib/Drupal/Core/Extension/ModuleInterface.php b/core/lib/Drupal/Core/Extension/ModuleInterface.php new file mode 100644 index 0000000..8027594 --- /dev/null +++ b/core/lib/Drupal/Core/Extension/ModuleInterface.php @@ -0,0 +1,25 @@ +get('status'); + } + +} diff --git a/core/lib/Drupal/Core/Extension/ProfileInterface.php b/core/lib/Drupal/Core/Extension/ProfileInterface.php new file mode 100644 index 0000000..f1c6a05 --- /dev/null +++ b/core/lib/Drupal/Core/Extension/ProfileInterface.php @@ -0,0 +1,25 @@ +get('screenshot'); + } + + /** + * {@inheritdoc} + */ + public function getEngine() { + return $this->get('engine'); + } + + /** + * {@inheritdoc} + */ + public function getBaseTheme() { + return $this->get('base theme'); + } + + /** + * {@inheritdoc} + */ + public function getStylesheets() { + return $this->get('stylesheets') ?: array(); + } + + /** + * {@inheritdoc} + */ + public function getScripts() { + return $this->get('scripts') ?: array(); + } + + /** + * {@inheritdoc} + */ + public function getRegions() { + return $this->get('regions') ?: array(); + } + + /** + * {@inheritdoc} + */ + public function getFeatures() { + return $this->get('regions') ?: array(); + } + + /** + * {@inheritdoc} + */ + public function isEnabled() { + return (bool) $this->get('status'); + } + +} diff --git a/core/lib/Drupal/Core/Extension/ThemeInterface.php b/core/lib/Drupal/Core/Extension/ThemeInterface.php new file mode 100644 index 0000000..d70dc6f --- /dev/null +++ b/core/lib/Drupal/Core/Extension/ThemeInterface.php @@ -0,0 +1,82 @@ +getModuleList() as $module => $filename) { if (isset($data[$module])) { - $info[$module] = $data[$module]->info; + $info[$module] = new Module($data[$module]->info); } } } @@ -2276,7 +2279,12 @@ function system_get_info($type, $name = NULL) { $list = system_list($type); foreach ($list as $shortname => $item) { if (!empty($item->status)) { - $info[$shortname] = $item->info; + if ($type == 'profile') { + $info[$shortname] = new Profile($info); + } + elseif ($type == 'theme') { + $info[$shortname] = new Theme($info); + } } } }