src/Guzzle/Http/Client.php
public static function extractPharCacert($pharCacertPath)
    {
        // Copy the cacert.pem file from the phar if it is not in the temp
        // folder.
        $certFile = sys_get_temp_dir() . '/guzzle-cacert.pem';

        if (!file_exists($pharCacertPath)) {
            throw new \RuntimeException("Could not find $pharCacertPath");
        }

        if (!file_exists($certFile) ||
            filesize($certFile) != filesize($pharCacertPath)
        ) {
            if (!copy($pharCacertPath, $certFile)) {
                throw new \RuntimeException(
                    "Could not copy {$pharCacertPath} to {$certFile}: "
                    . var_export(error_get_last(), true)
                );
            }
        }

        return $certFile;
    }
public static function extractPharCacert($pharCacertPath)
    {
        // Copy the cacert.pem file from the phar if it is not in the temp
        // folder.
        $certFile = sys_get_temp_dir() . '/guzzle-cacert.pem';

        if (!file_exists($pharCacertPath)) {
            throw new \RuntimeException("Could not find $pharCacertPath");
        }

        if (!file_exists($certFile) ||
            filesize($certFile) != filesize($pharCacertPath)
        ) {
            if (!copy($pharCacertPath, $certFile)) {
                throw new \RuntimeException(
                    "Could not copy {$pharCacertPath} to {$certFile}: "
                    . var_export(error_get_last(), true)
                );
            }
        }

        return $certFile;
    }
public static function extractPharCacert ( $ pharCacertPath ) { // Copy the cacert.pem file from the phar if it is not in the temp // folder. $ certFile = sys_get_temp_dir ( ) . '/guzzle-cacert.pem' ; if ( ! file_exists ( $ pharCacertPath ) ) { throw new \ RuntimeException ( "Could not find $pharCacertPath" ) ; } if ( ! file_exists ( $ certFile ) || filesize ( $ certFile ) != filesize ( $ pharCacertPath ) ) { if ( ! copy ( $ pharCacertPath , $ certFile ) ) { throw new \ RuntimeException ( "Could not copy {$pharCacertPath} to {$certFile}: " . var_export ( error_get_last ( ) , true ) ) ; } } return $ certFile ; }
Copies the phar cacert from a phar into the temp directory.

@param string $pharCacertPath Path to the phar cacert. For example:
'phar://aws.phar/Guzzle/Http/Resources/cacert.pem'

@return string Returns the path to the extracted cacert file.
@throws \RuntimeException Throws if the phar cacert cannot be found or
the file cannot be copied to the temp dir.
Copies the phar cacert from a phar into the temp directory .