Changeset 586 for trunk/docs


Ignore:
Timestamp:
Feb 16, 2015, 10:45:52 PM (6 years ago)
Author:
djay
Message:

Add the PHP ZOO-API, fix issue if ZTS is not defined, correct loading of the PHP script depending of the ZOO-Kernel location, use a ZEND_HANDLE_FD rather than the ZEND_HANDLE_FP used before, correct location of the hello.php service.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/services/howtos.txt

    r528 r586  
    146146.. code-block:: python
    147147
     148  import zoo
    148149  import sys
    149150  def HelloPy(conf,inputs,outputs):
    150151     outputs["Result"]["value"]="Hello "+inputs["a"]["value"]+" from Python World !"
    151      return 3
     152     return zoo.SERVICE_SUCCEEDED
    152153
    153154PHP
    154155---
    155156
     157ZOO-API
     158*******
     159
     160The ZOO-API for the PHP language is automatically available from your
     161service code. Tthe following functions are defined in the ZOO-API:
     162
     163int zoo_SERVICE_SUCCEEDED()
     164    return the value of SERVICE_SUCCEEDED
     165int zoo_SERVICE_FAILED()
     166    return the value of SERVICE_FAILED
     167string zoo_Translate(string a)
     168    return the translated string (using the "zoo-service" `textdomain
     169    <http://www.gnu.org/software/libc/manual/html_node/Locating-gettext-catalog.html#index-textdomain>`__)
     170
     171void zoo_UpdateStatus(Array conf,string message,int pourcent)
     172    update the status of the running service
     173
     174PHP ZCFG requirements
     175**********************************
     176
     177The ZCFG file should contain the following :
     178
     179serviceType
     180    PHP
     181serviceProvider
     182    The name of the php script (ie. service.php) to use as a ZOO Service Provider.
     183
     184PHP Data Structure used
     185********************************
     186
     187The three parameters are passed to the PHP function as
     188`Arrays <php.net/manual/language.types.array.php>`__.
     189
     190Sample ZOO PHP Services Provider
     191******************************************
     192
    156193.. code-block:: php
    157194
    158195  <?
    159196  function HelloPHP(&$main_conf,&$inputs,&$outputs){
    160      $outputs["Result"]["value"]="Hello ".$inputs[S][value]." from PHP world !";
    161      return 3;
     197     $tmp="Hello ".$inputs[S][value]." from PHP world !";
     198     $outputs["Result"]["value"]=zoo_Translate($tmp)
     199     return zoo_SERVICE_SUCCEEDED();
    162200  }
    163201  ?>
     
    203241    named ``HelloWorld.class`` then you should use ``HelloWorld``.
    204242
    205 
    206243Java Data Structure used
    207244********************************
    208245
    209 The three parameters of the function are passed to the Java function
    210 as `java.util.HashMap <http://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html>`__.
     246The three parameters are passed to the Java function as
     247`java.util.HashMap <http://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html>`__.
    211248
    212249Sample ZOO Java Services Provider
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png