当前位置: 首页>>代码示例>>PHP>>正文


PHP DokuHTTPClient::post方法代码示例

本文整理汇总了PHP中DokuHTTPClient::post方法的典型用法代码示例。如果您正苦于以下问题:PHP DokuHTTPClient::post方法的具体用法?PHP DokuHTTPClient::post怎么用?PHP DokuHTTPClient::post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DokuHTTPClient的用法示例。


在下文中一共展示了DokuHTTPClient::post方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dbglog

 /**
  * Render the output remotely at ditaa.org
  */
 function _remote($data, $in, $out)
 {
     if (!file_exists($in)) {
         if ($conf['debug']) {
             dbglog($in, 'no such ditaa input file');
         }
         return false;
     }
     $http = new DokuHTTPClient();
     $http->timeout = 30;
     $pass = array();
     $pass['scale'] = $data['scale'];
     $pass['timeout'] = 25;
     $pass['grid'] = io_readFile($in);
     if (!$data['antialias']) {
         $pass['A'] = 'on';
     }
     if (!$data['shadow']) {
         $pass['S'] = 'on';
     }
     if ($data['round']) {
         $pass['r'] = 'on';
     }
     if (!$data['edgesep']) {
         $pass['E'] = 'on';
     }
     $img = $http->post('http://ditaa.org/ditaa/render', $pass);
     if (!$img) {
         return false;
     }
     return io_saveFile($out, $img);
 }
开发者ID:rztuc,项目名称:dokuwiki-plugin-ditaa,代码行数:35,代码来源:syntax.php

示例2: escapeshellarg

 /**
  * Returns the content of a graphviz image.
  * 
  * @param data parameters.
  *           
  * @return PNG image.
  */
 function get_graphviz_image($data)
 {
     global $conf;
     $image = null;
     $gathered_data = $this->get_gathered_data($data);
     $dot_input = $this->get_dot($gathered_data);
     // See if a manual path was given for graphviz
     if ($this->getConf('graphviz_path')) {
         // Local build
         $cmd = $this->getConf('path');
         $cmd .= ' -Tpng';
         $cmd .= ' -K' . $data['layout'];
         $cmd .= ' -o' . escapeshellarg($image);
         //output
         $cmd .= ' ' . escapeshellarg($dot_input);
         //input
         exec($cmd, $image, $error);
         if ($error != 0) {
             if ($conf['debug']) {
                 dbglog(join("\n", $image), 'mindmap command failed: ' . $cmd);
             }
             return false;
         }
     } else {
         // Remote via google chart tools
         $http = new DokuHTTPClient();
         $http->timeout = 30;
         $pass = array();
         $pass['cht'] = 'gv:' . $data['format'];
         $pass['chl'] = $dot_input;
         $image = $http->post('http://chart.apis.google.com/chart', $pass, '&');
         if (!$image) {
             return false;
         }
     }
     return $image;
 }
开发者ID:jdtProjects,项目名称:dokuwiki,代码行数:44,代码来源:syntax.php

示例3: DokuHTTPClient

 /**
  * Submits the given data to the given Akismet service.
  * 
  * @param $function string  Akismet service to use. Can be 
  *                          'comment-check', 'submit-ham' or 
  *                          'submit-spam'
  * @param $data     array   Linkback data to submit
  * @return          string  The response of Akismet 
  */
 function _submitData($function, $data)
 {
     $info = $this->getInfo();
     $http = new DokuHTTPClient();
     // The Aksimet guys ask for a verbose UserAgent:
     $http->agent = 'DokuWiki/' . getVersion() . ' | ' . $info['name'] . '/' . $info['date'];
     $http->timeout = 5;
     $resp = $http->post('http://' . $this->getConf('akismet_apikey') . '.rest.akismet.com/1.1/comment-check', $data);
     return $resp;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:19,代码来源:akismet.php

示例4: search

 /**
  * Search for plugins or templates using the given query string
  *
  * @param string $q the query string
  * @return array a list of matching extensions
  */
 public function search($q)
 {
     $query = $this->parse_query($q);
     $query['fmt'] = 'php';
     $httpclient = new DokuHTTPClient();
     $data = $httpclient->post(EXTENSION_REPOSITORY_API, $query);
     if ($data === false) {
         return array();
     }
     $result = unserialize($data);
     $ids = array();
     // store cache info for each extension
     foreach ($result as $ext) {
         $name = $ext['plugin'];
         $cache = new cache('##extension_manager##' . $name, '.repo');
         $cache->storeCache(serialize($ext));
         $ids[] = $name;
     }
     return $ids;
 }
开发者ID:yjliugit,项目名称:dokuwiki,代码行数:26,代码来源:repository.php

示例5: dbglog

 /**
  * Render the output remotely at google
  */
 function _remote($data, $in, $out)
 {
     if (!file_exists($in)) {
         if ($conf['debug']) {
             dbglog($in, 'no such graphviz input file');
         }
         return false;
     }
     $http = new DokuHTTPClient();
     $http->timeout = 30;
     $pass = array();
     $pass['cht'] = 'gv:' . $data['layout'];
     $pass['chl'] = io_readFile($in);
     $img = $http->post('http://chart.apis.google.com/chart', $pass, '&');
     if (!$img) {
         return false;
     }
     return io_saveFile($out, $img);
 }
开发者ID:superdav42,项目名称:dokuwiki-plugin-graphviz,代码行数:22,代码来源:syntax.php

示例6: dbglog

 /**
  * Render the output remotely at ditaa.org
  */
 function _remote($data, $in, $out)
 {
     if (!file_exists($in)) {
         if ($conf['debug']) {
             dbglog($in, 'no such seqdia input file');
         }
         return false;
     }
     $http = new DokuHTTPClient();
     $http->timeout = 30;
     $pass = array();
     $pass['style'] = $data['style'];
     $pass['message'] = io_readFile($in);
     $result = $http->post('http://www.websequencediagrams.com/index.php', $pass);
     if (!$result) {
         return false;
     }
     $json = new JSON(JSON_LOOSE_TYPE);
     $json->skipnative = true;
     $json_data = $json->decode($result);
     $img = $http->get('http://www.websequencediagrams.com/index.php' . $json_data['img']);
     if (!$img) {
         return false;
     }
     return io_saveFile($out, $img);
 }
开发者ID:RaD,项目名称:dokuwiki-seqdia,代码行数:29,代码来源:syntax.php

示例7: DokuHTTPClient

 /**
  * Sends a Trackback to the given url, using the supplied data.
  * 
  * @param $pingurl string URL to ping
  * @param $trackback_info array Hash containing title, url and blog_name of linking post
  */
 function _ping_page_trackback($pingurl, $linkback_info)
 {
     $http_client = new DokuHTTPClient();
     $success = $http_client->post($pingurl, $linkback_info);
     return $success !== false;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:12,代码来源:send.php


注:本文中的DokuHTTPClient::post方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。