original_string: public static function get_cacert() {
          global $CFG;
  
          // Bundle in dataroot always wins.
          if (is_readable("$CFG->dataroot/moodleorgca.crt")) {
              return realpath("$CFG->dataroot/moodleorgca.crt");
          }
  
          // Next comes the default from php.ini
          $cacert = ini_get('curl.cainfo');
          if (!empty($cacert) and is_readable($cacert)) {
              return realpath($cacert);
          }
  
          // Windows PHP does not have any certs, we need to use something.
          if ($CFG->ostype === 'WINDOWS') {
              if (is_readable("$CFG->libdir/cacert.pem")) {
                  return realpath("$CFG->libdir/cacert.pem");
              }
          }
  
          // Use default, this should work fine on all properly configured *nix systems.
          return null;
      }
code: public static function get_cacert() {
          global $CFG;
  
          // Bundle in dataroot always wins.
          if (is_readable("$CFG->dataroot/moodleorgca.crt")) {
              return realpath("$CFG->dataroot/moodleorgca.crt");
          }
  
          // Next comes the default from php.ini
          $cacert = ini_get('curl.cainfo');
          if (!empty($cacert) and is_readable($cacert)) {
              return realpath($cacert);
          }
  
          // Windows PHP does not have any certs, we need to use something.
          if ($CFG->ostype === 'WINDOWS') {
              if (is_readable("$CFG->libdir/cacert.pem")) {
                  return realpath("$CFG->libdir/cacert.pem");
              }
          }
  
          // Use default, this should work fine on all properly configured *nix systems.
          return null;
      }
code_tokens: public static function get_cacert ( ) { global $ CFG ; // Bundle in dataroot always wins. if ( is_readable ( "$CFG->dataroot/moodleorgca.crt" ) ) { return realpath ( "$CFG->dataroot/moodleorgca.crt" ) ; } // Next comes the default from php.ini $ cacert = ini_get ( 'curl.cainfo' ) ; if ( ! empty ( $ cacert ) and is_readable ( $ cacert ) ) { return realpath ( $ cacert ) ; } // Windows PHP does not have any certs, we need to use something. if ( $ CFG -> ostype === 'WINDOWS' ) { if ( is_readable ( "$CFG->libdir/cacert.pem" ) ) { return realpath ( "$CFG->libdir/cacert.pem" ) ; } } // Use default, this should work fine on all properly configured *nix systems. return null ; }
docstring: Get the location of ca certificates.
  @return string absolute file path or empty if default used
docstring_tokens: Get the location of ca certificates .