Skip to content

Instantly share code, notes, and snippets.

@Opencontent
Created March 3, 2017 09:20
Show Gist options
  • Save Opencontent/8bc104f2e3ffeab04dea59b58a0d675e to your computer and use it in GitHub Desktop.
Save Opencontent/8bc104f2e3ffeab04dea59b58a0d675e to your computer and use it in GitHub Desktop.
<?php
require 'autoload.php';
$script = eZScript::instance( array( 'description' => ( 'Check image ini' ),
'use-session' => false,
'use-modules' => true,
'use-extensions' => true ) );
$script->startup();
$options = $script->getOptions();
$script->initialize();
$script->setUseDebugAccumulators( true );
$cli = eZCLI::instance();
$ini = eZINI::instance( 'image.ini' );
$aliasList = $ini->variable('AliasSettings', 'AliasList');
$add = array();
foreach($aliasList as $alias)
{
if ( !$ini->hasGroup( $alias ) )
{
$cli->error( "No such group $alias in ini file image.ini" );
}
else
{
$group = $ini->group( $alias );
$reference = $group['Reference'];
if ($reference != 'reference'){
$add[] = $alias;
}
}
}
sort($add);
$add = array_unique($add);
foreach($add as $item){
if ($item != 'reference'){
$cli->warning("[$item]");
$cli->warning("Reference=reference");
$cli->warning("");
}
}
$script->shutdown();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment