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.

71 lines
1.1 KiB

6 years ago
<?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;
/**
* The registration off all objects on this Framework.
*
* @since 0.0.1
*
* @package Phacil\Framework
*/
6 years ago
final class Registry {
/**
* data Objects
* @var array
*/
6 years ago
private $data = array();
/**
* Original route for childs
* @var string
*/
public $routeOrig;
/**
* @param string $key
* @return mixed
*/
6 years ago
public function get($key) {
return (isset($this->$key) ? $this->$key : $this->engine->checkRegistry($key));
6 years ago
}
/**
* @param string $key
* @param string $value
* @return void
*/
6 years ago
public function set($key, $value) {
$this->$key = $value;
6 years ago
}
/**
* @param string $key
* @return bool
*/
6 years ago
public function has($key) {
return isset($this->$key);
6 years ago
}
/**
* UnSet
*
* Unsets registry value by key.
*
* @param string $key
* @return void
*/
public function delete(string $key) {
if (isset($this->$key)) {
unset($this->$key);
}
}
6 years ago
}