Bläddra i källkod

In CLI mode, do not depend on the current directory: the script can be run from anywhere.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1414 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 14 år sedan
förälder
incheckning
131de01bc7
2 ändrade filer med 5 tillägg och 3 borttagningar
  1. 3 2
      synchro/synchro_exec.php
  2. 2 1
      synchro/synchro_import.php

+ 3 - 2
synchro/synchro_exec.php

@@ -28,12 +28,13 @@
 // - reconciliation is made on the first column
 //
 // Known issues
-// - ALMOST impossible to troubleshoot when an externl key has a wrong value
+// - ALMOST impossible to troubleshoot when an external key has a wrong value
 // - no character escaping in the xml output (yes !?!?!)
 // - not outputing xml when a wrong input is given (class, attribute names)
 //
 
-require_once('../approot.inc.php');
+if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
+require_once(__DIR__.'/../approot.inc.php');
 require_once(APPROOT.'/application/application.inc.php');
 require_once(APPROOT.'/application/webpage.class.inc.php');
 require_once(APPROOT.'/application/csvpage.class.inc.php');

+ 2 - 1
synchro/synchro_import.php

@@ -28,7 +28,8 @@
 // - reconciliation is made on the column primary_key
 //
 
-require_once('../approot.inc.php');
+if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
+require_once(__DIR__.'/../approot.inc.php');
 require_once(APPROOT.'/application/application.inc.php');
 require_once(APPROOT.'/application/webpage.class.inc.php');
 require_once(APPROOT.'/application/csvpage.class.inc.php');