Date: Fri May 10 11:29:35 CEST 2002
User: Derick Rethans
Directory: srmdoc/articles
Log Message:
[2.00]
- Added RPCs
Modified files:
srmdoc/articles/php-almanac-2002.xml (version: 1.2)
[FILE: /srmdoc/articles/php-almanac-2002.xml]
--- srmdoc/articles/php-almanac-2002.xml:1.1 Thu Apr 18 11:03:50 2002 GMT
+++ srmdoc/articles/php-almanac-2002.xml Fri May 10 07:29:35 2002 GMT
@@ -355,7 +355,7 @@
if ($timeout > 600) {
$timeout = 600;
}
- $srm = new SRM ('/tmp/srm.socket', 7777);
+ $srm = new SRM ('localhost', 7777);
$srm->globals['cache']['timeout'] = $timeout;
?>]]>
</programlisting>
@@ -368,7 +368,7 @@
<para>
<programlisting role="php">
<![CDATA[<?php
- $srm = new SRM ('/tmp/srm.socket', 7777);
+ $srm = new SRM ('/tmp/srm.socket');
$timeout = $srm->globals['cache']['timeout'];
if (get_cache_object_time('dyn_data') + $timeout > date()) {
@@ -418,32 +418,92 @@
</section>
<section id="remote-funcs">
- <title>Remote functions in SRM</title>
+ <title>Remote functions in &srm.small;</title>
<para>
-
+ Another basic feature of &srm.small; are remote functions, or Remote
+ Procedure Calls. By using the XML-RPC interface you can access your
+ application vars, and application objects written in &php; from another
+ program. Besides the XML-RPC interface to &srm.small; functionality you can
+ also use the native protocol to gain more performance. This native
+ interface can be used from every programming language, or program that can
+ link with shared objects.
</para>
+ <para>
+ There are serveral classes of functions that can be called as RPCs. These
+ classes are: built-in functions, such as srm_version(), functions in
+ &srm.small; modules, like auth_login(), and functions written in &php;.
+ Every class of functions has it's own subsection below in which they are
+ explained in more detail.
+ </para>
+
+ <section id="remote-funcs.built-in">
+ <title>Built-in functions</title>
+ <para>
+ Built-in functions are provided by the daemon itself. They are functions to
+ query modules, functions, versions and information about the deamon and
+ loaded modules. The functions can be called as member functions of an
+ instantiated SRM object in &php; as the following example shows:
+ </para>
+ <para>
+ <example>
+ <title>Calling RPCs</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+ $srm = new SRM('/tmp/srm.socket');
+
+ echo $srm->srm_version();
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ If you want to add built-in functionality you need to hack the &srm.small;
+ sources, but there is also the posibility to write an &srm.small; module.
+ </para>
+ </section>
<section id="remote-funcs.module-provided">
<title>Module provided functions</title>
<para>
+ A much easier way is to extend &srm.small; by writing a loadable module.
+ Such a module has full access to the data stored in the daemon and can
+ therefore be used to do different things with, for example, session data.
+ The bundled auth module authenticates an user with a specific session.
+ This can be done with a simple user/password authentication scheme, but
+ also with more complex challenge-response algorithms.
</para>
</section>
<section id="remote-funcs.library">
- <title>Functionlibrary</title>
+ <title>Function library</title>
<para>
+ If you don't need complex functions that do warrant a module written in C,
+ or your C-skills are just not good enough to do it, you can use &php; to
+ extend &srm.small;. This can be done by putting functions in the function
+ libarary which is loaded when the daemon starts. As soon as they are
+ loaded, you can can use them just like built-in functions. By using
+ functions in the function library you save the compilation stage of the
+ functions' PHP code at call-time, because they are compiled when the
+ daemon loaded the function library at start-up.
</para>
</section>
-
+<!--
<section id="remote-funcs.cached">
<title>Cached functions (pre-compiled)</title>
<para>
</para>
</section>
+-->
</section>
<section id="bananas">
<title>&bananas;</title>
+ <para>
+ Bananas for &php; are a lot like Enterprise Beans for Java. They are
+ objects written in &php; and 'live' inside the daemon.
+ </para>
<section id="bananas.remote-objs">
<title>Remote objects</title>
Received on Fri May 10 12:23:48 2002
This archive was generated by hypermail 2.1.8 : Tue Jan 06 2009 - 12:00:02 CET