Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • CurlHandle
  • CurlMulti
  • CurlMultiProxy
  • CurlVersion
  • RequestMediator

Interfaces

  • CurlMultiInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: namespace Guzzle\Http\Curl;
 4: 
 5: /**
 6:  * Class used for querying curl_version data
 7:  */
 8: class CurlVersion
 9: {
10:     /**
11:      * @var array curl_version() information
12:      */
13:     protected $version;
14: 
15:     /**
16:      * @var CurlVersion
17:      */
18:     protected static $instance;
19: 
20:     /**
21:      * @var string Default user agent
22:      */
23:     protected $userAgent;
24: 
25:     /**
26:      * Get the singleton instance of the CurlVersion object
27:      *
28:      * @return CurlVersion
29:      */
30:     public static function getInstance()
31:     {
32:         if (!self::$instance) {
33:             self::$instance = new self();
34:         }
35: 
36:         return self::$instance;
37:     }
38: 
39:     /**
40:      * Get all of the curl_version() data
41:      *
42:      * @return array
43:      */
44:     public function getAll()
45:     {
46:         if (!$this->version) {
47:             $this->version = curl_version();
48:         }
49: 
50:         return $this->version;
51:     }
52: 
53:     /**
54:      * Get a specific type of curl information
55:      *
56:      * @param string $type Version information to retrieve. This value is one of:
57:      *     - version_number:     cURL 24 bit version number
58:      *     - version:            cURL version number, as a string
59:      *     - ssl_version_number: OpenSSL 24 bit version number
60:      *     - ssl_version:        OpenSSL version number, as a string
61:      *     - libz_version:       zlib version number, as a string
62:      *     - host:               Information about the host where cURL was built
63:      *     - features:           A bitmask of the CURL_VERSION_XXX constants
64:      *     - protocols:          An array of protocols names supported by cURL
65:      *
66:      * @return string|float|bool if the $type is found, and false if not found
67:      */
68:     public function get($type)
69:     {
70:         $version = $this->getAll();
71: 
72:         return isset($version[$type]) ? $version[$type] : false;
73:     }
74: }
75: 
php-coveralls API documentation generated by ApiGen 2.8.0