예제 #1
1
파일: ecom360.php 프로젝트: fracting/cmc
 /**
  * Sends the tracking information to mailchimp if we have the tracking ids
  * Logs errors
  * @param $store_id
  * @param string $store_name
  * @param int $order_id
  * @param int $total_amount
  * @param int $tax_amount
  * @param int $shipping_amount
  * @param array $products
  * @return bool
  */
 public static function sendOrderInformations($store_id, $store_name = "Store name", $order_id = 0, $total_amount = 0, $tax_amount = 0, $shipping_amount = 0, $products = array(0 => array("product_id" => 0, "sku" => "", "product_name" => "", "category_id" => 0, "category_name" => "", "qty" => 1.0, "cost" => 0.0)))
 {
     // log the errors to a file
     JLog::addLogger(array('text_file' => 'com_cmc_ecom360.php'));
     $session = JFactory::getSession();
     $mc_cid = $session->get('mc_cid', '');
     $mc_eid = $session->get('mc_eid', '');
     if (!$mc_cid && !$mc_eid) {
         JLog::add('No cid and eid specified for the request', JLOG::ERROR);
         return false;
     }
     $order = array();
     $order["id"] = $order_id;
     $order["email_id"] = $mc_eid;
     $order["total"] = (double) $total_amount;
     $order["shipping"] = (double) $shipping_amount;
     $order["tax"] = (double) $tax_amount;
     $order["store_id"] = $store_id;
     $order["store_name"] = $store_name;
     $order["campaign_id"] = $mc_cid;
     // Optional
     $order["items"] = $products;
     $api = new cmcHelperChimp();
     $api->ecommOrderAdd($order);
     if ($api->errorCode) {
         JLog::add($api->errorMessage, JLOG::ERROR, $api->errorCode);
         return false;
     }
     return true;
 }
예제 #2
0
파일: ipn.php 프로젝트: rhotog/fabrik
 function __construct()
 {
     // Include the JLog class.
     jimport('joomla.log.log');
     // Add the logger.
     JLog::addLogger(array('logger' => 'database'));
 }
예제 #3
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (JDEBUG) {
         JLog::addLogger(array('text_file' => 'com_usernotes.log.php'), JLog::ALL, array('com_usernotes'));
     }
 }
예제 #4
0
 public function __construct()
 {
     JLog::addLogger(array('text_file' => "jotcache.recache.log.php", 'text_entry_format' => "{DATE} {TIME}\t{MESSAGE}", 'text_file_path' => JPATH_ROOT . '/logs'), JLog::INFO, 'jotcache.recache');
     $this->dbo = JFactory::getDBO();
     $this->recacheParams = JComponentHelper::getParams('com_jotcache');
     $this->logging = $this->recacheParams->get('recachelog', 0) == 1 ? true : false;
 }
예제 #5
0
 /**
  * Fired on log initialiser.
  *
  * @return  void
  *
  * @since   2.0
  */
 public function onLogInitialise()
 {
     // This is the columns that the log files will use
     $fileFormat = str_replace('\\t', "\t", $this->params->get('file_format', '{DATETIME}\\t{ID}\\t{MESSAGE}'));
     /*
      * Deals with the Information level logs.
      */
     if ($this->params->get('enable_info', true)) {
         // Setup a information file logger
         JLog::addLogger(array('logger' => self::LOGGER_FILE, 'text_file' => $this->params->get('log_name_info', 'sso.info.php'), 'text_entry_format' => $fileFormat), JLog::INFO, array(self::SSO_CATEGORY, self::AUTH_CATEGORY));
     }
     /*
      * Deals with the Debugging level logs (which includes all levels internally).
      */
     if ($this->params->get('enable_debug', true)) {
         // Setup a debugger file logger
         JLog::addLogger(array('logger' => self::LOGGER_FILE, 'text_file' => $this->params->get('log_name_debug', 'sso.debug.php'), 'text_entry_format' => $fileFormat), JLog::ALL, array(self::SSO_CATEGORY, self::AUTH_CATEGORY));
     }
     /*
      * Deals with the Error level logs.
      */
     if ($this->params->get('enable_error', true)) {
         // Setup a error file logger
         JLog::addLogger(array('logger' => self::LOGGER_FILE, 'text_file' => $this->params->get('log_name_error', 'sso.error.php'), 'text_entry_format' => $fileFormat), JLog::ERROR, array(self::SSO_CATEGORY, self::AUTH_CATEGORY));
         if ($this->params->get('error_to_screen', true)) {
             // Setup a error on-screen logger
             JLog::addLogger(array('logger' => self::LOGGER_SCREEN), JLog::ERROR, array(self::SSO_CATEGORY, self::AUTH_CATEGORY));
         }
     }
 }
