Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 22 files changed
  • 0 commit comments
  • 1 contributor
Showing with 237 additions and 68 deletions.
  1. +2 −2 PHP/Classes/Performance/Caching/eGloo.Performance.Caching.Gateway.php
  2. +4 −4 PHP/Classes/Plugins/XML/eGloo.Plugin.XML.XML.php
  3. +3 −3 PHP/Classes/Plugins/XML/eGloo.Plugin.XML.XMLChild.php
  4. +3 −3 PHP/Classes/Plugins/XML/eGloo.Plugin.XML.XMLNode.php
  5. +3 −3 PHP/Classes/Security/Exceptions/eGloo.Security.RequestDefinitionParser.Exception.php
  6. +3 −3 PHP/Classes/Security/eGloo.Security.RequestDefinitionParser.RequestDefinitionParser.php
  7. +4 −4 PHP/Classes/Security/eGloo.Security.RequestDefinitionParser.XML2ArrayRequestDefinitionParser.php
  8. +3 −3 PHP/Classes/Security/eGloo.Security.RequestValidator.ExtendedRequestValidator.php
  9. +1 −1  PHP/Classes/Security/eGloo.Security.RequestValidator.RequestValidator.php
  10. +4 −4 PHP/Classes/System/CLI/Combines/eGloo.Combine.Crontab.php
  11. +5 −5 PHP/Classes/System/CLI/Combines/eGloo.Combine.RequestLibrary.php
  12. +4 −4 PHP/Classes/System/CLI/Combines/eGloo.Combine.SystemChecks.php
  13. +4 −4 PHP/Classes/System/CLI/Combines/eGloo.Combine.SystemSearch.php
  14. +4 −4 PHP/Classes/System/CLI/Combines/eGloo.Combine.SystemStatus.php
  15. +2 −0  PHP/Classes/System/Configuration/eGloo.Configuration.php
  16. +99 −0 PHP/Classes/System/Messaging/eGloo.Messaging.Alert.php
  17. +60 −0 PHP/Classes/System/Utilities/Exceptions/eGloo.Utility.Exceptions.LoggerException.php
  18. +19 −12 PHP/Classes/System/Utilities/{eGloo.Logger.php → eGloo.Utility.Logger.php}
  19. +1 −1  PHP/Classes/System/Utilities/eGlooLogger.php
  20. +5 −4 PHP/Includes/eGlooCLIAutoload.php
  21. +3 −3 PHP/Includes/eGlooPHPUnitAutoload.php
  22. +1 −1  Scripts/egloo
