-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b932dbf
commit 03416b8
Showing
5 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
// Copyright (c) ZeroC, Inc. | ||
|
||
require_once 'Ice.php'; | ||
require_once 'Greeter.php'; | ||
|
||
// Create an Ice communicator to initialize the Ice runtime. This communicator is destroyed automatically at the end of | ||
// the script. | ||
$communicator = Ice\initialize(); | ||
|
||
// GreeterPrxHelper is a class generated by the Slice compiler. We create a Greeter proxy from a communicator and a | ||
// "stringified proxy" with the address of the target object. | ||
// If you run the server on a different computer, replace localhost in the string below with the server's hostname | ||
// or IP address. | ||
$greeter = VisitorCenter\GreeterPrxHelper::createProxy($communicator, 'greeter:tcp -h localhost -p 4061'); | ||
|
||
// Send a request to the remote object and get the response. | ||
$greeting = $greeter->greet(get_current_user()); | ||
|
||
echo "$greeting\n"; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) ZeroC, Inc. | ||
|
||
#pragma once | ||
|
||
module VisitorCenter | ||
{ | ||
/// Represents a simple greeter. | ||
interface Greeter | ||
{ | ||
/// Creates a personalized greeting. | ||
/// @param name The name of the person to greet. | ||
/// @return The greeting. | ||
string greet(string name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Greeter | ||
|
||
The Greeter demo illustrates how to write a client application with Ice for PHP. | ||
|
||
Ice for PHP supports only client-side applications. As a result, you first need to start a Greeter server implemented | ||
in a language with server-side support, such as Python, Java, or C#. | ||
|
||
Then, in a separate window: | ||
|
||
- Compile Greeter.ice with the Slice to PHP compiler into Greeter.php | ||
|
||
```shell | ||
slice2php Greeter.ice | ||
``` | ||
|
||
- Run the client application | ||
|
||
```shell | ||
php Client.php | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters