There is no license information available for the latest version (v1.1.1) of this package.

General useful PHP7 Library

v1.1.1 2017-01-08 18:10 UTC

README

This branch/lib is only for PHP7.

Installation

Install the latest version with

composer require sgc-fireball/libphp

Features

  • Event management
  • PCNTL Signal handling
  • Color convertions
    • rgb2hsv
    • rgb2hsl
    • rgb2hex
    • rgb2cmyk
    • rgb2xterm
    • hsv2rgb
    • hsv2hex
    • hsv2hsl
    • hsv2cmyk
    • hsl2rgb
    • hsl2hex
    • hsl2cmyk
    • hsl2hsv
    • hex2rgb
    • hex2hsl
    • hex2cmyk
    • hex2hsv
    • cmyk2rgb
    • cmyk2hsl
    • cmyk2hex
    • cmyk2hsv
    • xterm2cmyk
    • xterm2hex
    • xterm2hsl
    • xterm2hsv
    • xterm2rgb
    • xyb2rgb (testing!!!)
    • rgb2xyb (testing!!!)
  • FTP wrapper
  • generic TCP client
  • generic UDP client
  • SSDP client (Simple Service Discovery Protocol)
  • generic TCP server
  • generic UDP server
  • WebSocket Server
  • SSDP server (Simple Service Discovery Protocol)
  • SSL server validator (using openssl)
  • file wrapper and multiprocess safe file wrapper
  • geoip for ipv4 and ipv6 (based on country codes via ripe database)
  • interval manager (setinterval in js)
  • timer manager (settimeout in js)
  • linux daemon component
  • multi processing manager with processlist administration
  • multiprocessing shared storage via SHM or filesystem.
  • fifo buffer
  • filo buffer
  • ring buffer
  • csv wrapper
  • ipv4 and ipv6 calculation
    • subnetting and supernetting
  • generic struct object
  • url decoder and encoder
  • xml decoder and encoder
  • php based incoming network sniffer (icmp, tcp, udp)
  • homematic binrpc decoder/encoder
  • redis message queue

Examples

TCP Echo Server

Start the TCP Echo Server in Console 1:

cd ./libphp
php bin/example.php example:echoserver --help
php bin/example.php example:echoserver --listen 127.0.0.1 --port 12345

Start another Console to connect to TCP Echo Server:

telnet 127.0.0.1 12345

SSL Verify

A single console command to run ssl verification:

cd ./libphp
php bin/sslverify.php --host=www.google.com --port=443

Tests

Run all tests

cd ./libphp
composer test

Test it with PHP Code Sniffer

cd ./libphp
bin/phpcs

Test it with PHPUnit

cd ./libphp
bin/phpunit

Test it with PHP Copy/Paste Detector

cd ./libphp
bin/phpcpd src/

Test it with PHP Mess Detector

cd ./libphp
bin/phpmd src/ text cleancode,codesize,controversial,design,naming,unusedcode --suffixes php

About

Author

Richard Hülsberg - rh+github@hrdns.de - https://www.hrdns.de