Zmiany pomiędzy wersją początkową i wersją 1 dla DeployerGuide/Others/eDokumentyApi/GetFile

Pokaż
Ignoruj:
Data i czas:
01/07/15 09:33:11 (9 years temu)
Autor:
TS (IP: 31.175.20.158)
Komentarz:

--

Legend:

Bez zmian
Dodane
Usunięte
Zmienione
  • DeployerGuide/Others/eDokumentyApi/GetFile

    v1 v1  
     1=  Pobierz dane o pliku = 
     2 
     3---- 
     4 
     5''Informacje o wprowadzenie funkcjonalności:'' 
     6 
     7 || Wersja systemu || Wersja modułu/funkcji || Data kompilacji || Zmiany || Opis || 
     8 || 4.7.2 || 0.1 || 10.01.2015 || Dodanie || Dodanie funkcji || 
     9 
     10---- 
     11 
     12''' Definicja parametrów: ''' 
     13{{{ 
     14#!php 
     15<?php 
     16 
     17/** 
     18  * Pobiera informacje (dane) o pliku. 
     19  * 
     20  * @param  int $fileid - identyfikator pliku z tabeli files kolumna fileid 
     21  * @param  bool $return_json - czy ma zwrócić dane jako JSON (1 - tak, 0 - nie) 
     22  * @return array 
     23  * @throws Exception 
     24  */ 
     25array getFile(int fileid, bool return_json); 
     26 
     27?> 
     28}}} 
     29 
     30''' Przykłady wywołań: ''' 
     31{{{ 
     32#!php 
     33 
     34// Plik MyService.php umieszczony w apps/edokumenty. 
     35// MyService.php 
     36<?php 
     37 
     38define('EDOK_API_LOGIN', 'developer'); 
     39define('EDOK_API_PASSWORD', 'developer'); 
     40define('DEFAULT_ENTITY_SYMBOL', 'demo'); 
     41 
     42require_once('./classes/eDokumentyApi/EDokApiClient.inc'); 
     43 
     44$options = array( 
     45    'location' => 'http://{host}:{port}/eDokumentyApi.php', 
     46    "uri" => "eDokumentyAPI", 
     47    'encoding'=>'UTF-8' 
     48); 
     49         
     50$client = new EDokApiClient(NULL, $options); 
     51$client->setUser(EDOK_API_LOGIN); 
     52$client->setPass(md5(EDOK_API_PASSWORD)); 
     53$header = new SoapHeader('eDokumentyAPI', 'entity_symbol', DEFAULT_ENTITY_SYMBOL); 
     54$client->__setSoapHeaders($header); 
     55 
     56 
     57$file = array(); 
     58 
     59try { 
     60    $file = $client->getFile(678, 1); 
     61    var_dump($file); 
     62} catch(SoapFault $fault) { 
     63     
     64    var_dump($fault); 
     65     
     66    if ($fault->faultcode < 100) { 
     67        trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR); 
     68    } 
     69} 
     70 
     71?> 
     72}}}