This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

File renamed without changes.
@@ -93,14 +93,12 @@ public function __construct()

$options['logger'] = 'firephp';

if (!in_array($options['logger'], $loggerOptions))
{
if (!in_array($options['logger'], $loggerOptions)) {
$options['logger'] = 'echo';
}

/** Email */
if ($options['logger'] == 'email')
{
if ($options['logger'] == 'email') {
$options['mailer'] = Services::Mail();
$options['reply_to'] = Services::Registry()->get('Configuration\\mail_reply_to', '');
$options['from'] = Services::Registry()->get('Configuration\\mail_from', '');
@@ -109,43 +107,34 @@ public function __construct()
}

/** Formatted Text */
if ($options['logger'] == 'formattedtext')
{
if ($options['logger'] == 'formattedtext') {
$options['logger'] = 'formattedtext';
$options['text_file'] = Services::Registry()->get('Configuration\\debug_text_file', 'debug.php');
$temp = Services::Registry()->get('Configuration\\debug_text_file_path', 'SITE_LOGS_FOLDER');
if ($temp == 'SITE_LOGS_FOLDER')
{
if ($temp == 'SITE_LOGS_FOLDER') {
$options['text_file_path'] = SITE_LOGS_FOLDER;
}
else
{
} else {
$options['text_file_path'] = $temp;
}
if (Services::Filesystem()->fileExists(SITE_LOGS_FOLDER . '/'. $options['text_file']))
{
if (Services::Filesystem()->fileExists(SITE_LOGS_FOLDER . '/'. $options['text_file'])) {
$options['text_file_no_php']
= (int) Services::Registry()->get('Configuration\\debug_text_file_no_php', false);
$loggerSelected = true;
}
else
{
} else {
$options = array();
$options['logger'] = 'echo';
}
}

/** Database */
if ($options['logger'] == 'database')
{
if ($options['logger'] == 'database') {
$options['dbo'] = Services::Database()->get('db');
$options['db_table'] = Services::Registry()->get('Configuration\\debug_database_table', '#__log');
$loggerSelected = true;
}

/** Messages */
if ($options['logger'] == 'messages')
{
if ($options['logger'] == 'messages') {
$options['messages_namespace']
= Services::Registry()->get('Configuration\\debug_messages_namespace', 'debug');
$loggerSelected = true;
@@ -155,11 +144,6 @@ public function __construct()
if ($options['logger'] == 'chromephp') {
}


/** Firefox Console */
if ($options['logger'] == 'firephp') {
}

/** Echo */
if ($options['logger'] == 'echo') {
$options['logger'] = 'echo';
@@ -20,6 +20,7 @@
Class ErrorService
{
/**
* @static
* @var object
* @since 1.0
*/
@@ -39,12 +40,13 @@ public static function getInstance()
}

/**
* Set routing for an error condition
* 500 Set routing for an error condition
*
* @param $code
* @param null|string $message
*
* @return mixed
* @return null
*
* @since 1.0
*/
public function set($code, $message = 'Internal server error')
@@ -56,10 +58,10 @@ public function set($code, $message = 'Internal server error')

/** default error theme and page */
Services::Registry()->set('Request\\theme_id',
Services::Registry()->get('Configuration\\error_theme_id', 'system')
Services::Registry()->get('Configuration\\error_theme_id', 0)
);
Services::Registry()->set('Request\\page_view_id',
Services::Registry()->get('Configuration\\error_page_view_id', 'error')
Services::Registry()->get('Configuration\\error_page_view_id', 0)
);

/** set header status, message and override default theme/page, if needed */
@@ -75,17 +77,15 @@ public function set($code, $message = 'Internal server error')
} else {

Services::Response()
->setHeader('Status', '500 Internal server error', 'true');
->setHeader('Status', '500 Internal server error', true);

Services::Message()
->set($message, MESSAGE_TYPE_ERROR, 500);
}

return;
}

/**
* Offline
* 503 Offline
*
* @return null
*
@@ -106,18 +106,16 @@ protected function error503()
);

Services::Registry()->set('Request\\theme_id',
Services::Registry()->get('Configuration\\offline_theme_id', 'system')
Services::Registry()->get('Configuration\\offline_theme_id', 0)
);

Services::Registry()->set('Request\\page_view_id',
Services::Registry()->get('Configuration\\offline_page_view_id', 'offline')
Services::Registry()->get('Configuration\\offline_page_view_id', 0)
);

return;
}

/**
* Not Authorised
* 403 Not Authorised
*
* @return null
*
@@ -134,12 +132,10 @@ protected function error403()
MESSAGE_TYPE_ERROR,
403
);

return;
}

/**
* Page Not Found
* 404 Page Not Found
*
* @return null
*
@@ -135,10 +135,7 @@ public function __construct()
*
* +++ Molajo custom loggers
*
* 4. Messages
* $this->options['namespace']
*
* 5. Email
* 4. Email
* $this->options['sender'] = array(
* Services::Registry()->get('Configuration\\mail_from'),
* Services::Registry()->get('Configuration\\mail_from_name')
@@ -147,7 +144,7 @@ public function __construct()
* $this->options['subject'] = Services::Language()->translate('LOG_ALERT_EMAIL_SUBJECT'));
* $this->options['mailer'] = Services::Mail();
*
* 6. ChromePHP
* 5. ChromePHP
* No addition $option[] values. However, this option requires using Google Chrome and installing this
* Google Chrome extension: https://chrome.google.com/webstore/detail/noaneddfkdjfnfdakjjmocngnfkfehhd
* and https://github.com/ccampbell/chromephp
@@ -4,14 +4,15 @@
* @copyright 2012 Amy Stephen. All rights reserved.
* @license GNU General Public License Version 2, or later http://www.gnu.org/licenses/gpl.html
*/

namespace Molajo\Application\Service;

defined('MOLAJO') or die;

/**
* Message
*
* @package Molajo
* @package Molajo
* @subpackage Service
* @since 1.0
*/
@@ -31,7 +32,7 @@
* @var array
* @since 1.0
*/
protected $_messages = array();
protected $messages = array();

/**
* getInstance
@@ -49,8 +50,6 @@ public static function getInstance()
}

/**
* __construct
*
* Class constructor.
*
* @return boolean
@@ -61,29 +60,35 @@ public function __construct()
}

/**
* set
* get application messages
*
* @return array Application messages
*
* @since 1.0
*/
public function get()
{
return $this->messages;
}

/**
* Set the system message.
*
* @param string $message
* @param string $type message, notice, warning, and error
* @param string $message
* @param string $type message, notice, warning, and error
* @param integer $code
*
* @return bool
* @since 1.0
*/
public function set($message = null,
$type = 'message',
$code = null,
$debug_location = null,
$debug_object = null)
public function set($message = null, $type = 'message', $code = null)
{
if ($message == null
&& $code == null
) {
if ($message == null && $code == null) {
return false;
}

$type = strtolower($type);

if ($type == MESSAGE_TYPE_NOTICE
|| $type == MESSAGE_TYPE_WARNING
|| $type == MESSAGE_TYPE_ERROR
@@ -92,85 +97,12 @@ public function set($message = null,
$type = MESSAGE_TYPE_MESSAGE;
}

/** load session messages into messages array */
//$this->_getSessionMessages();

/** add new message */
$count = count($this->_messages);
$count = count($this->messages);

$this->_messages[$count]['message'] = $message;
$this->_messages[$count]['type'] = $type;
$this->_messages[$count]['code'] = $code;
$this->_messages[$count]['debug_location'] = $debug_location;
$this->_messages[$count]['debug_object'] = $debug_object;
$this->messages[$count]['message'] = $message;
$this->messages[$count]['type'] = $type;
$this->messages[$count]['code'] = $code;

return true;
}

/**
* get
*
* @return array Application messages
* @since 1.0
*/
public function get()
{
// $this->_getSessionMessages();
return $this->_messages;
}

/**
* _getSessionMessages
*
* Retrieve messages in _session and load into Application messages array
*
* @return void
* @since 1.0
*/
private function _getSessionMessages()
{
$_session = $this->getSession();
$_getSessionMessages = $_session->get('application.messages');

if (count($_getSessionMessages) > 0) {
$count = count($this->_messages);
foreach ($_getSessionMessages as $_sessionMessage) {
$this->_messages[$count] = $_sessionMessage;
$count++;
}
$_session->set('application.messages', null);
}
}

/**
* _setSessionMessages
*
* Store system messages in Session variable
*
* @return array System messages
* @since 1.0
*/
private function _setSessionMessages()
{
$_session = $this->getSession();

if (count($this->_messages) > 0) {
$_session->set('application.messages', $this->_messages);
} else {
$_session->set('application.messages', null);

}
}

/**
use Symfony\Component\HttpFoundation\Session\Session;
http://symfony.com/doc/master/components/http_foundation/sessions.html
$session = new Session();
$session->start();
// add flash messages
$session->getFlashBag()->add('warning', 'Your config file is writable, it should be set read-only');
$session->getFlashBag()->add('error', 'Failed to update name');
$session->getFlashBag()->add('error', 'Another error');
*/
}
@@ -33,15 +33,15 @@
* @var object
* @since 1.0
*/
public $connection;
protected $connection;

/**
* Request
*
* @var object
* @since 1.0
*/
public $request;
protected $request;

/**
* getInstance
@@ -59,35 +59,24 @@ public static function getInstance()
}

/**
* __construct
*
* Class constructor.
*
* @since 1.0
*/
public function __construct()
{

$class = 'Symfony\\Component\\HttpFoundation\\Request';
$this->connection = new $class();

/** Request */
$this->request = $this->connection->createFromGlobals();

return $this;
}

/**
* Used to connect to services
*
* @static
* @param $name
* @param $arguments
*/
public function __call($name, $arguments)
public function get($key)
{
echo 'Nmae ' . $name . '<br />';
echo '<pre>';
var_dump($arguments);
echo '</pre>';
return $this->connection->$name($arguments);
return $this->$key;
}
}
@@ -247,7 +247,7 @@ protected function getRequest()
$extra = array();

if (count($pairs) > 0) {
$xml = CONFIGURATION_FOLDER . '/parameters.xml';
$xml = CONFIGURATION_FOLDER . '/nonroutable.xml';
if (is_file($xml)) {
} else {
return false;