Beispiel #1
0
 /**
  * Set the path which would be used for logging.
  * @param unknown_type $path
  * @throws Exception
  */
 public static function setPath($path = 'app/logs/wyf.log')
 {
     if ($path != self::$path) {
         Logger::$fd[$path] = fopen($path, "a");
         self::$path = $path;
         if (Logger::$fd[$path] == false) {
             throw new Exception("Could not open log file [{$path}]");
         }
     }
 }
Beispiel #2
0
 /**
  * Start function, will be called from the bootstrap file.
  */
 public static function start()
 {
     if (self::$instance !== null) {
         throw new LogException("Logger already started!");
     }
     if (Configuration::get('app.log', true)) {
         // Get configuration
         $logPath = Configuration::get('app.logPath');
         if ($logPath === null) {
             // @codeCoverageIgnore
             throw new ConfigurationException("app.logPath is not valid!");
             // @codeCoverageIgnore
         }
         // @codeCoverageIgnore
         if (!file_exists($logPath)) {
             // @codeCoverageIgnore
             $make = mkdir($logPath);
             // @codeCoverageIgnore
             if (!$make) {
                 // @codeCoverageIgnore
                 throw new PermissionDeniedException("Could not create directory '" . $logPath . "'!");
                 // @codeCoverageIgnore
             }
             // @codeCoverageIgnore
         }
         // @codeCoverageIgnore
         // Get all level and log files.
         self::$files = Configuration::get('app.logFile', ['app.log' => self::ERROR]);
         // Load the logger
         self::$instance = new Writer($logPath);
         self::$path = $logPath;
         // Load all handlers.
         foreach (self::$files as $file => $minimumLevel) {
             self::$instance->addHandler(new StreamHandler($logPath . $file, $minimumLevel));
         }
         // Write debug message for starting logger
         self::log(self::DEBUG, 'Arvici Logger Started!');
         // Register exception/error handler
         ExceptionHandler::register();
     }
 }
<?php

require_once 'D:\\inetpub\\tsa\\wwwroot\\Logger\\Logger.php';
Logger::$path = 'D:\\inetpub\\tsa\\wwwroot\\msg_log.txt';
/**
 * Main eWAY Gateway Class
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
if (!class_exists('WC_Gateway_EWAY')) {
    class WC_Gateway_EWAY extends WC_Payment_Gateway
    {
        protected $api;
        protected $plugin_url;
        public function __construct()
        {
            $this->id = 'eway';
            $this->method_title = __('eWAY', 'wc-eway');
            $this->method_description = __('Allow customers to securely save their credit card to their account for use with single purchases and subscriptions.', 'wc-eway');
            $this->supports = array('subscriptions', 'products', 'refunds', 'subscription_cancellation', 'subscription_reactivation', 'subscription_suspension', 'subscription_amount_changes', 'subscription_date_changes');
            $this->has_fields = true;
            $this->icon = apply_filters('woocommerce_eway_icon', '');
            $this->card_types = '';
            // Load the form fields
            $this->init_form_fields();
            // Load the settings
            $this->init_settings();
            // Define user set variables
            foreach ($this->settings as $setting_key => $setting) {
 public static function setPath($path)
 {
     self::$path = $path;
 }
function call_infusion_complet_module($cid, $module_id)
{
    require_once TEMPLATEPATH . '/Services/Infusionsoft/isdk.enhanced.php';
    require_once TEMPLATEPATH . '/Services/Logger/Logger.php';
    Logger::$path = TEMPLATEPATH . '/Services/Logger/log.txt';
    $infusionsoft = new iSDK_enhanced($cid);
    if ($infusionsoft->connect('cl978')) {
        Logger::write('Running - Connected to Infusionsoft. Module: ' . $module_id . ' Contact: ' . $cid);
        $infusionsoft->achieveGoal("cl978", "finishedModule" . $module_id, $cid);
    } else {
        Logger::write('Running - Failed to connected to Infusionsoft. ');
    }
}