/** * Logging the debugging information to "debug.log" * * @param string $message * @return boolean */ static public function log($message) { $settings = SagepaySettings::getInstance(); if ($settings->getLogError()) { $filename = SAGEPAY_SDK_PATH . '/debug.log'; $line = '[' . date('Y-m-d H:i:s') . '] :: ' . $message; try { $file = fopen($filename, 'a+'); fwrite($file, $line . PHP_EOL); fclose($file); } catch (Exception $ex) { return false; } } return true; }
<?php /** * Start new or resume existing session */ session_start(); define('DEMO_PATH', dirname(__FILE__)); define('BASE_PATH', substr($_SERVER['SCRIPT_NAME'], 0, strlen($_SERVER['SCRIPT_NAME']) - 9)); require_once DEMO_PATH . '/bootstrap.php'; HelperSetup::checkDependencies(); // Is required for initialiize the the SagePay Api $config = SagepaySettings::getInstance(); new App($config);