php.install in Drupal 6
File
modules/php/php.install
View source
<?php
function php_install() {
$format_exists = db_result(db_query("SELECT COUNT(*) FROM {filter_formats} WHERE name = 'PHP code'"));
if (!$format_exists) {
db_query("INSERT INTO {filter_formats} (name, roles, cache) VALUES ('PHP code', '', 0)");
$format = db_result(db_query("SELECT MAX(format) FROM {filter_formats}"));
db_query("INSERT INTO {filters} (format, module, delta, weight) VALUES (%d, 'php', 0, 0)", $format);
drupal_set_message(t('A !php-code input format has been created.', array(
'!php-code' => l('PHP code', 'admin/settings/filters/' . $format),
)));
}
}
function php_disable() {
drupal_set_message(t('The PHP module has been disabled. Please note that any existing content that was using the PHP filter will now be visible in plain text. This might pose a security risk by exposing sensitive information, if any, used in the PHP code.'));
}