2017 © Pedro Peláez
 

library php-tools

PHP module for common tools

image

zguillez/php-tools

PHP module for common tools

  • Friday, November 3, 2017
  • by zguillez
  • Repository
  • 1 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 100 % Grown

The README.md

php-tools

Join the chat at https://gitter.im/zguillez/php-tools License, (*1)

PHP module for common tools, (*2)

Getting Started

Add package to composer.json

composer require zguillez/php-tools, (*3)

//packaje.json
{
    "require": {
        "zguillez/php-tools": "^0.1.0"
    }
}

Usage:

require 'vendor/autoload.php';
use Z\Tools;

$tools = new Tools();
$tools->test('This is a test!');

Examples

HTTP/GET

$data  = ['nombre' => 'test', 'apellidos' => 'test', 'email' => 'test@test.com'];
$result = $tools->get('https://dummy.webservice.com/json', $data, true);
$tools->test($result);

HTTP/POST

$data  = ['nombre' => 'test', 'apellidos' => 'test', 'email' => 'test@test.com'];
$result = $tools->post('https://dummy.webservice.com/json', $data, true);
$tools->test($result);

DATABASE

$db = $tools->database('***.***.***.***', 'user', '********', 'database');
$db->sql('INSERT INTO dummy_table SET value=1']);
leadid = $db->sql2lead('INSERT INTO dummy_table SET value=1']);
$tools->test($result);

EXCEL

$data = [[1, "a"], [2, "b"], [3, "c"], [4, "d"]];
$tools->excel('test', $data, ['id', 'value']);

DATABASE 2 EXCEL

$data = $tools->sql2array('SELECT * FROM dummy_table');
$tools->excel('test', $data, ['id', 'value', 'created_at'], true);
$tools->sql2csv('test', 'SELECT * FROM dummy_table', ['id', 'value', 'created_at']);
$tools->sql2excel('test2', 'SELECT * FROM dummy_table', ['id', 'value', 'created_at']);

Contributing and issues

Contributors are welcome, please fork and send pull requests! If you have any ideas on how to make this project better then please submit an issue or send me an email., (*4)

License

©2020 Zguillez.io, (*5)

Original code licensed under MIT Open Source projects used within this project retain their original licenses., (*6)

Changelog

v1.0.0 (Mar 10, 2020)

  • z-database package
  • z-http package

v0.1.0 (May 31, 2017)

  • GET/POST curl
  • Database connect
  • CSV/EXCEL file export

v0.0.1 (May 10, 2017)

  • Initial implementation

Analytics, (*7)

The Versions

03/11 2017

dev-master

9999999-dev

PHP module for common tools

  Sources   Download

MIT

The Requires

 

by Guillermo de la Iglesia

curl php webservice

20/07 2017

v0.1.1

0.1.1.0

PHP module for common tools

  Sources   Download

MIT

The Requires

 

by Guillermo de la Iglesia

curl php webservice

31/05 2017

v0.1.0

0.1.0.0

PHP module for common tools

  Sources   Download

MIT

The Requires

 

by Guillermo de la Iglesia

curl php webservice

11/05 2017

v0.0.4

0.0.4.0

PHP module for common tools

  Sources   Download

MIT

The Requires

 

by Guillermo de la Iglesia

curl php webservice

10/05 2017

v0.0.3

0.0.3.0

PHP module for common tools

  Sources   Download

MIT

by Guillermo de la Iglesia

curl php webservice

10/05 2017

v0.0.2

0.0.2.0

PHP module for common tools

  Sources   Download

MIT

by Guillermo de la Iglesia

curl php webservice

10/05 2017

v0.0.1

0.0.1.0

PHP module for common tools

  Sources   Download

MIT

by Guillermo de la Iglesia

curl php webservice