2017 © Pedro Peláez
 

library php-toei

PHP library to integrate scattered events in RDB.

image

g737a6b/php-toei

PHP library to integrate scattered events in RDB.

  • Monday, July 16, 2018
  • by g737a6b
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Toei CircleCI

PHP library to integrate scattered events in RDB., (*1)

Examples of use

RDB

-- Table "users"
CREATE TABLE `users` (`id` INT, `name` TEXT, `created` DATETIME, `deleted` DATETIME);
INSERT INTO `users` (`id`, `name`, `created`, `deleted`)
VALUES (1, 'Suzuki', '2017-01-01 12:04:11', NULL),
    (2, 'Tanaka', '2017-01-21 09:57:48', '2017-03-20 18:03:30'),
    (3, 'Yoshida', '2017-02-04 20:47:25', NULL);

-- Table "messages"
CREATE TABLE `messages` (`sender` INT, `receiver` INT, `body` TEXT, `created` DATETIME);
INSERT INTO `messages` (`sender`, `receiver`, `body`, `created`)
VALUES (1, 2, 'Hi!', '2017-01-21 12:01:44'),
    (2, 3, 'Hi!', '2017-02-04 21:54:17'),
    (1, 3, 'Hi!', '2017-02-05 12:03:01'),
    (2, 1, 'Bye!', '2017-03-20 17:54:46'),
    (2, 3, 'Bye!', '2017-03-20 17:56:23');

config.json

{
    "register": {
        "table": "users",
        "identifyBy": "id",
        "sortBy": "created"
    },
    "withdraw": {
        "table": "users",
        "identifyBy": "id",
        "sortBy": "deleted",
        "condition": "created > '2000-01-01 00:00:00'"
    },
    "send_message": {
        "table": "messages",
        "identifyBy": "sender",
        "sortBy": "created"
    },
    "recieve_message": {
        "table": "messages",
        "identifyBy": "receiver",
        "sortBy": "created"
    }
}

PHP

$config = json_decode(file_get_contents("config.json"));
$Toei = new Toei\Toei($PDO, $config);
$Toei->setId(2);
$result = $Toei->project(true);

// array(6) {
//   [0]=>
//   array(3) {
//     ["action"]=>
//     string(8) "register"
//     ["id"]=>
//     string(1) "2"
//     ["time"]=>
//     string(19) "2017-01-21 09:57:48"
//   }
//   [1]=>
//   array(3) {
//     ["action"]=>
//     string(15) "recieve_message"
//     ["id"]=>
//     string(1) "2"
//     ["time"]=>
//     string(19) "2017-01-21 12:01:44"
//   }
//   [2]=>
//   array(3) {
//     ["action"]=>
//     string(12) "send_message"
//     ["id"]=>
//     string(1) "2"
//     ["time"]=>
//     string(19) "2017-02-04 21:54:17"
//   }
//   [3]=>
//   array(3) {
//     ["action"]=>
//     string(12) "send_message"
//     ["id"]=>
//     string(1) "2"
//     ["time"]=>
//     string(19) "2017-03-20 17:54:46"
//   }
//   [4]=>
//   array(3) {
//     ["action"]=>
//     string(12) "send_message"
//     ["id"]=>
//     string(1) "2"
//     ["time"]=>
//     string(19) "2017-03-20 17:56:23"
//   }
//   [5]=>
//   array(3) {
//     ["action"]=>
//     string(8) "withdraw"
//     ["id"]=>
//     string(1) "2"
//     ["time"]=>
//     string(19) "2017-03-20 18:03:30"
//   }
// }

Installation

Composer

Add a dependency to your project's composer.json file., (*2)

{
    "require": {
        "g737a6b/toei": "*"
    }
}

Development

Run tests

docker run -it --rm -v $(pwd):/app composer:1.8 run-script tests

License

The MIT License, (*3)

Copyright (c) 2019 Hiroyuki Suzuki, (*4)

The Versions

16/07 2018

dev-master

9999999-dev

PHP library to integrate scattered events in RDB.

  Sources   Download

MIT

The Development Requires

analysis rdb

16/07 2018

1.1.x-dev

1.1.9999999.9999999-dev

PHP library to integrate scattered events in RDB.

  Sources   Download

MIT

The Development Requires

analysis rdb

16/07 2018

1.1.0

1.1.0.0

PHP library to integrate scattered events in RDB.

  Sources   Download

MIT

The Development Requires

analysis rdb

16/07 2018

dev-180716_dev

dev-180716_dev

PHP library to integrate scattered events in RDB.

  Sources   Download

MIT

The Development Requires

analysis rdb

16/07 2018

dev-180713_deleteme

dev-180713_deleteme

PHP library to integrate scattered events in RDB.

  Sources   Download

MIT

The Development Requires

analysis rdb

03/05 2017

1.0.x-dev

1.0.9999999.9999999-dev

PHP library to integrate scattered events in RDB.

  Sources   Download

MIT

The Development Requires

analysis rdb

03/05 2017

dev-dev

dev-dev

PHP library to integrate scattered events in RDB.

  Sources   Download

MIT

The Development Requires

analysis rdb

03/05 2017

1.0.0

1.0.0.0

PHP library to integrate scattered events in RDB.

  Sources   Download

MIT

The Development Requires

analysis rdb