summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-10-02 10:30:48 +0200
committerRemi Collet <fedora@famillecollet.com>2013-10-02 10:30:48 +0200
commite9dad8e262831c057955487e078e97c8bb8c1530 (patch)
tree8a0871664f41e0fa96c43fd98b01123ba8a6d519
parentce129625274030609afb4c4d8d48cf10eb604c18 (diff)
glpi: upstream patch for ZF2
-rw-r--r--glpi-0.84-zend.patch63
-rw-r--r--glpi-config_path.php2
-rw-r--r--glpi.spec10
3 files changed, 50 insertions, 25 deletions
diff --git a/glpi-0.84-zend.patch b/glpi-0.84-zend.patch
index c79fb94..f8de812 100644
--- a/glpi-0.84-zend.patch
+++ b/glpi-0.84-zend.patch
@@ -1,23 +1,44 @@
-diff -up config/based_config.php.orig config/based_config.php
---- config/based_config.php.orig 2013-09-29 17:26:58.940921006 +0200
-+++ config/based_config.php 2013-09-29 17:27:03.507928854 +0200
-@@ -176,4 +176,12 @@ if (!defined('GLPI_HTMLAWED')) {
- # if htmLawed available in system, use (in config_path.php)
- # define('GLPI_HTMLAWED', '/usr/share/htmlawed/htmLawed.php');
- }
-+
-+// Default patch to Zend Framework 2
-+if (!defined('GLPI_ZEND')) {
-+ define('GLPI_ZEND', GLPI_ROOT.'/lib/Zend');
-+
+Index: branches/0.84-bugfixes/config/based_config.php
+===================================================================
+--- branches/0.84-bugfixes/config/based_config.php (revision 21914)
++++ branches/0.84-bugfixes/config/based_config.php (revision 21915)
+@@ -138,11 +138,10 @@
+
+ // Default Zend_Loader path
+ if (!defined("GLPI_ZEND_PATH")) {
+- define("GLPI_ZEND_PATH", GLPI_ROOT."/lib");
++ define("GLPI_ZEND_PATH", GLPI_ROOT."/lib/Zend");
+
+- # if Zend installed, use (in config_path.php)
+- # define("GLPI_ZEND_PATH", "/usr/share/php/"); // if not in standard include_path
+- # define("GLPI_ZEND_PATH", ""); // if already in include_path
+ # if Zend Framework 2 available in system, use (in config_path.php)
-+ # define('GLPI_ZEND', '/usr/share/php/Zend');
-+}
- ?>
-diff -up inc/autoload.function.php.orig inc/autoload.function.php
---- inc/autoload.function.php.orig 2013-09-12 21:17:15.000000000 +0200
-+++ inc/autoload.function.php 2013-09-29 17:22:33.420537657 +0200
-@@ -323,11 +323,9 @@ function glpi_autoload($classname) {
++ # define('GLPI_ZEND_PATH', '/usr/share/php/Zend');
+ }
+
+ // Default SimplePie path
+Index: branches/0.84-bugfixes/inc/autoload.function.php
+===================================================================
+--- branches/0.84-bugfixes/inc/autoload.function.php (revision 21914)
++++ branches/0.84-bugfixes/inc/autoload.function.php (revision 21915)
+@@ -289,16 +289,6 @@
+ ezcBase::autoload($classname);
+ return true;
+ }
+- // Is Zend class ?
+-// if (preg_match('/^Zend/',$classname,$matches)) {
+-// if (GLPI_ZEND_PATH) {
+-// set_include_path(GLPI_ZEND_PATH . PATH_SEPARATOR . get_include_path());
+-// }
+-// require_once("Zend/Loader.php");
+-//
+-// Zend_Loader::loadClass($classname);
+-// return true;
+-// }
+
+ // Do not try to load phpcas using GLPI autoload
+ if (preg_match('/^CAS_.*/', $classname)) {
+@@ -323,11 +313,9 @@
}
}
@@ -26,8 +47,8 @@ diff -up inc/autoload.function.php.orig inc/autoload.function.php
-// Register the class map:
-$loader->registerAutoloadMap(GLPI_ROOT . '/lib/Zend/autoload_classmap.php');
-// Register with spl_autoload:
-+require_once (GLPI_ZEND . '/Loader/StandardAutoloader.php');
-+$option = array(Zend\Loader\StandardAutoloader::LOAD_NS => array('Zend' => GLPI_ZEND));
++require_once (GLPI_ZEND_PATH . '/Loader/StandardAutoloader.php');
++$option = array(Zend\Loader\StandardAutoloader::LOAD_NS => array('Zend' => GLPI_ZEND_PATH));
+$loader = new Zend\Loader\StandardAutoloader($option);
$loader->register();
diff --git a/glpi-config_path.php b/glpi-config_path.php
index 7e33abd..a76c3da 100644
--- a/glpi-config_path.php
+++ b/glpi-config_path.php
@@ -28,7 +28,7 @@ define('GLPI_PHPMAILER_DIR', 'PHPMailer');
define('GLPI_EZC_BASE', 'ezc/Base/base.php');
define('GLPI_PHPCAS', 'CAS.php');
define('GLPI_HTMLAWED', 'htmLawed/htmLawed.php');
-define('GLPI_ZEND', '/usr/share/php/Zend');
+define('GLPI_ZEND_PATH', '/usr/share/php/Zend');
define("GLPI_SIMPLEPIE_PATH", '/usr/share/php/php-simplepie');
// Fonts
diff --git a/glpi.spec b/glpi.spec
index b114553..8e6b88c 100644
--- a/glpi.spec
+++ b/glpi.spec
@@ -26,7 +26,7 @@ Source3: glpi-logrotate
# Switch all internal cron tasks to system
Patch0: glpi-0.84-cron.patch
-# For system Zend, waiting for upstream approval
+# https://forge.indepnet.net/repositories/revision/glpi/21915
Patch1: glpi-0.84-zend.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -99,7 +99,7 @@ techniciens grâce à une maintenance plus cohérente.
%setup -q -n glpi
%patch0 -p0
-%patch1 -p0
+%patch1 -p2
find . -name \*.orig -exec rm {} \; -print
@@ -119,6 +119,8 @@ rm -rf lib/ezcomponents
# fix font path on old version
sed -e '/GLPI_FONT_FREESANS/s/gnu-free/freefont/' \
%{SOURCE2} >config/config_path.php
+%else
+cp %{SOURCE2} config/config_path.php
%endif
mv lib/tiny_mce/license.txt LICENSE.tiny_mce
@@ -274,8 +276,10 @@ fi
%changelog
-* Sun Sep 29 2013 Remi Collet <remi@fedoraproject.org> - 0.84.2-4
+* Wed Oct 2 2013 Remi Collet <remi@fedoraproject.org> - 0.84.2-1
- update to 0.84.2
+- add upstream patch for Zend autoload
+- use system ZendFramework2 and SimplePie
* Thu Sep 12 2013 Remi Collet <remi@fedoraproject.org> - 0.83.9.1-4
- restrict access for install to local for security