Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
41e7c18
Refactoring Auth library
armanist Dec 11, 2024
6b50bc9
Logging improvements
armanist Dec 12, 2024
fee9d02
Error handling mechanisms improvements
armanist Dec 12, 2024
e696212
Debugger and Debug Bar Enhancements
armanist Dec 12, 2024
cc89f61
Refactoring Di functionality
armanist Dec 12, 2024
08f84ab
Refactoring HttpRequest and HttpResponse classes
armanist Dec 12, 2024
e69a185
Refactoring ModuleLoader functionality
armanist Dec 12, 2024
d47ada3
Refactoring Server related functionality
armanist Dec 12, 2024
77eddc3
Refactoring helpers
armanist Dec 12, 2024
6507a25
Refactoring Lang library related functionality
armanist Dec 12, 2024
71ba728
Refactoring and adding unit tests for Hook functionality
armanist Dec 12, 2024
66bb71d
Auth helper functionality related unit tests
armanist Dec 12, 2024
463d5e2
More unit tests for helpers
armanist Dec 12, 2024
f4ece3a
Refactoring Router functionality
armanist Dec 12, 2024
fe23a21
Refactoring ViewCache related code
armanist Dec 12, 2024
c637598
Minor refactoring related Debugger
armanist Dec 12, 2024
66ab252
Minor refactorings
armanist Dec 12, 2024
f624819
Enabling `--testdox` option in phpunit
armanist Dec 12, 2024
1a2b60b
Misc fixes on unit tests
armanist Dec 13, 2024
cf573d6
Fix case-sensitive folder name change from 'test' to 'Test'
armanist Dec 13, 2024
6bc2ab3
Fixing the service path
armanist Dec 13, 2024
b4caa3f
Updating the Logger and more code refactorings
armanist Dec 16, 2024
ca02aa4
Refactoring Asset library
armanist Dec 17, 2024
fc31807
Refactoring of Archive library
armanist Dec 22, 2024
b2ff6e6
Refactoring of Asset library
armanist Dec 22, 2024
e0d28fa
Refactoring of Auth library
armanist Dec 22, 2024
a5223ec
Refactoring of Cache library
armanist Dec 22, 2024
c6885e5
Refactoring of Captcha library
armanist Dec 22, 2024
56aeb4f
Refactoring of Config library
armanist Dec 22, 2024
a8e4597
Refactoring of Csrf library
armanist Dec 22, 2024
0ecba68
Refactoring of Curl library
armanist Dec 22, 2024
1e31be3
Refactoring of Database library
armanist Dec 22, 2024
201ac91
Refactoring of JWToken library
armanist Dec 22, 2024
0d64579
Refactoring of Lang library
armanist Dec 22, 2024
15c3748
Refactoring of Mailer library
armanist Dec 22, 2024
b6022a0
Refactoring of Database library
armanist Dec 22, 2024
622d598
Refactoring of Storage library
armanist Dec 22, 2024
2cba58d
Refactoring of Validation library
armanist Dec 22, 2024
22719eb
Refactoring of Cache library
armanist Dec 22, 2024
d8fb83d
Refactoring of Auth library
armanist Dec 22, 2024
6d05f8e
Refactoring of Csrf library
armanist Dec 22, 2024
0c4ec70
Refactoring of ViewCache library
armanist Dec 22, 2024
819644d
Refactoring of Logger feature
armanist Dec 22, 2024
ec2dd9c
Refactoring of Migration feature
armanist Dec 22, 2024
482ee19
Refactoring of MVC feature
armanist Dec 22, 2024
9cd09e9
Refactoring of Router feature
armanist Dec 22, 2024
9983e8e
Refactoring of Http feature
armanist Dec 22, 2024
037b4a6
Refactoring of Hook feature
armanist Dec 22, 2024
0f5f430
Refactoring of helpers
armanist Dec 22, 2024
edbd7e7
Refactoring of Factory features
armanist Dec 22, 2024
04d44dd
Refactoring of Environment feature
armanist Dec 22, 2024
cd53502
Refactoring of console commands
armanist Dec 22, 2024
5cf0053
Refactoring of exceptions
armanist Dec 22, 2024
8340bcc
Refactoring of Encryption feature
armanist Dec 22, 2024
f9355a2
Refactoring of Cookie feature
armanist Dec 22, 2024
d217312
Refactoring of Session feature
armanist Dec 22, 2024
57d4986
Refactoring App and Bootstrap
armanist Dec 22, 2024
4ab68da
Refactoring of ErrorHandler
armanist Dec 22, 2024
694581f
Updating unit tests in regard to code refactoring
armanist Dec 22, 2024
d56f03c
Add extension dependencies
armanist Dec 22, 2024
e6b2d1b
Correcting ViewCache unit test
armanist Dec 22, 2024
dc8730e
Minor refactoring as per code review
armanist Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
"ext-simplexml": "*",
"ext-fileinfo": "*",
"ext-openssl": "*",
"ext-bcmath": "*",
"ext-dom": "*",
"ext-zip": "*",
"ext-bcmath": "*",
"ext-memcached": "*",
"ext-redis": "*",
"j4mie/paris": "^1.5",
"firebase/php-jwt": "^6.0",
"gumlet/php-image-resize": "^2.0",
Expand Down Expand Up @@ -63,7 +65,7 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit --stderr --coverage-clover coverage.xml"
"test": "vendor/bin/phpunit --stderr --testdox --coverage-clover coverage.xml"
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
2 changes: 1 addition & 1 deletion coverage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@
<file name="D:\projects\forks\quantum-php-core\src\Libraries\Auth\AuthServiceInterface.php">
<metrics loc="54" ncloc="17" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</file>
<file name="D:\projects\forks\quantum-php-core\src\Libraries\Auth\AuthenticableInterface.php">
<file name="D:\projects\forks\quantum-php-core\src\Libraries\Auth\AuthenticatableInterface.php">
<metrics loc="50" ncloc="17" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</file>
<file name="D:\projects\forks\quantum-php-core\src\Libraries\Auth\BaseAuth.php">
Expand Down
47 changes: 30 additions & 17 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,28 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.8.0
* @since 2.9.5
*/

