-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.php
38 lines (36 loc) · 992 Bytes
/
Main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Created by PhpStorm.
* User: kumfo
* Date: 2018/2/24
* Time: 上午9:45
*/
class Main {
public $blockChain = [];
public function __construct()
{
$this->autoload();
}
public function autoload() {
spl_autoload_register(function($class) {
$path = dirname(__FILE__);
$filePath = explode('\\',$class);
$file = implode('/',$filePath).'.php';
require_once $path.'/'.$file;
});
}
public function testBlock() {
/*$block1hash = new Block('This is the first block','0');
$block2hash = new Block('This is the second block',$block1hash->hash);
$block3hash = new Block('This is the third block',$block2hash->hash);
$this->blockChain = [
$block1hash,
$block2hash,
$block3hash
];
var_dump(json_encode($this->blockChain));*/
CatchChain::catchBlock();
}
}
$main = new Main();
$main->testBlock();