From 1f77d5ec48c55a510b6f5b89e5ca4ed595136530 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 18 Jan 2012 10:37:00 +0100 Subject: [PATCH] Refactor include_pathes --- .../Api/Youtube/Bridge_Api_Youtube_ContainerTest.php | 9 ++++++--- .../Api/Youtube/Bridge_Api_Youtube_ElementTest.php | 9 ++++++--- lib/unitTest/Bridge/Bridge_datas.inc | 8 ++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/unitTest/Bridge/Api/Youtube/Bridge_Api_Youtube_ContainerTest.php b/lib/unitTest/Bridge/Api/Youtube/Bridge_Api_Youtube_ContainerTest.php index 1742616f65..c7d3b0283a 100644 --- a/lib/unitTest/Bridge/Api/Youtube/Bridge_Api_Youtube_ContainerTest.php +++ b/lib/unitTest/Bridge/Api/Youtube/Bridge_Api_Youtube_ContainerTest.php @@ -3,9 +3,12 @@ require_once __DIR__ . '/../../../PhraseanetPHPUnitAuthenticatedAbstract.class.inc'; require_once __DIR__ . '/../../Bridge_datas.inc'; -$new_include_path = realpath(__DIR__ . '/../../../../vendor/gdata/') . PATH_SEPARATOR . get_include_path(); -set_include_path($new_include_path); - +$include_path = realpath(__DIR__ . '/../../../../vendor/gdata/'); +if(strpos(get_include_path(), $include_path) === false) +{ + $new_include_path = $include_path . PATH_SEPARATOR . get_include_path(); + set_include_path($new_include_path); +} require_once('Zend/Loader.php'); Zend_Loader::loadClass('Zend_Gdata_YouTube'); diff --git a/lib/unitTest/Bridge/Api/Youtube/Bridge_Api_Youtube_ElementTest.php b/lib/unitTest/Bridge/Api/Youtube/Bridge_Api_Youtube_ElementTest.php index 08fe46adfe..295d667f13 100644 --- a/lib/unitTest/Bridge/Api/Youtube/Bridge_Api_Youtube_ElementTest.php +++ b/lib/unitTest/Bridge/Api/Youtube/Bridge_Api_Youtube_ElementTest.php @@ -3,9 +3,12 @@ require_once __DIR__ . '/../../../PhraseanetPHPUnitAuthenticatedAbstract.class.inc'; require_once __DIR__ . '/../../Bridge_datas.inc'; -$new_include_path = realpath(__DIR__ . '/../../../../vendor/gdata/') . PATH_SEPARATOR . get_include_path(); -set_include_path($new_include_path); - +$include_path = realpath(__DIR__ . '/../../../../vendor/gdata/'); +if(strpos(get_include_path(), $include_path) === false) +{ + $new_include_path = $include_path . PATH_SEPARATOR . get_include_path(); + set_include_path($new_include_path); +} require_once('Zend/Loader.php'); Zend_Loader::loadClass('Zend_Gdata_YouTube'); diff --git a/lib/unitTest/Bridge/Bridge_datas.inc b/lib/unitTest/Bridge/Bridge_datas.inc index 9506fb51e4..e6fec4eac5 100644 --- a/lib/unitTest/Bridge/Bridge_datas.inc +++ b/lib/unitTest/Bridge/Bridge_datas.inc @@ -2,8 +2,12 @@ require_once __DIR__ . '/../../bootstrap.php'; -$new_include_path = realpath(__DIR__ . "/../../vendor/") . PATH_SEPARATOR . get_include_path(); -set_include_path($new_include_path); +$include_path = realpath(__DIR__ . '/../../vendor/'); +if(strpos(get_include_path(), $include_path) === false) +{ + $new_include_path = $include_path . PATH_SEPARATOR . get_include_path(); + set_include_path($new_include_path); +} require_once __DIR__ . "/../../vendor/Phlickr/Api.php";