Skip to content

Commit 2fbd0ab

Browse files
committed
Code refactoring
1 parent a57de18 commit 2fbd0ab

25 files changed

+233
-257
lines changed

.eslintrc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"env": {
3+
"browser": true
4+
},
5+
"extends": "standard",
6+
"rules": {
7+
"space-before-function-paren": "off",
8+
"padded-blocks": "off",
9+
"no-trailing-spaces": "warn"
10+
}
11+
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
/vendor/
1+
vendor/
2+
node_modules/
3+
package-lock.json

assets/css/fontawesome-custom.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
content: "\e905";
5151
}
5252

53+
/* Deprecated */
5354
.fa-globe:before {
5455
content: "\e906";
5556
}

autoload.php

Lines changed: 0 additions & 12 deletions
This file was deleted.

extras/dataset/malformed.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
{
3+
"trailing": "comma",
4+
}
5+
]

addons/sql-to-mongo-db-query-converter-1.13-standalone.jar renamed to extras/programs/sql-to-mongo-db-query-converter-1.13-standalone.jar

File renamed without changes.
File renamed without changes.

index.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Development mode?
2525
*
2626
* @var boolean
27+
* @deprecated
2728
*/
2829
define('MPG_DEV_MODE', false);
2930

@@ -73,8 +74,14 @@
7374
*/
7475
define('MPG_BASE_URL', $baseUrl);
7576

76-
require MPG_ABS_PATH . '/autoload.php';
77-
require MPG_ABS_PATH . '/routes.php';
77+
if ( !file_exists($autoload_file = MPG_ABS_PATH . '/vendor/autoload.php') ) {
78+
die('Run `composer install` to complete ' . MPG_APP_NAME . ' installation.');
79+
}
80+
81+
$loader = require_once $autoload_file;
82+
$loader->add('MPG', MPG_ABS_PATH . '/source/php');
83+
84+
$router = require MPG_ABS_PATH . '/routes.php';
7885

7986
$application = new Application($router);
8087
$serverRequest = ServerRequestFactory::createFromGlobals();
@@ -86,4 +93,4 @@
8693

8794
} catch (NotFoundHttpException $e) {
8895
die('Route not found. Try to append a slash to URL.');
89-
}
96+
}

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"private": "true",
3+
"devDependencies": {
4+
"eslint": "latest",
5+
"eslint-config-standard": "latest"
6+
}
7+
}

0 commit comments

Comments
 (0)