本文整理汇总了PHP中PayPal::getPackageRoot方法的典型用法代码示例。如果您正苦于以下问题:PHP PayPal::getPackageRoot方法的具体用法?PHP PayPal::getPackageRoot怎么用?PHP PayPal::getPackageRoot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PayPal
的用法示例。
在下文中一共展示了PayPal::getPackageRoot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTypeList
/**
* Get information describing all types provided by the SDK.
* @static
*/
function getTypeList()
{
$root_dir = PayPal::getPackageRoot();
$types = "{$root_dir}/Type/*.php";
$files = glob($types);
if (count($files) < 2) {
return PayPal::raiseError("Types not found in package! (Looked for '{$types}')");
}
$retval = array();
foreach ($files as $type_files) {
$retval[] = basename(substr($type_files, 0, strpos($type_files, '.')));
}
return $retval;
}
示例2: getPayPalCertificateFile
/**
* Returns the PayPal public certificate filename.
*
* @param string The environment to get the certificate for.
* @return mixed The path and file of the certificate file, or a PayPal error object on failure.
*/
function getPayPalCertificateFile($environment)
{
$package_root = PayPal::getPackageRoot();
$cert = $package_root . '/cert/' . strtolower($environment) . '.paypal.com.pem';
if (@(include "{$package_root}/conf/paypal-sdk.php")) {
if (isset($__PP_CONFIG['paypal_cert_file']) && !empty($__PP_CONFIG['paypal_cert_file'])) {
$cert = $__PP_CONFIG['paypal_cert_file'][$environment];
}
}
if (!file_exists($cert)) {
return PayPal::raiseError("Could not file Paypal public Certificate file '{$cert}'");
}
return $cert;
}
示例3: _getHandlerPaths
/**
* Returns an array of paths where the Admin should search for Profile Handler classes
*
* @internal
* @return array An array of paths to search
*/
function _getHandlerPaths()
{
$package_root = PayPal::getPackageRoot();
$handler_paths = array("{$package_root}/Profile/Handler");
if (@(include "{$package_root}/conf/paypal-sdk.php")) {
if (isset($__PP_CONFIG['custom_handler_dir']) && is_array($__PP_CONFIG['custom_handler_dir'])) {
$handler_paths = array_merge($__PP_CONFIG['custom_handler_dir'], $handler_paths);
}
}
return $handler_paths;
}