Jump to content

MartyIX

Members
  • Posts

    15
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    MartyIX got a reaction from Blesta Addons in Advanced Debugger In Blesta   
    Hello,
     
    Blesta has its own mechanism for displaying errors. It is part of minPHP framework and the relevant files are /lib/stdlib.php and /lib/unknown_exception.php. However, there are PHP libraries that can help you further to ease development in PHP. I like https://packagist.org/packages/tracy/tracy (see an example here: http://examples.nette.org/ndebug/nette-exception.html)
      Advantages Tracy has a production mode (useful for production version of Blesta when you want to log exceptions and other errors to files) and a develoment mode (useful for plugin developers, maybe even Blesta developers). Development mode allows you to see stack trace, parameters and much more (see http://examples.nette.org/ndebug/nette-exception.html) You can catch all unhandled exceptions. You can event catch NOTICE errors (I believe that everybody should do that.) If an error occurs you have a log file to examine.   How to make it work in Blesta   1) Composer settings (composer.json)   {         "config": {                 "vendor-dir": "vendors"         },         "require": {                 "tracy/tracy": "dev-master"         } } 2) Create folder /log (in Blesta folder)
     
    3) Update /index.php <?php /* SVN FILE: $Id: index.php 52 2010-10-01 20:50:08Z cody $ */ /**  * This file transfers control over to the dispatcher which will invoke the  * appropriate controller. We also handle any exceptions that were not handled  * elsewhere in the application, so we can end gracefully.  *  * @package       minPHP  * @version       $Revision: 52 $  * @modifiedby    $LastChangedBy: cody $  * @lastmodified  $Date: 2010-10-01 13:50:08 -0700 (Fri, 01 Oct 2010) $  */ $start = microtime(true); include __DIR__ . '/vendors/autoload.php'; include __DIR__ . '/vendors/Logger/Logger.php'; // my logging class containing \BlestaLogger (it has nothing to do with Tracy) \BlestaLogger::create(); \BlestaLogger::addDebug("==== REQUEST START ===="); //try {     include(dirname(__FILE__) . "/lib/init.php");     // Start Tracy      // Note: Error handlers are registered in lib/init.php. Tracy does the same therefore      //   Tracy needs to be initalized after init.php to overwrite previous behaviour)     $serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : "";     $productionMode = php_sapi_name() === 'cli' || stripos($serverName, '.local') === false;     $logDir = __DIR__ . '/log';     \Tracy\Debugger::$strictMode = true;     \Tracy\Debugger::$scream = true;     \Tracy\Debugger::$onFatalError = "\UnknownException::setFatalErrorHandler";     \Tracy\Debugger::enable($productionMode, $logDir);     // Dispatch the Web request     if (!empty($_SERVER['REQUEST_URI']))         Dispatcher::dispatch($_SERVER['REQUEST_URI']);     // Dispatch the CLI request     else         Dispatcher::dispatchCli($argv); //} /*catch (Exception $e) {     try {         // Attempt to raise any error, gracefully         Dispatcher::raiseError($e);     }     catch (Exception $e) {         if (Configure::get("System.debug"))             echo $e->getMessage() . " on line <strong>" . $e->getLine() .                 "</strong> in <strong>" . $e->getFile() . "</strong>\n" .                 "<br />Printing Stack Trace:<br />" . nl2br($e->getTraceAsString());         else             echo $e->getMessage();     } }*/ \BlestaLogger::addDebug("==== REQUEST END ===="); $end = microtime(true); // Display rendering time if benchmarking is enabled if (Configure::get("System.benchmark"))     echo "execution time: " . ($end-$start) . " seconds"; ?> Feature request
     
    If you like Tracy (please note that I'm not affiliated with the library in any way) maybe you can integrate it into Blesta.
     
     
    Have a nice day!
  2. Like
    MartyIX got a reaction from flangefrog in Advanced Debugger In Blesta   
    Hello,
     
    Blesta has its own mechanism for displaying errors. It is part of minPHP framework and the relevant files are /lib/stdlib.php and /lib/unknown_exception.php. However, there are PHP libraries that can help you further to ease development in PHP. I like https://packagist.org/packages/tracy/tracy (see an example here: http://examples.nette.org/ndebug/nette-exception.html)
      Advantages Tracy has a production mode (useful for production version of Blesta when you want to log exceptions and other errors to files) and a develoment mode (useful for plugin developers, maybe even Blesta developers). Development mode allows you to see stack trace, parameters and much more (see http://examples.nette.org/ndebug/nette-exception.html) You can catch all unhandled exceptions. You can event catch NOTICE errors (I believe that everybody should do that.) If an error occurs you have a log file to examine.   How to make it work in Blesta   1) Composer settings (composer.json)   {         "config": {                 "vendor-dir": "vendors"         },         "require": {                 "tracy/tracy": "dev-master"         } } 2) Create folder /log (in Blesta folder)
     
    3) Update /index.php <?php /* SVN FILE: $Id: index.php 52 2010-10-01 20:50:08Z cody $ */ /**  * This file transfers control over to the dispatcher which will invoke the  * appropriate controller. We also handle any exceptions that were not handled  * elsewhere in the application, so we can end gracefully.  *  * @package       minPHP  * @version       $Revision: 52 $  * @modifiedby    $LastChangedBy: cody $  * @lastmodified  $Date: 2010-10-01 13:50:08 -0700 (Fri, 01 Oct 2010) $  */ $start = microtime(true); include __DIR__ . '/vendors/autoload.php'; include __DIR__ . '/vendors/Logger/Logger.php'; // my logging class containing \BlestaLogger (it has nothing to do with Tracy) \BlestaLogger::create(); \BlestaLogger::addDebug("==== REQUEST START ===="); //try {     include(dirname(__FILE__) . "/lib/init.php");     // Start Tracy      // Note: Error handlers are registered in lib/init.php. Tracy does the same therefore      //   Tracy needs to be initalized after init.php to overwrite previous behaviour)     $serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : "";     $productionMode = php_sapi_name() === 'cli' || stripos($serverName, '.local') === false;     $logDir = __DIR__ . '/log';     \Tracy\Debugger::$strictMode = true;     \Tracy\Debugger::$scream = true;     \Tracy\Debugger::$onFatalError = "\UnknownException::setFatalErrorHandler";     \Tracy\Debugger::enable($productionMode, $logDir);     // Dispatch the Web request     if (!empty($_SERVER['REQUEST_URI']))         Dispatcher::dispatch($_SERVER['REQUEST_URI']);     // Dispatch the CLI request     else         Dispatcher::dispatchCli($argv); //} /*catch (Exception $e) {     try {         // Attempt to raise any error, gracefully         Dispatcher::raiseError($e);     }     catch (Exception $e) {         if (Configure::get("System.debug"))             echo $e->getMessage() . " on line <strong>" . $e->getLine() .                 "</strong> in <strong>" . $e->getFile() . "</strong>\n" .                 "<br />Printing Stack Trace:<br />" . nl2br($e->getTraceAsString());         else             echo $e->getMessage();     } }*/ \BlestaLogger::addDebug("==== REQUEST END ===="); $end = microtime(true); // Display rendering time if benchmarking is enabled if (Configure::get("System.benchmark"))     echo "execution time: " . ($end-$start) . " seconds"; ?> Feature request
     
    If you like Tracy (please note that I'm not affiliated with the library in any way) maybe you can integrate it into Blesta.
     
     
    Have a nice day!
  3. Like
    MartyIX reacted to Cody in Invoices - Payment Method   
    Not sure what you mean here. Every transaction that is recorded shows when the payment was made and to which invoices. The invoice then shows all items that the invoice covers, which includes any services.
     

    Yes, Blesta allows an invoice to be paid by several transactions as well as serveral transactions to pay a single invoice. The connection between the payment gateway and the transaction is stored in the transactions table (see transactions.gateway_id, or better yet Transactions::get()).
  4. Like
    MartyIX reacted to Cody in How To Integrate Blesta In My Project To Share Information About Currently Logged In User?   
    Plugin coming for this soon. See this thead.
  5. Like
    MartyIX reacted to Cody in Exchange Rates By Google Finance   
    I've created the unit tests to process all exchange rate processors. We'll be moving to a daily build process soon which will help us catch these types of issues right away.
  6. Like
    MartyIX got a reaction from Michael in Exchange Rates By Google Finance   
    Hello,
     
      I examined Google Finance exchange rate processor (/components/exchange_rates/google_finance/google_finance.php) and it seems that it no longer works because the URL http://www.google.com/ig/calculator is not working any more. I believe that it was shutted down together with iGoogle by Google.
     
    Could anybody confirm this?
     
    Thank you!
     
     
    Blesta version: 3.0.6
×
×
  • Create New...