From 5cc344c8d7d4bc3d92a3ce093cae8ca1e97f0eec Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 16 Nov 2017 21:07:37 +0100 Subject: [PATCH] Improve docs further --- basics/requests.md | 21 +++++++++++++++++++++ quality/tests.md | 2 +- security/security_guidelines.md | 10 ---------- services/collection.md | 0 services/encoding.md | 0 services/encryption.md | 0 services/uri.md | 1 + 7 files changed, 23 insertions(+), 11 deletions(-) delete mode 100644 services/collection.md delete mode 100644 services/encoding.md delete mode 100644 services/encryption.md diff --git a/basics/requests.md b/basics/requests.md index 3833a64..43c4d29 100644 --- a/basics/requests.md +++ b/basics/requests.md @@ -4,8 +4,29 @@ Requests can be either incoming requests such as http requests on the server sid ## 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 +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 ## Websocket Requests diff --git a/quality/tests.md b/quality/tests.md index 1ea7d49..7735849 100644 --- a/quality/tests.md +++ b/quality/tests.md @@ -8,7 +8,7 @@ This application uses PHPUnit as unit testing framework. The PHPUnit directory i ### 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 diff --git a/security/security_guidelines.md b/security/security_guidelines.md index 9076228..9ecd7d8 100644 --- a/security/security_guidelines.md +++ b/security/security_guidelines.md @@ -122,18 +122,8 @@ These are just a few examples but it is very important to make sure, that these 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 if(($pathNew = realpath($path)) === false) { 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. \ No newline at end of file diff --git a/services/collection.md b/services/collection.md deleted file mode 100644 index e69de29..0000000 diff --git a/services/encoding.md b/services/encoding.md deleted file mode 100644 index e69de29..0000000 diff --git a/services/encryption.md b/services/encryption.md deleted file mode 100644 index e69de29..0000000 diff --git a/services/uri.md b/services/uri.md index 414211b..9455dc1 100644 --- a/services/uri.md +++ b/services/uri.md @@ -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. +* /base = base uri (e.g. http://www.yoururl.com/basepath) * /scheme = current scheme (e.g. http) * /host = current host (e.g. www.yoururl.com) * /lang = current language (e.g. en)