-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added script for fixing var_dir issues for images #2638
Added script for fixing var_dir issues for images #2638
Conversation
Open questions:
|
985333a
to
676f2c4
Compare
'--iteration-count=' . $iterationCount, | ||
]; | ||
|
||
$process = new Process( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_dir
issues.