diff --git a/lib/Alchemy/Phrasea/Application/Setup.php b/lib/Alchemy/Phrasea/Application/Setup.php index 93ec039e84..3e48a73578 100644 --- a/lib/Alchemy/Phrasea/Application/Setup.php +++ b/lib/Alchemy/Phrasea/Application/Setup.php @@ -39,8 +39,8 @@ return call_user_func(function() { $app['upgrade'] = true; } elseif (\setup::needUpgradeConfigurationFile()) { - $connexionInc = new \SplFileObject(__DIR__ . '/../../../../config/connexion.inc'); - $configInc = new \SplFileObject(__DIR__ . '/../../../../config/config.inc'); + $connexionInc = new \SplFileInfo(__DIR__ . '/../../../../config/connexion.inc', true); + $configInc = new \SplFileInfo(__DIR__ . '/../../../../config/config.inc', true); $configuration = \Alchemy\Phrasea\Core\Configuration::build(); $configuration->upgradeFromOldConf($configInc, $connexionInc); diff --git a/lib/Alchemy/Phrasea/Cache/Manager.php b/lib/Alchemy/Phrasea/Cache/Manager.php index c54157cbd5..d84c06181d 100644 --- a/lib/Alchemy/Phrasea/Cache/Manager.php +++ b/lib/Alchemy/Phrasea/Cache/Manager.php @@ -11,8 +11,9 @@ namespace Alchemy\Phrasea\Cache; -use \Alchemy\Phrasea\Core\Service\Builder, - \Alchemy\Phrasea\Core; +use Symfony\Component\HttpFoundation\File\File as SymfoFile; +use Alchemy\Phrasea\Core\Service\Builder; +use Alchemy\Phrasea\Core; /** * @@ -23,7 +24,7 @@ class Manager { /** * - * @var \SplFileObject + * @var \SplFileInfo */ protected $cacheFile; protected $core; @@ -40,7 +41,7 @@ class Manager */ protected $registry = array(); - public function __construct(Core $core, \SplFileObject $file) + public function __construct(Core $core, \SplFileInfo $file) { $this->cacheFile = $file; $this->parser = new \Symfony\Component\Yaml\Yaml(); diff --git a/lib/Alchemy/Phrasea/Core.php b/lib/Alchemy/Phrasea/Core.php index 1ff49daa2a..30709195cc 100644 --- a/lib/Alchemy/Phrasea/Core.php +++ b/lib/Alchemy/Phrasea/Core.php @@ -91,7 +91,7 @@ class Core extends \Pimple touch(__DIR__ . '/../../../tmp/cache_registry.yml'); } - $file = new \SplFileObject(__DIR__ . '/../../../tmp/cache_registry.yml'); + $file = new \SplFileInfo(__DIR__ . '/../../../tmp/cache_registry.yml'); return new \Alchemy\Phrasea\Cache\Manager($core, $file); }); diff --git a/lib/Alchemy/Phrasea/Core/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration.php index 7d82371ec4..458832c575 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration.php +++ b/lib/Alchemy/Phrasea/Core/Configuration.php @@ -72,11 +72,11 @@ class Configuration return $this; } - public function upgradeFromOldConf(\SplFileObject $configInc, \SplFileObject $connexionInc) + public function upgradeFromOldConf(\SplFileInfo $configInc, \SplFileInfo $connexionInc) { $this->initialize(); - $retrieve_old_credentials = function(\SplFileObject $connexionInc) { + $retrieve_old_credentials = function(\SplFileInfo $connexionInc) { require $connexionInc->getPathname(); return array( @@ -102,7 +102,7 @@ class Configuration $configs = $this->getConfigurations(); - $retrieve_old_parameters = function(\SplFileObject $configInc) { + $retrieve_old_parameters = function(\SplFileInfo $configInc) { require $configInc->getPathname(); return array( diff --git a/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php b/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php index 6d9c754533..7a63f3b076 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php @@ -70,17 +70,17 @@ class ApplicationSpecification implements Specification protected function getConfigurationsFile() { - return new \SplFileObject($this->getConfigurationsPathFile()); + return new \SplFileInfo($this->getConfigurationsPathFile()); } protected function getConnexionsFile() { - return new \SplFileObject($this->getConnexionsPathFile()); + return new \SplFileInfo($this->getConnexionsPathFile()); } protected function getServicesFile() { - return new \SplFileObject($this->getServicesPathFile()); + return new \SplFileInfo($this->getServicesPathFile()); } public function delete() diff --git a/lib/classes/Bridge/Api/Dailymotion.class.php b/lib/classes/Bridge/Api/Dailymotion.class.php index d6fedbc581..025121da48 100644 --- a/lib/classes/Bridge/Api/Dailymotion.class.php +++ b/lib/classes/Bridge/Api/Dailymotion.class.php @@ -896,7 +896,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I private function check_record_constraints(record_adapter $record) { $errors = array(); - if ( ! $record->get_hd_file() instanceof SplFileObject) + if ( ! $record->get_hd_file() instanceof \SplFileInfo) $errors["file_size"] = _("Le record n'a pas de fichier physique"); //Record must rely on real file if ($record->get_duration() > self::AUTH_VIDEO_DURATION) diff --git a/lib/classes/Bridge/Api/Flickr.class.php b/lib/classes/Bridge/Api/Flickr.class.php index 7093eb7b2f..30b461ac59 100644 --- a/lib/classes/Bridge/Api/Flickr.class.php +++ b/lib/classes/Bridge/Api/Flickr.class.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -use \Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Request; /** * @@ -818,7 +818,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf private function check_record_constraints(record_adapter $record) { $errors = array(); - if ( ! $record->get_hd_file() instanceof SplFileObject) + if ( ! $record->get_hd_file() instanceof \SplFileInfo) $errors["file_size"] = _("Le record n'a pas de fichier physique"); //Record must rely on real file if ($record->get_technical_infos('size') > self::AUTH_PHOTO_SIZE) $errors["size"] = sprintf(_("Le poids maximum d'un fichier est de %s"), p4string::format_octets(self::AUTH_PHOTO_SIZE)); diff --git a/lib/classes/Bridge/Api/Youtube.class.php b/lib/classes/Bridge/Api/Youtube.class.php index c7176a18ed..0ccfe08c1d 100644 --- a/lib/classes/Bridge/Api/Youtube.class.php +++ b/lib/classes/Bridge/Api/Youtube.class.php @@ -1022,7 +1022,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter { $errors = array(); $key = $record->get_serialize_key(); - if ( ! $record->get_hd_file() instanceof SplFileObject) + if ( ! $record->get_hd_file() instanceof SplFileInfo) $errors["file_size_" . $key] = _("Le record n'a pas de fichier physique"); //Record must rely on real file if ($record->get_duration() > self::AUTH_VIDEO_DURATION) diff --git a/lib/classes/module/console/systemUpgrade.class.php b/lib/classes/module/console/systemUpgrade.class.php index ab2cc41f69..eb6c44bd2d 100644 --- a/lib/classes/module/console/systemUpgrade.class.php +++ b/lib/classes/module/console/systemUpgrade.class.php @@ -50,8 +50,8 @@ class module_console_systemUpgrade extends Command if ($continue == 'y') { try { - $connexionInc = new \SplFileObject(__DIR__ . '/../../../../config/connexion.inc'); - $configInc = new \SplFileObject(__DIR__ . '/../../../../config/config.inc'); + $connexionInc = new \SplFileInfo(__DIR__ . '/../../../../config/connexion.inc', true); + $configInc = new \SplFileInfo(__DIR__ . '/../../../../config/config.inc', true); $Core->getConfiguration()->upgradeFromOldConf($configInc, $connexionInc); } catch (\Exception $e) {