diff --git a/Auth/Auth.php b/Auth/Auth.php index d3a5a737b..c174be1bb 100644 --- a/Auth/Auth.php +++ b/Auth/Auth.php @@ -108,7 +108,7 @@ class Auth implements OptionsInterface case DatabaseType::MYSQL: $sth = $this->connection->con->prepare( - 'SELECT + 'SELECT `' . $this->connection->prefix . 'account`.* FROM `' . $this->connection->prefix . 'account` @@ -119,7 +119,7 @@ class Auth implements OptionsInterface $sth->execute(); $result = $sth->fetchAll(); -break; + break; } // TODO: check if user is allowed to login on THIS page (backend|frontend|etc...) diff --git a/Message/Http/Request.php b/Message/Http/Request.php index 6e3026901..f8f7ec621 100644 --- a/Message/Http/Request.php +++ b/Message/Http/Request.php @@ -392,6 +392,14 @@ class Request extends RequestAbstract return '/'; } + /** + * Get files passed in request. + * + * @return array + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public function getFiles() : array { return $this->files; @@ -402,6 +410,14 @@ class Request extends RequestAbstract // NOT Required for Http request } + /** + * Get request route. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public function getRoutify() : \string { return $this->uri->__toString(); diff --git a/Message/Http/Rest.php b/Message/Http/Rest.php index 66dd0ece0..a1d813e3b 100644 --- a/Message/Http/Rest.php +++ b/Message/Http/Rest.php @@ -20,7 +20,7 @@ use phpOMS\Message\RequestMethod; use phpOMS\Uri\InvalidUriException; /** - * Request class. + * Rest request class. * * @category Framework * @package phpOMS\Request @@ -32,10 +32,30 @@ use phpOMS\Uri\InvalidUriException; */ class Rest { + /** + * Url. + * + * @var string + * @since 1.0.0 + */ private $url = ''; - private $method = ''; + /** + * Method. + * + * @var string + * @since 1.0.0 + */ + private $method = RequestMethod::POST; + /** + * Set url. + * + * @param \string $url Url + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public function setUrl(\string $url) { if (filter_var($url, FILTER_VALIDATE_URL) === false) { throw new InvalidUriException('$url'); @@ -44,6 +64,14 @@ class Rest $this->url = $url; } + /** + * Set method. + * + * @param \string $method Method + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ public function setMethod(\string $method) { if(!RequestMethod::isValidValue($method)) { throw new InvalidEnumValue($method); @@ -52,7 +80,17 @@ class Rest $this->method = $method; } - public function callApi($data = false) + /** + * Make request. + * + * @param mixed $data Data to pass + * + * @return \string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function callApi($data = false) : \string { $curl = curl_init();