Improve docs further

This commit is contained in:
Dennis Eichhorn 2017-11-16 21:07:37 +01:00
parent 88da3eddc7
commit 5cc344c8d7
7 changed files with 23 additions and 11 deletions

View File

@ -4,8 +4,29 @@ Requests can be either incoming requests such as http requests on the server sid
## Http Requests ## Http Requests
A http request in its' most basic form only consists of a uri.
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
```
## Rest Requests ## Rest Requests
With the rest implementation it's possible to make http requests and read the response.
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
$result = Rest::request($request);
```
The result contains the raw response text. By defining the request method it's also possible to make other requests such as `PUT` requests.
```php
$request = new Request(new Http('http://your_request.com/url?to=call'));
$request->setMethod(RequestMethod::PUT);
$result = Rest::request($request);
```
## Socket Requests ## Socket Requests
## Websocket Requests ## Websocket Requests

View File

@ -8,7 +8,7 @@ This application uses PHPUnit as unit testing framework. The PHPUnit directory i
### Modules ### Modules
Every module needs to have a `Admin` directory containing a class called `AdminTest.php` which is used for testing the installation, activation, deactivation, uninstall and remove of the module. Tests that install, update, remove etc. a module need to have a group called `admin`. After running the `AdminTest.php` test the final state of the module should be installed and active, only this way it's possible to further test the controller and models. A code coverage of 80% is mandatory for every module for integration. Every module needs to have a `Admin` directory containing a class called `AdminTest.php` which is used for testing the installation, activation, deactivation, uninstall and remove of the module. Tests that install, update, remove etc. a module need to have a group called `admin`. After running the `AdminTest.php` test the final state of the module should be installed and active, only this way it's possible to further test the controller and models. A code coverage of at least 80% is mandatory for every module for integration.
## Jasmine ## Jasmine

View File

@ -122,18 +122,8 @@ These are just a few examples but it is very important to make sure, that these
Example usage: Example usage:
```php
if(($pathNew = realpath($path)) === false || strpos($pathNew, self::MODULE_PATH) === false) {
throw new PathException($path);
}
```
The example throws an exception if the path either doesn't exist or is trying to access a path that doesn't contain the path defined in `self::MODULE_PATH`. Another validation could be:
```php ```php
if(($pathNew = realpath($path)) === false) { if(($pathNew = realpath($path)) === false) {
throw new PathException($path); throw new PathException($path);
} }
``` ```
This example now is not only checking if the path exists and if it contains a path element, it also makes sure that the path is inside the application root path.

View File

View File

View File

View File

@ -28,6 +28,7 @@ It is possible to simply use the current uri and simply append parameters if you
Some default parameters can be used for easier use. Some default parameters can be used for easier use.
* /base = base uri (e.g. http://www.yoururl.com/basepath)
* /scheme = current scheme (e.g. http) * /scheme = current scheme (e.g. http)
* /host = current host (e.g. www.yoururl.com) * /host = current host (e.g. www.yoururl.com)
* /lang = current language (e.g. en) * /lang = current language (e.g. en)