Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CaBundle.php

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\CaBundle

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal