diff --git a/bin/doctrine b/bin/doctrine index e595ff2e0d..78ff3027d7 100755 --- a/bin/doctrine +++ b/bin/doctrine @@ -25,7 +25,6 @@ use Symfony\Component\Console\Application; use Alchemy\Phrasea; $Core = require_once dirname(__FILE__) . '/../lib/bootstrap.php'; -bootstrap::register_autoloads(); try { diff --git a/hudson/build.properties b/hudson/build.properties index 12294dcf26..7e9f0fbb3b 100644 --- a/hudson/build.properties +++ b/hudson/build.properties @@ -1,5 +1,5 @@ # temp pour lint -dir.src=/tmp/jenkinsWorking-dev +dir.src=/tmp/jenkinsWorking-doctrine # test.ci -dir.dest=/home/sites_web/test-dev.ci.alchemyasp.com/pv3 +dir.dest=/home/sites_web/test-doctrine.ci.alchemyasp.com/pv3 diff --git a/lib/Alchemy/Phrasea/Cache/ApcCache.php b/lib/Alchemy/Phrasea/Cache/ApcCache.php index 59f4d643c0..33fd6927a9 100644 --- a/lib/Alchemy/Phrasea/Cache/ApcCache.php +++ b/lib/Alchemy/Phrasea/Cache/ApcCache.php @@ -27,11 +27,6 @@ class ApcCache extends DoctrineApc implements Cache return false; } - public function getStats() - { - return null; - } - public function get($key) { if (!$this->contains($key)) @@ -52,9 +47,4 @@ class ApcCache extends DoctrineApc implements Cache return $this; } - public function flush() - { - return apc_clear_cache() && apc_clear_cache('user'); - } - } diff --git a/lib/Alchemy/Phrasea/Cache/ArrayCache.php b/lib/Alchemy/Phrasea/Cache/ArrayCache.php index 50e32f7577..d8ad78c8fd 100644 --- a/lib/Alchemy/Phrasea/Cache/ArrayCache.php +++ b/lib/Alchemy/Phrasea/Cache/ArrayCache.php @@ -28,12 +28,6 @@ class ArrayCache extends DoctrineArray implements Cache return false; } - public function getStats() - { - - return null; - } - public function get($id) { if (!$this->contains($id)) @@ -54,11 +48,4 @@ class ArrayCache extends DoctrineArray implements Cache return; } - public function flush() - { - $this->deleteAll(); - - return true; - } - } diff --git a/lib/Alchemy/Phrasea/Cache/Cache.php b/lib/Alchemy/Phrasea/Cache/Cache.php index 91e94382fd..516072dbba 100644 --- a/lib/Alchemy/Phrasea/Cache/Cache.php +++ b/lib/Alchemy/Phrasea/Cache/Cache.php @@ -24,10 +24,6 @@ interface Cache extends DoctrineCache public function isServer(); - public function getStats(); - - public function flush(); - public function get($key); public function deleteMulti(array $array_keys); diff --git a/lib/Alchemy/Phrasea/Cache/Manager.php b/lib/Alchemy/Phrasea/Cache/Manager.php index be278499bd..aa0ab90c1e 100644 --- a/lib/Alchemy/Phrasea/Cache/Manager.php +++ b/lib/Alchemy/Phrasea/Cache/Manager.php @@ -60,7 +60,7 @@ class Manager { foreach ($this->registry as $cacheKey => $service_name) { - $this->get($cacheKey, $service_name)->getDriver()->flush(); + $this->get($cacheKey, $service_name)->getDriver()->flushAll(); } return $this; @@ -87,8 +87,7 @@ class Manager if ($this->hasChange($cacheKey, $service_name)) { - $driver->flush(); - + $service->getDriver()->flush(); if ($write) { $this->registry[$cacheKey] = $service_name; diff --git a/lib/Alchemy/Phrasea/Cache/MemcacheCache.php b/lib/Alchemy/Phrasea/Cache/MemcacheCache.php index 084e98bb0a..7872e3387a 100644 --- a/lib/Alchemy/Phrasea/Cache/MemcacheCache.php +++ b/lib/Alchemy/Phrasea/Cache/MemcacheCache.php @@ -27,11 +27,6 @@ class MemcacheCache extends DoctrineMemcache implements Cache return true; } - public function getStats() - { - return $this->getMemcache()->getstats(); - } - public function get($key) { if (!$this->contains($key)) @@ -52,9 +47,4 @@ class MemcacheCache extends DoctrineMemcache implements Cache return $this; } - public function flush() - { - return $this->getMemcache()->flush(); - } - } diff --git a/lib/Alchemy/Phrasea/Cache/RedisCache.php b/lib/Alchemy/Phrasea/Cache/RedisCache.php index c3234a9940..74a77bab6b 100644 --- a/lib/Alchemy/Phrasea/Cache/RedisCache.php +++ b/lib/Alchemy/Phrasea/Cache/RedisCache.php @@ -99,11 +99,6 @@ class RedisCache extends AbstractCache implements Cache return true; } - public function getStats() - { - return null; - } - public function get($key) { if (!$this->contains($key)) @@ -124,7 +119,7 @@ class RedisCache extends AbstractCache implements Cache return $this; } - public function flush() + public function flushAll() { return $this->_redis->flushAll(); } diff --git a/lib/Alchemy/Phrasea/Cache/XcacheCache.php b/lib/Alchemy/Phrasea/Cache/XcacheCache.php index 907639727f..2003704a26 100644 --- a/lib/Alchemy/Phrasea/Cache/XcacheCache.php +++ b/lib/Alchemy/Phrasea/Cache/XcacheCache.php @@ -27,11 +27,6 @@ class XcacheCache extends DoctrineXcache implements Cache return false; } - public function getStats() - { - return null; - } - public function get($key) { if (!$this->contains($key)) @@ -52,9 +47,4 @@ class XcacheCache extends DoctrineXcache implements Cache return $this; } - public function flush() - { - return xcache_clear_cache(XC_TYPE_VAR, 0); - } - } diff --git a/lib/Alchemy/Phrasea/Core.php b/lib/Alchemy/Phrasea/Core.php index b0c0fe1372..9874c7073a 100644 --- a/lib/Alchemy/Phrasea/Core.php +++ b/lib/Alchemy/Phrasea/Core.php @@ -443,7 +443,6 @@ class Core extends \Pimple 'Doctrine\\Logger' => realpath(__DIR__ . '/../../'), 'Monolog' => realpath(__DIR__ . '/../../vendor/Silex/vendor/monolog/src'), 'Gedmo' => realpath(__DIR__ . '/../../vendor/doctrine2-gedmo/lib'), - 'Events' => realpath(__DIR__ . '/../../Doctrine'), 'DoctrineExtensions' => realpath(__DIR__ . "/../../vendor/doctrine2-beberlei/lib"), 'Types' => realpath(__DIR__ . "/../../Doctrine"), 'PhraseaFixture' => realpath(__DIR__ . "/../../conf.d"), diff --git a/lib/Alchemy/Phrasea/Loader/ApcAutoloader.php b/lib/Alchemy/Phrasea/Loader/ApcAutoloader.php index 07d46c3119..c3552f6c49 100644 --- a/lib/Alchemy/Phrasea/Loader/ApcAutoloader.php +++ b/lib/Alchemy/Phrasea/Loader/ApcAutoloader.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Loader; require_once __DIR__ . '/LoaderStrategy.php'; require_once __DIR__ . '/../../../vendor/doctrine2-orm/lib/vendor/doctrine-common/lib/Doctrine/Common/Cache/Cache.php'; -require_once __DIR__ . '/../../../vendor/doctrine2-orm/lib/vendor/doctrine-common/lib/Doctrine/Common/Cache/AbstractCache.php'; +require_once __DIR__ . '/../../../vendor/doctrine2-orm/lib/vendor/doctrine-common/lib/Doctrine/Common/Cache/CacheProvider.php'; require_once __DIR__ . '/../../../vendor/doctrine2-orm/lib/vendor/doctrine-common/lib/Doctrine/Common/Cache/ApcCache.php'; use Alchemy\Phrasea\Loader\LoaderStrategy as CacheStrategy; diff --git a/lib/Alchemy/Phrasea/Loader/XcacheAutoloader.php b/lib/Alchemy/Phrasea/Loader/XcacheAutoloader.php index 38730c261c..d1e7fded8e 100644 --- a/lib/Alchemy/Phrasea/Loader/XcacheAutoloader.php +++ b/lib/Alchemy/Phrasea/Loader/XcacheAutoloader.php @@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Loader; require_once __DIR__ . '/LoaderStrategy.php'; require_once __DIR__ . '/../../../vendor/doctrine2-orm/lib/vendor/doctrine-common/lib/Doctrine/Common/Cache/Cache.php'; -require_once __DIR__ . '/../../../vendor/doctrine2-orm/lib/vendor/doctrine-common/lib/Doctrine/Common/Cache/AbstractCache.php'; +require_once __DIR__ . '/../../../vendor/doctrine2-orm/lib/vendor/doctrine-common/lib/Doctrine/Common/Cache/CacheProvider.php'; require_once __DIR__ . '/../../../vendor/doctrine2-orm/lib/vendor/doctrine-common/lib/Doctrine/Common/Cache/XcacheCache.php'; use Alchemy\Phrasea\Loader\LoaderStrategy as CacheStrategy; diff --git a/lib/Doctrine/Proxies/EntitiesBasketProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesBasket.php similarity index 93% rename from lib/Doctrine/Proxies/EntitiesBasketProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesBasket.php index 1ed363229c..4fc6d6b417 100644 --- a/lib/Doctrine/Proxies/EntitiesBasketProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesBasket.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } @@ -220,4 +229,4 @@ class EntitiesBasketProxy extends \Entities\Basket implements \Doctrine\ORM\Prox } } -} \ No newline at end of file +} diff --git a/lib/Doctrine/Proxies/EntitiesBasketElementProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesBasketElement.php similarity index 92% rename from lib/Doctrine/Proxies/EntitiesBasketElementProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesBasketElement.php index 4aef7e8e65..275bc60924 100644 --- a/lib/Doctrine/Proxies/EntitiesBasketElementProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesBasketElement.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } diff --git a/lib/Doctrine/Proxies/EntitiesStoryWZProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesStoryWZ.php similarity index 90% rename from lib/Doctrine/Proxies/EntitiesStoryWZProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesStoryWZ.php index 566c78675e..ba73c42ca2 100644 --- a/lib/Doctrine/Proxies/EntitiesStoryWZProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesStoryWZ.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } diff --git a/lib/Doctrine/Proxies/EntitiesUsrListProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php similarity index 91% rename from lib/Doctrine/Proxies/EntitiesUsrListProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesUsrList.php index 60a2b07dbf..d54062e0b8 100644 --- a/lib/Doctrine/Proxies/EntitiesUsrListProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } diff --git a/lib/Doctrine/Proxies/EntitiesUsrListEntryProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrListEntry.php similarity index 89% rename from lib/Doctrine/Proxies/EntitiesUsrListEntryProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesUsrListEntry.php index fdc40e6062..779318f62d 100644 --- a/lib/Doctrine/Proxies/EntitiesUsrListEntryProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrListEntry.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } diff --git a/lib/Doctrine/Proxies/EntitiesUsrListOwnerProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php similarity index 90% rename from lib/Doctrine/Proxies/EntitiesUsrListOwnerProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php index 6765ac71e8..a3ca49d4e9 100644 --- a/lib/Doctrine/Proxies/EntitiesUsrListOwnerProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } diff --git a/lib/Doctrine/Proxies/EntitiesValidationDataProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesValidationData.php similarity index 90% rename from lib/Doctrine/Proxies/EntitiesValidationDataProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesValidationData.php index 16ce6c81b8..cc6f315171 100644 --- a/lib/Doctrine/Proxies/EntitiesValidationDataProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesValidationData.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } diff --git a/lib/Doctrine/Proxies/EntitiesValidationParticipantProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesValidationParticipant.php similarity index 92% rename from lib/Doctrine/Proxies/EntitiesValidationParticipantProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesValidationParticipant.php index a30a98d72e..71c354900a 100644 --- a/lib/Doctrine/Proxies/EntitiesValidationParticipantProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesValidationParticipant.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } diff --git a/lib/Doctrine/Proxies/EntitiesValidationSessionProxy.php b/lib/Doctrine/Proxies/__CG__EntitiesValidationSession.php similarity index 93% rename from lib/Doctrine/Proxies/EntitiesValidationSessionProxy.php rename to lib/Doctrine/Proxies/__CG__EntitiesValidationSession.php index 0c6dd668c4..cfb393d42e 100644 --- a/lib/Doctrine/Proxies/EntitiesValidationSessionProxy.php +++ b/lib/Doctrine/Proxies/__CG__EntitiesValidationSession.php @@ -1,11 +1,11 @@ _entityPersister, $this->_identifier); } } - + + /** @private */ + public function __isInitialized() + { + return $this->__isInitialized__; + } + public function getId() { + if ($this->__isInitialized__ === false) { + return (int) $this->_identifier["id"]; + } $this->__load(); return parent::getId(); } diff --git a/lib/unitTest/Alchemy/Phrasea/Cache/XcacheCacheTest.php b/lib/unitTest/Alchemy/Phrasea/Cache/XcacheCacheTest.php index 42ef4312d8..c50423ebc3 100644 --- a/lib/unitTest/Alchemy/Phrasea/Cache/XcacheCacheTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Cache/XcacheCacheTest.php @@ -20,6 +20,11 @@ class XcacheCacheTest extends \PHPUnit_Framework_TestCase */ public function setUp() { + if(!function_exists('xcache_info')) + { + $this->markTestSkipped('Xcache not loaded'); + } + $this->object = new \Alchemy\Phrasea\Cache\XcacheCache; } diff --git a/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc b/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc index 98cecc7068..b810c2d72e 100644 --- a/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc +++ b/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc @@ -23,7 +23,6 @@ use Doctrine\Common\DataFixtures\Loader; * @link www.phraseanet.com */ -\bootstrap::register_autoloads(); abstract class PhraseanetPHPUnitAbstract extends WebTestCase diff --git a/lib/vendor/doctrine2-orm b/lib/vendor/doctrine2-orm index 3e7c9a1ff4..191520439b 160000 --- a/lib/vendor/doctrine2-orm +++ b/lib/vendor/doctrine2-orm @@ -1 +1 @@ -Subproject commit 3e7c9a1ff4d2ce44c5659c9bf5849c1b9c51eb45 +Subproject commit 191520439b61f801cdaabeb1916818e2e52878d0 diff --git a/lib/vendor/sphinx b/lib/vendor/sphinx index 4e878fa9c7..3435431efe 160000 --- a/lib/vendor/sphinx +++ b/lib/vendor/sphinx @@ -1 +1 @@ -Subproject commit 4e878fa9c760502721253e222796f822bf1fbbff +Subproject commit 3435431efe058e84adcf731c70d0354f41f04a6c diff --git a/www/admin/router.php b/www/admin/router.php index d6cd34e2a3..9e019e4b69 100644 --- a/www/admin/router.php +++ b/www/admin/router.php @@ -15,8 +15,7 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -require_once __DIR__ . "/../../lib/bootstrap.php"; -bootstrap::register_autoloads(); +$Core = require_once __DIR__ . "/../../lib/bootstrap.php"; $request = http_request::getInstance(); $parm = $request->get_parms('session'); diff --git a/www/include/overview.php b/www/include/overview.php index 591cc3bccc..9a76b62ff1 100644 --- a/www/include/overview.php +++ b/www/include/overview.php @@ -15,8 +15,7 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -require_once __DIR__ . "/../../lib/bootstrap.php"; -bootstrap::register_autoloads(); +$Core = require_once __DIR__ . "/../../lib/bootstrap.php"; $app = require __DIR__ .'/../../lib/Alchemy/Phrasea/Application/Overview.php';