Beispiel #1
0
<?php

use Avovello\Xphp\Facades\Pusher;
use Avovello\Xphp\Facades\Auth;
spl_autoload_register(function ($class) {
    $prefix = 'Avovello\\Xphp\\';
    $base_dir = __DIR__ . '/src/';
    $len = strlen($prefix);
    if (strncmp($prefix, $class, $len) !== 0) {
        return;
        //No Avovello\xphp prefix found, pass through to next autoloader
    }
    $relative_class = substr($class, $len);
    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
    if (file_exists($file)) {
        require $file;
    }
});
$dbConfig = (require_once __DIR__ . '/src/config/Database.php');
$pushTokens = [['device_id' => '123', 'platform' => 'ios', 'push_token' => 'asdfsdafsdf'], ['device_id' => '234', 'platform' => 'windows', 'push_token' => 'asdfsadf'], ['device_id' => '345', 'platform' => 'android', 'push_token' => 'asdfsadfsdf']];
$object = new Pusher($dbConfig);
$object->dropTables();
$object->createTables();
//$new_id_user = $object->addUser('user','*****@*****.**', 'test');
//$new_token = $object->login('user', 'test');
//$user = $object->checkToken('0b5de927-3304-4cd2-90b0-8a0ccb8e9b48');
Pusher::printR('-------');
Pusher::printR($object);