Skip to content

Commit 0b47999

Browse files
authored
Merge pull request #168 from WebFiori/dev
Renamed Class `WebFioriApp` to `App` + Refactoring Server Error Page
2 parents 14f9e9f + 716c8f8 commit 0b47999

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+466
-206
lines changed

bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use webfiori\framework\AutoLoader;
77
use webfiori\framework\ConfigController;
8-
use webfiori\framework\WebFioriApp;
8+
use webfiori\framework\App;
99

1010
$DS = DIRECTORY_SEPARATOR;
1111

@@ -84,7 +84,7 @@
8484
}
8585

8686
fprintf(STDOUT,"Initializing application...\n");
87-
WebFioriApp::start();
87+
App::start();
8888
fprintf(STDOUT,'Done.'."\n");
8989
fprintf(STDOUT,'Root Directory: \''.AutoLoader::get()->root().'\'.'."\n");
9090
define('TESTS_PATH', AutoLoader::get()->root().$DS.TESTS_DIRECTORY);

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"webfiori/cli":"v1.1.1",
2323
"webfiori/file":"v1.3.1",
2424
"webfiori/collections":"v1.1.3",
25-
"webfiori/ui":"v2.5.1",
25+
"webfiori/ui":"v2.5.2",
2626
"webfiori/jsonx":"v3.2.1",
2727
"webfiori/http":"v3.3.2 ",
2828
"webfiori/database":"v0.7.0",

tests/webfiori/framework/test/DBTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use webfiori\database\DatabaseException;
1515
use webfiori\framework\ConfigController;
1616
use webfiori\framework\DB;
17-
use webfiori\framework\WebFioriApp;
17+
use webfiori\framework\App;
1818