namespace Quantum;

use Quantum\Environment\Environment;
use Quantum\Libraries\Database\Exceptions\DatabaseException;
use Quantum\Libraries\Encryption\CryptorException;
use Quantum\Libraries\Session\SessionException;
use Quantum\Libraries\Config\ConfigException;
use Quantum\Libraries\Csrf\CsrfException;
use Quantum\Libraries\Lang\LangException;
use Quantum\Router\ModuleLoaderException;
use Quantum\Libraries\Config\Config;
use Quantum\Tracer\ErrorHandler;
use Quantum\Environment\Environment;
use Quantum\Logger\LoggerException;
use DebugBar\DebugBarException;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;
use Twig\Error\LoaderError;
use Quantum\Loader\Loader;
use Quantum\Loader\Setup;
use ReflectionException;
use Quantum\Di\Di;

if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR);
Expand All @@ -38,24 +50,27 @@ class App
/**
* Starts the app
* @param string $baseDir
* @throws Exceptions\ConfigException
* @return void
* @throws ConfigException
* @throws CryptorException
* @throws CsrfException
* @throws DatabaseException
* @throws DebugBarException
* @throws Exceptions\AppException
* @throws Exceptions\ControllerException
* @throws Exceptions\CsrfException
* @throws Exceptions\DatabaseException
* @throws Exceptions\DiException
* @throws Exceptions\EnvException
* @throws Exceptions\HookException
* @throws Exceptions\LangException
* @throws Exceptions\MiddlewareException
* @throws Exceptions\ModuleLoaderException
* @throws Exceptions\RouteException
* @throws Exceptions\SessionException
* @throws Exceptions\ViewException
* @throws \ErrorException
* @throws \ReflectionException
* @throws \Twig\Error\LoaderError
* @throws \Twig\Error\RuntimeError
* @throws \Twig\Error\SyntaxError
* @throws LangException
* @throws LoaderError
* @throws LoggerException
* @throws ModuleLoaderException
* @throws ReflectionException
* @throws RuntimeError
* @throws SessionException
* @throws SyntaxError
*/
public static function start(string $baseDir)
{
Expand All @@ -75,8 +90,6 @@ public static function start(string $baseDir)

Config::getInstance()->load(new Setup('config', 'config'));

ErrorHandler::setup();

Bootstrap::run();
}

Expand Down
55 changes: 42 additions & 13 deletions src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,27 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.0
* @since 2.9.5
*/

namespace Quantum;

use Quantum\Libraries\Database\Exceptions\DatabaseException;
use Quantum\Exceptions\StopExecutionException;
use Quantum\Libraries\ResourceCache\ViewCache;
use Quantum\Libraries\Config\ConfigException;
use Quantum\Router\ModuleLoaderException;
use Quantum\Logger\LoggerManager;
use Quantum\Router\ModuleLoader;
use Quantum\Libraries\Lang\Lang;
use Quantum\Tracer\ErrorHandler;
use DebugBar\DebugBarException;
use Quantum\Environment\Server;
use Quantum\Debugger\Debugger;
use Quantum\Hooks\HookManager;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;
use Twig\Error\LoaderError;
use Quantum\Mvc\MvcManager;
use Quantum\Router\Router;
use Quantum\Http\Response;
Expand All @@ -38,16 +48,24 @@ class Bootstrap

