Classes, interfaces and traits

PVCommunicator

PVCommunicator opens up communication with other services via Curl, SOAP, or Sockets.

With the rise of RESTFUL API and Microservices, this class was designed to allow easy communication with those services without having to rewrite the underlying commands. Example: ```php //CURL GET $url = 'http://api.wunderground.com/api/Your_Key/conditions/q/CA/San_Francisco.json'; $communicator = new PVCommunicator(); $communicator->send('get', $url); print_r($communicator ->getResponseBody()); //CURL POST $url = 'http://api.example.com/createuser'; $data = array('name' =>'John Doe', 'email' => 'johndoe@example.com') $communicator = new PVCommunicator(); $communicator->send('POST', $url, ); print_r($communicator ->getResponseBody()); ```
« More »

PVRequest

PVRequest is responsible for receiving and parsing income HTTP requests.

Built for receiving communication from other sources, PVRequest has the ability to take a request, parse the headers, get the data, determine what kind of requests, and other features. Example: ```php $request = new PVRequest(); if($request -> isAjaxRequest()) { echo "AJAX REQUEST\n"; } if(strtolower($request -> getRequestMethod()) =='post') { echo "A Post Request was send\n"; } $data = getRequestData(); print_r($data); ```
« More »

PVResponse

PVResponse is responsible for sending HTTP responses back to a client.

The class takes into consideration the many generic responses HTTP has ranging from 200 to 500, and helps make it easy to output the correct response with headers. Example: ```php //Init the class PVResponse::init(); //Successful Response PVResponse::createResponse(200, 'Hello Word!'); //Page Not Found PVResponse::createResponse(404, 'The page you are looking for cannot be found'); ```
« More »

PVRouter

PVRouter is responsible for parsing the URL setting up the ability for routing within your application.

Applications, especially with Frontend Controller Design Pattern, may require routing to get a user to their destination correctly. This class can take rules, route and correctly navigate the user to their destination.
« More »