Ejemplo n.º 1
0
int php3_minit_oracle(INIT_FUNC_ARGS)
{
	if (cfg_get_long("oracle.allow_persistent",
			 &ORACLE_GLOBAL(php3_oracle_module).allow_persistent)
		== FAILURE) {
	  ORACLE_GLOBAL(php3_oracle_module).allow_persistent = -1;
	}
	if (cfg_get_long("oracle.max_persistent",
					 &ORACLE_GLOBAL(php3_oracle_module).max_persistent)
	    == FAILURE) {
		ORACLE_GLOBAL(php3_oracle_module).max_persistent = -1;
	}
	if (cfg_get_long("oracle.max_links",
					 &ORACLE_GLOBAL(php3_oracle_module).max_links)
	    == FAILURE) {
		ORACLE_GLOBAL(php3_oracle_module).max_links = -1;
	}
	
	ORACLE_GLOBAL(php3_oracle_module).num_persistent = 0;
	
	ORACLE_GLOBAL(php3_oracle_module).le_cursor =
		register_list_destructors(_close_oracur, NULL);
	ORACLE_GLOBAL(php3_oracle_module).le_conn =
		register_list_destructors(_close_oraconn, NULL);
	ORACLE_GLOBAL(php3_oracle_module).le_pconn =
		register_list_destructors(NULL, _close_orapconn);

	ORACLE_GLOBAL(php3_oracle_module).conns = malloc(sizeof(HashTable));
	_php3_hash_init(ORACLE_GLOBAL(php3_oracle_module).conns, 13, NULL, NULL, 1);

	REGISTER_LONG_CONSTANT("ORA_BIND_INOUT", 0, CONST_CS | CONST_PERSISTENT);
	REGISTER_LONG_CONSTANT("ORA_BIND_IN",    1, CONST_CS | CONST_PERSISTENT);
	REGISTER_LONG_CONSTANT("ORA_BIND_OUT",   2, CONST_CS | CONST_PERSISTENT);

	REGISTER_LONG_CONSTANT("ORA_FETCHINTO_ASSOC",ORA_FETCHINTO_ASSOC, CONST_CS | CONST_PERSISTENT);
	REGISTER_LONG_CONSTANT("ORA_FETCHINTO_NULLS",ORA_FETCHINTO_NULLS, CONST_CS | CONST_PERSISTENT);

#if NEEDED
	opinit(OCI_EV_TSF); /* initialize threaded environment - must match the threaded mode 
						   of the oci8 driver if both are used at the same time!! */
#endif

	return SUCCESS;
}
Ejemplo n.º 2
0
int main(int argc,char** argv)
{
	Para para;
	if(!opinit(argc, argv, para))
	{
		return 0;
	}

	glog_init("/home/viewin-cc/workspace/POI_db");

	RCF::RcfInitDeinit rcfInit;

	POIDB_RPC_FUN_Impl poidb_rpc_fun_impl;
	poidb_rpc_fun_impl.init(para.create_table_list);

	RCF::RcfServer server( RCF::TcpEndpoint(para.listening_port) );
	server.bind<POIDB_RPC_FUN>(poidb_rpc_fun_impl);
	server.start();

    std::cout << "Press Enter to exit..." << std::endl;
    std::cin.get();

    return 0;
}