Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit ac331b8

Browse files
authored
Merge pull request #48 from modulusphp/feature/maintenance-update-and-bug-fixes
Feature/maintenance update and bug fixes
2 parents e42b8d8 + e202b0d commit ac331b8

File tree

9 files changed

+93
-27
lines changed

9 files changed

+93
-27
lines changed

Auth/MustAuthenticateUser.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Modulus\Utility\Notification;
1212
use Modulus\Framework\Auth\RedirectsUsers;
1313
use Modulus\Framework\Auth\Notifications\MustLogin;
14-
use Modulus\Framework\Auth\Requests\EmailLoginRequest;
1514

1615
trait MustAuthenticateUser
1716
{
@@ -73,12 +72,17 @@ public function showMagicLinkPage()
7372
/**
7473
* Login with rmail
7574
*
76-
* @param EmailLoginRequest $request
75+
* @param Request $request
7776
* @return void
7877
*/
79-
public function loginWithEmail(EmailLoginRequest $request)
78+
public function loginWithEmail(Request $request)
8079
{
80+
$request->rules = [
81+
'email' => 'required'
82+
];
83+
8184
$request->validate();
85+
8286
$provider = $this->provider;
8387

8488
$info = MagicLink::notify($request, $provider, $this->musk());

Auth/Requests/EmailLoginRequest.php

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Donald Pakkies
3+
Copyright (c) 2019 Donald Pakkies
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Plugin/Load.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ class Load
1313
* Load plugins
1414
*
1515
* @param bool $isConsole
16+
* @param bool $start
17+
* @param mixed $response
1618
* @return void
1719
*/
18-
public static function plugins(bool $isConsole)
20+
public static function plugins(bool $isConsole, bool $start = true, $response = null)
1921
{
2022
$plugins = config('app.plugins');
2123

@@ -39,8 +41,14 @@ public static function plugins(bool $isConsole)
3941

4042
if (!Validate::check($extension, $class_info)) return;
4143

42-
$extension->instance($extendable, $DIR);
43-
$extension->boot($extendable);
44+
if ($start) {
45+
$extension->instance($extendable, $DIR);
46+
$extension->boot($extendable);
47+
} else {
48+
if ($extension->exit($response)) {
49+
continue;
50+
}
51+
}
4452
}
4553
}
4654
}

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
11
# Modulus Core
22

3-
This package is the core component of Modulus.
3+
This package is the core component of Modulus.
4+
5+
Install
6+
-------
7+
8+
This package is automatically installed with the Modulus Framework.
9+
10+
```
11+
composer require modulusphp/framework
12+
```
13+
14+
Security
15+
-------
16+
17+
If you discover any security related issues, please email donaldpakkies@gmail.com instead of using the issue tracker.
18+
19+
License
20+
-------
21+
22+
The MIT License (MIT). Please see [License File](LICENSE) for more information.

Response.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ public static function make(Upstart $app)
2121
*/
2222
$response = $app->getResponse();
2323

24+
/**
25+
* Convert to array
26+
*/
27+
if (method_exists($response, 'toArray')) {
28+
$response = $response->toArray();
29+
}
30+
2431
/**
2532
* Create a rest response
2633
*/

Upstart.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ class Upstart
3939
*/
4040
protected $request;
4141

42+
/**
43+
* $service
44+
*
45+
* @var \App\Resolvers\AppServiceResolver
46+
*/
47+
protected $service;
48+
4249
/**
4350
* $response
4451
*
@@ -113,10 +120,15 @@ class_alias($class, $alias);
113120
*/
114121
private function startApp(bool $isConsole)
115122
{
123+
/**
124+
* Create a new instance of the service resolver
125+
*/
126+
$this->service = new AppServiceResolver;
127+
116128
/**
117129
* Start the App Service Resolver
118130
*/
119-
(new AppServiceResolver)->start(Application::prototype($isConsole));
131+
$this->service->start(Application::prototype($isConsole));
120132

121133
/**
122134
* Load framework plugins
@@ -141,6 +153,17 @@ private function startRouter(bool $isConsole)
141153
$this->route($isConsole);
142154
}
143155

156+
/**
157+
* Undocumented function
158+
*
159+
* @param mixed $response
160+
* @return bool
161+
*/
162+
public function parseResponse($response) : bool
163+
{
164+
return $this->service->onExit($response);
165+
}
166+
144167
/**
145168
* Set application request
146169
*

Upstart/Service.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,26 @@ public function start(?array $args = null)
4646

4747
$this->boot($extendable);
4848
}
49+
50+
/**
51+
* Handle on exit response
52+
*
53+
* @param mixed $response
54+
* @return bool
55+
*/
56+
public function onExit($response) : bool
57+
{
58+
return $this->exit($response);
59+
}
60+
61+
/**
62+
* Handle application response on exit
63+
*
64+
* @param mixed $response
65+
* @return bool
66+
*/
67+
protected function exit($response) : bool
68+
{
69+
return false;
70+
}
4971
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "modulusphp/framework",
33
"description": "Framework component for Modulus",
4-
"version": "1.9.9.3",
4+
"version": "1.9.9.4",
55
"license": "MIT",
66
"type": "package",
77
"authors": [{

0 commit comments

Comments
 (0)