예제 #6
0
파일: djcf2co.php 프로젝트: kidaa30/lojinha
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     $lang = JFactory::getLanguage();
     $lang->load('plg_djclassifiedspayment_djcf2co', JPATH_ROOT . DS . 'plugins' . DS . 'djclassifiedspayment' . DS . 'djcf2co', 'en-GB', false, false);
     $lang->load('plg_djclassifiedspayment_djcf2co', JPATH_ADMINISTRATOR, 'en-GB', false, false);
     $lang->load('plg_djclassifiedspayment_djcf2co', JPATH_ROOT . DS . 'plugins' . DS . 'djclassifiedspayment' . DS . 'djcf2co', null, true, false);
     $lang->load('plg_djclassifiedspayment_djcf2co', JPATH_ADMINISTRATOR, null, true, false);
     $params["plugin_name"] = "djcf2co";
     $params["icon"] = "2checkout-logo.png";
     $params["logo"] = "2checkout-logo.png";
     $params["description"] = JText::_("PLG_DJCLASSIFIEDSPAYMENT_DJCF2CO_PAYMENT_METHOD_DESC");
     $params["payment_method"] = JText::_("PLG_DJCLASSIFIEDSPAYMENT_DJCF2CO_PAYMENT_METHOD_NAME");
     $params["testmode"] = $this->params->get("test", "1");
     $params["currency_code"] = $this->params->get("currency_code", "USD");
     $params["sid"] = $this->params->get("sid", null);
     $params["secret_word"] = $this->params->get("secret_word", null);
     $params["2co_url"] = 'https://www.2checkout.com/checkout/purchase';
     $params["debug"] = $this->params->get('debug', null);
     if ($this->params->get('debug', null) == '1') {
         JLog::addLogger(array('logger' => 'formattedtext', 'text_file' => 'djcf2co.log.php'), JLog::ALL, array('djcf2co'));
     }
     $this->params = $params;
 }
예제 #7
0
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     $lang = JFactory::getLanguage();
     $lang->load('plg_djclassifiedspayment_djcfSkrill', JPATH_ROOT . DS . 'plugins' . DS . 'djclassifiedspayment' . DS . 'djcfSkrill', 'en-GB', false, false);
     $lang->load('plg_djclassifiedspayment_djcfSkrill', JPATH_ADMINISTRATOR, 'en-GB', false, false);
     $lang->load('plg_djclassifiedspayment_djcfSkrill', JPATH_ROOT . DS . 'plugins' . DS . 'djclassifiedspayment' . DS . 'djcfSkrill', null, true, false);
     $lang->load('plg_djclassifiedspayment_djcfSkrill', JPATH_ADMINISTRATOR, null, true, false);
     $params["plugin_name"] = "djcfskrill";
     $params["icon"] = "skrill_logo.png";
     $params["logo"] = "skrill_logo.png";
     $params["description"] = JText::_("PLG_DJCLASSIFIEDSPAYMENT_DJCFSKRILL_PAYMENT_METHOD_DESC");
     $params["payment_method"] = JText::_("PLG_DJCLASSIFIEDSPAYMENT_DJCFSKRILL_PAYMENT_METHOD_NAME");
     //$params["testmode"] = $this->params->get("test", "1");
     $params["currency_code"] = $this->params->get("currency_code", "USD");
     $params["merchant_id"] = $this->params->get("merchant_id", null);
     $params["pay_to_email"] = $this->params->get("pay_to_email", null);
     $params["secret_word"] = $this->params->get("secret_word", null);
     $params["skrill_url"] = 'https://www.moneybookers.com/app/payment.pl';
     $params["skrill_test_url"] = 'https://www.moneybookers.com/app/test_payment.pl';
     $params["debug"] = $this->params->get('debug', null);
     $params["languages"] = array('EN', 'DE', 'ES', 'FR', 'IT', 'PL', 'GR', 'RO', 'RU', 'TR', 'CN', 'CZ', 'NL', 'DA', 'SV', 'FI');
     if ($this->params->get('debug', null) == '1') {
         JLog::addLogger(array('logger' => 'formattedtext', 'text_file' => 'djcfskrill.log.php'), JLog::ALL, array('djcfskrill'));
     }
     $this->params = $params;
 }
