32 lines
842 B
PHP
32 lines
842 B
PHP
<?php
|
|
// File name: incpath.inc.php
|
|
// Description: Extended PHP subroutine to set the include path
|
|
// Date: 2007-08-07
|
|
// Author: imacat <imacat@pristine.com.tw>
|
|
// Copyright: Copyright (C) 2007 Pristine Communications
|
|
|
|
// This file is to be included by Monica core files before
|
|
// including other Monica core files
|
|
|
|
// Set the include path
|
|
_incpath_set_include_path();
|
|
define("INCPATH_SET", true);
|
|
|
|
// _incpath_set_include_path: Set the include path
|
|
function _incpath_set_include_path()
|
|
{
|
|
$oldpath = get_include_path();
|
|
$paths = explode(PATH_SEPARATOR, $oldpath);
|
|
$dir = dirname(dirname(__FILE__));
|
|
if (!in_array($dir, $paths)) {
|
|
$paths[] = $dir;
|
|
}
|
|
$newpath = implode(PATH_SEPARATOR, $paths);
|
|
if ($newpath != $oldpath) {
|
|
set_include_path(implode(PATH_SEPARATOR, $paths));
|
|
}
|
|
return;
|
|
}
|
|
|
|
?>
|