diff --git a/core/modules/php/config/filter.format.php_code.yml b/core/modules/php/config/filter.format.php_code.yml new file mode 100644 index 0000000..504b970 --- /dev/null +++ b/core/modules/php/config/filter.format.php_code.yml @@ -0,0 +1,11 @@ +format: php_code +name: 'PHP code' +cache: '0' +status: '1' +weight: '11' +filters: + php_code: + module: php + status: '1' + weight: '0' +langcode: und diff --git a/core/modules/php/php.install b/core/modules/php/php.install index f2281f2..a88fe6a 100644 --- a/core/modules/php/php.install +++ b/core/modules/php/php.install @@ -6,45 +6,6 @@ */ /** - * Implements hook_enable(). - */ -function php_enable() { - // Add a PHP code text format, if it does not exist. Do this only for the - // first install (or if the format has been manually deleted) as there is no - // reliable method to identify the format in an uninstall hook or in - // subsequent clean installs. - $format_exists = FALSE; - $filter_formats = entity_load_multiple('filter_format'); - foreach ($filter_formats as $format) { - if ($format->name == 'PHP code') { - $format_exists = TRUE; - break; - } - } - if (!$format_exists) { - $php_format_config = array( - 'format' => 'php_code', - 'name' => 'PHP code', - // 'Plain text' format is installed with a weight of 10 by default. Use a - // higher weight here to ensure that this format will not be the default - // format for anyone. - 'weight' => 11, - 'filters' => array( - // Enable the PHP evaluator filter. - 'php_code' => array( - 'weight' => 0, - 'status' => 1, - ), - ), - ); - $php_format = entity_create('filter_format', $php_format_config); - $php_format->save(); - - drupal_set_message(t('A PHP code text format has been created.', array('@php-code' => url('admin/config/content/formats/' . $php_format->format)))); - } -} - -/** * Implements hook_disable(). */ function php_disable() {