예제 #8
0
파일: log.php 프로젝트: Rikisha/proj
 /**
  * Set db logger. Since all JErrors E_ERROR will be added to log.
  * Usefull if you render something J! native. 
  * Covers all E_ERROR generated by 
  * JError::raiseError, JError::raise, JError::throwError.
  * 
  * All execs of JLog::add(...) with 
  * JLog::EMERGENCY | JLog::ALERT | JLog::CRITICAL | JLog::ERROR
  * will be added to LOGS table.
  */
 public static function startJoomlaDbErrorLogger()
 {
     // Add handler to JError for E_ERROR
     JError::setErrorHandling(E_ERROR, 'callback', array('LogHelper', 'addJError'));
     // Now we log all the troubles into our LOGS table.
     JLog::addLogger(array('logger' => 'database', 'db_table' => '#__newsletter_logs'), JLog::EMERGENCY | JLog::ALERT | JLog::CRITICAL | JLog::ERROR);
 }
예제 #9
0
파일: helper.php 프로젝트: sansandeep143/av
 /**
  * returns the name of the file for this url.
  */
 public static function getPicasawebResult($url)
 {
     $params = JComponentHelper::getParams('com_eventgallery');
     $cachelifetime = $params->get('cache_picasa_lifetime', self::$cache_life);
     JLog::addLogger(array('text_file' => 'com_eventgallery.log.php', 'logger' => 'Eventgalleryformattedtext'), JLog::ALL, 'com_eventgallery');
     //JLog::add('processing url '.$url, JLog::INFO, 'com_eventgallery');
     self::initCacheDirs();
     $cachefilename = self::$cachebasedir . md5($url) . '.xml';
     if (file_exists($cachefilename) && time() - filemtime($cachefilename) <= $cachelifetime) {
         // no need to do anything since the cache is still valid
     } else {
         //JLog::add('have writen new cache file for '.$url, JLog::INFO, 'com_eventgallery');
         $xml = @file_get_contents($url);
         if ($xml === false) {
             JLog::add('unable to connect to remote host. Make sure allow_url_fopen=On and the server has access to the internet. url: ' . $url, JLog::INFO, 'com_eventgallery');
         }
         $xml = str_replace("xmlns='http://www.w3.org/2005/Atom'", '', $xml);
         #echo "reloading content from $url <br>";
         if (strlen($xml) > 0) {
             $fh = fopen($cachefilename, 'w') or die("can't open file {$cachefilename}");
             fwrite($fh, $xml);
             fclose($fh);
         }
     }
     $xml = NULL;
     return $cachefilename;
 }
