store() 공개 메소드

Save all dirty prefs to the storage backend.
public store ( boolean $throw = true )
$throw boolean Throw exception on error? If false, ignores errors. (Since 2.1.0)
예제 #1
0
파일: Base.php 프로젝트: raz0rsdge/horde
 public function testModifyPreferences()
 {
     $p = new Horde_Prefs('horde', array(self::$prefs));
     $p['theme'] = "barbie";
     $p->store();
     $this->assertEquals("barbie", $this->_readValue(self::$db->selectValue('SELECT pref_value FROM horde_prefs WHERE pref_uid = ? AND pref_scope = ? AND pref_name = ?', array('joe', 'horde', 'theme'))));
 }
예제 #2
0
파일: Oci8Test.php 프로젝트: horde/horde
 public function testLargePreferences()
 {
     $p = new Horde_Prefs('test', array(self::$prefs, new Horde_Prefs_Stub_Storage('test')));
     $value = str_repeat('x', 4001);
     $p['a'] = $value;
     $p->store();
     $this->assertEquals($value, $this->_readValue(self::$db->selectValue('SELECT pref_value FROM horde_prefs WHERE pref_uid = ? AND pref_scope = ? AND pref_name = ?', array('joe', 'test', 'a'))));
 }
예제 #3
0
 public function testCreateFolder()
 {
     $this->markTestIncomplete('The mock driver confuses user/test/Preferences with INBOX/Preferences');
     setlocale(LC_MESSAGES, 'C');
     $p = new Horde_Prefs('test', array(new Horde_Prefs_Storage_KolabImap('test', array('kolab' => $this->_createStorage())), new Horde_Prefs_Stub_Storage('test')));
     $p['a'] = 'c';
     $p->store();
     $this->assertLogContains('Horde_Prefs_Storage_KolabImap: Created default Kolab preferences folder "Preferences".');
 }
예제 #4
0
 public function testModifyPreferences()
 {
     $storage = $this->_createDefaultStorage();
     $p = new Horde_Prefs('horde', array(new Horde_Prefs_Storage_KolabImap('*****@*****.**', array('kolab' => $storage))));
     $p['theme'] = 'barbie';
     $p->store();
     $objects = $storage->getData('INBOX/Preferences')->getObjects();
     $object = array_pop($objects);
     $this->assertContains('theme:YmFyYmll', $object['pref']);
     $p->cleanup(true);
 }