コード例 #1
0
ファイル: Client.php プロジェクト: oceanwavechina/ice
function allTests()
{
    global $NS;
    echo "testing Slice predefined macros... ";
    flush();
    if ($NS) {
        $d = new Test\_Default();
        test($d->x == 10);
        test($d->y == 10);
        $nd = new Test\NoDefault();
        test($nd->x != 10);
        test($nd->y != 10);
        $c = new Test\PhpOnly();
        test($c->lang == "php");
        test($c->version == Ice\intVersion());
    } else {
        $d = new Test_Default();
        test($d->x == 10);
        test($d->y == 10);
        $nd = new Test_NoDefault();
        test($nd->x != 10);
        test($nd->y != 10);
        $c = new Test_PhpOnly();
        test($c->lang == "php");
        test($c->version == Ice_intVersion());
    }
    echo "ok\n";
}
コード例 #2
0
ファイル: ServerInterface.php プロジェクト: nicolasjoly/MumPI
 function __construct()
 {
     // Check that the PHP Ice extension is loaded.
     if (!extension_loaded('ice')) {
         MessageManager::addError(tr('error_noIceExtensionLoaded'));
     } else {
         $this->contextVars = SettingsManager::getInstance()->getDbInterface_iceSecrets();
         if (!function_exists('Ice_intVersion') || Ice_intVersion() < 30400) {
             $this->initIce33();
         } else {
             $this->initIce34();
         }
         $this->connect();
     }
 }
コード例 #3
0
 function __construct()
 {
     // Check that the PHP Ice extension is loaded.
     if (!extension_loaded('ice')) {
         MessageManager::addError(tr('error_noIceExtensionLoaded'));
     } else {
         $this->contextVars = SettingsManager::getInstance()->getDbInterface_iceSecrets();
         if (!function_exists('Ice_intVersion') || Ice_intVersion() < 30400) {
             // ice 3.3
             global $ICE;
             Ice_loadProfile();
             $this->conn = $ICE->stringToProxy(SettingsManager::getInstance()->getDbInterface_address());
             $this->meta = $this->conn->ice_checkedCast("::Murmur::Meta");
             // use IceSecret if set
             if (!empty($this->contextVars)) {
                 $this->meta = $this->meta->ice_context($this->contextVars);
             }
             $this->meta = $this->meta->ice_timeout(10000);
         } else {
             // ice 3.4
             $initData = new Ice_InitializationData();
             $initData->properties = Ice_createProperties();
             $initData->properties->setProperty('Ice.ImplicitContext', 'Shared');
             $ICE = Ice_initialize($initData);
             /*
              * getImplicitContext() is not implemented for icePHP yet…
              * $ICE->getImplicitContext();
              * foreach ($this->contextVars as $key=>$value) {
              * 	 $ICE->getImplicitContext()->put($key, $value);
              * }
              */
             try {
                 $this->meta = Murmur_MetaPrxHelper::checkedCast($ICE->stringToProxy(SettingsManager::getInstance()->getDbInterface_address()));
                 $this->meta = $this->meta->ice_context($this->contextVars);
             } catch (Ice_ConnectionRefusedException $exc) {
                 MessageManager::addError(tr('error_iceConnectionRefused'));
             }
         }
         $this->connect();
     }
 }
コード例 #4
0
ファイル: simpleregister.php プロジェクト: NasnNeeder/mumble
<?php

// Really simple script to add users to your mumble server.
// Make sure to select the server this script should be used for first:
$serverId = 1;
// Requires a correctly set up PHP-ICE Module and mumble server running with ICE.
//  For instructions see http://wiki.mumble.info/wiki/Ice
// Credits
//  This script was created by Kissaki
// This is as simple as it can get. You really SHOULD NOT make the URL to this script all-public as it may be abused/spammed.
if (!extension_loaded('ice')) {
    exit('Error: This example script needs the PHP extension for Ice to be loaded.');
}
if (!function_exists('Ice_intVersion') || Ice_intVersion() < 30400 || !function_exists('Ice_loadProfile')) {
    exit('Error: This example script is compatible only for php-ice versions prior to 3.4.');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<?php 
Ice_loadProfile();
if (isset($_GET['uname']) && $_GET['password'] && $_GET['email'] && $_GET['uname'] != '' && $_GET['password'] != '') {
    try {
        $base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502");
        $meta = $base->ice_checkedCast("::Murmur::Meta");
        $server = $meta->getServer($serverId);