4 PHP/Classes/Performance/Caching/eGloo.Performance.Caching.Gateway.php
View
@@ -1,8 +1,8 @@
<?php
namespace eGloo\Performance\Caching;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
use \Exception as Exception;
use \Memcache as Memcache;
8 PHP/Classes/Plugins/XML/eGloo.Plugin.XML.XML.php
View
@@ -1,11 +1,11 @@
<?php
namespace eGloo\Plugin\XML;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
-use eGloo\Plugin\Text\Inflector as Inflector;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Plugin\Text\Inflector as Inflector;
use \DOMDocument as DOMDocument;
use \ErrorException as ErrorException;
6 PHP/Classes/Plugins/XML/eGloo.Plugin.XML.XMLChild.php
View
@@ -1,10 +1,10 @@
<?php
namespace eGloo\Plugin\XML;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \DOMDocument as DOMDocument;
use \ErrorException as ErrorException;
6 PHP/Classes/Plugins/XML/eGloo.Plugin.XML.XMLNode.php
View
@@ -1,10 +1,10 @@
<?php
namespace eGloo\Plugin\XML;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \DOMDocument as DOMDocument;
use \ErrorException as ErrorException;
6 PHP/Classes/Security/Exceptions/eGloo.Security.RequestDefinitionParser.Exception.php
View
@@ -1,10 +1,10 @@
<?php
namespace eGloo\Security\RequestDefinitionParser;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \ErrorException as ErrorException;
6 PHP/Classes/Security/eGloo.Security.RequestDefinitionParser.RequestDefinitionParser.php
View
@@ -1,10 +1,10 @@
<?php
namespace eGloo\Security\RequestDefinitionParser;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \ErrorException as ErrorException;
use \Exception as Exception;
8 PHP/Classes/Security/eGloo.Security.RequestDefinitionParser.XML2ArrayRequestDefinitionParser.php
View
@@ -1,11 +1,11 @@
<?php
namespace eGloo\Security\RequestDefinitionParser;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
-use eGloo\Plugin\XML\XML as eGlooXML;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Plugin\XML\XML as eGlooXML;
use \ErrorException as ErrorException;
use \Exception as Exception;
6 PHP/Classes/Security/eGloo.Security.RequestValidator.ExtendedRequestValidator.php
View
@@ -1,10 +1,10 @@
<?php
namespace eGloo\Security\RequestValidator;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \DOMDocument as DOMDocument;
use \ErrorException as ErrorException;
2  PHP/Classes/Security/eGloo.Security.RequestValidator.RequestValidator.php
View
@@ -2,7 +2,7 @@
namespace eGloo\Security\RequestValidator;
use \eGloo\Configuration as Configuration;
-use \eGloo\Logger as Logger;
+use \eGloo\Utility\Logger as Logger;
use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \eGloo\Security\RequestDefinitionParser\XML2ArrayRequestDefinitionParser as XML2ArrayRequestDefinitionParser;
8 PHP/Classes/System/CLI/Combines/eGloo.Combine.Crontab.php
View
@@ -1,11 +1,11 @@
<?php
namespace eGloo\Combine;
-use eGloo;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \Exception as Exception;
10 PHP/Classes/System/CLI/Combines/eGloo.Combine.RequestLibrary.php
View
@@ -1,12 +1,12 @@
<?php
namespace eGloo\Combine;
-use eGloo;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
-use eGloo\Security\RequestValidator\ExtendedRequestValidator as ExtendedRequestValidator;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Security\RequestValidator\ExtendedRequestValidator as ExtendedRequestValidator;
use \Exception as Exception;
8 PHP/Classes/System/CLI/Combines/eGloo.Combine.SystemChecks.php
View
@@ -1,11 +1,11 @@
<?php
namespace eGloo\Combine;
-use eGloo;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \Exception as Exception;
8 PHP/Classes/System/CLI/Combines/eGloo.Combine.SystemSearch.php
View
@@ -1,11 +1,11 @@
<?php
namespace eGloo\Combine;
-use eGloo;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \Exception as Exception;
8 PHP/Classes/System/CLI/Combines/eGloo.Combine.SystemStatus.php
View
@@ -1,11 +1,11 @@
<?php
namespace eGloo\Combine;
-use eGloo;
-use eGloo\Configuration as Configuration;
-use eGloo\Logger as Logger;
+use \eGloo;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \Exception as Exception;
2  PHP/Classes/System/Configuration/eGloo.Configuration.php
View
@@ -1,6 +1,8 @@
<?php
namespace eGloo;
+use \eGloo\Utility\Logger as Logger;
+
/**
* eGloo\Configuration Class File
*
99 PHP/Classes/System/Messaging/eGloo.Messaging.Alert.php
View
@@ -0,0 +1,99 @@
+<?php
+namespace eGloo\Messaging;
+
+use \eGloo;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Logger as Logger;
+
+use \Exception as Exception;
+
+/**
+ * eGloo\Messaging\Alert Class File
+ *
+ * Contains the class definition for the eGloo\Messaging\Alert
+ *
+ * Copyright 2011 eGloo LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @author George Cooper
+ * @copyright 2011 eGloo LLC
+ * @license http://www.apache.org/licenses/LICENSE-2.0
+ * @category System
+ * @package Messaging
+ * @subpackage Alerts
+ * @version 1.0
+ */
+
+/**
+ * eGloo\Messaging\Alert
+ *
+ * $short_description
+ *
+ * $long_description
+ *
+ * @category System
+ * @package Messaging
+ * @subpackage Alerts
+ */
+class Alert {
+
+ public static function sendAlert() {
+
+ }
+
+ public static function sendEmailAlert( $subject = '', $message = '', $trigger_type = null ) {
+ foreach( Configuration::getAlerts() as $alert_id => $alert ) {
+ if ( !$trigger_type ) {
+ switch( strtolower($alert['type']) ) {
+ case 'email' :
+ $mail_to = $alert['value'];
+ $mail_subject = 'eGloo Alert: ' . $subject;
+
+ if ( mail( $mail_to, $mail_subject, $message ) ) {
+ Logger::writeLog( Logger::DEBUG, 'eGloo Alert: Successfully sent email notification', 'Mail' );
+ } else {
+ Logger::writeLog( Logger::EMERGENCY, 'eGloo Alert: Did not successfully send email notification', 'Mail' );
+ }
+
+ break;
+ default :
+ break;
+ }
+ } else if ( isset($alert['trigger']) && $alert['trigger'] === $tigger_type ) {
+ switch( strtolower($alert['type']) ) {
+ case 'email' :
+ $mail_to = $alert['value'];
+ $mail_subject = 'eGloo Alert: ' . $subject;
+
+ if ( mail( $mail_to, $mail_subject, $message ) ) {
+ Logger::writeLog( Logger::DEBUG, 'eGloo Alert: Successfully sent email notification', 'Mail' );
+ } else {
+ Logger::writeLog( Logger::EMERGENCY, 'eGloo Alert: Did not successfully send email notification', 'Mail' );
+ }
+
+ break;
+ default :
+ break;
+ }
+ }
+ }
+
+ }
+
+ public static function sendSMSAlert() {
+
+ }
+
+}
+
60 PHP/Classes/System/Utilities/Exceptions/eGloo.Utility.Exceptions.LoggerException.php
View
@@ -0,0 +1,60 @@
+<?php
+namespace eGloo\Utility\Exceptions;
+
+use \Exception as Exception;
+
+/**
+ * eGloo\Utility\Exceptions\LoggerException Class File
+ *
+ * Contains the class definition for the eGloo\Utility\Exceptions\LoggerException, an exception
+ * class for eGloo framework logging functionality.
+ *
+ * Copyright 2011 eGloo, LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @author George Cooper
+ * @copyright 2011 eGloo, LLC
+ * @license http://www.apache.org/licenses/LICENSE-2.0
+ * @category System
+ * @package Utilities
+ * @subpackage Exceptions
+ * @version 1.0
+ */
+
+/**
+ * Private exception subclass for use by eGloo\Utility\Logger
+ *
+ * @author George Cooper
+ * @category System
+ * @package Utilities
+ * @subpackage Exceptions
+ */
+final class LoggerException extends Exception {
+
+ /**
+ * eGloo\Utility\Exceptions\LoggerException constructor. Takes a message and a code and invokes
+ * the parent (Exception) constructor. May eventually contain additional code,
+ * but for now acts as a means of determining the exact type of exception thrown
+ * so it is possible to track down what threw it.
+ *
+ * @param $message the message that this exception will contain
+ * @param $code the optional code of this exception (unused)
+ * @returns an eGloo\Utility\Exceptions\LoggerException
+ */
+ public function __construct( $message, $code = 0 ) {
+ // Call parent constructor
+ parent::__construct( $message, $code );
+ }
+
+}
31 PHP/Classes/System/Utilities/eGloo.Logger.php → ...Classes/System/Utilities/eGloo.Utility.Logger.php
View
@@ -1,12 +1,19 @@
<?php
-namespace eGloo;
+namespace eGloo\Utility;
+use \eGloo\Configuration as Configuration;
+use \eGloo\Utility\Exceptions\LoggerException as LoggerException;
+
+use \RequestInfoBean as RequestInfoBean;
+
+use \DateTime as DateTime;
+use \DateTimeZone as DateTimeZone;
use \ErrorException as ErrorException;
/**
- * eGloo\Logger Class File
+ * eGloo\Utility\Logger Class File
*
- * Contains the class definition for the eGloo\Logger, a final class for
+ * Contains the class definition for the eGloo\Utility\Logger, a final class for
* eGloo framework logging functionality.
*
* Copyright 2011 eGloo, LLC
@@ -33,7 +40,7 @@
*/
/**
- * eGloo\Logger is responsible for handling all system logging for the eGloo web
+ * eGloo\Utility\Logger is responsible for handling all system logging for the eGloo web
* application. It contains static constants for specifying levels of logging
* and the type of notice of any particular logged message. Messages are evaluated
* to determine if their notice level matches the current logging level of the system
@@ -92,14 +99,14 @@
public static function initialize( $level, $format ) {
self::$requestDate = date( 'Y-m-d' );
- $num = mt_rand ( 0, 0xffffff );
- self::$requestID = sprintf ( "%06x", $num );
+ $num = mt_rand( 0, 0xffffff );
+ self::$requestID = sprintf( "%06x", $num );
self::setLoggingLevel( $level );
self::setLoggingType( $format );
- set_error_handler( array('\eGloo\Logger', 'global_error_handler') );
- set_exception_handler( array('\eGloo\Logger', 'global_exception_handler') );
+ set_error_handler( array('\eGloo\Utility\Logger', 'global_error_handler') );
+ set_exception_handler( array('\eGloo\Utility\Logger', 'global_exception_handler') );
if ( !defined('STDIN') ) {
// TODO fix this so it actually says the actual level
@@ -139,7 +146,7 @@ public static function setLoggingType($type){
self::$logFilePath = self::$htmlFilePath;
$header = '<html><body BGCOLOR="#000000">';
if ( (file_put_contents( self::$logFilePath, $header . "\n", FILE_APPEND ) ) === false ) {
- throw new Logger\Exception( 'Error writing to log' );
+ throw new LoggerException( 'Error writing to log' );
}
}
@@ -163,7 +170,7 @@ public static function setLoggingType($type){
* should be printed along with the given message
* @param $timezone an additional timezone to display in the logs, in case
* developers are not in the same timezone as their servers
- * @throws eGloo\Logger\Exception if there was an error writing to the log file
+ * @throws eGloo\Utility\Logger\Exception if there was an error writing to the log file
* @returns null
*/
public static function writeLog( $level, $message, $logPackage = 'Default', $data = null, $timezone = 'America/New_York', $aggregateApplicationLogs = true ) {
@@ -206,7 +213,7 @@ public static function writeLog( $level, $message, $logPackage = 'Default', $dat
//Default, write to error.log
if( self::$loggingType == self::LOG_LOG){
if ( (file_put_contents( $log_path . '/' . $logPackage . '.log', $message . "\n", FILE_APPEND ) ) === false ) {
- throw new Logger\Exception( 'Error writing to log' );
+ throw new LoggerException( 'Error writing to log' );
}
}
} else {
@@ -295,7 +302,7 @@ public static function global_exception_handler( $exception ) {
// TODO determine how to handle multiple app logging -- branching folders or unique trace hashes
// Should probably be a deployment option
- // Use eGlooHTTPRequest stuff... if it exists
+ // use \eGlooHTTPRequest stuff... if it exists
$not_found = 'Not found in HTTP headers';
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $not_found;
2  PHP/Classes/System/Utilities/eGlooLogger.php
View
@@ -291,7 +291,7 @@ public static function global_exception_handler( $exception ) {
// TODO determine how to handle multiple app logging -- branching folders or unique trace hashes
// Should probably be a deployment option
- // Use eGlooHTTPRequest stuff... if it exists
+ // use \eGlooHTTPRequest stuff... if it exists
$not_found = 'Not found in HTTP headers';
$request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $not_found;
9 PHP/Includes/eGlooCLIAutoload.php
View
@@ -1,7 +1,8 @@
<?php
namespace eGloo;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Utility\Logger as Logger;
use \RecursiveDirectoryIterator as RecursiveDirectoryIterator;
use \RecursiveIteratorIterator as RecursiveIteratorIterator;
@@ -40,9 +41,9 @@
// Load the install configuration
Configuration::loadCLIConfigurationOptions();
-// Bring up the eGloo\Logger
-if ( !class_exists( '\eGloo\Logger', false ) ) {
- include( 'PHP/Classes/System/Utilities/eGloo.Logger.php' );
+// Bring up the eGloo\Utility\Logger
+if ( !class_exists( '\eGloo\Utility\Logger', false ) ) {
+ include( 'PHP/Classes/System/Utilities/eGloo.Utility.Logger.php' );
}
global $egloo_script_arguments;
6 PHP/Includes/eGlooPHPUnitAutoload.php
View
@@ -1,7 +1,7 @@
<?php
namespace eGloo;
-use eGloo\Performance\Caching\Gateway as CacheGateway;
+use \eGloo\Performance\Caching\Gateway as CacheGateway;
use \RecursiveDirectoryIterator as RecursiveDirectoryIterator;
use \RecursiveIteratorIterator as RecursiveIteratorIterator;
@@ -41,8 +41,8 @@
Configuration::loadCLIConfigurationOptions( true );
// Bring up the Logger
-if ( !class_exists( '\eGloo\Logger', false ) ) {
- include( 'PHP/Classes/System/Utilities/eGloo.Logger.php' );
+if ( !class_exists( '\eGloo\Utility\Logger', false ) ) {
+ include( 'PHP/Classes/System/Utilities/eGloo.Utility.Logger.php' );
}
// Initialize the Logger
2  Scripts/egloo
View
@@ -2,7 +2,7 @@
<?php
namespace eGloo;
-use eGloo\Combine\Help as Help;
+use \eGloo\Combine\Help as Help;
/**
* eGloo Framework Control Script

No commit comments for this range

Something went wrong with that request. Please try again.