function CaBundle::getBundledCaBundlePath
Returns the path to the bundled CA file
In case you don't want to trust the user or the system, you can use this directly
Return value
string path to a CA bundle file
2 calls to CaBundle::getBundledCaBundlePath()
- CaBundle::getSystemCaRootBundlePath in vendor/
composer/ ca-bundle/ src/ CaBundle.php - Returns the system CA bundle path, or a path to the bundled one
- Compiler::compile in vendor/
composer/ composer/ src/ Composer/ Compiler.php - Compiles composer into a single phar file
File
-
vendor/
composer/ ca-bundle/ src/ CaBundle.php, line 122
Class
- CaBundle
- @author Chris Smith <chris@cs278.org> @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\CaBundleCode
public static function getBundledCaBundlePath() {
$caBundleFile = __DIR__ . '/../res/cacert.pem';
// cURL does not understand 'phar://' paths
// see https://github.com/composer/ca-bundle/issues/10
if (0 === strpos($caBundleFile, 'phar://')) {
$tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-');
if (false === $tempCaBundleFile) {
throw new \RuntimeException('Could not create a temporary file to store the bundled CA file');
}
file_put_contents($tempCaBundleFile, file_get_contents($caBundleFile));
register_shutdown_function(function () use ($tempCaBundleFile) {
@unlink($tempCaBundleFile);
});
$caBundleFile = $tempCaBundleFile;
}
return $caBundleFile;
}