예제 #10
0
 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An array that holds the plugin configuration
  *
  * @since 1.5
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     // Log the deprecated API.
     if ($this->params->get('log-deprecated')) {
         \JLog::addLogger(array('text_file' => 'deprecated.php'), \JLog::ALL, array('deprecated'));
     }
     // Log database errors
     if ($this->params->get('log-database-errors')) {
         \JLog::addLogger(array('text_file' => 'jdatabase.error.php'), \JLog::ALL, array('database'));
     }
     // Log database queries
     if ($this->params->get('log-database-queries')) {
         \JLog::addLogger(array('text_file' => 'jdatabase.query.php'), \JLog::ALL, array('databasequery'));
         // Register the HUBzero database logger as well
         // Don't worry, this won't log things twice...queries through joomla's database driver
         // will get logged above, and this will catch queries through hubzero's database driver
         \Event::listen(function ($event) {
             \Hubzero\Database\Log::add($event->getArgument('query'), $event->getArgument('time'));
         }, 'database_query');
     }
     // Only if debugging or language debug is enabled
     if (Config::get('debug') || Config::get('debug_lang')) {
         Config::set('gzip', 0);
         ob_start();
         ob_implicit_flush(false);
     }
     $this->linkFormat = ini_get('xdebug.file_link_format');
 }
예제 #11
0
파일: ipn.php 프로젝트: jfquestiaux/fabrik
 /**
  * Construct
  */
 public function __construct()
 {
     // Include the JLog class.
     jimport('joomla.log.log');
     // Add the logger.
     JLog::addLogger(array('text_file' => 'fabrik.subs.log.php'));
 }
예제 #12
0
 /**
  * Constructor.
  *
  * @param   object  &$subject  The object to observe
  * @param   array   $config    An array that holds the plugin configuration
  *
  * @since 1.5
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     // Log the deprecated API.
     if ($this->params->get('log-deprecated')) {
         JLog::addLogger(array('text_file' => 'deprecated.php'), JLog::ALL, array('deprecated'));
     }
     $this->debugLang = JFactory::getApplication()->getCfg('debug_lang');
     // Only if debugging or language debug is enabled
     if (JDEBUG || $this->debugLang) {
         JFactory::getConfig()->set('gzip', 0);
         ob_start();
         ob_implicit_flush(false);
     }
     $this->linkFormat = ini_get('xdebug.file_link_format');
     if ($this->params->get('logs', 1)) {
         $priority = 0;
         foreach ($this->params->get('log_priorities', array()) as $p) {
             $const = 'JLog::' . strtoupper($p);
             if (!defined($const)) {
                 continue;
             }
             $priority |= constant($const);
         }
         // Split into an array at any character other than alphabet, numbers, _, ., or -
         $categories = array_filter(preg_split('/[^A-Z0-9_\\.-]/i', $this->params->get('log_categories', '')));
         $mode = $this->params->get('log_category_mode', 0);
         JLog::addLogger(array('logger' => 'callback', 'callback' => array($this, 'logger')), $priority, $categories, $mode);
     }
 }
예제 #13
0
 function display($tpl = null)
 {
     /*
     // load component parameters
     $params = JComponentHelper::getParams( 'com_chessvn' );
     $params = $app->getParams( 'com_chessvn' );	
     $dummy = $params->get( 'dummy_param', 1 ); 
     
     // load another model
     JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_chessvn/models');
     $otherModel = JModelLegacy::getInstance( 'Record', 'RecordModel' );
     */
     $data = $this->get('Data');
     $this->assignRef('data', $data);
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JLog::add(implode('<br />', $errors), JLog::WARNING, 'jerror');
         return false;
     }
     $userid = JRequest::getVar('userid');
     $this->assignRef('userid', $userid);
     $gameid = JRequest::getVar('gameid');
     $this->assignRef('gameid', $gameid);
     jimport('joomla.log.log');
     JLog::addLogger(array());
     //        JLog::add(JText::_('$userid = '.$userid), JLog::INFO);
     //        $cvnuser = JFactory::getUser();
     //        $returnData = CvnDao::getChallenges();//$cvnuser->get('id')
     parent::display($tpl);
 }
예제 #14
0
파일: debug.php 프로젝트: q0821/esportshop
 public function __construct($options = array())
 {
     $this->debug = intval(JFBCFactory::config()->get('facebook_display_errors'));
     $this->text_file = isset($options['text_file']) ? $options['text_file'] : $this->text_file;
     if ($this->debug) {
         JLog::addLogger(array('text_file' => $this->text_file), JLog::ALL, 'jfbconnect');
     }
 }
