/home/milim/milim_apps_prod/library_app/vendor/limindustries/life/src/application/Response.php
Events::getInstance()->dispatch(new ResponseCompletedEvent(), ResponseCompletedEvent::NAME);
// if (getenv('APP_DEBUG')) {
// // $debugBar = new DebugBar($this);
// }
}
/**
* Checks if the Action method exists in the controller.
* If no match can be found the Apllication is re-routed
* to the Error page.
*
* @throws NotFoundException
*/
private function validate()
{
// Set controller and action vars.
$className = $this->request['namespace'] . ucfirst($this->request['controller']) . "Controller";
$actionName = $this->request['action'] . "Action";
$controller = New $className();
// Check if action exists.
if (!method_exists($controller, $actionName)) {
throw new NotFoundException("Controller method '$actionName' does not exist.", 404);
}
// Unset old vars.
unset($controller);
}
public function getView() {
return $this->view;
}
public function render()
{
return $this->getView()->render();
}
public function messages()
Arguments
"Class 'App\Controllers\MilimDataController' not found"
/home/milim/milim_apps_prod/library_app/vendor/limindustries/life/src/application/Response.php
$this->preDispatch();
// Set controller and action vars
$className = $this->request['namespace'] . ucfirst($this->request['controller']) . "Controller";
$actionName = $this->request['action'] . "Action";
$controller = New $className();
$this->view = $controller->$actionName();
$this->postDispatch();
}
/**
* Enter description here ...
*
* @since 1.2
*/
function preDispatch() {
$this->request = Request::getInstance()->getRequest();
$this->validate();
}
/**
* Enter description here ...
*
* @since 1.2
*/
function postDispatch() {
Events::getInstance()->dispatch(new ResponseCompletedEvent(), ResponseCompletedEvent::NAME);
// if (getenv('APP_DEBUG')) {
// // $debugBar = new DebugBar($this);
// }
}
/**
* Checks if the Action method exists in the controller.
* If no match can be found the Apllication is re-routed
* to the Error page.
*
/home/milim/milim_apps_prod/library_app/vendor/limindustries/life/src/application/Response.php
{
return static::$instance = $instance;
}
/**
* Get the globally available instance of the container.
*
* @return static
*/
public static function getInstance()
{
if (is_null(static::$instance)) {
static::$instance = new static;
}
return static::$instance;
}
public function dispatch() {
$this->preDispatch();
// Set controller and action vars
$className = $this->request['namespace'] . ucfirst($this->request['controller']) . "Controller";
$actionName = $this->request['action'] . "Action";
$controller = New $className();
$this->view = $controller->$actionName();
$this->postDispatch();
}
/**
* Enter description here ...
*
* @since 1.2
*/
function preDispatch() {
$this->request = Request::getInstance()->getRequest();
$this->validate();
}
/home/milim/milim_apps_prod/library_app/vendor/limindustries/life/src/event/events/RequestRecordedSubscriber.php
{
public static function getSubscribedEvents()
{
return [
RequestRecordedEvent::NAME => [
['processRequest'],
['dispatchResponse'],
['appStatus'],
],
];
}
public function processRequest(RequestRecordedEvent $event)
{
ProcessManager::getInstance()->preProcess();
}
public function dispatchResponse(RequestRecordedEvent $event)
{
Response::getInstance()->dispatch();
}
public function appStatus() {
Application::getInstance()->setStatus('ok');
}
}
/home/milim/milim_apps_prod/library_app/vendor/symfony/event-dispatcher/EventDispatcher.php
/**
* Triggers the listeners of an event.
*
* This method can be overridden to add functionality that is executed
* for each listener.
*
* @param callable[] $listeners The event listeners
* @param string $eventName The name of the event to dispatch
* @param object $event The event object to pass to the event handlers/listeners
*/
protected function callListeners(iterable $listeners, string $eventName, object $event)
{
$stoppable = $event instanceof StoppableEventInterface;
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
*/
private function sortListeners(string $eventName)
{
krsort($this->listeners[$eventName]);
$this->sorted[$eventName] = [];
foreach ($this->listeners[$eventName] as &$listeners) {
foreach ($listeners as $k => &$listener) {
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
$listener[0] = $listener[0]();
$listener[1] = $listener[1] ?? '__invoke';
}
$this->sorted[$eventName][] = $listener;
}
}
Arguments
LimIndustries\Life\Event\Events\RequestRecordedEvent {#25}
"request.recorded"
LimIndustries\Life\Event\EventDispatcher {#8
-listeners: array:2 [
"request.recorded" => array:1 [
0 => array:3 [
0 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "processRequest"
]
1 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "dispatchResponse"
]
2 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "appStatus"
]
]
]
"response.completed.event" => array:1 [
0 => array:1 [
0 => array:2 [
0 => LimIndustries\Life\Event\Events\ResponseCompletedSubscriber {#10}
1 => "processResponse"
]
]
]
]
-sorted: array:1 [
"request.recorded" => array:3 [
0 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "processRequest"
]
1 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "dispatchResponse"
]
2 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "appStatus"
]
]
]
-optimized: null
}
/home/milim/milim_apps_prod/library_app/vendor/symfony/event-dispatcher/EventDispatcher.php
if (__CLASS__ === static::class) {
$this->optimized = [];
}
}
/**
* {@inheritdoc}
*/
public function dispatch(object $event, string $eventName = null): object
{
$eventName = $eventName ?? \get_class($event);
if (null !== $this->optimized) {
$listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName));
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
/**
* {@inheritdoc}
*/
public function getListeners(string $eventName = null)
{
if (null !== $eventName) {
if (empty($this->listeners[$eventName])) {
return [];
}
if (!isset($this->sorted[$eventName])) {
$this->sortListeners($eventName);
}
return $this->sorted[$eventName];
Arguments
array:3 [
0 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "processRequest"
]
1 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "dispatchResponse"
]
2 => array:2 [
0 => LimIndustries\Life\Event\Events\RequestRecordedSubscriber {#9}
1 => "appStatus"
]
]
"request.recorded"
LimIndustries\Life\Event\Events\RequestRecordedEvent {#25}
/home/milim/milim_apps_prod/library_app/vendor/limindustries/life/src/event/Events.php
{
return static::$instance = $instance;
}
/**
* Get the globally available instance of the container.
*
* @return static
*/
public static function getInstance()
{
if (is_null(static::$instance)) {
static::$instance = new static;
}
return static::$instance;
}
public function dispatch($event, $name) {
$this->_dispatcher->dispatch($event, $name);
}
}
Arguments
LimIndustries\Life\Event\Events\RequestRecordedEvent {#25}
"request.recorded"
/home/milim/milim_apps_prod/library_app/vendor/limindustries/life/src/application/Request.php
if (is_null(static::$instance)) {
static::$instance = new static;
}
return static::$instance;
}
/**
* Reads the request.
*
* @return array
*/
public function record(): array
{
$this->request = $this->route->matchRoute();
$this->addRequest("public_path", public_path(''));
$this->addRequest("resource_path", resource_path(''));
Events::getInstance()->dispatch(new RequestRecordedEvent($this->request), RequestRecordedEvent::NAME);
return $this->request;
}
/**
* Get the request.
* @return array
*/
public function getRequest(): array
{
return $this->request;
}
/**
* Insert a key value pair into the request.
* @param string $newKey
* @param $newValue
* @return void
*/
public function addRequest(string $newKey, $newValue)
Arguments
LimIndustries\Life\Event\Events\RequestRecordedEvent {#25}
"request.recorded"
/home/milim/milim_apps_prod/library_app/vendor/limindustries/life/src/application/Application.php
}
/**
* Set error reporting.
*
* @return void
*/
public function handleErrors() {
$this->errorHandler = new HandleErrors();
}
/**
* Sets up and runs the application.
* And Checks for errors along the way.
*
* @return void
*/
public function handleRequest()
{
Request::getInstance()->record();
}
/**
* Render the response.
*/
public function renderResponse()
{
Response::getInstance()->render();
}
/**
* Render the response.
*/
public function responseMessages()
{
return Response::getInstance()->messages();
}
/**
* Returns the app status.
/home/milim/public_html/library/index.php
ini_set("display_errors", "1");
// Report all PHP errors (see changelog)
error_reporting(E_ALL);
ini_set('error_reporting', E_ALL);
//
define('LIFE_START', microtime(true));
require dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'milim_apps_prod' . DIRECTORY_SEPARATOR . 'library_app' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR .
'autoload.php';;
$public_path = dirname(__FILE__);
define('MILIM_CACHE', dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'milim_apps_prod' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR);
$app = require dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'milim_apps_prod' . DIRECTORY_SEPARATOR . 'library_app' . DIRECTORY_SEPARATOR . 'bootstrap' .
DIRECTORY_SEPARATOR . 'app.php';
$app->handleErrors();
$app->handleRequest();
$app->renderResponse();