Changeset 586 for trunk/docs
- Timestamp:
- Feb 16, 2015, 10:45:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/services/howtos.txt
r528 r586 146 146 .. code-block:: python 147 147 148 import zoo 148 149 import sys 149 150 def HelloPy(conf,inputs,outputs): 150 151 outputs["Result"]["value"]="Hello "+inputs["a"]["value"]+" from Python World !" 151 return 3152 return zoo.SERVICE_SUCCEEDED 152 153 153 154 PHP 154 155 --- 155 156 157 ZOO-API 158 ******* 159 160 The ZOO-API for the PHP language is automatically available from your 161 service code. Tthe following functions are defined in the ZOO-API: 162 163 int zoo_SERVICE_SUCCEEDED() 164 return the value of SERVICE_SUCCEEDED 165 int zoo_SERVICE_FAILED() 166 return the value of SERVICE_FAILED 167 string 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 171 void zoo_UpdateStatus(Array conf,string message,int pourcent) 172 update the status of the running service 173 174 PHP ZCFG requirements 175 ********************************** 176 177 The ZCFG file should contain the following : 178 179 serviceType 180 PHP 181 serviceProvider 182 The name of the php script (ie. service.php) to use as a ZOO Service Provider. 183 184 PHP Data Structure used 185 ******************************** 186 187 The three parameters are passed to the PHP function as 188 `Arrays <php.net/manual/language.types.array.php>`__. 189 190 Sample ZOO PHP Services Provider 191 ****************************************** 192 156 193 .. code-block:: php 157 194 158 195 <? 159 196 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(); 162 200 } 163 201 ?> … … 203 241 named ``HelloWorld.class`` then you should use ``HelloWorld``. 204 242 205 206 243 Java Data Structure used 207 244 ******************************** 208 245 209 The three parameters of the function are passed to the Java function210 as`java.util.HashMap <http://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html>`__.246 The 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>`__. 211 248 212 249 Sample ZOO Java Services Provider
Note: See TracChangeset
for help on using the changeset viewer.