/**
* Boots the app
* @throws Exceptions\ModuleLoaderException
* @throws DebugBarException
* @throws Exceptions\ControllerException
* @throws Exceptions\DiException
* @throws Exceptions\MiddlewareException
* @throws Exceptions\ConfigException
* @throws Exceptions\RouteException
* @throws Exceptions\ViewException
* @throws Libraries\Config\ConfigException
* @throws Libraries\Csrf\CsrfException
* @throws DatabaseException
* @throws Libraries\Encryption\CryptorException
* @throws Libraries\Lang\LangException
* @throws Libraries\Session\SessionException
* @throws LoaderError
* @throws Logger\LoggerException
* @throws ModuleLoaderException
* @throws ReflectionException
* @throws \Twig\Error\LoaderError
* @throws \Twig\Error\RuntimeError
* @throws \Twig\Error\SyntaxError
* @throws RuntimeError
* @throws SyntaxError
*/
public static function run()
{
Expand All @@ -62,18 +80,29 @@ public static function run()
stop();
}

Debugger::initStore();
ErrorHandler::getInstance()->setup(LoggerManager::getHandler());

$debugger = Debugger::getInstance();
$debugger->initStore();

ModuleLoader::getInstance()->loadModulesRoutes();

ModuleLoader::loadModulesRoutes();
$viewCache = ViewCache::getInstance();

$router = new Router($request, $response);
if($viewCache->isEnabled()) {
$viewCache->setup();
}

$router = new Router($request);
$router->findRoute();

if (config()->get('multilang')) {
Lang::getInstance((int)config()->get(Lang::LANG_SEGMENT))->load();
$lang = Lang::getInstance();

if($lang->isEnabled()) {
$lang->load();
}

Debugger::addToStore(Debugger::HOOKS, LogLevel::INFO, HookManager::getRegistered());
info(HookManager::getInstance()->getRegistered(), ['tab' => Debugger::HOOKS]);

MvcManager::handle($request, $response);

Expand All @@ -87,7 +116,7 @@ public static function run()
/**
* Handles CORS
* @param Response $response
* @throws Exceptions\ConfigException
* @throws ConfigException
* @throws Exceptions\DiException
* @throws ReflectionException
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/DebugBarCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.0
* @since 2.9.5
*/

namespace Quantum\Console\Commands;

use Quantum\Libraries\Storage\FileSystem;
use Quantum\Exceptions\LangException;
use Quantum\Libraries\Lang\LangException;
use Quantum\Exceptions\DiException;
use Quantum\Console\QtCommand;
use ReflectionException;
Expand Down
8 changes: 4 additions & 4 deletions src/Console/Commands/MigrationMigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.0
* @since 2.9.5
*/

namespace Quantum\Console\Commands;

use Quantum\Libraries\Database\Exceptions\DatabaseException;
use Quantum\Libraries\Config\ConfigException;
use Quantum\Exceptions\MigrationException;
use Quantum\Exceptions\DatabaseException;
use Quantum\Exceptions\ConfigException;
use Quantum\Libraries\Lang\LangException;
use Quantum\Migration\MigrationManager;
use Quantum\Exceptions\LangException;
use Quantum\Exceptions\AppException;
use Quantum\Exceptions\DiException;
use Quantum\Console\QtCommand;
Expand Down
10 changes: 5 additions & 5 deletions src/Console/Commands/OpenApiCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.0
* @since 2.9.5
*/

namespace Quantum\Console\Commands;

use Quantum\Exceptions\ModuleLoaderException;
use Quantum\Router\ModuleLoaderException;
use Quantum\Libraries\Storage\FileSystem;
use Quantum\Exceptions\RouteException;
use Quantum\Exceptions\DiException;
Expand Down Expand Up @@ -83,14 +83,14 @@ class OpenApiCommand extends QtCommand

/**
* Executes the command and generate Open API specifications
* @throws ModuleLoaderException
* @throws RouteException
* @throws DiException
* @throws ModuleLoaderException
* @throws ReflectionException
* @throws RouteException
*/
public function exec()
{
ModuleLoader::loadModulesRoutes();
ModuleLoader::getInstance()->loadModulesRoutes();

$this->fs = Di::get(FileSystem::class);

Expand Down
4 changes: 2 additions & 2 deletions src/Console/Commands/ResourceCacheClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
* @author Arman Ag. <arman.ag@softberg.org>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.8.0
* @since 2.9.5
*/

namespace Quantum\Console\Commands;

use Quantum\Libraries\Config\ConfigException;
use Quantum\Libraries\Storage\FileSystem;
use Quantum\Exceptions\ConfigException;
use Quantum\Exceptions\DiException;
use Quantum\Console\QtCommand;
use Quantum\Loader\Setup;
Expand Down
Loading