예제 #15
0
파일: helper.php 프로젝트: Shtier/digicom
 public static function Storelog($name, $logdata)
 {
     jimport('joomla.error.log');
     $options = array('format' => "{DATE}\t{TIME}\t{USER}\t{DESC}");
     $path = JPATH_SITE . '/plugins/digicom-pay/' . $name . '/' . $name . '/';
     $my = JFactory::getUser();
     JLog::addLogger(array('user' => $my->name . '(' . $my->id . ')', 'desc' => json_encode($logdata['raw_data'])));
 }
예제 #16
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     if (JDEBUG) {
         JLog::addLogger(array('text_file' => 'com_usernotes.log.php'), JLog::ALL, array('com_usernotes'));
     }
     $this->uid = JFactory::getUser()->get('id');
 }
예제 #17
0
 /**
  * Constructor
  *
  * @param  object  $subject  The object to observe
  * @param  array   $config   An array that holds the plugin configuration
  *
  * @since       2.5
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $this->loadLanguage();
     $this->_images_folder = 'images/' . $this->params->get('folder', 'j2xml') . '/';
     $this->_images_path = JPATH_ROOT . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $this->_images_folder);
     JLog::addLogger(array('logger' => 'messagequeue'), JLOG::ALL, array('plg_content_setimages'));
 }
예제 #18
0
 public function __construct(&$subject, $config = array())
 {
     parent::__construct($subject, $config);
     $app = JFactory::getApplication();
     $lang = JFactory::getLanguage();
     $lang->load('plg_system_gantry', JPATH_ADMINISTRATOR);
     JLog::addLogger(array('text_file' => 'gantry.php'), $this->params->get('debugloglevel', 63), array('gantry'));
 }
예제 #19
0
 /**
  * Construct
  *
  * @param   object  &$subject  Subject to observer
  * @param   array   $config    Config
  */
 public function __construct(&$subject, $config = array())
 {
     // Include the JLog class.
     jimport('joomla.log.log');
     // Add the logger.
     JLog::addLogger(array('text_file' => 'fabrik.subs.log.php'));
     parent::__construct($subject, $config);
 }
function logMsg($message)
{
    $log_file_location = JURI::base() . "/logs/brafton_extension.errors.php";
    if (!file_exists($log_file_location)) {
        JLog::addLogger(array('text_file' => 'brafton_extension.errors.php'), JLog::ALL, 'brafton_extension');
    }
    JLog::add(JText::_($message), JLog::WARNING, 'brafton_extension');
}
예제 #21
0
파일: log.php 프로젝트: Joomi1945/bfstop
 function __construct($log_level)
 {
     $this->log_level = $log_level;
     $priorities = JLog::ALL;
     if ($log_level > self::Disabled) {
         JLog::addLogger(array('text_file' => 'plg_system_bfstop.log.php', 'text_entry_format' => '{DATETIME} {PRIORITY} {MESSAGE}'), $priorities, array(self::LogCategory));
     }
 }
예제 #22
0
 /**
  * Setup for testing.
  *
  * @return  void
  *
  * @since   11.3
  */
 public function setUp()
 {
     // Setup the system logger to echo all.
     JLog::addLogger(array('logger' => 'echo'), JLog::ALL);
     $_SERVER['HTTP_HOST'] = 'mydomain.com';
     $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0';
     // Get a new JWebInspector instance.
     $this->inspector = new JWebClientInspector();
     parent::setUp();
 }
예제 #23
0
 /**
  * @param $subject
  * @param $config
  */
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     $app = JFactory::getApplication();
     if ($app->isAdmin()) {
         $lang = JFactory::getLanguage();
         $lang->load('plg_system_rokbooster', JPATH_ADMINISTRATOR);
     }
     JLog::addLogger(array('text_file' => 'rokbooster.php'), $this->params->get('debugloglevel', 63), array('rokbooster'));
 }
