Skip to content

Commit 0ea2a52

Browse files
author
nveid
committed
1) Added DEVSYSTEM define in config.inc.php.master defaults to 0 If set to 1 classes can load as symbolc links, server.php now 2) server.php now resolves its require()ed files with an absolute path instead of relative.
1 parent e615265 commit 0ea2a52

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

install/tpl/config.inc.php.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ $revision = str_replace(array('Revision:','$',' '), '', $svn_revision);
5757
//** Application
5858
define('ISPC_APP_TITLE', 'ISPConfig');
5959
define('ISPC_APP_VERSION', '3.0.3.3');
60+
define('DEVSYSTEM', 0);
6061

6162

6263
//** Database

server/lib/app.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function uses($classes) {
7575
if(is_array($cl)) {
7676
foreach($cl as $classname) {
7777
if(!@is_object($this->$classname)) {
78-
if(is_file($conf['classpath'].'/'.$classname.'.inc.php') && !is_link($conf['classpath'].'/'.$classname.'.inc.php')) {
78+
if(is_file($conf['classpath'].'/'.$classname.'.inc.php') && (DEVSYSTEM || !is_link($conf['classpath'].'/'.$classname.'.inc.php'))) {
7979
include_once($conf['classpath'].'/'.$classname.'.inc.php');
8080
$this->$classname = new $classname;
8181
}
@@ -91,7 +91,7 @@ function load($classes) {
9191
$cl = explode(',',$classes);
9292
if(is_array($cl)) {
9393
foreach($cl as $classname) {
94-
if(is_file($conf['classpath'].'/'.$classname.'.inc.php') && !is_link($conf['classpath'].'/'.$classname.'.inc.php')) {
94+
if(is_file($conf['classpath'].'/'.$classname.'.inc.php') && (DEVSYSTEM || !is_link($conf['classpath'].'/'.$classname.'.inc.php'))) {
9595
include_once($conf['classpath'].'/'.$classname.'.inc.php');
9696
} else {
9797
die('Unable to load: '.$conf['classpath'].'/'.$classname.'.inc.php');

server/server.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
/*
43
Copyright (c) 2007-2011, Till Brehm, projektfarm Gmbh
54
All rights reserved.
@@ -28,8 +27,11 @@
2827
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2928
*/
3029

31-
require('lib/config.inc.php');
32-
require('lib/app.inc.php');
30+
// $script_path allows development work of using a symbolic link farm
31+
// to use along side git or svn
32+
$script_path = dirname($_SERVER["SCRIPT_FILENAME"]);
33+
require("$script_path/lib/config.inc.php");
34+
require("$script_path/lib/app.inc.php");
3335

3436
set_time_limit(0);
3537
ini_set('error_reporting', E_ALL & ~E_NOTICE);

0 commit comments

Comments
 (0)