Example #1
0
 private function getProject($name)
 {
     foreach ($this->request->getJson($this->request->getClient()->get('projects')) as $project) {
         if ($project['label'] == $name) {
             return $project;
         }
     }
 }
 public function editClient()
 {
     $id = $_GET['id'];
     $Client = new Client();
     $Client->getClient($id);
     Session::put('selected_client', serialize($Client));
     return View::make('edit_client')->with('current_client', $Client);
 }
Example #3
0
 /**
  * Does the upload if there are no errors, and uploads the db_field if necessary
  * @return array   response array
  */
 public function doUpload()
 {
     if ($this->errors) {
         return $this->respond();
     }
     $upload_opts = array('folder' => $this->folders_path);
     $re = Client::getClient()->addItem($upload_opts, $this->uploaded_file);
     unlink($this->uploaded_file);
     // delete file from tmpdir
     if ($re->errors) {
         $this->errors[] = 'There was an error uploading the file:';
         $this->errors = array_merge($this->errors, array_map(function ($e) {
             return $e->message;
         }, $re->errors));
         return $this->respond($re);
     }
     if ($this->params['db_field'] && $this->params['db_row_id']) {
         $this->updateDBRecord($re->item->id);
     }
     $folder = Client::getFolder($this->folders_path);
     // update the last upload time so we know when to refresh cached folders
     $memkey = "vf2:getFolder:lastUpload:" . $this->folders_path;
     mem($memkey, date('U'));
     $memkey = "vf2:getFolder:lastUpload:" . $folder->id;
     mem($memkey, date('U'));
     return $this->respond($re);
 }
Example #4
0
<?php

/**
 * PHP SOAP Web-service 测试文件
 * @author ueaner <*****@*****.**> www.aboutc.net
 */
include 'Client.php';
$mode = 'wsdl';
// or non-wsdl
$params = array('serverIP' => '127.0.0.1', 'serverPort' => '80', 'mode' => $mode, 'serviceName' => 'Person');
$clientClass = new Client($params);
$client = $clientClass->getClient();
try {
    // say 为 server 端 Person.class.php 中的函数
    $result = $client->__soapCall('say', array('aboutc'));
    // 或
    $result2 = $client->serverVar();
    var_dump($result, $result2);
} catch (SoapFault $fault) {
    echo 'Error Message: ' . $fault->getMessage();
}
// 注:
// 如果对方使用的 .NET,尝试使用以下两种形式:
// 例如你需要传类似这样的参数:
// $params['email'] = '*****@*****.**';
// $params['name'] = 'ueaner';
//  $client->__soapCall('someFunction', array('param' => $params));
//  $client->__soapCall('someFunction', array($params));