Difference between revisions of "Ice"

From Mumble Wiki
Jump to: navigation, search
Line 17: Line 17:
  
 
There's an example included in the source; have a look at [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/scripts/icedemo.php?view=markup icedemo.php].
 
There's an example included in the source; have a look at [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/scripts/icedemo.php?view=markup icedemo.php].
 +
 +
= Guide on how to set up a Windows web server in order to use the ICE php scripts =
 +
 +
Install [http://apache.osuosl.org/httpd/binaries/win32/apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi Apache], [http://www.php.net/get/php-5.2.6-win32-installer.msi/from/us.php.net/mirror PHP], and [http://www.zeroc.com/download/Ice/3.3/Ice-3.3.0-VC60.msi ICE]. First install Apache, and install it to C:\apache then install PHP. Tell PHP to install to C:\PHP5. In the installer on the "Web Server Setup" window select Apache 2.2.x Module. Proceed through the installer. Now install ICE. Go to C:\Ice*\bin (where * is a variable) and copy bzip2.dll, ice33.dll, iceutil33.dll, msvcp60.dll, msvcrt.dll, php_ice.dll, slice33.dll, ssleay32.dll, and stlport_vc646.dll to C:\apache\bin. Now open C:\PHP5\php.ini and add the following two lines to the bottom of the file:
 +
extension=php_ice.dll
 +
ice.slice=C:\PHP5\Murmur.ice
 +
Save the file and then download [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/src/murmur/Murmur.ice?view=log Murmur.ice], [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/scripts/icedemo.php?view=log icedemo.php], and [http://mumble.svn.sourceforge.net/viewvc/mumble/trunk/scripts/weblist.php?view=log weblist.php]. Put Murmur.ice in C:\PHP5. Put icedemo.php and weblist.php in C:\apache\htdocs. Double click the Apache icon in the system tray and select "Restart." You should now be able to go to http://<your IP or Domain>/icedemo.php (or weblist.php).

Revision as of 01:14, 28 August 2008

Murmur supports remote scripting using ZeroC ICE, a RPC mechanism. There are bindings for C++, Java, .NET, Python, PHP and Ruby, and this is supported on all our platforms (Win32, Linux and OSX). ICE also works over a network, meaning you can create a web application that interfaces with a murmur process running on another machine.

Getting ready to use ICE

You can download ICE directly from ZeroC. If you installed a binary version of Murmur, it already includes the necesarry components for running ICE, but you might need additional tools to develop with it.

Apache and PHP

If you want to use ICE from PHP, you'll need to tell the PHP parser where to find the slice (Specification Language for ICE) file for Murmur, which is called simply Murmur.ice. If you're running from the command line, you'll need to create a file called php.ini in the directory you are running from. Insert the following:

ice.slice = /path/to/Murmur.ice

When you get far enough that it's time to run the script from Apache, you'll need to tell Apache's PHP parser where to find the slice file. If you have a /etc/php.d file, you can simply create a new murmur.ini file in that directory with the same contents as the php.ini above. If not, you'll have to append it at the end of /etc/php.ini

Using ICE

How to use ICE differs from language to language. The parameters and method names will remain the same, but the syntax will naturally be different. Murmur will, by default, open up an adapter on port 6502 (or 10000 for homedir installs), which has a single accessible object named "Meta". This is the Meta server, and from it you can retrieve adapters for any configured server.

There's an example included in the source; have a look at icedemo.php.

Guide on how to set up a Windows web server in order to use the ICE php scripts

Install Apache, PHP, and ICE. First install Apache, and install it to C:\apache then install PHP. Tell PHP to install to C:\PHP5. In the installer on the "Web Server Setup" window select Apache 2.2.x Module. Proceed through the installer. Now install ICE. Go to C:\Ice*\bin (where * is a variable) and copy bzip2.dll, ice33.dll, iceutil33.dll, msvcp60.dll, msvcrt.dll, php_ice.dll, slice33.dll, ssleay32.dll, and stlport_vc646.dll to C:\apache\bin. Now open C:\PHP5\php.ini and add the following two lines to the bottom of the file:

extension=php_ice.dll
ice.slice=C:\PHP5\Murmur.ice

Save the file and then download Murmur.ice, icedemo.php, and weblist.php. Put Murmur.ice in C:\PHP5. Put icedemo.php and weblist.php in C:\apache\htdocs. Double click the Apache icon in the system tray and select "Restart." You should now be able to go to http://<your IP or Domain>/icedemo.php (or weblist.php).