Come visualizzare le phpinfo su Drupal 6
Ecco un semplice codice per visualizzare le phpinfo in amministrazione:
File informationphp.info
; $Id: informationphp.info,v 1.1.2.3.2.1 2010-09-08 13:17:50: danzisiweb Exp $
name = Information PHPInfo
description = "Function phpinfo() output sends a lot of information about configuring PHP. All about file httpd.conf e php.ini of apache server"
package = About-x
core = 6.x
; Information added by danzisiweb packaging script on 2010-09-08
version = "6.x"
project = "drupal"
datestamp = "1283944670"
informationphp.install
<?php
// $Id: informationphp.install,v 1.1 2010-09-08 13:17:50 danzisiweb Exp $
function informationphp_install() {
drupal_set_message(t('New module informationphp istalled.'));
watchdog('informationphp','Installed informationphp module ');
}
/**
* Implementation of hook_uninstall().
*/
function informationphp_uninstall() {
drupal_set_message(t('Module informationphp Uninstall.'));
watchdog('informationphp","Uninstall informationphp module ');
}
File informationphp.module
<?php
/**
* Display help and module information
*/
function informationphp_help($path, $arg) {
$output = '';
switch ($path) {
case "admin/help#informationphp":
$output = '<p>'. t("Allows you to show phpinfo inside the site") .'</p>';
break;
}
return $output;
}
/**
* Valid permissions for this module
* @return array An array of valid permissions for the informationphp module
*/
function informationphp_perm() {
//an administrator can define which roles have those permissions on the Administer » User management » Permissions page.
return array('access informationphp');
}
function informationphp_menu() {
$items = array();
$items['admin/settings/informationphp'] = array(
'title' => t('PHP info'),
'description' => t('Allows you to show phpinfo inside the site'),
'page callback' => 'informationphp_admin',
'access arguments' => array('access informationphp'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
function informationphp_admin() {
print phpinfo();
exit;
}
Esiste il modulo devel che ha questa funzione inserita, tuttavia spero che questo codice possa essere utile. Ciao!
Argomenti:
- Accedi o registrati per inserire commenti.