PHRAS-3519_filesystem-atomic-move

WIP
extend filesystem (no change yet)
This commit is contained in:
jygaulier
2021-10-06 18:23:52 +02:00
parent 0d07c8fb84
commit d7d731a496
30 changed files with 106 additions and 38 deletions

View File

@@ -9,8 +9,10 @@
*/
namespace Alchemy\Phrasea\Application\Helper;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Neutron\TemporaryFilesystem\Manager;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
trait FilesystemAware
{

View File

@@ -12,9 +12,11 @@
namespace Alchemy\Phrasea\Command\Developer;
use Alchemy\Phrasea\Command\Command;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class Behat extends Command
{

View File

@@ -15,6 +15,7 @@ use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Manager;
use Alchemy\Phrasea\Command\Command;
use Alchemy\Phrasea\ControllerProvider\Api\V2;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Alchemy\Phrasea\Media\SubdefSubstituer;
use Alchemy\Phrasea\Model\Entities\AggregateToken;
use Alchemy\Phrasea\Model\Entities\ApiApplication;
@@ -48,7 +49,9 @@ use Doctrine\ORM\Tools\SchemaTool;
use Gedmo\Timestampable\TimestampableListener;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class RegenerateSqliteDb extends Command
{

View File

@@ -11,6 +11,7 @@
namespace Alchemy\Phrasea\Controller\Admin;
use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Alchemy\Phrasea\Model\Entities\Feed;
use Alchemy\Phrasea\Model\Entities\FeedPublisher;
use Alchemy\Phrasea\Model\Repositories\FeedPublisherRepository;
@@ -20,12 +21,12 @@ use Doctrine\Common\Persistence\ObjectManager;
use MediaAlchemyst\Alchemyst;
use MediaAlchemyst\Specification\Image;
use MediaVorus\Media\MediaInterface;
use MediaVorus\MediaVorus;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
// use Symfony\Component\Filesystem\Filesystem;
class FeedController extends Controller
{
public function listFeedsAction()

View File

@@ -12,11 +12,13 @@
namespace Alchemy\Phrasea\ControllerProvider;
use Alchemy\Phrasea\Controller\MinifierController;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Silex\Application;
use Silex\ControllerCollection;
use Silex\ControllerProviderInterface;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class Minifier implements ControllerProviderInterface, ServiceProviderInterface
{

View File

@@ -3,14 +3,16 @@
namespace Alchemy\Phrasea\Core\Thumbnail;
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use MediaAlchemyst\Alchemyst;
use MediaAlchemyst\Specification\Image as ImageSpecification;
use MediaVorus\Media\Image;
use MediaVorus\Media\MediaInterface;
use MediaVorus\Media\Video;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\File\File;
//use Symfony\Component\Filesystem\Filesystem;
abstract class AbstractThumbnailManager
{
/**

View File

@@ -17,11 +17,11 @@ use MediaAlchemyst\Specification\SpecificationInterface;
class FilesystemService
{
/**
* @var \Symfony\Component\Filesystem\Filesystem
* @var PhraseanetFilesystem
*/
private $filesystem;
public function __construct(\Symfony\Component\Filesystem\Filesystem $filesystem)
public function __construct(PhraseanetFilesystem $filesystem)
{
$this->filesystem = $filesystem;
}

View File

@@ -10,11 +10,13 @@
namespace Alchemy\Phrasea\Filesystem;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Neutron\TemporaryFilesystem\Manager;
use Neutron\TemporaryFilesystem\TemporaryFilesystem;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Component\Filesystem\Filesystem;
//use Symfony\Component\Filesystem\Filesystem;
class FilesystemServiceProvider implements ServiceProviderInterface
{

View File

@@ -11,11 +11,13 @@
namespace Alchemy\Phrasea\Filesystem;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use MediaAlchemyst\Alchemyst;
use MediaAlchemyst\Exception\ExceptionInterface;
use MediaAlchemyst\Specification\Image as ImageSpecification;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class LazaretFilesystemService
{

View File

@@ -10,8 +10,11 @@
namespace Alchemy\Phrasea\Filesystem;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class LazaretPathBooker
{

View File

@@ -0,0 +1,15 @@
<?php
/**
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Filesystem;
class PhraseanetFilesystem extends \Symfony\Component\Filesystem\Filesystem
{
}

View File

@@ -11,8 +11,9 @@
namespace Alchemy\Phrasea\Http\StaticFile\Symlink;
use Silex\Application;
use Symfony\Component\Filesystem\Filesystem;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
/**
* Create & retrieve symlinks

View File

@@ -13,6 +13,7 @@ use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Border;
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
use Alchemy\Phrasea\Border\Attribute\MetaField;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Alchemy\Phrasea\Model\Entities\LazaretFile;
use Alchemy\Phrasea\WorkerManager\Event\RecordsWriteMetaEvent;
use Alchemy\Phrasea\WorkerManager\Event\WorkerEvents;
@@ -20,7 +21,8 @@ use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use PHPExiftool\Driver\Metadata\Metadata;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class LazaretManipulator

View File

@@ -11,10 +11,12 @@
namespace Alchemy\Phrasea\Plugin\Importer;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Alchemy\Phrasea\Plugin\Exception\ImportFailureException;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\ExceptionInterface as FsException;
// use Symfony\Component\Filesystem\Filesystem;
class FolderImporter implements ImporterInterface
{
private $fs;

View File

@@ -12,10 +12,12 @@
namespace Alchemy\Phrasea\Plugin\Management;
use Alchemy\Phrasea\Exception\RuntimeException;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Alchemy\Phrasea\Plugin\Schema\Manifest;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
// use Symfony\Component\Filesystem\Filesystem;
/**
* Manages plugins assets
*/

View File

@@ -9,9 +9,10 @@ use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Field;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Flag;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\GlobalStructure;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\MetadataHelper;
// use Alchemy\Phrasea\Utilities\Stopwatch;
use databox;
// use Alchemy\Phrasea\Utilities\Stopwatch;
class SearchEngineStructure
{
@@ -27,6 +28,19 @@ class SearchEngineStructure
$this->cache = $cache;
}
/**
* @param databox[] $databoxes
*/
public function getGlobalStructureConflictsFromDataboxes(array $databoxes)
{
$fieldsByName = [];
foreach ($databoxes as $databox) {
foreach ($databox->get_meta_structure() as $fieldStructure) {
$name = $fieldStructure->get_name();
}
}
}
/**
* @param databox[] $databoxes
*

View File

@@ -11,7 +11,9 @@
namespace Alchemy\Phrasea\Status;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
/**
* Provides status structure definition from XML

View File

@@ -17,14 +17,16 @@ use Alchemy\Phrasea\Core\LazyLocator;
use Alchemy\Phrasea\Core\Version\AppboxVersionRepository;
use Alchemy\Phrasea\Databox\DataboxConnectionProvider;
use Alchemy\Phrasea\Databox\DataboxRepository;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Doctrine\ORM\Tools\SchemaTool;
use MediaAlchemyst\Alchemyst;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\File\File as SymfoFile;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpFoundation\File\File as SymfoFile;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use vierbergenlars\SemVer\version;
// use Symfony\Component\Filesystem\Filesystem;
class appbox extends base
{
/**

View File

@@ -10,10 +10,9 @@
*/
use Alchemy\Phrasea\Command\Command;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
class module_console_systemClearCache extends Command
{

View File

@@ -10,8 +10,11 @@
*/
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class patch_384alpha2a implements patchInterface
{

View File

@@ -10,8 +10,6 @@
*/
use Alchemy\Phrasea\Application;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
class patch_386alpha3a implements patchInterface
{

View File

@@ -10,8 +10,6 @@
*/
use Alchemy\Phrasea\Application;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Filesystem\Filesystem;
class patch_386alpha4a implements patchInterface
{

View File

@@ -9,6 +9,7 @@
*/
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Alchemy\Phrasea\Model\Entities\Token;
use Alchemy\Phrasea\Model\Entities\User;
use Alchemy\Phrasea\Model\Repositories\BasketRepository;
@@ -17,7 +18,8 @@ use Alchemy\Phrasea\Model\Serializer\CaptionSerializer;
use Alchemy\Phrasea\Out\Module\PDFCgu;
use Assert\Assertion;
use Doctrine\DBAL\Connection;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class set_export extends set_abstract

View File

@@ -45,7 +45,7 @@ class PluginCommandTestCase extends \PhraseanetTestCase
protected function createFilesystemMock()
{
return $this->getMockBuilder('Symfony\Component\Filesystem\Filesystem')
return $this->getMockBuilder('Alchemy\Phrasea\Filesystem\PhraseanetFilesystem')
->disableOriginalConstructor()
->getMock();
}

View File

@@ -20,7 +20,7 @@ class PluginResetTest extends \PhraseanetTestCase
$capturedSource = null;
self::$DI['cli']['filesystem'] = $this->getMockBuilder('Symfony\Component\Filesystem\Filesystem')
self::$DI['cli']['filesystem'] = $this->getMockBuilder('Alchemy\Phrasea\Filesystem\PhraseanetFilesystem')
->disableOriginalConstructor()
->getMock();
self::$DI['cli']['filesystem']->expects($this->once())

View File

@@ -11,8 +11,11 @@
namespace Alchemy\Tests\Phrasea\Filesystem;
use Alchemy\Phrasea\Filesystem\FilesystemService;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Alchemy\Phrasea\Model\RecordInterface;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class FilesystemServiceTest extends \PHPUnit_Framework_TestCase
{

View File

@@ -11,9 +11,12 @@
namespace Alchemy\Tests\Phrasea\Filesystem;
use Alchemy\Phrasea\Filesystem\LazaretPathBooker;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
class LazaretPathBookerTest extends \PHPUnit_Framework_TestCase
{

View File

@@ -95,7 +95,7 @@ class AssetsManagerTest extends \PhraseanetTestCase
private function getFilesystemMock()
{
return $this->getMockBuilder('Symfony\Component\Filesystem\Filesystem')
return $this->getMockBuilder('Alchemy\Phrasea\Filesystem\PhraseanetFilesystem')
->disableOriginalConstructor()
->getMock();
}

View File

@@ -2,11 +2,14 @@
namespace Alchemy\Tests\Phrasea\Plugin\Management;
use Alchemy\Phrasea\Filesystem\PhraseanetFilesystem as Filesystem;
use Alchemy\Phrasea\Plugin\Management\ComposerInstaller;
use Alchemy\Phrasea\Utilities\ComposerSetup;
use Guzzle\Http\Client as Guzzle;
use Symfony\Component\Process\ExecutableFinder;
use Symfony\Component\Filesystem\Filesystem;
// use Symfony\Component\Filesystem\Filesystem;
/**
* @group functional

View File

@@ -22,7 +22,7 @@ class PluginTestCase extends \PhraseanetTestCase
protected function createFilesystemMock()
{
return $this->getMock('Symfony\Component\Filesystem\Filesystem');
return $this->getMock('Alchemy\Phrasea\Filesystem\PhraseanetFilesystem');
}
protected function getSchema()