$params['database'] = $dbName; } $db = eZDB::instance($dbImpl, $params, true); eZDB::setInstance($db); } $db->setIsSQLOutputEnabled((bool) $options['sql']); // Log in admin user $user = eZUser::fetchByName(isset($options['admin-user']) ? $options['admin-user'] : '******'); if ($user) { eZUser::setCurrentlyLoggedInUser($user, $user->attribute('id')); } else { $cli->error('Could not fetch admin user object'); $script->shutdown(1); return; } // Take care of script monitoring $scheduledScript = false; if (isset($options['scriptid'])) { $scheduledScript = eZScheduledScript::fetch($options['scriptid']); } // Do the update if (isset($options['classid'])) { updateClass($options['classid'], $scheduledScript); } else { $cli->notice('The classid parameter was not given, will check all classes.'); foreach (eZContentClass::fetchList(eZContentClass::VERSION_STATUS_MODIFIED, false) as $class) { $cli->output('Checking class with ID: ' . $class['id']); updateClass($class['id'], $scheduledScript); } } $script->shutdown();
<?php /** * File containing view controller * * @copyright Copyright (C) eZ Systems AS. * @license For full copyright and license information view LICENSE file distributed with this source code. * */ $Module = $Params['Module']; $scriptID = $Params['ScriptID']; $script = eZScheduledScript::fetch($scriptID); if (is_object($script)) { $scriptName = $script->attribute('name'); } else { $scriptName = ezpI18n::tr('ezscriptmonitor', 'Script not found'); } $tpl = eZTemplate::factory(); $tpl->setVariable('module', $Module); $tpl->setVariable('script', $script); $Result = array(); $Result['content'] = $tpl->fetch('design:scriptmonitor/view.tpl'); $Result['path'] = array(array('url' => '/scriptmonitor/list/', 'text' => ezpI18n::tr('ezscriptmonitor', 'Script monitor')), array('url' => false, 'text' => $scriptName));