You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-16Lines changed: 50 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
Utopia HTTP is a PHP MVC based framework with minimal must-have features for professional, simple, advanced and secure web development. This library is maintained by the [Appwrite team](https://appwrite.io).
10
10
11
-
Utopia HTTP is dependency-free. Any extra features, such as authentication or caching are available as standalone models in order to keep the framework core clean, light, and easy to learn.
11
+
Utopia HTTP is *almost*dependency-free. Any extra features, such as authentication or caching are available as standalone models in order to keep the framework core clean, light, and easy to learn.
$http = new Http(new Server(), 'America/New_York');
70
+
$http = new Http(new Server(), $container, 'America/New_York');
47
71
$http->start();
48
72
```
49
73
@@ -66,6 +90,7 @@ The library supports server adapters to be able to run on any PHP setup. You cou
66
90
#### Use PHP FPM server
67
91
68
92
```php
93
+
use Utopia\DI\Container;
69
94
use Utopia\Http\Http;
70
95
use Utopia\Http\Response;
71
96
use Utopia\Http\Adapter\FPM\Server;
@@ -78,7 +103,7 @@ Http::get('/')
78
103
}
79
104
);
80
105
81
-
$http = new Http(new Server(), 'America/New_York');
106
+
$http = new Http(new Server(), new Container() 'America/New_York');
82
107
$http->start();
83
108
```
84
109
@@ -87,6 +112,7 @@ $http->start();
87
112
#### Using Swoole server
88
113
89
114
```php
115
+
use Utopia\DI\Container;
90
116
use Utopia\Http\Http;
91
117
use Utopia\Http\Request;
92
118
use Utopia\Http\Response;
@@ -101,13 +127,13 @@ Http::get('/')
101
127
}
102
128
);
103
129
104
-
$http = new Http(new Server('0.0.0.0', '80'), 'America/New_York');
130
+
$http = new Http(new Server('0.0.0.0', '80' , ['open_http2_protocol' => true]), new Container(), 'America/New_York');
105
131
$http->start();
106
132
```
107
133
108
134
> When using Swoole, you can use the command `php src/server.php` to run the HTTP server locally, but you need Swoole installed. For setup with Docker, check out our [example application](/example)
109
135
110
-
###Parameters
136
+
###Parameters
111
137
112
138
Parameters are used to receive input into endpoint action from the HTTP request. Parameters could be defined as URL parameters or in a body with a structure such as JSON.
113
139
@@ -206,16 +232,24 @@ Http::init()
206
232
207
233
Groups are designed to be actions that run during the lifecycle of requests to endpoints that have some logic in common. Groups allow you to prevent code duplication and are designed to be defined anywhere in your source code to allow flexibility.
208
234
209
-
### Resources
235
+
### Injections
210
236
211
-
Resources allow you to prepare dependencies for requests such as database connection or the user who sent the request. A new instance of a resource is created for every request.
237
+
Injections allow you to prepare dependencies for requests such as database connection or the user who sent the request. A new instance of a resource is created for every request.
0 commit comments