Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piffall/phramework
Some useful classes and function libraries.
https://github.com/piffall/phramework
Last synced: 5 days ago
JSON representation
Some useful classes and function libraries.
- Host: GitHub
- URL: https://github.com/piffall/phramework
- Owner: piffall
- License: gpl-3.0
- Created: 2014-02-09T19:51:52.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-17T12:27:21.000Z (over 9 years ago)
- Last Synced: 2024-04-03T01:43:01.440Z (7 months ago)
- Language: PHP
- Homepage:
- Size: 242 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phramework
__phramework__ is a collection of PHP classes that I use frequently.
## Installation
Go to yout project directory and install the package.
```bash
# Install composer if is not installed
curl -sS https://getcomposer.org/installer | php# Install phramework using composer
php composer.phar require piffall/phramework
```Now, require Composer's autoloader in your aplication.
```php
require 'vendor/autoload.php';
```## Curl
Curl is a curl wrapper. Here is an example.
```php
use PHK\Curl as Curl;// New instance
$c = new Curl();// GET
$c->setUrl('http://yourdomain.net');
$c->get();// POST
$c->setUrl('http://yourdomain.net/action/');
$c->setDataFields(array('username'=>'user', 'password'=>'*****'));
$c->post();// Result
$html = $c->getLastReturn();// Reset Object
$c->reset();// POST Multipart
$c->setUrl('http://yourdomain.net/action/');
$c->setDataFields(array('username'=>'user', 'password'=>'*****'), true);// Errors
$err_no = $c->getErrorNumber();
$err_str = $c->getErrorString();
```