Debugging some stuff
This commit is contained in:
parent
e3cfdda60b
commit
72428be04b
@ -1,27 +1,10 @@
|
||||
<?php
|
||||
xdebug_disable();
|
||||
define('IN_SCRIPT', 1);
|
||||
define('HESK_PATH', '../../');
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
set_error_handler(function($errorNumber, $errorMessage, $errorFile, $errorLine) {
|
||||
output("An error occurred: {$errorMessage} in {$errorFile} on {$errorLine}",
|
||||
500,
|
||||
"Content-Type: text/plain");
|
||||
});
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
// USED FOR MIGRATIONS
|
||||
$file = HESK_PATH . 'install/migrations/' . str_replace('\\', '/', $class) . '.php';
|
||||
|
||||
if (file_exists($file)) {
|
||||
require($file);
|
||||
} else {
|
||||
output(array("message" => "{$file} not found!", 500));
|
||||
}
|
||||
});
|
||||
|
||||
require(HESK_PATH . 'install/migrations/core.php');
|
||||
|
||||
@ -34,9 +17,9 @@ $migration = $allMigrations[$request['migrationNumber']];
|
||||
|
||||
hesk_dbConnect();
|
||||
if ($request['direction'] === 'up') {
|
||||
$migration->up($hesk_settings);
|
||||
//$migration->up($hesk_settings);
|
||||
} elseif ($request['direction'] === 'down') {
|
||||
$migration->down($hesk_settings);
|
||||
//$migration->down($hesk_settings);
|
||||
} else {
|
||||
output(array("message" => "Invalid direction provided"), 400);
|
||||
}
|
||||
|
@ -1,4 +1,20 @@
|
||||
<?php
|
||||
set_error_handler(function($errorNumber, $errorMessage, $errorFile, $errorLine) {
|
||||
output("An error occurred: {$errorMessage} in {$errorFile} on {$errorLine}",
|
||||
500,
|
||||
"Content-Type: text/plain");
|
||||
});
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
// USED FOR MIGRATIONS
|
||||
$file = HESK_PATH . 'install/migrations/' . str_replace('\\', '/', $class) . '.php';
|
||||
|
||||
if (file_exists($file)) {
|
||||
require($file);
|
||||
} else {
|
||||
output(array("message" => "{$file} not found!", 500));
|
||||
}
|
||||
});
|
||||
|
||||
function getAllMigrations() {
|
||||
return array(
|
||||
|
Loading…
x
Reference in New Issue
Block a user