function updateINI_1_1_0() { showMessage2("Updating INI-files..."); $siteaccessList = getUserInput("Please specify the eZ Flow siteaccesses on your site (separated with space, for example eng nor): "); $siteaccessList = explode(' ', $siteaccessList); $translationSA = array(); foreach ($siteaccessList as $siteaccess) { if (!file_exists('settings/siteaccess/' . $siteaccess)) { continue; } /* Update override.ini.append.php part */ $settings = array('full_silverlight' => array('Source' => 'node/view/full.tpl', 'MatchFile' => 'full/silverlight.tpl', 'Subdir' => 'templates', 'Match' => array('class_identifier' => 'silverlight')), 'line_silverlight' => array('Source' => 'node/view/line.tpl', 'MatchFile' => 'line/silverlight.tpl', 'Subdir' => 'templates', 'Match' => array('class_identifier' => 'silverlight')), 'edit_ezsubtreesubscription_forum_topic' => array('Source' => 'content/datatype/edit/ezsubtreesubscription.tpl', 'MatchFile' => 'datatype/edit/ezsubtreesubscription/forum_topic.tpl', 'Subdir' => 'templates', 'Match' => array('class_identifier' => 'forum_topic')), 'block_item_article' => array('Source' => 'node/view/block_item.tpl', 'MatchFile' => 'block_item/article.tpl', 'Subdir' => 'templates', 'Match' => array('class_identifier' => 'article')), 'block_item_image' => array('Source' => 'node/view/block_item.tpl', 'MatchFile' => 'block_item/image.tpl', 'Subdir' => 'templates', 'Match' => array('class_identifier' => 'image')), 'dynamic_3_items1' => array('Source' => 'block/view/view.tpl', 'MatchFile' => 'block/dynamic_3_items1.tpl', 'Subdir' => 'templates', 'Match' => array('type' => 'Dynamic3Items', 'view' => '3_items1'))); $ini = eZINI::instance('override.ini', 'settings/siteaccess/' . $siteaccess, null, null, false, true); $ini->setReadOnlySettingsCheck(false); $ini->setVariables($settings); $ini->save(false, '.append.php', false, false, 'settings/siteaccess/' . $siteaccess, false); /* Update menu.ini.append.php part */ $settings = array('SelectedMenu' => array('CurrentMenu' => 'DoubleTop', 'TopMenu' => 'double_top', 'LeftMenu' => '')); $ini = eZINI::instance('menu.ini', 'settings/siteaccess/' . $siteaccess, null, null, false, true); $ini->setReadOnlySettingsCheck(false); $ini->setVariables($settings); $ini->save(false, '.append.php', false, false, 'settings/siteaccess/' . $siteaccess, false); /* Get site.ini for ContentObjectLocale code */ $ini = eZINI::instance('site.ini', 'settings/siteaccess/' . $siteaccess, null, null, false, true); $contentObjectLocale = explode('-', $ini->variable('RegionalSettings', 'ContentObjectLocale')); $translationSA[$siteaccess] = ucfirst($contentObjectLocale[0]); } $settings = array(array('name' => 'site.ini', 'settings' => array('RegionalSettings' => array('TranslationSA' => $translationSA))), array('name' => 'content.ini', 'settings' => array('table' => array('CustomAttributes' => array('0' => 'summary', '1' => 'caption')), 'td' => array('CustomAttributes' => array('0' => 'valign')), 'th' => array('CustomAttributes' => array('0' => 'scope', '1' => 'abbr', '2' => 'valign')), 'CustomTagSettings' => array('AvailableCustomTags' => array('0' => 'underline'), 'IsInline' => array('underline' => 'true')), 'embed-type_images' => array('AvailableClasses' => array()))), array('name' => 'ezoe_attributes.ini', 'settings' => array('CustomAttribute_table_summary' => array('Name' => 'Summary (WAI)', 'Required' => 'true'), 'CustomAttribute_scope' => array('Name' => 'Scope', 'Title' => 'The scope attribute defines a way to associate header cells and data cells in a table.', 'Type' => 'select', 'Selection' => array('0' => '', 'col' => 'Column', 'row' => 'Row')), 'CustomAttribute_valign' => array('Title' => 'Lets you define the vertical alignment of the table cell/ header.', 'Type' => 'select', 'Selection' => array('0' => '', 'top' => 'Top', 'middle' => 'Middle', 'bottom' => 'Bottom', 'baseline' => 'Baseline')), 'Attribute_table_border' => array('Type' => 'htmlsize', 'AllowEmpty' => 'true'), 'CustomAttribute_embed_offset' => array('Type' => 'int', 'AllowEmpty' => 'true'), 'CustomAttribute_embed_limit' => array('Type' => 'int', 'AllowEmpty' => 'true'))), array('name' => 'ezxml.ini', 'settings' => array('TagSettings' => array('TagPresets' => array('0' => '', 'mini' => 'Simple formatting'))))); foreach ($settings as $setting) { $iniName = $setting['name']; $onlyModified = false; if (file_exists('settings/override/' . $iniName . '.append') || file_exists('settings/override/' . $iniName . '.append.php')) { $ini = eZINI::instance($iniName, 'settings/override', null, null, false, true); } else { $ini = eZINI::create($iniName, 'settings/override'); $onlyModified = true; } $ini->setReadOnlySettingsCheck(false); $ini->setVariables($setting['settings']); $ini->save(false, '.append.php', false, $onlyModified, 'settings/override', false); } }
function installPackages($packageList, $params = array()) { global $cli; showMessage2("Installing..."); // copy/paste from eZPackage if (!isset($params['path'])) { $params['path'] = false; } // process packages $action = false; while ((list(, $packageName) = each($packageList)) && $action != EZ_INSTALL_PACKAGE_EXTRA_ACTION_QUIT) { $action = false; $cli->output($cli->stylize('emphasize', "Installing package '{$packageName}'"), true); $package = eZPackage::fetch($packageName); if (!is_object($package)) { showError("can't fetch package '{$packageName}'. Aborting..."); } // skip package which can not be installed(e.g. which can be imported only, like 'design' and 'site' types) if ($package->attribute('install_type') != 'install') { continue; } $packageType = $package->attribute('type'); $packageItems = $package->installItemsList(); while ((list(, $item) = each($packageItems)) && $action != EZ_INSTALL_PACKAGE_EXTRA_ACTION_QUIT && $action != EZ_INSTALL_PACKAGE_EXTRA_ACTION_SKIP_PACKAGE) { $itemInstalled = false; do { $action = false; $package->installItem($item, $params); if (isset($params['error']) && is_array($params['error']) && count($params['error']) > 0) { global $autoMode; if ($autoMode == 'on') { switch ($packageType) { case 'contentclass': $action = 2; break; case 'extension': $action = 1; break; default: $action = handlePackageError($params['error']); break; } } else { $action = handlePackageError($params['error']); } $params['error']['choosen_action'] = $action; } else { $itemInstalled = true; } } while (!$itemInstalled && $action != EZ_INSTALL_PACKAGE_EXTRA_ACTION_QUIT && $action != EZ_INSTALL_PACKAGE_EXTRA_ACTION_SKIP_PACKAGE); } } }
function eZExecuteShellCommand($command, $errMessage = '', $retry = true, $ignore = false) { $err = 0; do { $out = system($command, $err); if ($err) { if ($errMessage) { showMessage2($errMessage); } if ($retry) { do { $action = $ignore ? eZGetUserInput("Retry? [y/n/Ignore]: ") : eZGetUserInput("Retry? [y/n]: "); if (strpos($action, 'y') === 0) { $continue = false; } elseif ($ignore && strpos($action, 'I') === 0) { $continue = true; $retry = false; } else { // default action is not to retry but to abort showError("Aborting..."); } } while (!$continue); } else { showError("Aborting..."); } } else { $retry = false; } } while ($retry); return $err; }
postInstallAdminSiteaccessINIUpdate($params); postInstallUserSiteaccessINIUpdate($params); createTranslationSiteAccesses($params); // updateTemplateLookClassAttributes() and updateTemplateLookObjectAttributes(); $classIdentifier = 'template_look'; $newAttributeIdArr = expandClass($classIdentifier); foreach ($newAttributeIdArr as $id) { updateObject($classIdentifier, $id); } $templateLookData = templateLookObjectData($params); $siteInstaller->updateContentObjectAttributes(array('object_id' => $webinInstaller->setting('template_look_object_id'), 'attributes_data' => $templateLookData)); $siteInstaller->swapNodes(array('src_node' => array('name' => "eZ Publish"), 'dst_node' => array('name' => "Home"))); $siteInstaller->removeContentObject(array('name' => 'eZ Publish')); $webinInstaller->postInstall(); } // // Output installation status. // showMessage2('Installation complete.'); showMessage('URLs to access eZWebin sites:'); foreach ($siteaccessUrls as $siteaccessType => $siteaccessInfo) { showMessage(" {$siteaccessType}:"); foreach ($siteaccessInfo as $siteaccessName => $urlInfo) { showMessage(" {$siteaccessName}: " . $urlInfo['url']); } } } else { showWarning("Unable to find installation script dir."); } } $script->shutdown(0, 'Done');