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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
<?php
namespace oroboros\core\interfaces\api;
/*
* 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 Flag Api>
* Defines the base level system flags, and the
* standard methods for interacting with flags.
* @author Brian Dayhoff <brian@mopsyd.me>
*/
interface FlagApi extends \oroboros\OroborosInterface {
/**
* Designates that the runtime process is a test,
* and only relevant resources should be loaded.
*/
const FLAG_UNIT_TEST = '::unit_test::';
/**
* Designates that additional debugging
* information should be shown and/or collected.
*/
const FLAG_DEBUG = '::debug::';
/**
* Designates that destructive processes should be emulated.
*/
const FLAG_SANDBOX = '::sandbox::';
/**
* Production server, all errors and
* server details should be opaque to the client.
* Typically, this designates the following behavior:
* @note Errors are not displayed on screen.
* @note Alpha features are disabled.
* @note Beta features may be disabled, depending on app settings.
* @note Errors with level ALERT or EMERGENCY alert the maintainer immediately.
*/
const FLAG_PRODUCTION = '::production::';
/**
* Development server, additional statistics
* and information displayed about performance
* and errors is ok.
*/
const FLAG_DEVELOPMENT = '::development::';
/**
* Designates that the application is in recovery,
* and only whitelisted users should have access whatsoever.
* Also that static resources should be used to bootstrap
* the application instead of the standard data sources.
* This flag typically gets tripped when the database is down,
* or some mission critical resource is not responding.
* This allows the whitelisted admins to log in and diagnose
* at least enough information to get the problem corrected
* with minimal downtime, instead of hunting through logs
* for nebulous error messages.
*/
const FLAG_RECOVERY = '::recovery::';
/**
* Designates that the application is in maintenance mode,
* and only authorized users should have access.
*/
const FLAG_MAINTENANCE = '::maintenance::';
/**
* A feature in development,
* may be unsafe in production.
*/
const FLAG_BETA = '::beta::';
/**
* An experimental feature,
* should not be used in production.
*/
const FLAG_ALPHA = '::alpha::';
/**
* Output Mode Flag.
* ajax request. Check the headers for the request data type.
*/
const FLAG_MODE_AJAX = '::mode-ajax::';
/**
* Output Mode Flag.
* command line interface, do not use server variables
* or set headers, output should be plaintext.
*/
const FLAG_MODE_CLI = '::mode-cli::';
/**
* HTTP Response Flag.
* GET HTTP or GET REST API request.
*/
const FLAG_TYPE_GET = '::type-get::';
/**
* HTTP Response Flag.
* POST HTTP or POST REST API request.
*/
const FLAG_TYPE_POST = '::type-post::';
/**
* HTTP Response Flag.
* PUT REST API request.
*/
const FLAG_TYPE_PUT = '::type-put::';
/**
* HTTP Response Flag.
* DELETE REST API request.
*/
const FLAG_TYPE_DELETE = '::type-delete::';
/**
* HTTP Response Flag.
* Respond with options headers.
*/
const FLAG_TYPE_OPTIONS = '::type-options::';
/**
* HTTP Response Flag.
* Respond with only http headers.
*/
const FLAG_TYPE_HEAD = '::type-head::';
/**
* Designates that an object is read-only, and may only
* provide already defined data to other sources.
*/
const FLAG_READONLY = '::read-only::';
/**
* Designates that an object should not be writeable,
* but may be readable or executeable.
*/
const FLAG_LOCK_WRITE = '::lock-write::';
/**
* Designates that an object should not be readable,
* but may still be writeable or executeable.
*/
const FLAG_LOCK_READ = '::lock-read::';
/**
* Designates that an object should be locked,
* and prevent method execution.
*/
const FLAG_LOCK_EXECUTE = '::lock-execute::';
}