From a6282ca0e8a13fd53b4bea6eeff7a69f1312eef3 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Tue, 8 Jun 2010 18:39:20 +0200
Subject: autoload

---
 include/main.php | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

(limited to 'include')

diff --git a/include/main.php b/include/main.php
index b97db02..265d20c 100644
--- a/include/main.php
+++ b/include/main.php
@@ -37,7 +37,6 @@ define('RPMPHP_VERSION', '1.0.0-dev');
 
 require 'config.php';
 require 'Smarty/Smarty.class.php';
-require dirname(__FILE__).'/../class/FedoraClient.php';
 
 $smarty = new Smarty();
 
@@ -51,6 +50,18 @@ $ariane[] = array (
    'text' => 'Reports home'
 );
 
+/**
+ * Manage class autoload
+ *
+ * @param string $classname
+ *
+ * @return void
+ */
+function __autoload($classname)
+{
+    require dirname(__FILE__).'/../class/'.$classname.'.php';
+}
+
 /**
 * Get repositories list
 *
-- 
cgit 


From 50f2de59ed8ea3f41530fc4f06c12ae1613416ab Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Sun, 11 Jul 2010 18:23:35 +0200
Subject: fix fedcli

---
 include/main.php | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

(limited to 'include')

diff --git a/include/main.php b/include/main.php
index 265d20c..286cf4e 100644
--- a/include/main.php
+++ b/include/main.php
@@ -36,19 +36,23 @@
 define('RPMPHP_VERSION', '1.0.0-dev');
 
 require 'config.php';
-require 'Smarty/Smarty.class.php';
 
-$smarty = new Smarty();
+if (!defined('CLIONLY'))
+{
+    require 'Smarty/Smarty.class.php';
+
+    $smarty = new Smarty();
 
-$smarty->template_dir = 'smarty/templates/rpmphp';
-$smarty->compile_dir = 'smarty/templates_c';
-$smarty->cache_dir = 'smarty/cache';
-$smarty->config_dir = 'smarty/configs';
+    $smarty->template_dir = 'smarty/templates/rpmphp';
+    $smarty->compile_dir = 'smarty/templates_c';
+    $smarty->cache_dir = 'smarty/cache';
+    $smarty->config_dir = 'smarty/configs';
 
-$ariane[] = array (
-   'url' => './',
-   'text' => 'Reports home'
-);
+    $ariane[] = array (
+       'url' => './',
+       'text' => 'Reports home'
+    );
+}
 
 /**
  * Manage class autoload
-- 
cgit