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
+43-16Lines changed: 43 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');
63
+
$http = new Http(new Server(), $container, 'America/New_York');
47
64
$http->start();
48
65
```
49
66
@@ -66,6 +83,7 @@ The library supports server adapters to be able to run on any PHP setup. You cou
66
83
#### Use PHP FPM server
67
84
68
85
```php
86
+
use Utopia\DI\Container;
69
87
use Utopia\Http\Http;
70
88
use Utopia\Http\Response;
71
89
use Utopia\Http\Adapter\FPM\Server;
@@ -78,7 +96,7 @@ Http::get('/')
78
96
}
79
97
);
80
98
81
-
$http = new Http(new Server(), 'America/New_York');
99
+
$http = new Http(new Server(), new Container() 'America/New_York');
82
100
$http->start();
83
101
```
84
102
@@ -87,6 +105,7 @@ $http->start();
87
105
#### Using Swoole server
88
106
89
107
```php
108
+
use Utopia\DI\Container;
90
109
use Utopia\Http\Http;
91
110
use Utopia\Http\Request;
92
111
use Utopia\Http\Response;
@@ -101,13 +120,13 @@ Http::get('/')
101
120
}
102
121
);
103
122
104
-
$http = new Http(new Server('0.0.0.0', '80'), 'America/New_York');
123
+
$http = new Http(new Server('0.0.0.0', '80' , ['open_http2_protocol' => true]), new Container(), 'America/New_York');
105
124
$http->start();
106
125
```
107
126
108
127
> 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
128
110
-
###Parameters
129
+
###Parameters
111
130
112
131
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
132
@@ -206,16 +225,24 @@ Http::init()
206
225
207
226
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
227
209
-
### Resources
228
+
### Injections
210
229
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.
230
+
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