本文整理汇总了PHP中ezpINIHelper::setINISetting方法的典型用法代码示例。如果您正苦于以下问题:PHP ezpINIHelper::setINISetting方法的具体用法?PHP ezpINIHelper::setINISetting怎么用?PHP ezpINIHelper::setINISetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ezpINIHelper
的用法示例。
在下文中一共展示了ezpINIHelper::setINISetting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
parent::setUp();
$this->xxx = eZContentLanguage::addLanguage('xxx-XX', 'XXXX');
ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'SiteLanguageList', array('xxx-XX', 'eng-GB'));
eZContentLanguage::clearPrioritizedLanguages();
}
示例2: setUp
/**
* Test setup
*
* Load an instance of file.ini
* Assigns DB parameters for cluster
**/
public function setUp()
{
parent::setUp();
// We need to clear the existing handler if it was loaded before the INI
// settings changes
eZClusterFileHandler::resetHandler();
unset($GLOBALS['eZClusterInfo']);
// Load database parameters for cluster
// The same DSN than the relational database is used
$dsn = ezpTestRunner::dsn()->parts;
switch ($dsn['phptype']) {
case 'mysql':
case 'mysqli':
$backend = 'eZDBFileHandlerMysqliBackend';
break;
case 'postgresql':
$backend = 'eZDBFileHandlerPostgresqlBackend';
break;
default:
$this->markTestSkipped("Unsupported database type '{$dsn['phptype']}'");
}
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'FileHandler', 'eZDBFileHandler');
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBHost', $dsn['host']);
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBPort', $dsn['port']);
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBSocket', $dsn['socket']);
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBName', $dsn['database']);
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBUser', $dsn['user']);
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBPassword', $dsn['password']);
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBBackend', $backend);
// ezpTestDatabaseHelper::insertSqlData( $this->sharedFixture, $this->sqlFiles );
$this->db = $this->sharedFixture;
}
示例3: testLinksAcrossTranslations
/**
* Test scenario for issue #13492: Links are lost after removing version
*
* Test Outline
* ------------
* 1. Create a Folder in English containing a link (in the short_description attribute).
* 2. Translate Folder into Norwegian containing another link (not the same link as above.)
* 3. Remove Folder version 1. (Version 2 is created when translating).
*
* @result: short_description in version 2 will have an empty link.
* @expected: short_description should contain same link as in version 1.
* @link http://issues.ez.no/13492
*/
public function testLinksAcrossTranslations()
{
ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'ContentObjectLocale', 'eng-GB');
$xmlDataEng = '<link href="/some-where-random">a link</link>';
$xmlDataNor = '<link href="/et-tilfeldig-sted">en link</link>';
// Step 1: Create folder
$folder = new ezpObject("folder", 2);
$folder->name = "Folder Eng";
$folder->short_description = $xmlDataEng;
$folder->publish();
$version1Xml = $folder->short_description->attribute('output')->attribute('output_text');
// Step 2: Translate folder
$trData = array("name" => "Folder Nor", "short_description" => $xmlDataNor);
$folder->addTranslation("nor-NO", $trData);
// addTranslation() publishes too.
// Step 3: Remove version 1
$version1 = eZContentObjectVersion::fetchVersion(1, $folder->id);
$version1->removeThis();
// Grab current versions data and make sure it's fresh.
$folder->refresh();
$version2Xml = $folder->short_description->attribute('output')->attribute('output_text');
$folder->remove();
ezpINIHelper::restoreINISettings();
self::assertEquals($version1Xml, $version2Xml);
}
示例4: setUp
public function setUp()
{
parent::setUp();
ezpEvent::resetInstance();
ezpINIHelper::setINISetting('site.ini', 'Event', 'Listeners', array('test/notify@ezpEventTest::helperNotify', 'test/filter@ezpEventTest::helperFilterNotNull'));
$this->event = ezpEvent::getInstance();
}
示例5: testFetchTranslatedNamesSort
/**
* Test for the sort feature of country list
*/
public function testFetchTranslatedNamesSort()
{
$translatedCountriesList = array(
'FR' => 'France',
'GB' => 'Royaume-uni',
'DE' => 'Allemagne',
'NO' => 'Norvège' );
ezpINIHelper::setINISetting( array( 'fre-FR.ini', 'share/locale' ), 'CountryNames', 'Countries', $translatedCountriesList );
ezpINIHelper::setINISetting( 'site.ini', 'RegionalSettings', 'Locale', 'fre-FR' );
$countries = eZCountryType::fetchCountryList();
$this->assertInternalType( 'array', $countries, "eZCountryType::fetchCountryList() didn't return an array" );
$countryListIsSorted = true;
foreach( $countries as $country )
{
if ( !isset( $previousCountry ) )
{
$previousCountry = $country;
continue;
}
if ( strcoll( $previousCountry['Name'], $country['Name'] ) > 0 )
{
$countryListIsSorted = false;
break;
}
}
ezpINIHelper::restoreINISettings();
$this->assertTrue( $countryListIsSorted, "Country list isn't sorted" );
}
示例6: testSendHTTPRequestException
/**
* Test for {@link eZSolrBase::sendHTTPRequest()} with a request that will time out
* An exception must be thrown in that case
* @link http://issues.ez.no/17862
* @group issue17862
* @expectedException ezfSolrException
*/
public function testSendHTTPRequestException()
{
ezpINIHelper::setINISetting('solr.ini', 'SolrBase', 'SearchServerURI', $this->nonReachableSolr);
$solrBase = new eZSolrBase();
$postString = $solrBase->buildPostString($this->postParams);
$solrBase->sendHTTPRequest($solrBase->SearchServerURI . $this->testURI, $postString);
}
示例7: testIssue13497
/**
* Test for regression #13497:
* attribute operator throws a PHP fatal error on a node without parent in a displayable language
*
* Situation:
* - siteaccess with one language (fre-FR) and ShowUntranslatedObjects disabled
* - parent content node in another language (eng-GB) with always available disabled
* - content node in the siteaccess' language (fre-FR)
* - fetch this fre-FR node from anywhere, and call attribute() on it
*
* Result:
* - Fatal error: Call to a member function attribute() on a non-object in
* kernel/classes/ezcontentobjecttreenode.php on line 4225
*
* Explanation: the error actually comes from the can_remove_location attribute
*/
public function testIssue13497()
{
$bkpLanguages = eZContentLanguage::prioritizedLanguageCodes();
// Create a folder in english only
$folder = new ezpObject("folder", 2, 14, 1, 'eng-GB');
$folder->setAlwaysAvailableLanguageID(false);
$folder->name = "Parent for " . __FUNCTION__;
$folder->publish();
$locale = eZLocale::instance('fre-FR');
$translation = eZContentLanguage::addLanguage($locale->localeCode(), $locale->internationalLanguageName());
// Create an article in french only, as a subitem of the previously created folder
$article = new ezpObject("article", $folder->attribute('main_node_id'), 14, 1, 'fre-FR');
$article->title = "Object for " . __FUNCTION__;
$article->short_description = "Description of test for " . __FUNCTION__;
$article->publish();
$articleNodeID = $article->attribute('main_node_id');
// INi changes: set language to french only, untranslatedobjects disabled
ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'ContentObjectLocale', 'fre-FR');
// ezpINIHelper::setINISetting( 'site.ini', 'RegionalSettings', 'SiteLanguageList', array( 'fre-FR' ) );
eZContentLanguage::setPrioritizedLanguages(array('fre-FR'));
ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'ShowUntranslatedObjects', 'disabled');
eZContentLanguage::expireCache();
// This should crash
eZContentObjectTreeNode::fetch($articleNodeID)->attribute('can_remove_location');
ezpINIHelper::restoreINISettings();
// re-expire cache for further tests
eZContentLanguage::setPrioritizedLanguages($bkpLanguages);
$article->remove();
$translation->removeThis();
eZContentLanguage::expireCache();
ezpINIHelper::restoreINISettings();
}
示例8: setUpDatabase
public static function setUpDatabase()
{
$dsn = ezpTestRunner::dsn()->parts;
switch ($dsn['phptype']) {
case 'mysql':
case 'mysqli':
$backend = 'eZDFSFileHandlerMySQLiBackend';
break;
case 'postgresql':
$backend = 'eZDFSFileHandlerPostgresqlBackend';
if (!class_exists('eZDFSFileHandlerPostgresqlBackend')) {
self::markTestSkipped("Missing extension 'ezpostgresqlcluster', skipping PostgreSQL DFS tests");
}
break;
default:
self::markTestSkipped("Unsupported database type '{$dsn['phptype']}'");
}
// We need to clear the existing handler if it was loaded before the INI
// settings changes
eZClusterFileHandler::resetHandler();
unset($GLOBALS['eZClusterInfo']);
// Load database parameters for cluster
// The same DSN than the relational database is used
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'FileHandler', 'eZDFSFileHandler');
ezpINIHelper::setINISetting('file.ini', 'eZDFSClusteringSettings', 'DBHost', $dsn['host']);
ezpINIHelper::setINISetting('file.ini', 'eZDFSClusteringSettings', 'DBPort', $dsn['port']);
ezpINIHelper::setINISetting('file.ini', 'eZDFSClusteringSettings', 'DBSocket', $dsn['socket']);
ezpINIHelper::setINISetting('file.ini', 'eZDFSClusteringSettings', 'DBName', $dsn['database']);
ezpINIHelper::setINISetting('file.ini', 'eZDFSClusteringSettings', 'DBUser', $dsn['user']);
ezpINIHelper::setINISetting('file.ini', 'eZDFSClusteringSettings', 'DBPassword', $dsn['password']);
ezpINIHelper::setINISetting('file.ini', 'eZDFSClusteringSettings', 'MountPointPath', self::getDfsPath());
ezpINIHelper::setINISetting('file.ini', 'eZDFSClusteringSettings', 'DBBackend', $backend);
}
示例9: setUp
public function setUp()
{
parent::setUp();
$_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3';
$_SERVER['HTTP_ACCEPT'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
// Enable mobile device detection
ezpINIHelper::setINISetting('site.ini', 'SiteAccessSettings', 'DetectMobileDevice', 'enabled');
$this->mobileDeviceDetect = $this->getMock('ezpMobileDeviceDetect', null, array($this->getMock('ezpMobileDeviceRegexpFilter', null)));
}
示例10: setUp
/**
* Test setup
*
* Load an instance of file.ini
*/
public function setUp()
{
parent::setUp();
// We need to clear the existing handler if it was loaded before the INI
// settings changes
eZClusterFileHandler::resetHandler();
// Load database parameters for cluster
// The same DSN than the relational database is used
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'FileHandler', $this->clusterClass);
}
示例11: testGetFilter
/**
* Tests new filter object instance creation
*
*/
public function testGetFilter()
{
$mobileDeviceDetectFilter = ezpMobileDeviceDetectFilter::getFilter();
$this->assertNotNull($mobileDeviceDetectFilter);
$this->assertInstanceOf('ezpMobileDeviceDetectFilterInterface', $mobileDeviceDetectFilter);
ezpINIHelper::setINISetting('site.ini', 'SiteAccessSettings', 'MobileDeviceFilterClass', '');
$mobileDeviceDetectFilter = ezpMobileDeviceDetectFilter::getFilter();
$this->assertNull($mobileDeviceDetectFilter);
ezpINIHelper::restoreINISettings();
}
示例12: setUp
public function setUp()
{
parent::setUp();
eZINI::instance('ezfind.ini')->loadCache(true);
eZINI::instance('solr.ini')->loadCache(true);
ezpINIHelper::setINISetting('site.ini', 'SearchSettings', 'AllowEmptySearch', 'enabled');
ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'SiteLanguageList', array('eng-GB'));
$this->solrSearch = new eZSolr();
$this->testObj = eZContentObject::fetchByNodeID(2);
$this->solrSearch->addObject($this->testObj);
$this->fetchParams = array('SearchOffset' => 0, 'SearchLimit' => 10, 'Facet' => null, 'SortBy' => null, 'Filter' => null, 'SearchContentClassID' => null, 'SearchSectionID' => null, 'SearchSubTreeArray' => null, 'AsObjects' => null, 'SpellCheck' => null, 'IgnoreVisibility' => null, 'Limitation' => null, 'BoostFunctions' => null, 'QueryHandler' => 'ezpublish', 'EnableElevation' => null, 'ForceElevation' => null, 'SearchDate' => null, 'DistributedSearch' => null, 'FieldsToReturn' => null);
}
示例13: setUp
/**
* Test setup
*
* Load an instance of file.ini
**/
public function setUp()
{
$this->markTestSkipped("Tests skipped until eZFS2 becomes more stable");
parent::setUp();
// We need to clear the existing handler if it was loaded before the INI
// settings changes
if (isset($GLOBALS['eZClusterFileHandler_chosen_handler']) and !$GLOBALS['eZClusterFileHandler_chosen_handler'] instanceof $this->clusterClass) {
unset($GLOBALS['eZClusterFileHandler_chosen_handler']);
}
// Load database parameters for cluster
// The same DSN than the relational database is used
ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'FileHandler', $this->clusterClass);
}
示例14: setUp
public function setUp()
{
parent::setUp();
ezpINIHelper::setINISetting('site.ini', 'SearchSettings', 'AllowEmptySearch', 'enabled');
ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'SiteLanguageList', array('eng-GB'));
$this->findINI = eZINI::instance('ezfind.ini');
$this->findINI->loadCache(true);
$this->solrSearch = new eZSolr();
$this->object = new ezpObject('folder', 2);
$this->object->name = 'foo';
$this->object->publish();
$this->object->addNode(43);
// Add a location under Media node
$this->solrSearch->addObject($this->object->object);
}
示例15: testVersionHistoryLimitWithObjectParameter
/**
* Unit test for eZContentClass::versionHistoryLimit() with object parameters
*
* Replica of testVersionHistoryLimit() but you cannot make calls
* to the eZ API which relies on a database, as this is not present
* in the provider methods.
*/
public function testVersionHistoryLimitWithObjectParameter()
{
// different custom limits (article: 13, image: 6) and object as a parameter
$INISettings = array(array('VersionHistoryClass', array('article' => 13, 'image' => 6)));
$class = eZContentClass::fetchByIdentifier('image');
$expectedLimit = 6;
// change the INI limit settings
foreach ($INISettings as $settings) {
list($INIVariable, $INIValue) = $settings;
ezpINIHelper::setINISetting('content.ini', 'VersionManagement', $INIVariable, $INIValue);
}
$limit = eZContentClass::versionHistoryLimit($class);
self::assertEquals($expectedLimit, $limit);
ezpINIHelper::restoreINISettings();
}