/** * Check whether a specified parameter in a specified section is set in a specified file * * @deprecated Since 4.4 * @param string fileName file name (optional) * @param string rootDir directory (optional) * @param string section section name * @param string parameter parameter name * @return bool True if the the parameter is set. */ static function parameterSet($fileName = 'site.ini', $rootDir = 'settings', &$section, &$parameter) { if (!eZINI::exists($fileName, $rootDir)) { return false; } $iniInstance = eZINI::instance($fileName, $rootDir, null, null, null, true); return $iniInstance->hasVariable($section, $parameter); }
function languageFile($withVariation = false) { $type = $withVariation ? 'variation' : 'default'; if (!$this->LanguageINI[$type] instanceof eZINI) { $language = $this->languageCode(); $countryVariation = $this->countryVariation(); $locale = $language; if ($withVariation) { if ($countryVariation !== '') { $locale .= '@' . $countryVariation; } } $languageFile = 'language/' . $locale . '.ini'; if (eZLocale::isDebugEnabled()) { eZDebug::writeNotice("Requesting {$languageFile}", __METHOD__); } if (eZINI::exists($languageFile, 'share/locale')) { $this->LanguageINI[$type] = eZINI::instance($languageFile, 'share/locale'); } } return $this->LanguageINI[$type]; }
$script->startup(); $options = $script->getOptions( '[clusterIdentifier:]', '', array( 'clusterIdentifier' => 'Cluster\' identifier (ie : cluster_france)' ) ); $script->initialize(); if ( !isset( $options['clusterIdentifier'] ) ) { $script->shutdown( 1, 'clusterIdentifier must be specified' ); } $clusterIdentifier = $options['clusterIdentifier']; if ( !eZINI::exists( 'site.ini', "extension/{$clusterIdentifier}/settings" ) ) { $script->shutdown( 1, "Cluster {$clusterIdentifier} hasn't been correctly initialized. Script will shutdown now." ); } $language = eZINI::instance( 'site.ini', "extension/{$clusterIdentifier}/settings", null, false, false, true )->variable( 'RegionalSettings', 'SiteLanguageList' ); $language = $language[0]; $user = eZUser::fetchByName( 'admin' ); $userID = $user->attribute( 'contentobject_id' ); eZUser::setCurrentlyLoggedInUser( $user, $userID ); $cli = new QuestionInteractiveCli(); $country = eZContentObject::fetchByRemoteID( 'country_' . $clusterIdentifier );