Sample code for 30+ languages & platforms
PHP Extension Requires Chilkat v11.0.0+

Transition from Cert.GetCertChain to Cert.BuildCertChain

Provides instructions for replacing deprecated GetCertChain method calls with BuildCertChain.

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

$success = false;

$cert = new CkCert();

//  ------------------------------------------------------------------------
//  The GetCertChain method is deprecated:

// certchainObj is a CkCertChain
$certchainObj = $cert->GetCertChain();
if ($cert->get_LastMethodSuccess() == false) {
    print $cert->lastErrorText() . "\n";
    exit;
}

//  ...
//  ...

//  ------------------------------------------------------------------------
//  Do the equivalent using BuildCertChain.
//  Your application creates a new, empty CertChain object which is passed 
//  in the last argument and filled upon success.

$certchainOut = new CkCertChain();
$success = $cert->BuildCertChain($certchainOut);
if ($success == false) {
    print $cert->lastErrorText() . "\n";
    exit;
}


?>