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);
|
||||
}
|
||||
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' ) ) {
|
||||
require_once BEDROCK_CONFIG_DIRECTORY . 'constants.php';
|
||||
@ -27,19 +27,19 @@ if ( class_exists( 'TheTempusProject\Hermes\Classes\Autoloader' ) ) {
|
||||
$autoloader->setRootFolder( BEDROCK_ROOT_DIRECTORY );
|
||||
$autoloader->addNamespace(
|
||||
'TheTempusProject\Bedrock',
|
||||
'Bin'
|
||||
'bin'
|
||||
);
|
||||
$autoloader->addNamespace(
|
||||
'TheTempusProject\Bedrock\Classes',
|
||||
'Classes'
|
||||
'classes'
|
||||
);
|
||||
$autoloader->addNamespace(
|
||||
'TheTempusProject\Bedrock\Functions',
|
||||
'Functions'
|
||||
'functions'
|
||||
);
|
||||
$autoloader->register();
|
||||
}
|
||||
|
||||
require_once 'Bedrock.php';
|
||||
require_once 'bedrock.php';
|
||||
|
||||
define( 'BEDROCK_AUTOLOADED', true );
|
@ -121,6 +121,7 @@ class Bedrock {
|
||||
}
|
||||
Components::set( 'META_IMAGE', Routes::getAddress() . Config::getValue( 'main/logoLarge' ) );
|
||||
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( 'AUTHOR', '<meta name="author" content="' . Config::getValue( 'main/name' ) . '">' );
|
||||
call_user_func_array( [ $this->controllerObject, self::$methodName ], $this->params );
|
@ -98,7 +98,12 @@ class Database {
|
||||
if ( $this->error === false ) {
|
||||
try {
|
||||
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 ) {
|
||||
$this->error = true;
|
||||
$this->errorMessage = $Exception->getMessage();
|
||||
@ -349,7 +354,7 @@ class Database {
|
||||
}
|
||||
$tableName = Config::getValue( 'database/dbPrefix' ) . $tableName;
|
||||
$sql = "{$action} FROM `{$tableName}` WHERE ";
|
||||
$validOperators = ['=', '!=', '>', '<', '>=', '<=', 'LIKE', 'IS'];
|
||||
$validOperators = ['=', '!=', '>', '<', '>=', '<=', 'LIKE', 'IS', 'IN'];
|
||||
$validDelimiters = ['AND', 'OR'];
|
||||
$values = [];
|
||||
while ( $whereCount > 2 ) {
|
@ -66,14 +66,11 @@ class Model {
|
||||
$ids[] = $id;
|
||||
}
|
||||
}
|
||||
return $ids;
|
||||
return [ $this->tableName => $ids ];
|
||||
}
|
||||
|
||||
public function uninstallResources() {
|
||||
// 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;
|
||||
}
|
||||
|
@ -24,21 +24,21 @@
|
||||
"require":
|
||||
{
|
||||
"php": ">=8.1.0",
|
||||
"thetempusproject/canary": "1.0.7",
|
||||
"thetempusproject/canary": "1.0.9",
|
||||
"thetempusproject/hermes": "1.0.5",
|
||||
"thetempusproject/houdini": "2.0.3"
|
||||
"thetempusproject/houdini": "2.0.5"
|
||||
},
|
||||
"autoload":
|
||||
{
|
||||
"psr-4":
|
||||
{
|
||||
"TheTempusProject\\Bedroock\\Classes\\": "Classes",
|
||||
"TheTempusProject\\Bedroock\\Functions\\": "Functions"
|
||||
},
|
||||
"classmap":
|
||||
[
|
||||
"classes",
|
||||
"functions"
|
||||
],
|
||||
"files":
|
||||
[
|
||||
"Config/constants.php",
|
||||
"Bin/Bedrock.php"
|
||||
"config/constants.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",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "a5baf978df78c7223d6c2f4bf2421050",
|
||||
"content-hash": "8c8b2e1232989c7e9998964f1fe5fc86",
|
||||
"packages": [
|
||||
{
|
||||
"name": "thetempusproject/canary",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.9",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://git.thetempusproject.com/the-tempus-project/canary",
|
||||
"reference": "9c48e66bf54e63ba5ad2d4af90306c87b69f7048"
|
||||
"reference": "77cef522e9919573836901eb82b59b20f453fb61"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1.0"
|
||||
@ -20,12 +20,12 @@
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"Config/constants.php",
|
||||
"Bin/Canary.php"
|
||||
"config/constants.php",
|
||||
"bin/canary.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"TheTempusProject\\Canary\\Classes\\": "Classes"
|
||||
}
|
||||
"classmap": [
|
||||
"classes"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@ -48,7 +48,7 @@
|
||||
"thetempusproject",
|
||||
"tools"
|
||||
],
|
||||
"time": "2025-02-02T23:02:51+00:00"
|
||||
"time": "2025-02-04T12:16:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "thetempusproject/hermes",
|
||||
@ -96,15 +96,15 @@
|
||||
},
|
||||
{
|
||||
"name": "thetempusproject/houdini",
|
||||
"version": "2.0.3",
|
||||
"version": "2.0.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://git.thetempusproject.com/the-tempus-project/houdini",
|
||||
"reference": "4c9c9b60233c4dd7a366758c8436560098761eb5"
|
||||
"reference": "2c7538471ab1f900048ccdb2c71d6bf2bee975e0"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1.0",
|
||||
"thetempusproject/canary": "1.0.7",
|
||||
"thetempusproject/canary": "1.0.9",
|
||||
"thetempusproject/hermes": "1.0.5"
|
||||
},
|
||||
"type": "library",
|
||||
@ -136,7 +136,7 @@
|
||||
"thetempusproject",
|
||||
"tools"
|
||||
],
|
||||
"time": "2025-02-02T23:31:11+00:00"
|
||||
"time": "2025-02-04T12:19:25+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
Reference in New Issue
Block a user