IBOS open source
  • Namespace
  • Class

Namespaces

  • application
    • core
      • cache
        • driver
        • provider
      • components
      • controllers
      • engines
        • local
        • sae
      • model
      • modules
      • utils
      • widgets
    • modules
      • article
        • controllers
        • core
        • model
        • utils
      • calendar
        • controllers
        • model
        • utils
      • contact
        • controllers
        • model
        • utils
      • dashboard
        • controllers
        • model
        • utils
      • department
        • components
        • model
        • utils
      • diary
        • components
        • controllers
        • model
        • utils
        • widgets
      • email
        • controllers
        • core
        • model
        • utils
      • main
        • behaviors
        • components
        • controllers
        • model
        • utils
        • widgets
      • message
        • controllers
        • core
          • co
          • wx
            • callback
            • event
        • model
        • utils
      • mobile
        • components
        • controllers
        • utils
      • position
        • components
        • model
        • utils
      • recruit
        • components
        • controllers
        • core
        • model
        • utils
        • widgets
      • role
        • model
        • utils
      • user
        • components
        • controllers
        • model
        • utils
      • vote
        • components
        • controllers
        • model
        • utils
      • weibo
        • controllers
        • core
        • model
        • utils

Classes

  • Api
  • ApiCode
  • Attach
  • Cache
  • Cloud
  • Convert
  • Credit
  • Database
  • DateTime
  • Env
  • File
  • Ftp
  • IBOS
  • Image
  • Mail
  • Module
  • Org
  • Page
  • PHPExcel
  • String
  • System
  • Upgrade
  • Url
  • WebSite
  • Xml
  • XMLParse

Class Api

CApplicationComponent
Extended by application\core\utils\System
Extended by application\core\utils\Api

Direct known subclasses

application\core\utils\Cloud, application\core\utils\WebSite, application\modules\message\core\co\CoApi, application\modules\message\core\wx\WxApi

Namespace: application\core\utils
Copyright: Copyright © 2012-2013 IBOS Inc
Author: banyanCheung banyan@ibos.com.cn
Located at system/core/utils/Api.php

Methods summary

public static object
# getInstance( $className = __CLASS__ )

单例化api

单例化api

Returns

object

Overrides

application\core\utils\System::getInstance
public
# setOpt( array $opt )

设置curl选项

设置curl选项

Parameters

$opt
public array
# getOpt( )

返回curl默认选项

返回curl默认选项

Returns

array
public string
# buildUrl( string $url, array $param = array() )

创建api链接

创建api链接

Parameters

$url
链接地址
$param
附件的参数

Returns

string
public array
# fetchResult( string $url, string $param = array(), array $type = 'get' )

获取调用api结果

获取调用api结果

Parameters

$url
api地址
$param
$type 发送的类型 get or post
$type
$param 如果类型为post时,要提交的参数

Returns

array

Properties summary

protected array $curlopt

默认的CURL选项

默认的CURL选项

# array( CURLOPT_RETURNTRANSFER => true, // 返回页面内容 CURLOPT_HEADER => false, // 不返回头部 CURLOPT_ENCODING => "", // 处理所有编码 CURLOPT_USERAGENT => "spider", // CURLOPT_AUTOREFERER => true, // 自定重定向 CURLOPT_CONNECTTIMEOUT => 15, // 链接超时时间 CURLOPT_TIMEOUT => 20, // 超时时间 CURLOPT_MAXREDIRS => 10, // 超过十次重定向后停止 CURLOPT_SSL_VERIFYHOST => 0, // 不检查ssl链接 CURLOPT_SSL_VERIFYPEER => false, // CURLOPT_VERBOSE => 1 // )
IBOS open source API documentation generated by ApiGen