formatting

This commit is contained in:
Shish 2019-11-03 18:28:38 +00:00
parent 427acc55a0
commit c58a13ae88
8 changed files with 24 additions and 17 deletions

View file

@ -77,7 +77,7 @@ _load_event_listeners();
$_tracer->end();
send_event(new InitExtEvent());
if(AUTO_DB_UPGRADE) {
send_event(new DatabaseUpgradeEvent());
if (AUTO_DB_UPGRADE) {
send_event(new DatabaseUpgradeEvent());
}
$_tracer->end();

View file

@ -317,5 +317,6 @@ class LogEvent extends Event
}
}
class DatabaseUpgradeEvent extends Event {
class DatabaseUpgradeEvent extends Event
{
}

View file

@ -70,9 +70,9 @@ class AdminPage extends Extension
}
if ($event->cmd == "db-upgrade") {
print("Running DB Upgrade\n");
global $database;
global $database;
$database->set_timeout(300000); // These updates can take a little bit
send_event(new DatabaseUpgradeEvent());
send_event(new DatabaseUpgradeEvent());
}
if ($event->cmd == "get-page") {
global $page;

View file

@ -77,8 +77,8 @@ class Approval extends Extension
$database->set_timeout(300000); // These updates can take a little bit
$database->execute(
$database->scoreql_to_sql(
"UPDATE images SET approved = SCORE_BOOL_Y, approved_by_id = :approved_by_id WHERE approved = SCORE_BOOL_N"
),
"UPDATE images SET approved = SCORE_BOOL_Y, approved_by_id = :approved_by_id WHERE approved = SCORE_BOOL_N"
),
["approved_by_id"=>$user->id]
);
break;
@ -169,8 +169,8 @@ class Approval extends Extension
$database->execute(
$database->scoreql_to_sql(
"UPDATE images SET approved = SCORE_BOOL_Y, approved_by_id = :approved_by_id WHERE id = :id AND approved = SCORE_BOOL_N"
),
"UPDATE images SET approved = SCORE_BOOL_Y, approved_by_id = :approved_by_id WHERE id = :id AND approved = SCORE_BOOL_N"
),
["approved_by_id"=>$user->id, "id"=>$image_id]
);
}
@ -181,8 +181,8 @@ class Approval extends Extension
$database->execute(
$database->scoreql_to_sql(
"UPDATE images SET approved = SCORE_BOOL_N, approved_by_id = NULL WHERE id = :id AND approved = SCORE_BOOL_Y"
),
"UPDATE images SET approved = SCORE_BOOL_N, approved_by_id = NULL WHERE id = :id AND approved = SCORE_BOOL_Y"
),
["id"=>$image_id]
);
}

View file

@ -90,7 +90,8 @@ class CommentList extends Extension
/** @var CommentListTheme $theme */
public $theme;
public function onInitExt(InitExtEvent $event) {
public function onInitExt(InitExtEvent $event)
{
global $config;
$config->set_default_int('comment_window', 5);
$config->set_default_int('comment_limit', 10);

View file

@ -8,7 +8,8 @@ class LogDatabase extends Extension
$config->set_default_int("log_db_priority", SCORE_LOG_INFO);
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event) {
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
{
global $config, $database;
if ($config->get_int("ext_log_database_version") < 1) {

View file

@ -61,7 +61,8 @@ class PoolCreationEvent extends Event
class Pools extends Extension
{
public function onInitExt(InitExtEvent $event) {
public function onInitExt(InitExtEvent $event)
{
global $config;
// Set the defaults for the pools extension
@ -75,7 +76,8 @@ class Pools extends Extension
$config->set_default_bool(PoolsConfig::AUTO_INCREMENT_ORDER, false);
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event) {
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
{
global $config, $database;
// Create the database tables

View file

@ -5,7 +5,8 @@ require_once "config.php";
class TagCategories extends Extension
{
public function onInitExt(InitExtEvent $event) {
public function onInitExt(InitExtEvent $event)
{
global $config;
// whether we split out separate categories on post view by default
@ -13,7 +14,8 @@ class TagCategories extends Extension
$config->set_default_bool(TagCategoriesConfig::SPLIT_ON_VIEW, true);
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event) {
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
{
global $config, $database;
if ($config->get_int(TagCategoriesConfig::VERSION) < 1) {