A super easy PHP Framework for web development!
https://github.com/exacti/phacil-framework
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.0 KiB
64 lines
1.0 KiB
<?php
|
|
/*
|
|
* Copyright © 2021 ExacTI Technology Solutions. All rights reserved.
|
|
* GPLv3 General License.
|
|
* https://exacti.com.br
|
|
* Phacil PHP Framework - https://github.com/exacti/phacil-framework
|
|
*/
|
|
|
|
namespace Phacil\Framework;
|
|
|
|
/** @package Phacil\Framework */
|
|
final class Registry {
|
|
/**
|
|
* data Objects
|
|
* @var array
|
|
*/
|
|
private $data = array();
|
|
|
|
/**
|
|
* Original route for childs
|
|
* @var string
|
|
*/
|
|
public $routeOrig;
|
|
|
|
/**
|
|
* @param string $key
|
|
* @return mixed
|
|
*/
|
|
public function get($key) {
|
|
|
|
return (isset($this->$key) ? $this->$key : $this->engine->checkRegistry($key));
|
|
}
|
|
|
|
/**
|
|
* @param string $key
|
|
* @param string $value
|
|
* @return void
|
|
*/
|
|
public function set($key, $value) {
|
|
$this->$key = $value;
|
|
}
|
|
|
|
/**
|
|
* @param string $key
|
|
* @return bool
|
|
*/
|
|
public function has($key) {
|
|
return isset($this->$key);
|
|
}
|
|
|
|
/**
|
|
* UnSet
|
|
*
|
|
* Unsets registry value by key.
|
|
*
|
|
* @param string $key
|
|
* @return void
|
|
*/
|
|
public function destroy(string $key) {
|
|
if (isset($this->$key)) {
|
|
unset($this->$key);
|
|
}
|
|
}
|
|
}
|
|
|