예제 #1
0
 /**
  * Tests functionality of both get() and save()
  */
 public function testGetSave()
 {
     if (!is_writeable('./')) {
         throw new PHPUnit_Framework_IncompleteTestError('Directory not writeable');
     }
     $this->assertTrue(Zend_XmlRpc_Server_Cache::save($this->_file, $this->_server));
     $expected = $this->_server->listMethods();
     $server = new Zend_XmlRpc_Server();
     $this->assertTrue(Zend_XmlRpc_Server_Cache::get($this->_file, $server));
     $actual = $server->listMethods();
     $this->assertSame($expected, $actual);
 }
예제 #2
0
파일: CacheTest.php 프로젝트: netvlies/zf
 public function testShouldReturnFalseWithInvalidCache()
 {
     if (!is_writeable('./')) {
         $this->markTestIncomplete('Directory no writable');
     }
     file_put_contents($this->_file, 'blahblahblah');
     $server = new Zend_XmlRpc_Server();
     $this->assertFalse(Zend_XmlRpc_Server_Cache::get($this->_file, $server));
 }
예제 #3
0
	/**
	 * XMLRPC server
	 */
	public function xmlrpcAction() 
	{
		$cacheFile = ROOT_PATH . '/var/cache/xmlrpc.cache';
		$server = new Zend_XmlRpc_Server();
		
		if( !Zend_XmlRpc_Server_Cache::get( $cacheFile, $server )){
			$server->setClass( 'User_Service_User', 'user' );
			Zend_XmlRpc_Server_Cache::save( $cacheFile, $server);
		}
		echo $server->handle();
	}