Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
e9c3fd84dd | |||
89d30a8d36 | |||
cfa53c9e70 |
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user