1919
/**
2020
* Description of DBTest
@@ -69,11 +69,11 @@ public function test03() {
6969
public function test04() {
7070
$conn = new ConnectionInfo('mysql', 'root', '123456', 'testing_db');
7171
$conn->setName('default-conn');
72-
WebFioriApp::getAppConfig()->addDbConnection($conn);
72+
App::getAppConfig()->addDbConnection($conn);
7373
$db = new DB('default-conn');
7474
$this->assertEquals(0, count($db->getTables()));
7575
$db->register('database');
7676
$this->assertEquals(2, count($db->getTables()));
77-
WebFioriApp::getAppConfig()->removeDBConnections();
77+
App::getAppConfig()->removeDBConnections();
7878
}
7979
}

tests/webfiori/framework/test/cli/AddCommandTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use webfiori\file\File;
88
use webfiori\framework\cli\commands\AddCommand;
99
use webfiori\framework\ConfigController;
10-
use webfiori\framework\WebFioriApp;
10+
use webfiori\framework\App;
1111

1212
/**
1313
* Description of TestAddCommand
@@ -36,7 +36,7 @@ public function test00() {
3636
* @test
3737
*/
3838
public function testAddDBConnection00() {
39-
$runner = WebFioriApp::getRunner();
39+
$runner = App::getRunner();
4040
$runner->setInputs([
4141
'0',
4242
'0',
@@ -52,7 +52,7 @@ public function testAddDBConnection00() {
5252
'add'
5353
]);
5454
$this->assertEquals(0, $runner->start());
55-
$connName = 'db-connection-'.count(WebFioriApp::getAppConfig()->getDBConnections());
55+
$connName = 'db-connection-'.count(App::getAppConfig()->getDBConnections());
5656
$this->assertEquals([
5757
"What would you like to add?\n",
5858
"0: New database connection.\n",
@@ -77,7 +77,7 @@ public function testAddDBConnection00() {
7777
* @test
7878
*/
7979
public function testAddDBConnection01() {
80-
$runner = WebFioriApp::getRunner();
80+
$runner = App::getRunner();
8181
$runner->setInputs([
8282
'0',
8383
'0',
@@ -94,7 +94,7 @@ public function testAddDBConnection01() {
9494
'add'
9595
]);
9696
$this->assertEquals(0, $runner->start());
97-
$connName = 'db-connection-'.count(WebFioriApp::getAppConfig()->getDBConnections());
97+
$connName = 'db-connection-'.count(App::getAppConfig()->getDBConnections());
9898
$this->assertEquals([
9999
"What would you like to add?\n",
100100
"0: New database connection.\n",
@@ -121,7 +121,7 @@ public function testAddDBConnection01() {
121121
* @test
122122
*/
123123
public function testAddDBConnection02() {
124-
$runner = WebFioriApp::getRunner();
124+
$runner = App::getRunner();
125125
$runner->setInputs([
126126
'0',
127127
'0',
@@ -138,7 +138,7 @@ public function testAddDBConnection02() {
138138
'add'
139139
]);
140140
$this->assertEquals(0, $runner->start());
141-
$connName = 'db-connection-'.count(WebFioriApp::getAppConfig()->getDBConnections());
141+
$connName = 'db-connection-'.count(App::getAppConfig()->getDBConnections());
142142
$this->assertEquals([
143143
"What would you like to add?\n",
144144
"0: New database connection.\n",
@@ -242,7 +242,7 @@ public function testAddLang02() {
242242
* @test
243243
*/
244244
public function testAddSMTPConnection00() {
245-
$runner = WebFioriApp::getRunner();
245+
$runner = App::getRunner();
246246
$runner->setInputs([
247247
'1',
248248
'127.0.0.1',
@@ -259,7 +259,7 @@ public function testAddSMTPConnection00() {
259259
'add'
260260
]);
261261
$this->assertEquals(0, $runner->start());
262-
$connName = 'smtp-connection-'.count(WebFioriApp::getAppConfig()->getAccounts());
262+
$connName = 'smtp-connection-'.count(App::getAppConfig()->getAccounts());
263263
$this->assertEquals([
264264
"What would you like to add?\n",
265265
"0: New database connection.\n",

tests/webfiori/framework/test/cli/CreateCLICommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use PHPUnit\Framework\TestCase;
66
use webfiori\framework\scheduler\TasksManager;
7-
use webfiori\framework\WebFioriApp;
7+
use webfiori\framework\App;
88
/**
99
* @author Ibrahim
1010
*/
@@ -13,7 +13,7 @@ class CreateCLICommandTest extends CreateTestCase {
1313
* @test
1414
*/
1515
public function testCreateCommand00() {
16-
$runner = $runner = WebFioriApp::getRunner();
16+
$runner = $runner = App::getRunner();
1717
$runner->setArgsVector([
1818
'webfiori',
1919
'create'
@@ -55,7 +55,7 @@ public function testCreateCommand00() {
5555
* @test
5656
*/
5757
public function testCreateCommand01() {
58-
$runner = $runner = WebFioriApp::getRunner();
58+
$runner = $runner = App::getRunner();
5959
$runner->setArgsVector([
6060
'webfiori',
6161
'create',

tests/webfiori/framework/test/cli/CreateCommandTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
namespace webfiori\framework\test\cli;
33

4-
use webfiori\framework\WebFioriApp;
4+
use webfiori\framework\App;
55
/**
66
* Description of TestCreateCommand
77
*
@@ -12,7 +12,7 @@ class CreateCommandTest extends CreateTestCase {
1212
* @test
1313
*/
1414
public function testCreate00() {
15-
$runner = WebFioriApp::getRunner();
15+
$runner = App::getRunner();
1616
$runner->setInputs([
1717
'9',
1818
]);
@@ -39,7 +39,7 @@ public function testCreate00() {
3939
* @test
4040
*/
4141
public function testCreate01() {
42-
$runner = $runner = WebFioriApp::getRunner();
42+
$runner = $runner = App::getRunner();
4343
$runner->setInputs([
4444
'',
4545
]);
@@ -70,7 +70,7 @@ public function testCreate01() {
7070
* @test
7171
*/
7272
public function testCreateWebService00() {
73-
$runner = $runner = WebFioriApp::getRunner();
73+
$runner = $runner = App::getRunner();
7474
$runner->setInputs([
7575
'2',
7676
'NewWeb',

tests/webfiori/framework/test/cli/CreateDBAccessTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace webfiori\framework\test\cli;
44

55
use webfiori\database\ConnectionInfo;
6-
use webfiori\framework\WebFioriApp;
6+
use webfiori\framework\App;
77

88
/**
99
* Description of CreateDBAccessTest
@@ -15,7 +15,7 @@ class CreateDBAccessTest extends CreateTestCase {
1515
* @test
1616
*/
1717
public function test00() {
18-
$runner = WebFioriApp::getRunner();
18+
$runner = App::getRunner();
1919
$runner->setArgsVector([
2020
'webfiori',
2121
'create',
@@ -50,7 +50,7 @@ public function test00() {
5050
* @test
5151
*/
5252
public function test01() {
53-
$runner = WebFioriApp::getRunner();
53+
$runner = App::getRunner();
5454
$runner->setArgsVector([
5555
'webfiori',
5656
'create',
@@ -87,9 +87,9 @@ public function test01() {
8787
public function test02() {
8888
$conn = new ConnectionInfo('mysql', 'root', '123456', 'testing_db', '127.0.0.1', 3306);
8989
$conn->setName('Test Connection');
90-
WebFioriApp::getAppConfig()->addDbConnection($conn);
90+
App::getAppConfig()->addDbConnection($conn);
9191

92-
$runner = WebFioriApp::getRunner();
92+
$runner = App::getRunner();
9393
$runner->setArgsVector([
9494
'webfiori',
9595
'create',

tests/webfiori/framework/test/cli/CreateEntityTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
namespace webfiori\framework\test\cli;
33

44
use app\database\TestTable;
5-
use webfiori\framework\WebFioriApp;
5+
use webfiori\framework\App;
66

77
class CreateEntityTest extends CreateTestCase {
88
/**
99
* @test
1010
*/
1111
public function testCreateEntity00() {
12-
$runner = $runner = WebFioriApp::getRunner();
12+
$runner = $runner = App::getRunner();
1313
$runner->setInputs([
1414
'NeEntity',
1515
'',
@@ -55,7 +55,7 @@ public function testCreateEntity00() {
5555
* @test
5656
*/
5757
public function testCreateEntity01() {
58-
$runner = $runner = WebFioriApp::getRunner();
58+
$runner = $runner = App::getRunner();
5959
$runner->setInputs([
6060
'1',
6161
'NewEntity',

tests/webfiori/framework/test/cli/CreateMiddlewareTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace webfiori\framework\test\cli;
44

55
use webfiori\framework\middleware\AbstractMiddleware;
6-
use webfiori\framework\WebFioriApp;
6+
use webfiori\framework\App;
77

88
/**
99
* Description of CreateThemeTest
@@ -15,7 +15,7 @@ class MiddlewareTest extends CreateTestCase {
1515
* @test
1616
*/
1717
public function testCreateMiddleware00() {
18-
$runner = $runner = WebFioriApp::getRunner();
18+
$runner = $runner = App::getRunner();
1919
$runner->setArgsVector([
2020
'webfiori',
2121
'create'
@@ -57,7 +57,7 @@ public function testCreateMiddleware00() {
5757
* @test
5858
*/
5959
public function testCreateMiddleware01() {
60-
$runner = $runner = WebFioriApp::getRunner();
60+
$runner = $runner = App::getRunner();
6161
$runner->setArgsVector([
6262
'webfiori',
6363
'create',

tests/webfiori/framework/test/cli/CreateRESTTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace webfiori\framework\test\cli;
44

55
use webfiori\database\ConnectionInfo;
6-
use webfiori\framework\WebFioriApp;
6+
use webfiori\framework\App;
77

88
/**
99
* Description of CreateRESTTest
@@ -15,8 +15,8 @@ class CreateRESTTest extends CreateTestCase {
1515
* @test
1616
*/
1717
public function test00() {
18-
WebFioriApp::getAppConfig()->removeDBConnections();
19-
$runner = WebFioriApp::getRunner();
18+
App::getAppConfig()->removeDBConnections();
19+
$runner = App::getRunner();
2020
$runner->setArgsVector([
2121
'webfiori',
2222
'create',
@@ -143,8 +143,8 @@ public function test00() {
143143
* @test
144144
*/
145145
public function test01() {
146-
WebFioriApp::getAppConfig()->removeDBConnections();
147-
$runner = WebFioriApp::getRunner();
146+
App::getAppConfig()->removeDBConnections();
147+
$runner = App::getRunner();
148148
$runner->setArgsVector([
149149
'webfiori',
150150
'create',
@@ -275,12 +275,12 @@ public function test01() {
275275
* @test
276276
*/
277277
public function test02() {
278-
WebFioriApp::getAppConfig()->removeDBConnections();
278+
App::getAppConfig()->removeDBConnections();
279279
$conn = new ConnectionInfo('mysql','root', '123456', 'testing_db', '127.0.0.1', 3306, [
280280
'connection-name' => 'Super Connection'
281281
]);
282-
WebFioriApp::getAppConfig()->addDbConnection($conn);
283-
$runner = WebFioriApp::getRunner();
282+
App::getAppConfig()->addDbConnection($conn);
283+
$runner = App::getRunner();
284284
$runner->setArgsVector([
285285
'webfiori',
286286
'create',

0 commit comments

Comments
 (0)