Ejemplo n.º 1
0
<?php

set_include_path(".:" . realpath(dirname(__FILE__) . "/..") . "/:" . PEAR_INSTALL_DIR);
require_once "Atrox/Core/Application/Application.php";
Atrox_Core_ServiceLocator::load(Atrox_Core_ServiceLocator::getInstance());
$application = Atrox_Core_ServiceLocator::getApplication();
//$application->setupCustomExceptionHandler();
$application->setName("Atrox Unit Test Application");
Ejemplo n.º 2
0
 public function query($query)
 {
     Atrox_Core_ServiceLocator::getInstance()->getLogger()->log($query, "Connection", Atrox_Core_Logging_Logger::DEBUG);
     $result = parent::query($query);
     return $result;
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $serviceLocator = Atrox_Core_ServiceLocator::getInstance();
     $dataAdaptorfactory = $serviceLocator->getDataAdaptorFactory();
     $this->contacts = new $dataAdaptorfactory->getCollection("Contact", Atrox_Base_AddressBook_Contact::getSchema(), $serviceLocator->getConnection());
 }
Ejemplo n.º 4
0
 /**
  *
  * @param string $name
  * @param string $id
  * @param Atrox_Core_Data_IConnection $connection
  * @return void
  */
 public function __construct($name, $id = "Id", Atrox_Core_Data_IConnection $connection = null)
 {
     parent::__construct($name, $id, $connection);
     $this->serviceLocator = Atrox_Core_ServiceLocator::getInstance();
     $this->parsedSequenceName = $this->connection->parsePropertyName("{$name}_{$id}_seq");
 }
Ejemplo n.º 5
0
 /**
  *
  * @param Exception $exception
  */
 protected function exceptionHandler(Exception $exception)
 {
     $logger = Atrox_Core_ServiceLocator::getInstance()->getLogger();
     $logger->log($exception, "Exception", Atrox_Core_Logging_Logger::ERROR);
     if (method_exists($exception, "getContext")) {
         $logger->log($exception->getContext(), "Exception", Atrox_Core_Logging_Logger::ERROR);
     }
     if (ini_get("display_errors")) {
         @header("Content-type: text/plain");
         echo $exception;
     } else {
         @header("HTTP/1.1 500 Internal Server Error");
         @header("Status: 500 Internal Server Error");
         exit;
     }
     return false;
 }