File tree Expand file tree Collapse file tree 5 files changed +78
-37
lines changed
Expand file tree Collapse file tree 5 files changed +78
-37
lines changed Original file line number Diff line number Diff line change 1818 "php" : " >=8.0" ,
1919 "ext-json" : " *" ,
2020 "ext-redis" : " *" ,
21+ "utopia-php/cli" : " 0.17.*" ,
2122 "utopia-php/framework" : " 0.34.*" ,
22- "utopia-php/cli " : " 0.15 .*" ,
23- "utopia-php/queue " : " 0.14 .*"
23+ "utopia-php/queue " : " 0.14 .*" ,
24+ "utopia-php/validators " : " 0.1 .*"
2425 },
2526 "require-dev" : {
2627 "phpunit/phpunit" : " 9.*" ,
Original file line number Diff line number Diff line change 33namespace Utopia \Platform ;
44
55use Exception ;
6- use Utopia \App ;
6+ use Utopia \Http \ Http ;
77use Utopia \CLI \CLI ;
88use Utopia \Queue \Adapter \Swoole ;
99use Utopia \Queue \Server ;
10- use Utopia \Route ;
10+ use Utopia \Http \ Route ;
1111
1212abstract class Platform
1313{
@@ -82,16 +82,16 @@ protected function initHttp(array $services): void
8282 /** @var Action $action */
8383 switch ($ action ->getType ()) {
8484 case Action::TYPE_INIT :
85- $ hook = App ::init ();
85+ $ hook = Http ::init ();
8686 break ;
8787 case Action::TYPE_ERROR :
88- $ hook = App ::error ();
88+ $ hook = Http ::error ();
8989 break ;
9090 case Action::TYPE_OPTIONS :
91- $ hook = App ::options ();
91+ $ hook = Http ::options ();
9292 break ;
9393 case Action::TYPE_SHUTDOWN :
94- $ hook = App ::shutdown ();
94+ $ hook = Http ::shutdown ();
9595 break ;
9696 case Action::TYPE_DEFAULT :
9797 default :
@@ -100,7 +100,7 @@ protected function initHttp(array $services): void
100100 if ($ httpMethod === null || $ httpPath === null ) {
101101 throw new Exception ('HTTP method and path must be set for default actions ' );
102102 }
103- $ hook = App ::addRoute ($ httpMethod , $ httpPath );
103+ $ hook = Http ::addRoute ($ httpMethod , $ httpPath );
104104 break ;
105105 }
106106
@@ -125,10 +125,7 @@ protected function initHttp(array $services): void
125125 $ option ['description ' ],
126126 $ option ['optional ' ],
127127 $ option ['injections ' ],
128- $ option ['skipValidation ' ],
129- $ option ['deprecated ' ],
130- $ option ['example ' ],
131- $ option ['model ' ],
128+ $ option ['skipValidation ' ]
132129 );
133130 break ;
134131 case 'injection ' :
Original file line number Diff line number Diff line change 33namespace Utopia \Tests ;
44
55use Utopia \Platform \Action ;
6- use Utopia \Response ;
6+ use Utopia \Http \ Response ;
77
88class TestActionInit extends Action
99{
Original file line number Diff line number Diff line change 22
33require_once __DIR__ .'/../../vendor/autoload.php ' ;
44
5- use Utopia \App ;
6- use Utopia \Request ;
7- use Utopia \Response ;
5+ use Utopia \Http \Adapter \FPM \Server ;
6+ use Utopia \Http \Http ;
87use Utopia \Tests \TestPlatform ;
98
109ini_set ('memory_limit ' , '512M ' );
1615$ platform = new TestPlatform ();
1716$ platform ->init ('http ' );
1817
19- $ request = new Request ();
20- $ response = new Response ();
21-
22- $ app = new App ('UTC ' );
23- $ app ->run ($ request , $ response );
18+ $ server = new Server ();
19+ $ http = new Http ($ server , 'UTC ' );
20+ $ http ->start ();
You can’t perform that action at this time.
0 commit comments