3 Commits
1.1.5 ... 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
3 changed files with 10 additions and 7 deletions

View File

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

View File

@ -91,14 +91,19 @@ class Database {
$this->errorMessage = $Exception->getMessage();
}
}
if ( !$this->enabled() ) {
if ( ! $this->enabled() ) {
$this->error = true;
$this->errorMessage = 'Database disabled in config.';
}
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 ) {

View File

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