Object
8 years ago
Subject
8 years ago
API.php
8 years ago
Cache.php
8 years ago
Compatibility.php
8 years ago
Config.php
8 years ago
ConfigPress.php
8 years ago
Console.php
8 years ago
Exporter.php
8 years ago
Importer.php
8 years ago
Media.php
8 years ago
Object.php
8 years ago
Request.php
8 years ago
Server.php
8 years ago
Subject.php
8 years ago
Console.php
77 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * ====================================================================== |
| 5 | * LICENSE: This file is subject to the terms and conditions defined in * |
| 6 | * file 'license.txt', which is part of this source code package. * |
| 7 | * ====================================================================== |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * AAM Core Consol Panel |
| 12 | * |
| 13 | * Track and display list of all warnings that has been detected during AAM |
| 14 | * execution. The consol is used only when AAM interface was triggered in Admin side. |
| 15 | * |
| 16 | * @package AAM |
| 17 | * @author Vasyl Martyniuk <vasyl@vasyltech.com> |
| 18 | */ |
| 19 | class AAM_Core_Console { |
| 20 | |
| 21 | /** |
| 22 | * List of Runtime errors related to AAM |
| 23 | * |
| 24 | * @var array |
| 25 | * |
| 26 | * @access private |
| 27 | * @static |
| 28 | */ |
| 29 | private static $_warnings = array(); |
| 30 | |
| 31 | /** |
| 32 | * Add new warning |
| 33 | * |
| 34 | * @param string $message |
| 35 | * |
| 36 | * @return void |
| 37 | * |
| 38 | * @access public |
| 39 | * @static |
| 40 | */ |
| 41 | public static function add($message) { |
| 42 | self::$_warnings[] = $message; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Check if there is any warning during execution |
| 47 | * |
| 48 | * @return boolean |
| 49 | * |
| 50 | * @access public |
| 51 | * @static |
| 52 | */ |
| 53 | public static function hasIssues() { |
| 54 | return (count(self::$_warnings) ? true : false); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Get list of all warnings |
| 59 | * |
| 60 | * @return array |
| 61 | * |
| 62 | * @access public |
| 63 | * @static |
| 64 | */ |
| 65 | public static function getWarnings() { |
| 66 | return self::$_warnings; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * |
| 71 | * @return type |
| 72 | */ |
| 73 | public static function count() { |
| 74 | return count(self::$_warnings); |
| 75 | } |
| 76 | |
| 77 | } |