Public Member Functions | Protected Attributes

Robo47_Curl_Multi Class Reference

List of all members.

Public Member Functions

 __construct ($curlMulti=null)
 __destruct ()
 Destructor.
 addHandle (Robo47_Curl $curl)
 Add Handle.
 close ()
 Close.
 count ()
 Implements SPL::Countable.
 exec (&$running)
 Execute.
 getCurlMulti ()
 Get CurlMulti.
 getCurls ()
 Get Curls.
 removeHandle (Robo47_Curl $curl)
 Remove Handle.
 setCurlMulti ($curlMulti)
 Set CurlMulti.

Protected Attributes

 $_curlMulti = null
 $_curls = array()

Detailed Description

Definition at line 26 of file Multi.php.


Constructor & Destructor Documentation

Robo47_Curl_Multi::__construct ( curlMulti = null  ) 
Parameters:
resource $curlMulti

Definition at line 44 of file Multi.php.

References setCurlMulti().

    {
        $this->setCurlMulti($curlMulti);
    }

Here is the call graph for this function:

Robo47_Curl_Multi::__destruct (  ) 

Destructor.

Closes the resource

Definition at line 152 of file Multi.php.

References close().

    {
        $this->close();
    }

Here is the call graph for this function:


Member Function Documentation

Robo47_Curl_Multi::addHandle ( Robo47_Curl curl  ) 

Add Handle.

Returns:
Robo47_Curl_Multi *Provides Fluent Interface*

Definition at line 64 of file Multi.php.

References Robo47_Curl::getCurl().

    {
        curl_multi_add_handle($this->_curlMulti, $curl->getCurl());
        $this->_curls[] = $curl;
        return $this;
    }

Here is the call graph for this function:

Robo47_Curl_Multi::close (  ) 

Close.

Definition at line 141 of file Multi.php.

Referenced by __destruct().

    {
        @curl_multi_close($this->_curlMulti);
        return $this;
    }

Here is the caller graph for this function:

Robo47_Curl_Multi::count (  ) 

Implements SPL::Countable.

Returns:
int

Definition at line 133 of file Multi.php.

    {
        return count($this->_curls);
    }

Robo47_Curl_Multi::exec ( &$  running  ) 

Execute.

Returns:
Robo47_Curl_Multi *Provides Fluent Interface*

Definition at line 92 of file Multi.php.

    {
        curl_multi_exec($this->_curlMulti, $running);
        return $this;
    }

Robo47_Curl_Multi::getCurlMulti (  ) 

Get CurlMulti.

Returns:
resource

Definition at line 123 of file Multi.php.

    {
        return $this->_curlMulti;
    }

Robo47_Curl_Multi::getCurls (  ) 

Get Curls.

Returns:
array

Definition at line 54 of file Multi.php.

    {
        return $this->_curls;
    }

Robo47_Curl_Multi::removeHandle ( Robo47_Curl curl  ) 

Remove Handle.

Returns:
Robo47_Curl_Multi *Provides Fluent Interface*

Definition at line 76 of file Multi.php.

References Robo47_Curl::getCurl().

    {
        curl_multi_remove_handle($this->_curlMulti, $curl->getCurl());
        foreach ($this->_curls as $key => $internalCurl) {
            if ($internalCurl === $curl) {
                unset($this->_curls[$key]);
            }
        }
        return $this;
    }

Here is the call graph for this function:

Robo47_Curl_Multi::setCurlMulti ( curlMulti  ) 

Set CurlMulti.

Parameters:
resource $curlMulti
Returns:
Robo47_Curl_Multi *Provides Fluent Interface*

Definition at line 104 of file Multi.php.

Referenced by __construct().

    {
        if (null === $curlMulti) {
            $curlMulti = curl_multi_init();
        }
        if (!is_resource($curlMulti) ||
            get_resource_type($curlMulti) != 'curl_multi') {
            $message = '$curlMulti is not an curl-resource';
            throw new Robo47_Curl_Multi_Exception($message);
        }
        $this->_curlMulti = $curlMulti;
        return $this;
    }

Here is the caller graph for this function:


Member Data Documentation

Robo47_Curl_Multi::$_curlMulti = null [protected]

Definition at line 34 of file Multi.php.

Robo47_Curl_Multi::$_curls = array() [protected]

Definition at line 38 of file Multi.php.


The documentation for this class was generated from the following file: