Skip to content

Commit f30fb6d

Browse files
committed
Move some pages to Core namespace
1 parent 80dca17 commit f30fb6d

Some content is hidden

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

42 files changed

+178
-145
lines changed

src/Controllers/Legacy.php renamed to src/Controllers/Core/Legacy.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
<?php
22

3-
namespace BNETDocs\Controllers;
3+
namespace BNETDocs\Controllers\Core;
44

55
use \BNETDocs\Libraries\Core\HttpCode;
66
use \BNETDocs\Libraries\Core\Router;
77
use \CarlBennett\MVC\Libraries\Common;
88

9-
class Legacy extends Base
9+
class Legacy extends \BNETDocs\Controllers\Base
1010
{
1111
/**
1212
* Constructs a Controller, typically to initialize properties.
1313
*/
1414
public function __construct()
1515
{
16-
$this->model = new \BNETDocs\Models\Legacy();
16+
$this->model = new \BNETDocs\Models\Core\Legacy();
1717
}
1818

1919
/**

src/Controllers/Maintenance.php renamed to src/Controllers/Core/Maintenance.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22

3-
namespace BNETDocs\Controllers;
3+
namespace BNETDocs\Controllers\Core;
44

5-
class Maintenance extends Base
5+
class Maintenance extends \BNETDocs\Controllers\Base
66
{
77
/**
88
* Constructs a Controller, typically to initialize properties.
99
*/
1010
public function __construct()
1111
{
12-
$this->model = new \BNETDocs\Models\Maintenance();
12+
$this->model = new \BNETDocs\Models\Core\Maintenance();
1313
}
1414

1515
/**

src/Controllers/PageNotFound.php renamed to src/Controllers/Core/NotFound.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22

3-
namespace BNETDocs\Controllers;
3+
namespace BNETDocs\Controllers\Core;
44

5-
class PageNotFound extends Base
5+
class NotFound extends \BNETDocs\Controllers\Base
66
{
77
/**
88
* Constructs a Controller, typically to initialize properties.
99
*/
1010
public function __construct()
1111
{
12-
$this->model = new \BNETDocs\Models\PageNotFound();
12+
$this->model = new \BNETDocs\Models\Core\NotFound();
1313
}
1414

1515
/**

src/Controllers/PhpInfo.php renamed to src/Controllers/Core/PhpInfo.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22

3-
namespace BNETDocs\Controllers;
3+
namespace BNETDocs\Controllers\Core;
44

55
use \BNETDocs\Libraries\Core\HttpCode;
66

7-
class PhpInfo extends Base
7+
class PhpInfo extends \BNETDocs\Controllers\Base
88
{
99
/**
1010
* Constructs a Controller, typically to initialize properties.
1111
*/
1212
public function __construct()
1313
{
14-
$this->model = new \BNETDocs\Models\PhpInfo();
14+
$this->model = new \BNETDocs\Models\Core\PhpInfo();
1515
}
1616

1717
/**

src/Controllers/RedirectSoft.php renamed to src/Controllers/Core/RedirectSoft.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22

3-
namespace BNETDocs\Controllers;
3+
namespace BNETDocs\Controllers\Core;
44

5-
class RedirectSoft extends Base
5+
class RedirectSoft extends \BNETDocs\Controllers\Base
66
{
77
/**
88
* Constructs a Controller, typically to initialize properties.
99
*/
1010
public function __construct()
1111
{
12-
$this->model = new \BNETDocs\Models\RedirectSoft();
12+
$this->model = new \BNETDocs\Models\Core\RedirectSoft();
1313
}
1414

1515
/**

src/Controllers/Robotstxt.php renamed to src/Controllers/Core/Robotstxt.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22

3-
namespace BNETDocs\Controllers;
3+
namespace BNETDocs\Controllers\Core;
44

5-
class Robotstxt extends Base
5+
class Robotstxt extends \BNETDocs\Controllers\Base
66
{
77
/**
88
* Constructs a Controller, typically to initialize properties.
99
*/
1010
public function __construct()
1111
{
12-
$this->model = new \BNETDocs\Models\Robotstxt();
12+
$this->model = new \BNETDocs\Models\Core\Robotstxt();
1313
}
1414

1515
/**

src/Controllers/Status.php renamed to src/Controllers/Core/Status.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

3-
namespace BNETDocs\Controllers;
3+
namespace BNETDocs\Controllers\Core;
44

55
use \BNETDocs\Libraries\Core\HttpCode;
6-
use \BNETDocs\Models\Status as StatusModel;
6+
use \BNETDocs\Models\Core\Status as StatusModel;
77
use \CarlBennett\MVC\Libraries\Common;
88

9-
class Status extends Base
9+
class Status extends \BNETDocs\Controllers\Base
1010
{
1111
public const MAX_USER_AGENT = 255; // database varchar(255)
1212

src/Libraries/Core/ExceptionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private static function gracefulExit(StdClass &$context): void
139139
$display_errors = \ini_get('display_errors');
140140
if (!$display_errors || \strtolower($display_errors) == 'off')
141141
{
142-
(new \BNETDocs\Libraries\Core\Template(null, 'ExceptionHandler'))->invoke();
142+
(new \BNETDocs\Libraries\Core\Template(null, 'Core/ExceptionHandler'))->invoke();
143143
}
144144
else
145145
{

src/Models/Core/Legacy.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace BNETDocs\Models\Core;
4+
5+
class Legacy extends \BNETDocs\Models\ActiveUser implements \JsonSerializable
6+
{
7+
public ?string $did = null;
8+
public ?bool $is_legacy = null;
9+
public ?string $lang = null;
10+
public ?string $nid = null;
11+
public ?string $op = null;
12+
public ?string $pid = null;
13+
public ?string $url = null;
14+
15+
public function jsonSerialize(): mixed
16+
{
17+
return \array_merge(parent::jsonSerialize(), [
18+
'did' => $this->did,
19+
'is_legacy' => $this->is_legacy,
20+
'lang' => $this->lang,
21+
'nid' => $this->nid,
22+
'op' => $this->op,
23+
'pid' => $this->pid,
24+
'url' => $this->url,
25+
]);
26+
}
27+
}

src/Models/Core/Maintenance.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace BNETDocs\Models\Core;
4+
5+
class Maintenance extends \BNETDocs\Models\ActiveUser implements \JsonSerializable
6+
{
7+
public ?string $message = null;
8+
9+
public function jsonSerialize(): mixed
10+
{
11+
return \array_merge(parent::jsonSerialize(), ['message' => $this->message]);
12+
}
13+
}

0 commit comments

Comments
 (0)