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 77 78 79 80 81 82 83 84 85 86
<?php
/*
* The MIT License
*
* @author Brian Dayhoff <mopsyd@me.com>
* @copyright (c) 2017, Brian Dayhoff <mopsyd@me.com> all rights reserved.
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
*
* 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.
*/
namespace \oroboros\core\abstracts\bootstrap;
/**
* <AbstractBootstrap Class>
* This class provides a generic implementation of the bootstrap process,
* with no modification or opinion whatsoever.
*
* This class must be told to initialize, and then to execute.
* It DOES NOT assume control automatically.
*
* @execution Default Execution Plan (minimal)
* //this represents generic usage in a bootload routine
* $bootstrap = new \path\to\your\class\with\this\trait\YourBootstrapClass();
* $bootstrap->initialize();
* try {
* $bootstrap->execute();
* }
* catch (\oroboros\core\interfaces\contract\bootstrap\BootstrapExceptionContract $e) {
* $bootstrap->error($e);
* }
* $bootstrap->shutdown();
* exit();
*
* @author Brian Dayhoff <mopsyd@me.com>
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
* @link https://oroborosframework.bitbucket.io/core/ Oroboros Api Documentation
* @category abstracts
* @package oroboros/core
* @subpackage bootstrap
* @provides \oroboros\core\interfaces\contracts\bootstrap\BootstrapContract
* @provides \oroboros\core\interfaces\contracts\utilities\UtilityContract
* @provides \oroboros\core\interfaces\contracts\BaseContract
* @provides \oroboros\core\interfaces\api\EnvironmentApi
* @version 0.2.4-alpha
* @since 0.2.4-alpha
*/
abstract class AbstractBootstrap
//This is the method contract this class honors
implements \oroboros\core\interfaces\contract\bootstrap\BootstrapContract,
//This provides us some insight into the current runtime environment,
//so we know which routes to tell the router to honor
\oroboros\core\interfaces\api\EnvironmentApi
{
//This trait provides all of the functionality
//required to honor the contract interface.
use \oroboros\core\traits\bootstrap\BootstrapTrait;
//Declare the class type
const CLASS_TYPE = \oroboros\core\interfaces\api\ClassTypeApi::CLASS_TYPE_BOOTSTRAP;
//Declare the class scope
const CLASS_SCOPE = \oroboros\core\interfaces\api\ClassScopeApi::CLASS_SCOPE_ABSTRACT_BOOTSTRAP;
//Declare the Api Interface
const API = '\\oroboros\\core\\interfaces\\api\\bootstrap\\BootstrapApi';
}