1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
<?php
namespace oroboros;
/*
* The MIT License
*
* Copyright 2016 Brian Dayhoff <brian@mopsyd.me>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* <Oroboros Core Global Accessor>
* ------------------------
* @todo port all of this over to it's corresponding CoreTrait
*
* This class exposes the Oroboros API to other classes,
* executing calls to the core system. All other functionality
* is deferred to other classes in keeping with the
* Single Responsibility Principle.
*/
final class Oroboros
implements
//Implement the core contract
\oroboros\core\interfaces\contract\CoreContract,
//Implement the core api
\oroboros\core\interfaces\api\CoreApi,
//Implement the error codes
\oroboros\core\interfaces\api\ExceptionCodeApi,
//Expose the environmental constants publicly
\oroboros\core\interfaces\api\EnvironmentApi,
//Comply with Psr-3
\Psr\Log\LoggerAwareInterface
{
//Include the core logic
use \oroboros\core\traits\CoreTrait;
const CLASS_TYPE = \oroboros\core\interfaces\api\ClassTypeApi::CLASS_TYPE_CORE;
const CLASS_SCOPE = \oroboros\core\interfaces\api\ClassScopeApi::CLASS_SCOPE_CORE_GLOBAL;
const API = '\\oroboros\\core\\interfaces\\api\\CoreApi';
/**
* @todo Port all of these out to an enum interface
*/
const LOGGER_DEFAULT = "\\oroboros\\core\\libraries\\logger\\NullLogger";
const LOGGER_FILE = "\\oroboros\\core\\libraries\\logger\\FileLogger";
const LOGGER_DATABASE = "\\oroboros\\core\\libraries\\logger\\DatabaseLogger";
const LOGGER_NULL = "\\oroboros\\core\\libraries\\logger\\NullLogger";
const LOGGER_SCREEN = "\\oroboros\\core\\libraries\\logger\\ScreenLogger";
const LOGGER_CLI = "\\oroboros\\core\\libraries\\logger\\CliLogger";
const LOGGER_CSS = "\\oroboros\\core\\libraries\\logger\\CssLogger";
const LOGGER_JS = "\\oroboros\\core\\libraries\\logger\\JsLogger";
const LOGGER_AJAX = "\\oroboros\\core\\libraries\\logger\\AjaxLogger";
const LOGGER_DEFAULT_FILE = 'errors.log';
const SETTINGS_DEFAULT = '/conf/settings_default.json';
const SETTINGS_OVERRIDE = '/conf/settings.json';
}