eZPublishCommunityProject(LegacyStack)  2013.5
fiximagesoutsidevardir.php File Reference

Variables

 $cli = eZCLI::instance()
 File containing the fiximagesoutsidevardir.php script. More...
 
 $clusterHandler = eZClusterFileHandler::instance()
 
 $db = eZDB::instance()
 
 $optDryRun = (bool)$options['dry-run']
 
 $options = $script->getOptions( "[dry-run]", "", array( 'n' => 'Dry run' ) )
 
 $rows = $db->arrayQuery( "SELECT * FROM ezimagefile WHERE filepath NOT LIKE '{$varDir}%'" )
 
 $script
 
 $varDir = eZINI::instance( 'site.ini' )->variable( 'FileSettings', 'VarDir' )
 

Variable Documentation

$cli = eZCLI::instance()

File containing the fiximagesoutsidevardir.php script.

Version
2013.5 This update script will fix references to images that aren't part of the current vardir.

This may for instance occur when the VarDir setting is changed. This script will rename the files, and update the database references to the new path

$db = eZDB::instance()
$optDryRun = (bool)$options['dry-run']
$options = $script->getOptions( "[dry-run]", "", array( 'n' => 'Dry run' ) )
$rows = $db->arrayQuery( "SELECT * FROM ezimagefile WHERE filepath NOT LIKE '{$varDir}%'" )
$script
Initial value:
array(
'description' => "Fixes references to images located outside VarDir.\n\n" .
"This may for instance occur when the VarDir setting is changed after a project has been started\n" .
"\n" .
"The legacy kernel will accept this, but the new Public API will not.",
'use-session' => true,
'use-modules' => false,
'use-extensions' => true
)
)
static instance($settings=array())
Returns a shared instance of the eZScript class.
Definition: ezscript.php:1084
$varDir = eZINI::instance( 'site.ini' )->variable( 'FileSettings', 'VarDir' )