Initial commit.
This commit is contained in:
31
lib/php/monica/incpath.inc.php
Normal file
31
lib/php/monica/incpath.inc.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user