Added script for fixing var_dir issues for images#2638
Added script for fixing var_dir issues for images#2638mateuszbieniek wants to merge 3 commits intoezsystems:6.7from
Conversation
|
Open questions:
|
985333a to
676f2c4
Compare
| '--iteration-count=' . $iterationCount, | ||
| ]; | ||
|
|
||
| $process = new Process( |
There was a problem hiding this comment.
So side comment, but with this, re-index command and probably also others, maybe we can find a way to expose reusable code for parallel processes? So one place where we can make sure any global arguments like siteaccess, debug, env, memory, ... is passed to php & bin/console.
Same goes for installers and need to run sub commands, like in Commerce installer PR.
There was a problem hiding this comment.
So side comment, but with this, re-index command and probably also others, maybe we can find a way to expose reusable code for parallel processes? So one place where we can make sure any global arguments like siteaccess, debug, env, memory, ... is passed to php & bin/console.
Same goes for installers and need to run sub commands, like in Commerce installer PR.
Yeah, this seems to be very repetitive.
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
glye
left a comment
There was a problem hiding this comment.
No blockers from me.
- Move files? No. Minimise what it does. Admins may feel safer moving stuff themselves with regular file commands. Besides, if the script did the whole job, it would need a diffferent name :)
- Clear cache? No. Again, minimise what it does, and let admin decide how and when to clear. But be very clear in info to admin.
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Show resolved
Hide resolved
alongosz
left a comment
There was a problem hiding this comment.
The direction here with a Gateway is good, however you need to apply it for all queries called directly from the Command. Otherwise you might end up having multiple transactions.
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
| $query = $this->connection->createQueryBuilder(); | ||
| $query | ||
| ->update('ezcontentobject_attribute', 'oa') | ||
| ->set('oa.data_text', ':text') |
There was a problem hiding this comment.
This line tells me that you haven't tested this with Postgres ;) It won't work.
eZ/Bundle/EzPublishMigrationBundle/Resources/config/services.yml
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/FieldType/Image/ImageStorage/Gateway/LegacyStorage.php
Outdated
Show resolved
Hide resolved
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Outdated
Show resolved
Hide resolved
| protected function initialize(InputInterface $input, OutputInterface $output) | ||
| { | ||
| parent::initialize($input, $output); | ||
| $this->imageGateway->setConnection($this->db); |
There was a problem hiding this comment.
Warning: this will stop working on upper branch. At this point I'd refactor Gateway itself, or decorate it just to be safe.
There was a problem hiding this comment.
Script has to be refactored slightly for 2.x and onward, so maybe w can leave it as it is and change it for "upper braches"?
eZ/Bundle/EzPublishMigrationBundle/Command/LegacyStorage/FixImagesVarDirCommand.php
Show resolved
Hide resolved
d37ad0f to
3f7b2ba
Compare
|
closed in favor: #2995 |
This is port of legacy script that fixes images
var_dirissues.