4 Commits
1.1.4 ... main

Author SHA1 Message Date
e9c3fd84dd small cleanup 2025-06-20 11:29:47 -04:00
89d30a8d36 wip 2025-02-25 13:09:01 -05:00
cfa53c9e70 add safe-version of url 2025-02-05 22:02:46 -05:00
39d350df06 composer bump 2025-02-04 07:26:47 -05:00
5 changed files with 23 additions and 20 deletions

View File

@ -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 );

View File

@ -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 ) {

View File

@ -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;
} }

View File

@ -24,9 +24,9 @@
"require": "require":
{ {
"php": ">=8.1.0", "php": ">=8.1.0",
"thetempusproject/canary": "1.0.8", "thetempusproject/canary": "1.0.9",
"thetempusproject/hermes": "1.0.5", "thetempusproject/hermes": "1.0.5",
"thetempusproject/houdini": "2.0.4" "thetempusproject/houdini": "2.0.5"
}, },
"autoload": "autoload":
{ {

22
composer.lock generated
View File

@ -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": "d68a088d48d6c8f0385a138a0163cbfd", "content-hash": "8c8b2e1232989c7e9998964f1fe5fc86",
"packages": [ "packages": [
{ {
"name": "thetempusproject/canary", "name": "thetempusproject/canary",
"version": "1.0.8", "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": "9d339b961e7702e92293757fd495cadebbc1c418" "reference": "77cef522e9919573836901eb82b59b20f453fb61"
}, },
"require": { "require": {
"php": ">=8.1.0" "php": ">=8.1.0"
@ -23,9 +23,9 @@
"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-03T17:39:23+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.4", "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": "21ef1ba8c9fed2fb6f789505671d11a10c1c344e" "reference": "2c7538471ab1f900048ccdb2c71d6bf2bee975e0"
}, },
"require": { "require": {
"php": ">=8.1.0", "php": ">=8.1.0",
"thetempusproject/canary": "1.0.8", "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-03T17:43:12+00:00" "time": "2025-02-04T12:19:25+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],