예제 #24
0
파일: helper.php 프로젝트: politik86/test2
 function Storelog($name, $logdata)
 {
     jimport('joomla.error.log');
     $options = "{DATE}\t{TIME}\t{USER}\t{DESC}";
     $my = JFactory::getUser();
     JLog::addLogger(array('text_file' => $logdata['JT_CLIENT'] . '_' . $name . '.log', 'text_entry_format' => $options), JLog::INFO, $logdata['JT_CLIENT']);
     $logEntry = new JLogEntry('Transaction added', JLog::INFO, $logdata['JT_CLIENT']);
     $logEntry->user = $my->name . '(' . $my->id . ')';
     $logEntry->desc = json_encode($logdata['raw_data']);
     JLog::add($logEntry);
 }
예제 #25
0
 /**
  * 
  * @param type $message
  * @param type $category
  */
 public static function log($message, $priority, $filename='plg_jch_optimize.errors.php')
 {
         jimport('joomla.log.log');
         JLog::addLogger(
                 array(
                 'text_file' => $filename
                 ), JLog::ALL,
                 array ('plg_jch_optimize')
         );
         JLog::add(JText::_($message), constant('JLog::' . $priority), 'plg_jch_optimize');
 }
예제 #26
0
 public function __construct(&$subject, $config)
 {
     parent::__construct($subject, $config);
     if (JComponentHelper::isInstalled('com_usernotify')) {
         $this->cparms = JComponentHelper::getParams('com_usernotify');
         $this->targs = $this->cparms->get('target', array());
         if (JDEBUG) {
             JLog::addLogger(array('text_file' => 'com_usernotify.log.php'), JLog::ALL, array('com_usernotify'));
         }
     }
 }
 function plgSystemBraftonCron(&$subject, $params)
 {
     parent::__construct($subject, $params);
     JLog::addLogger(array('text_file' => 'com_braftonarticles.log.php'), JLog::ALL, 'com_braftonarticles');
     $this->plugin = JPluginHelper::getPlugin('system', 'braftoncron');
     $this->params->get('params');
     $this->interval = (int) $this->params->get('interval', 60) * 60;
     if ($this->interval < 3600) {
         $this->interval = 3600;
     }
 }
예제 #28
0
 /**
  * Setup for testing.
  *
  * @return void
  */
 public function setUp()
 {
     // Skip this test suite if PCNTL  extension is not available
     if (!extension_loaded("PCNTL")) {
         $this->markTestSkipped('The PCNTL extension is not available.');
     }
     // Include the inspector.
     include_once JPATH_TESTS . '/suite/joomla/application/cli/TestStubs/JDaemon_Inspector.php';
     // Setup the system logger to echo all.
     JLog::addLogger(array('logger' => 'echo'), JLog::ALL);
 }
예제 #29
0
 public static function init($debug = true)
 {
     $categories = array(self::DEFAULT_CATEGORY);
     JLog::addLogger(array('text_file' => 'jb_emergency.php'), JLog::EMERGENCY, $categories);
     if ($debug) {
         // log every type of exception ind different file.
         JLog::addLogger(array('text_file' => 'jb_alert.php'), JLog::ALERT, $categories);
         JLog::addLogger(array('text_file' => 'jb_critical.php'), JLog::CRITICAL, $categories);
         JLog::addLogger(array('text_file' => 'jb_error.php'), JLog::ERROR, $categories);
     }
 }
예제 #30
0
 /**
  * Method to update Joomla!
  *
  * @param   JInstallerFile  $installer  The class calling this method
  *
  * @return void
  */
 public function update($installer)
 {
     $options['format'] = '{DATE}\\t{TIME}\\t{LEVEL}\\t{CODE}\\t{MESSAGE}';
     $options['text_file'] = 'joomla_update.php';
     JLog::addLogger($options, JLog::INFO, array('Update', 'databasequery', 'jerror'));
     JLog::add(JText::_('COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES'), JLog::INFO, 'Update');
     $this->deleteUnexistingFiles();
     $this->updateManifestCaches();
     $this->updateDatabase();
     $this->clearRadCache();
     $this->updateAssets();
 }