| 1 |
<?php
|
| 2 |
// $Id: pear.module,v 1.2 2008/05/02 17:46:20 mepcotterell Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Perform startup tasks
|
| 6 |
*/
|
| 7 |
function pear_init() {
|
| 8 |
|
| 9 |
/**
|
| 10 |
* This is just a test...
|
| 11 |
*
|
| 12 |
*/
|
| 13 |
$pear_path = variable_get('pear_pear_path', -1);
|
| 14 |
|
| 15 |
if ($pear_path == -1) {
|
| 16 |
trigger_error(t('The Pear module installation failed!'));
|
| 17 |
} else {
|
| 18 |
|
| 19 |
$include_path = array(
|
| 20 |
$pear_path,
|
| 21 |
get_include_path(),
|
| 22 |
);
|
| 23 |
set_include_path(implode(PATH_SEPARATOR, $include_path));
|
| 24 |
|
| 25 |
include_once 'PEAR.php';
|
| 26 |
|
| 27 |
trigger_error(t('The path to PEAR is @path', array('@path' => $pear_path)));
|
| 28 |
}
|
| 29 |
|
| 30 |
}
|
| 31 |
|
| 32 |
/*
|
| 33 |
* This function sends log messages to watchdog.
|
| 34 |
* The $message parameter must be handled where
|
| 35 |
* the pear_log function is called.
|
| 36 |
*/
|
| 37 |
function pear_log($message, $error = FALSE) {
|
| 38 |
watchdog('pear', $message, NULL, ($error) ? WATCHDOG_DEBUG : $error);
|
| 39 |
}
|
| 40 |
|