Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
e9c3fd84dd | |||
89d30a8d36 | |||
cfa53c9e70 | |||
39d350df06 | |||
3f2bd6869b | |||
1d9c772e73 | |||
1101055a5d | |||
98b2f8086c | |||
20f09e6789 |
@ -17,7 +17,7 @@ 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';
|
||||||
@ -27,19 +27,19 @@ if ( class_exists( 'TheTempusProject\Hermes\Classes\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';
|
require_once 'bedrock.php';
|
||||||
|
|
||||||
define( 'BEDROCK_AUTOLOADED', true );
|
define( 'BEDROCK_AUTOLOADED', true );
|
@ -121,6 +121,7 @@ class Bedrock {
|
|||||||
}
|
}
|
||||||
Components::set( 'META_IMAGE', Routes::getAddress() . Config::getValue( 'main/logoLarge' ) );
|
Components::set( 'META_IMAGE', Routes::getAddress() . Config::getValue( 'main/logoLarge' ) );
|
||||||
Components::set( 'CURRENT_URL', self::getCurrentUrl() );
|
Components::set( 'CURRENT_URL', self::getCurrentUrl() );
|
||||||
|
Components::set( 'CURRENT_URL_SAFE', urlencode( self::getUrl() ) );
|
||||||
Components::set( 'SITENAME', Config::getValue( 'main/name' ) ?? APP_NAME );
|
Components::set( 'SITENAME', Config::getValue( 'main/name' ) ?? APP_NAME );
|
||||||
Components::set( 'AUTHOR', '<meta name="author" content="' . 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 );
|
call_user_func_array( [ $this->controllerObject, self::$methodName ], $this->params );
|
@ -91,14 +91,19 @@ class Database {
|
|||||||
$this->errorMessage = $Exception->getMessage();
|
$this->errorMessage = $Exception->getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !$this->enabled() ) {
|
if ( ! $this->enabled() ) {
|
||||||
$this->error = true;
|
$this->error = true;
|
||||||
$this->errorMessage = 'Database disabled in config.';
|
$this->errorMessage = 'Database disabled in config.';
|
||||||
}
|
}
|
||||||
if ( $this->error === false ) {
|
if ( $this->error === false ) {
|
||||||
try {
|
try {
|
||||||
Debug::debug( 'Attempting to connect to DB with config credentials.' );
|
Debug::debug( 'Attempting to connect to DB with config credentials.' );
|
||||||
$this->pdo = new PDO( 'mysql:host=' . Config::getValue( 'database/dbHost' ) . ';dbname=' . Config::getValue( 'database/dbName' ), Config::getValue( 'database/dbUsername' ), Config::getValue( 'database/dbPassword' ) );
|
$this->pdo = new PDO(
|
||||||
|
'mysql:host=' . Config::getValue( 'database/dbHost' ) .
|
||||||
|
';dbname=' . Config::getValue( 'database/dbName' ),
|
||||||
|
Config::getValue( 'database/dbUsername' ),
|
||||||
|
Config::getValue( 'database/dbPassword' )
|
||||||
|
);
|
||||||
} catch ( PDOException $Exception ) {
|
} catch ( PDOException $Exception ) {
|
||||||
$this->error = true;
|
$this->error = true;
|
||||||
$this->errorMessage = $Exception->getMessage();
|
$this->errorMessage = $Exception->getMessage();
|
||||||
@ -349,7 +354,7 @@ class Database {
|
|||||||
}
|
}
|
||||||
$tableName = Config::getValue( 'database/dbPrefix' ) . $tableName;
|
$tableName = Config::getValue( 'database/dbPrefix' ) . $tableName;
|
||||||
$sql = "{$action} FROM `{$tableName}` WHERE ";
|
$sql = "{$action} FROM `{$tableName}` WHERE ";
|
||||||
$validOperators = ['=', '!=', '>', '<', '>=', '<=', 'LIKE', 'IS'];
|
$validOperators = ['=', '!=', '>', '<', '>=', '<=', 'LIKE', 'IS', 'IN'];
|
||||||
$validDelimiters = ['AND', 'OR'];
|
$validDelimiters = ['AND', 'OR'];
|
||||||
$values = [];
|
$values = [];
|
||||||
while ( $whereCount > 2 ) {
|
while ( $whereCount > 2 ) {
|
@ -66,14 +66,11 @@ class Model {
|
|||||||
$ids[] = $id;
|
$ids[] = $id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $ids;
|
return [ $this->tableName => $ids ];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function uninstallResources() {
|
public function uninstallResources() {
|
||||||
// this one needs some work
|
// this one needs some work
|
||||||
// should probably save the created resource ID's or something and remove them.
|
|
||||||
// presumably this isn't a big issue because i would imagine the table is removed
|
|
||||||
// there may be future instances where you can create resources for other tables
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -24,21 +24,21 @@
|
|||||||
"require":
|
"require":
|
||||||
{
|
{
|
||||||
"php": ">=8.1.0",
|
"php": ">=8.1.0",
|
||||||
"thetempusproject/canary": "1.0.7",
|
"thetempusproject/canary": "1.0.9",
|
||||||
"thetempusproject/hermes": "1.0.5",
|
"thetempusproject/hermes": "1.0.5",
|
||||||
"thetempusproject/houdini": "2.0.3"
|
"thetempusproject/houdini": "2.0.5"
|
||||||
},
|
},
|
||||||
"autoload":
|
"autoload":
|
||||||
{
|
{
|
||||||
"psr-4":
|
"classmap":
|
||||||
{
|
[
|
||||||
"TheTempusProject\\Bedroock\\Classes\\": "Classes",
|
"classes",
|
||||||
"TheTempusProject\\Bedroock\\Functions\\": "Functions"
|
"functions"
|
||||||
},
|
],
|
||||||
"files":
|
"files":
|
||||||
[
|
[
|
||||||
"Config/constants.php",
|
"config/constants.php",
|
||||||
"Bin/Bedrock.php"
|
"bin/bedrock.php"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
26
composer.lock
generated
26
composer.lock
generated
@ -4,15 +4,15 @@
|
|||||||
"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": "a5baf978df78c7223d6c2f4bf2421050",
|
"content-hash": "8c8b2e1232989c7e9998964f1fe5fc86",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "thetempusproject/canary",
|
"name": "thetempusproject/canary",
|
||||||
"version": "1.0.7",
|
"version": "1.0.9",
|
||||||
"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": "9c48e66bf54e63ba5ad2d4af90306c87b69f7048"
|
"reference": "77cef522e9919573836901eb82b59b20f453fb61"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1.0"
|
"php": ">=8.1.0"
|
||||||
@ -20,12 +20,12 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
"files": [
|
||||||
"Config/constants.php",
|
"config/constants.php",
|
||||||
"Bin/Canary.php"
|
"bin/canary.php"
|
||||||
],
|
],
|
||||||
"psr-4": {
|
"classmap": [
|
||||||
"TheTempusProject\\Canary\\Classes\\": "Classes"
|
"classes"
|
||||||
}
|
]
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
@ -48,7 +48,7 @@
|
|||||||
"thetempusproject",
|
"thetempusproject",
|
||||||
"tools"
|
"tools"
|
||||||
],
|
],
|
||||||
"time": "2025-02-02T23:02:51+00:00"
|
"time": "2025-02-04T12:16:29+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "thetempusproject/hermes",
|
"name": "thetempusproject/hermes",
|
||||||
@ -96,15 +96,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "thetempusproject/houdini",
|
"name": "thetempusproject/houdini",
|
||||||
"version": "2.0.3",
|
"version": "2.0.5",
|
||||||
"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": "4c9c9b60233c4dd7a366758c8436560098761eb5"
|
"reference": "2c7538471ab1f900048ccdb2c71d6bf2bee975e0"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1.0",
|
"php": ">=8.1.0",
|
||||||
"thetempusproject/canary": "1.0.7",
|
"thetempusproject/canary": "1.0.9",
|
||||||
"thetempusproject/hermes": "1.0.5"
|
"thetempusproject/hermes": "1.0.5"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
@ -136,7 +136,7 @@
|
|||||||
"thetempusproject",
|
"thetempusproject",
|
||||||
"tools"
|
"tools"
|
||||||
],
|
],
|
||||||
"time": "2025-02-02T23:31:11+00:00"
|
"time": "2025-02-04T12:19:25+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
|
Reference in New Issue
Block a user