Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
3b8e099491 | |||
e7dc2186a8 | |||
3152d180c0 | |||
42ade08306 | |||
464201cf17 | |||
983f6ed624 | |||
8cd7a6ebbc |
109
Bin/Bedrock.php
109
Bin/Bedrock.php
@ -32,6 +32,7 @@ class Bedrock {
|
|||||||
protected $controllerObject = null;
|
protected $controllerObject = null;
|
||||||
protected $controllerClass = '';
|
protected $controllerClass = '';
|
||||||
protected $params = [];
|
protected $params = [];
|
||||||
|
protected $controllerError = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The constructor handles the entire process of parsing the url,
|
* The constructor handles the entire process of parsing the url,
|
||||||
@ -64,55 +65,6 @@ class Bedrock {
|
|||||||
$this->setVarsFromUrlArray( $urlArray );
|
$this->setVarsFromUrlArray( $urlArray );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function load() {
|
|
||||||
$this->loadController();
|
|
||||||
$this->loadPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getUrl() {
|
|
||||||
return Routes::getAddress() . Input::get( 'url' );
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function loadPage() {
|
|
||||||
if ( !method_exists( $this->controllerClass, self::$methodName ) ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Components::set( 'META_IMAGE', Routes::getAddress() . Config::getValue( 'main/logoLarge' ) );
|
|
||||||
Components::set( 'CURRENT_URL', self::getCurrentUrl() );
|
|
||||||
Components::set( 'SITENAME', Config::getValue( 'main/name' ) );
|
|
||||||
Components::set( 'AUTHOR', '<meta name="author" content="' . Config::getValue( 'main/name' ) . '">' );
|
|
||||||
call_user_func_array( [ $this->controllerObject, self::$methodName ], $this->params );
|
|
||||||
Components::set( 'TITLE', Template::parse( $this->controllerObject::$title ) );
|
|
||||||
Components::set( 'PAGE_DESCRIPTION', Template::parse( $this->controllerObject::$pageDescription ) );
|
|
||||||
Template::render();
|
|
||||||
Debug::closeAllGroups();
|
|
||||||
// self::$session->updatePage( self::getUrl() ); // where did this method go?
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function loadController() {
|
|
||||||
if ( empty( $this->controllerClass ) ) {
|
|
||||||
$this->controllerClass = (string) APP_SPACE . '\\Controllers\\' . self::$controllerName;
|
|
||||||
}
|
|
||||||
$this->controllerObject = new $this->controllerClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function setController( $name, $namespace ) {
|
|
||||||
$controllerClass = $namespace . ucfirst( $name );
|
|
||||||
if ( Autoloader::testLoad( $controllerClass ) ) {
|
|
||||||
$this->controllerClass = $controllerClass;
|
|
||||||
self::$controllerName = $name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function setPage( $name ) {
|
|
||||||
$name = strtolower( $name );
|
|
||||||
if ( !method_exists( $this->controllerClass, $name ) ) {
|
|
||||||
Debug::info( 'setPage - Method not found: ' . $name );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
self::$methodName = $name;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function setVarsFromUrlArray( $urlArray ) {
|
protected function setVarsFromUrlArray( $urlArray ) {
|
||||||
if ( !empty( $urlArray[0] ) ) {
|
if ( !empty( $urlArray[0] ) ) {
|
||||||
$urlPart = array_shift( $urlArray );
|
$urlPart = array_shift( $urlArray );
|
||||||
@ -154,6 +106,65 @@ class Bedrock {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function load() {
|
||||||
|
$this->loadController();
|
||||||
|
$this->loadPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getUrl() {
|
||||||
|
return Routes::getAddress() . Input::get( 'url' );
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function loadPage() {
|
||||||
|
if ( !method_exists( $this->controllerClass, self::$methodName ) ) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Components::set( 'META_IMAGE', Routes::getAddress() . Config::getValue( 'main/logoLarge' ) );
|
||||||
|
Components::set( 'CURRENT_URL', self::getCurrentUrl() );
|
||||||
|
Components::set( 'SITENAME', Config::getValue( 'main/name' ) ?? APP_NAME );
|
||||||
|
Components::set( 'AUTHOR', '<meta name="author" content="' . Config::getValue( 'main/name' ) . '">' );
|
||||||
|
call_user_func_array( [ $this->controllerObject, self::$methodName ], $this->params );
|
||||||
|
Components::set( 'TITLE', Template::parse( $this->controllerObject::$title ) );
|
||||||
|
Components::set( 'PAGE_DESCRIPTION', Template::parse( $this->controllerObject::$pageDescription ) );
|
||||||
|
Template::render();
|
||||||
|
Debug::closeAllGroups();
|
||||||
|
// self::$session->updatePage( self::getUrl() ); // where did this method go?
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function loadController() {
|
||||||
|
if ( empty( $this->controllerClass ) ) {
|
||||||
|
$this->controllerClass = (string) APP_SPACE . '\\Controllers\\' . self::$controllerName;
|
||||||
|
}
|
||||||
|
if ( empty( $this->controllerError ) ) {
|
||||||
|
Components::set( 'TOKEN', Token::generate() );
|
||||||
|
}
|
||||||
|
$this->controllerObject = new $this->controllerClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setController( $name, $namespace ) {
|
||||||
|
$controllerClass = $namespace . ucfirst( $name );
|
||||||
|
if ( Autoloader::testLoad( $controllerClass ) ) {
|
||||||
|
$this->controllerClass = $controllerClass;
|
||||||
|
self::$controllerName = $name;
|
||||||
|
} else {
|
||||||
|
$this->controllerError = 'setController - Controller not found. Name: ' . $name . ' Namespace: ' . $namespace;
|
||||||
|
Debug::info( $this->controllerError );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setPage( $name ) {
|
||||||
|
$name = strtolower( $name );
|
||||||
|
if ( empty( $this->controllerClass ) ) {
|
||||||
|
Debug::info( 'setPage - controllerClass Empty' );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ( ! method_exists( $this->controllerClass, $name ) ) {
|
||||||
|
Debug::info( 'setPage - Method not found. Controller: ' . $this->controllerClass . ' Method: ' . $name );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
self::$methodName = $name;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getCurrentUrl() {
|
public static function getCurrentUrl() {
|
||||||
return Sanitize::url( Input::get( 'url' ) );
|
return Sanitize::url( Input::get( 'url' ) );
|
||||||
}
|
}
|
||||||
|
@ -17,36 +17,29 @@ if ( ! defined('BEDROCK_ROOT_DIRECTORY' ) ) {
|
|||||||
define('BEDROCK_ROOT_DIRECTORY', dirname(__DIR__) . DIRECTORY_SEPARATOR);
|
define('BEDROCK_ROOT_DIRECTORY', dirname(__DIR__) . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
if ( ! defined('BEDROCK_CONFIG_DIRECTORY' ) ) {
|
if ( ! defined('BEDROCK_CONFIG_DIRECTORY' ) ) {
|
||||||
define('BEDROCK_CONFIG_DIRECTORY', BEDROCK_ROOT_DIRECTORY . 'config' . DIRECTORY_SEPARATOR);
|
define('BEDROCK_CONFIG_DIRECTORY', BEDROCK_ROOT_DIRECTORY . 'Config' . DIRECTORY_SEPARATOR);
|
||||||
}
|
}
|
||||||
if ( ! defined('BEDROCK_CONSTANTS_LOADED' ) ) {
|
if ( ! defined('BEDROCK_CONSTANTS_LOADED' ) ) {
|
||||||
require_once BEDROCK_CONFIG_DIRECTORY . 'constants.php';
|
require_once BEDROCK_CONFIG_DIRECTORY . 'constants.php';
|
||||||
}
|
}
|
||||||
if ( ! class_exists( 'TheTempusProject\Bedrock\Classes\Autoloader' ) ) {
|
if ( class_exists( 'TheTempusProject\Hermes\Classes\Autoloader' ) ) {
|
||||||
if ( file_exists( BEDROCK_CLASSES_DIRECTORY . 'autoloader.php' ) ) {
|
|
||||||
require_once BEDROCK_CLASSES_DIRECTORY . 'autoloader.php';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( ! class_exists( 'TheTempusProject\Bedrock\App' ) ) {
|
|
||||||
if ( file_exists( BEDROCK_ROOT_DIRECTORY . 'app.php' ) ) {
|
|
||||||
require_once BEDROCK_ROOT_DIRECTORY . 'app.php';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$autoloader = new Autoloader;
|
$autoloader = new Autoloader;
|
||||||
$autoloader->setRootFolder( BEDROCK_ROOT_DIRECTORY );
|
$autoloader->setRootFolder( BEDROCK_ROOT_DIRECTORY );
|
||||||
$autoloader->addNamespace(
|
$autoloader->addNamespace(
|
||||||
'TheTempusProject\Bedrock',
|
'TheTempusProject\Bedrock',
|
||||||
'bin'
|
'Bin'
|
||||||
);
|
);
|
||||||
$autoloader->addNamespace(
|
$autoloader->addNamespace(
|
||||||
'TheTempusProject\Bedrock\Classes',
|
'TheTempusProject\Bedrock\Classes',
|
||||||
'classes'
|
'Classes'
|
||||||
);
|
);
|
||||||
$autoloader->addNamespace(
|
$autoloader->addNamespace(
|
||||||
'TheTempusProject\Bedrock\Functions',
|
'TheTempusProject\Bedrock\Functions',
|
||||||
'functions'
|
'Functions'
|
||||||
);
|
);
|
||||||
$autoloader->register();
|
$autoloader->register();
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once 'Bedrock.php';
|
||||||
|
|
||||||
define( 'BEDROCK_AUTOLOADED', true );
|
define( 'BEDROCK_AUTOLOADED', true );
|
||||||
|
@ -14,6 +14,7 @@ namespace TheTempusProject\Bedrock\Classes;
|
|||||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||||
use TheTempusProject\Bedrock\Functions\Check;
|
use TheTempusProject\Bedrock\Functions\Check;
|
||||||
use TheTempusProject\Bedrock\Functions\Input;
|
use TheTempusProject\Bedrock\Functions\Input;
|
||||||
|
use TheTempusProject\Bedrock\Functions\Upload;
|
||||||
|
|
||||||
class Config {
|
class Config {
|
||||||
public static $config = false;
|
public static $config = false;
|
||||||
@ -145,8 +146,20 @@ class Config {
|
|||||||
}
|
}
|
||||||
$fieldname = str_ireplace( '/', '-', $name );
|
$fieldname = str_ireplace( '/', '-', $name );
|
||||||
if ( Input::exists( $fieldname ) ) {
|
if ( Input::exists( $fieldname ) ) {
|
||||||
|
if ( 'file' == $node['type'] ) {
|
||||||
|
$upload = Upload::image( $fieldname, IMAGE_DIRECTORY );
|
||||||
|
if ( $upload ) {
|
||||||
|
$route = str_replace( APP_ROOT_DIRECTORY, '', IMAGE_DIRECTORY );
|
||||||
|
$this->update( $category, $field, $route . Upload::last() );
|
||||||
|
} else {
|
||||||
|
Debug::error( 'There was an error with your upload.');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$this->update( $category, $field, Input::post( $fieldname ) );
|
$this->update( $category, $field, Input::post( $fieldname ) );
|
||||||
}
|
}
|
||||||
|
} elseif ( 'radio' == $node['type'] ) {
|
||||||
|
$this->update( $category, $field, false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( $save ) {
|
if ( $save ) {
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* classes/custom_exception.php
|
|
||||||
*
|
|
||||||
* This class is used exclusively when throwing predefined exceptions.
|
|
||||||
* It will intercept framework thrown exceptions and deal with them however
|
|
||||||
* you choose; in most cases by logging them and taking appropriate responses
|
|
||||||
* such as redirecting to error pages.
|
|
||||||
*
|
|
||||||
* @version 3.0
|
|
||||||
* @author Joey Kimsey <Joey@thetempusproject.com>
|
|
||||||
* @link https://TheTempusProject.com/Core
|
|
||||||
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
|
|
||||||
*/
|
|
||||||
namespace TheTempusProject\Bedrock\Classes;
|
|
||||||
|
|
||||||
use Exception;
|
|
||||||
use TheTempusProject\Hermes\Functions\Redirect;
|
|
||||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
|
||||||
|
|
||||||
class CustomException extends Exception {
|
|
||||||
private $originFunction = null;
|
|
||||||
private $exceptionName = null;
|
|
||||||
private $originClass = null;
|
|
||||||
private $data = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This function allows the application to deal with errors
|
|
||||||
* in a dynamic way by letting you customize the response
|
|
||||||
*
|
|
||||||
* @param string $type - The type of the exception being called/thrown.
|
|
||||||
* @param string $data - Any additional data being passed with the exception.
|
|
||||||
*
|
|
||||||
* @example - throw new CustomException('model'); - Calls the model-missing exception
|
|
||||||
*/
|
|
||||||
public function __construct( $type, $data = null ) {
|
|
||||||
$this->originFunction = debug_backtrace()[1]['function'];
|
|
||||||
$this->originClass = debug_backtrace()[1]['class'];
|
|
||||||
$this->exceptionName = $type;
|
|
||||||
$this->data = $data;
|
|
||||||
switch ( $type ) {
|
|
||||||
case 'model':
|
|
||||||
Debug::error( 'Model not found: ' . $data );
|
|
||||||
break;
|
|
||||||
case 'dbConnection':
|
|
||||||
Debug::error( 'Error Connecting to the database: ' . $data );
|
|
||||||
break;
|
|
||||||
case 'DB':
|
|
||||||
Debug::error( 'Unspecified database error: ' . $data );
|
|
||||||
break;
|
|
||||||
case 'view':
|
|
||||||
Debug::error( 'View not found: ' . $data );
|
|
||||||
break;
|
|
||||||
case 'controller':
|
|
||||||
Debug::error( 'Controller not found: ' . $data );
|
|
||||||
Redirect::to( 404 );
|
|
||||||
break;
|
|
||||||
case 'defaultController':
|
|
||||||
Debug::error( 'DEFAULT Controller not found: ' . $data );
|
|
||||||
Redirect::to( 404 );
|
|
||||||
break;
|
|
||||||
case 'method':
|
|
||||||
Debug::error( 'Method not found: ' . $data );
|
|
||||||
Redirect::to( 404 );
|
|
||||||
break;
|
|
||||||
case 'simpleView':
|
|
||||||
Debug::error( 'View not found: ' . $data );
|
|
||||||
break;
|
|
||||||
case 'defaultMethod':
|
|
||||||
Debug::error( 'DEFAULT Method not found: ' . $data );
|
|
||||||
Redirect::to( 404 );
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Debug::error( 'Default exception: ' . $data );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -16,6 +16,7 @@ namespace TheTempusProject\Bedrock\Classes;
|
|||||||
use PDO;
|
use PDO;
|
||||||
use PDOException;
|
use PDOException;
|
||||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||||
|
use TheTempusProject\Canary\Classes\CustomException;
|
||||||
|
|
||||||
class Database {
|
class Database {
|
||||||
public static $instance = null;
|
public static $instance = null;
|
||||||
@ -273,7 +274,7 @@ class Database {
|
|||||||
foreach ( $params as $param ) {
|
foreach ( $params as $param ) {
|
||||||
$x++;
|
$x++;
|
||||||
if ( is_array( $param ) ) {
|
if ( is_array( $param ) ) {
|
||||||
dv( $param );
|
// dv( $param );
|
||||||
}
|
}
|
||||||
$this->query->bindValue( $x, $param );
|
$this->query->bindValue( $x, $param );
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ use TheTempusProject\Bedrock\Classes\Config;
|
|||||||
use TheTempusProject\Bedrock\Functions\Check;
|
use TheTempusProject\Bedrock\Functions\Check;
|
||||||
use TheTempusProject\Canary\Bin\Canary as Debug;
|
use TheTempusProject\Canary\Bin\Canary as Debug;
|
||||||
use TheTempusProject\Houdini\Classes\Components;
|
use TheTempusProject\Houdini\Classes\Components;
|
||||||
|
use TheTempusProject\Houdini\Classes\Views;
|
||||||
|
|
||||||
class Pagination extends Template {
|
class Pagination extends Template {
|
||||||
//The settings that will not change
|
//The settings that will not change
|
||||||
@ -155,7 +156,7 @@ class Pagination extends Template {
|
|||||||
$pageData = (object) $pageData;
|
$pageData = (object) $pageData;
|
||||||
|
|
||||||
if ( self::totalPages() <= 1 ) {
|
if ( self::totalPages() <= 1 ) {
|
||||||
Components::set( 'PAGINATION', 'no pagination' );
|
Components::set( 'PAGINATION', '' );
|
||||||
} else {
|
} else {
|
||||||
Components::set( 'PAGINATION', Views::simpleView( 'nav.pagination', $pageData ) );
|
Components::set( 'PAGINATION', Views::simpleView( 'nav.pagination', $pageData ) );
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,10 @@
|
|||||||
if (!defined('TOKEN_ENABLED')) {
|
if (!defined('TOKEN_ENABLED')) {
|
||||||
define('TOKEN_ENABLED', true);
|
define('TOKEN_ENABLED', true);
|
||||||
}
|
}
|
||||||
|
// dUH
|
||||||
|
if (!defined('APP_NAME')) {
|
||||||
|
define('APP_NAME', 'Bedrock Application');
|
||||||
|
}
|
||||||
# Tell the app all constants have been loaded.
|
# Tell the app all constants have been loaded.
|
||||||
if ( ! defined('BEDROCK_CONSTANTS_LOADED' ) ) {
|
if ( ! defined('BEDROCK_CONSTANTS_LOADED' ) ) {
|
||||||
define( 'BEDROCK_CONSTANTS_LOADED', true );
|
define( 'BEDROCK_CONSTANTS_LOADED', true );
|
||||||
|
@ -100,24 +100,24 @@ class Check {
|
|||||||
*/
|
*/
|
||||||
public static function imageUpload( $imageName ) {
|
public static function imageUpload( $imageName ) {
|
||||||
if ( !Config::getValue( 'uploads/images' ) ) {
|
if ( !Config::getValue( 'uploads/images' ) ) {
|
||||||
self::addError( 'Image uploads are disabled.' );
|
self::addUserError( 'Image uploads are disabled.' );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( !isset( $_FILES[$imageName] ) ) {
|
if ( !isset( $_FILES[$imageName] ) ) {
|
||||||
self::addError( 'File not found.', $imageName );
|
self::addUserError( 'File not found.', $imageName );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( $_FILES[$imageName]['error'] != 0 ) {
|
if ( $_FILES[$imageName]['error'] != 0 ) {
|
||||||
self::addError( 'File error:' . $_FILES[$imageName]['error'] );
|
self::addUserError( 'File error:' . $_FILES[$imageName]['error'] );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( $_FILES[$imageName]['size'] > Config::getValue( 'uploads/maxImageSize' ) ) {
|
if ( $_FILES[$imageName]['size'] > Config::getValue( 'uploads/maxImageSize' ) ) {
|
||||||
self::addError( 'Image is too large.' );
|
self::addUserError( 'Image is too large.' );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$fileType = strrchr( $_FILES[$imageName]['name'], '.' );
|
$fileType = strrchr( $_FILES[$imageName]['name'], '.' );
|
||||||
if ( !( in_array( $fileType, ALLOWED_IMAGE_UPLOAD_EXTENTIONS ) ) ) {
|
if ( !( in_array( $fileType, ALLOWED_IMAGE_UPLOAD_EXTENTIONS ) ) ) {
|
||||||
self::addError( 'Invalid image type', $fileType );
|
self::addUserError( 'Invalid image type', $fileType );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -29,7 +29,7 @@ class Input {
|
|||||||
} elseif ( self::file( $data ) ) {
|
} elseif ( self::file( $data ) ) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Debug::info( 'Input::exists: No input Found: '. $data );
|
Debug::log( 'Input::exists: No input Found: '. $data );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,11 +43,11 @@ class Input {
|
|||||||
*/
|
*/
|
||||||
public static function file( $data ) {
|
public static function file( $data ) {
|
||||||
if ( !isset( $_FILES[$data] ) ) {
|
if ( !isset( $_FILES[$data] ) ) {
|
||||||
Debug::debug( "Input - file : $data not found." );
|
Debug::log( "Input - file : $data not found." );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( $_FILES[$data]['tmp_name'] == '' ) {
|
if ( $_FILES[$data]['tmp_name'] == '' ) {
|
||||||
Debug::debug( "Input - file : $data empty." );
|
Debug::log( "Input - file : $data empty." );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $_FILES[$data];
|
return $_FILES[$data];
|
||||||
|
@ -31,7 +31,7 @@ class Session {
|
|||||||
if ( isset( $_SESSION[ $sessionName ] ) ) {
|
if ( isset( $_SESSION[ $sessionName ] ) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Debug::info( "Session::exists - Session not found: $sessionName" );
|
Debug::log( "Session::exists - Session not found: $sessionName" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class Session {
|
|||||||
if ( self::exists( $name ) ) {
|
if ( self::exists( $name ) ) {
|
||||||
return $_SESSION[ $sessionName ];
|
return $_SESSION[ $sessionName ];
|
||||||
}
|
}
|
||||||
Debug::info( "Session::get - Session not found: $sessionName" );
|
Debug::log( "Session::get - Session not found: $sessionName" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ class Session {
|
|||||||
}
|
}
|
||||||
$sessionName = DEFAULT_SESSION_PREFIX . $name;
|
$sessionName = DEFAULT_SESSION_PREFIX . $name;
|
||||||
$_SESSION[ $sessionName ] = $data;
|
$_SESSION[ $sessionName ] = $data;
|
||||||
Debug::info( "Session::get - Created/Updated: $sessionName" );
|
Debug::log( "Session::get - Created/Updated: $sessionName" );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ class Session {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( self::exists( $name ) ) {
|
if ( self::exists( $name ) ) {
|
||||||
Debug::info("Session::flash - Exists");
|
Debug::log("Session::flash - Exists");
|
||||||
$session = self::get( $name );
|
$session = self::get( $name );
|
||||||
self::delete( $name );
|
self::delete( $name );
|
||||||
return $session;
|
return $session;
|
||||||
@ -121,11 +121,11 @@ class Session {
|
|||||||
}
|
}
|
||||||
if ( ! empty( $data ) ) {
|
if ( ! empty( $data ) ) {
|
||||||
self::put( $name, $data );
|
self::put( $name, $data );
|
||||||
Debug::info("Session::flash - Session created.");
|
Debug::log("Session::flash - Session created.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ( self::exists( $name ) ) {
|
if ( self::exists( $name ) ) {
|
||||||
Debug::info("Session::flash - Exists");
|
Debug::log("Session::flash - Exists");
|
||||||
$session = self::get( $name );
|
$session = self::get( $name );
|
||||||
self::delete( $name );
|
self::delete( $name );
|
||||||
return $session;
|
return $session;
|
||||||
|
@ -22,9 +22,9 @@
|
|||||||
"require":
|
"require":
|
||||||
{
|
{
|
||||||
"php": ">=8.1.0",
|
"php": ">=8.1.0",
|
||||||
"thetempusproject/canary": ">=1.0",
|
"thetempusproject/canary": "1.0.6",
|
||||||
"thetempusproject/hermes": ">=1.0",
|
"thetempusproject/hermes": "1.0.3",
|
||||||
"thetempusproject/houdini": ">=1.0"
|
"thetempusproject/houdini": "2.0.1"
|
||||||
},
|
},
|
||||||
"autoload":
|
"autoload":
|
||||||
{
|
{
|
||||||
|
29
composer.lock
generated
29
composer.lock
generated
@ -4,20 +4,19 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "4467bdc4b2a87dc7540fc9854ebd9384",
|
"content-hash": "97195cc6dbe0b460b98f4757ecf1adc1",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "thetempusproject/canary",
|
"name": "thetempusproject/canary",
|
||||||
"version": "dev-main",
|
"version": "1.0.6",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.thetempusproject.com/the-tempus-project/canary",
|
"url": "https://git.thetempusproject.com/the-tempus-project/canary",
|
||||||
"reference": "7ce988fbd95c0d9b975e7647f2e4d7ee3d5e3aad"
|
"reference": "44b2ad688cff933964ec2ff50b408d94c7f51e40"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1.0"
|
"php": ">=8.1.0"
|
||||||
},
|
},
|
||||||
"default-branch": true,
|
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
"files": [
|
||||||
@ -48,20 +47,19 @@
|
|||||||
"thetempusproject",
|
"thetempusproject",
|
||||||
"tools"
|
"tools"
|
||||||
],
|
],
|
||||||
"time": "2024-08-10T18:58:57+00:00"
|
"time": "2025-01-22T01:39:34+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "thetempusproject/hermes",
|
"name": "thetempusproject/hermes",
|
||||||
"version": "dev-main",
|
"version": "1.0.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.thetempusproject.com/the-tempus-project/hermes",
|
"url": "https://git.thetempusproject.com/the-tempus-project/hermes",
|
||||||
"reference": "171183c0abdbbdf12b3b577821636dd1c51ec752"
|
"reference": "4b4e06a98f0f01695bda18de240bb3294d096ef4"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1.0"
|
"php": ">=8.1.0"
|
||||||
},
|
},
|
||||||
"default-branch": true,
|
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
"files": [
|
||||||
@ -92,22 +90,21 @@
|
|||||||
"thetempusproject",
|
"thetempusproject",
|
||||||
"tools"
|
"tools"
|
||||||
],
|
],
|
||||||
"time": "2024-08-13T02:56:27+00:00"
|
"time": "2025-01-22T01:43:15+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "thetempusproject/houdini",
|
"name": "thetempusproject/houdini",
|
||||||
"version": "dev-main",
|
"version": "2.0.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.thetempusproject.com/the-tempus-project/houdini",
|
"url": "https://git.thetempusproject.com/the-tempus-project/houdini",
|
||||||
"reference": "4d2ccfb1c5f18dba9886405e7e6e2264e04e1f89"
|
"reference": "b03fc3b7ddcdd0213f8f927a9bf1c0c68c62138f"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1.0",
|
"php": ">=8.1.0",
|
||||||
"thetempusproject/canary": ">=1.0",
|
"thetempusproject/canary": "1.0.6",
|
||||||
"thetempusproject/hermes": ">=1.0"
|
"thetempusproject/hermes": "1.0.3"
|
||||||
},
|
},
|
||||||
"default-branch": true,
|
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
"files": [
|
||||||
@ -137,7 +134,7 @@
|
|||||||
"thetempusproject",
|
"thetempusproject",
|
||||||
"tools"
|
"tools"
|
||||||
],
|
],
|
||||||
"time": "2024-08-13T03:43:46+00:00"
|
"time": "2025-01-22T01:59:01+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
@ -150,5 +147,5 @@
|
|||||||
"php": ">=8.1.0"
|
"php": ">=8.1.0"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.3.0"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user