Move old archive constants to config class so we don't have to keep loading archive class
Move old archive constants to config class so we don't have to keep loading archive class

--- a/include/Config.class.php
+++ b/include/Config.class.php
@@ -8,6 +8,11 @@
  * @copyright Copyright (c) 2010 Christopher Han
  * @package GitPHP
  */
+
+define('GITPHP_COMPRESS_TAR', 'tar');
+define('GITPHP_COMPRESS_BZ2', 'tbz2');
+define('GITPHP_COMPRESS_GZ', 'tgz');
+define('GITPHP_COMPRESS_ZIP', 'zip');
 
 /**
  * Config class

--- a/include/controller/ControllerBase.class.php
+++ b/include/controller/ControllerBase.class.php
@@ -9,6 +9,8 @@
  * @package GitPHP
  * @subpackage Controller
  */
+
+require_once(GITPHP_GITOBJECTDIR . 'Archive.class.php');
 
 /**
  * ControllerBase class

--- a/include/git/Archive.class.php
+++ b/include/git/Archive.class.php
@@ -12,11 +12,6 @@
 
 require_once(GITPHP_GITOBJECTDIR . 'GitExe.class.php');
 require_once(GITPHP_GITOBJECTDIR . 'Commit.class.php');
-
-define('GITPHP_COMPRESS_TAR', 'tar');
-define('GITPHP_COMPRESS_BZ2', 'tbz2');
-define('GITPHP_COMPRESS_GZ', 'tgz');
-define('GITPHP_COMPRESS_ZIP', 'zip');
 
 /**
  * Archive class

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -35,7 +35,7 @@
 
 define('GITPHP_CACHE', GITPHP_BASEDIR . 'cache/');
 
-include_once(GITPHP_INCLUDEDIR . 'version.php');
+include(GITPHP_INCLUDEDIR . 'version.php');
 
 require_once(GITPHP_INCLUDEDIR . 'Util.class.php');
 
@@ -53,9 +53,6 @@
 
 require_once(GITPHP_CACHEDIR . 'Cache.class.php');
 require_once(GITPHP_CACHEDIR . 'MemoryCache.class.php');
-
-// Need this include for the compression constants used in the config file
-require_once(GITPHP_GITOBJECTDIR . 'Archive.class.php');
 
 // Test these executables early
 require_once(GITPHP_GITOBJECTDIR . 'GitExe.class.php');

comments