This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
declare (strict_types = 1); | |
/* | |
proof of concept of the inner workings of a Block Chain | |
*/ | |
class BlockChain { | |
public string $path; | |
public array $data; | |
public function __construct(string $path) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// php7 emulation of apc_* functions | |
if (!function_exists('apc_fetch')) { | |
function apc_fetch($key) { | |
return apcu_fetch($key); | |
} | |
function apc_exists($keys) { | |
return apcu_exists($keys); | |
} | |
function apc_delete($key) { | |
return apcu_delete($key); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get a reference of your connections someware | |
$GLOBALS['__db_link'] = mysqli_connect($__dbaddress,$__login,$__password,$__dbname); | |
if (mysqli_connect_errno()) { | |
die(mysqli_connect_error()); | |
} | |
// php7 emulation | |
function mysql_query($rs) { return mysqli_query($GLOBALS['__db_link'], $rs); } | |
function mysql_fetch_assoc($rs) { return mysqli_fetch_assoc($rs); } | |
function mysql_fetch_array($rs) { return mysqli_fetch_array($rs); } | |
function mysql_fetch_row($rs) { return mysqli_fetch_row($rs); } |