function _keyboardBaseHandleLoad() { // if( _appBaseGetMode( ) == "edit" ) return( false ) ; $byte = _keyboardBasePullInput(); if (chr($byte) == 'p') { if (!_configBaseQuery("loaded")) { $t = _cursorBaseGridLine(); if ($t != "") { $ph = hash('sha256', "~_1ZAF_2WOZ_3ERE_+" . $t); _configBaseQuery("loadedHash", $ph); _configBaseQuery("loaded", true); _appBaseLoadSession(); _logBaseWrite("LOADED!!"); } } return true; } _keyboardBasePushInput($byte); return false; }
function _logBase() { _logBaseWrite("\n#BOOT#" . date('l jS \\of F Y h:i:s A')); }
<?php include "functions-boot-base.php"; _configBaseDebug(); $a = array("a" => 1, "b" => 2, "c" => "what?"); _logBaseWrite($a); for ($i = 0; $i < 65; $i++) { sleep(3); _logBaseWrite("TICKTOCK {$i}"); }
function _appBaseDecrypt($data) { $key = substr(_configBaseQuery("loadedHash"), 0, \Sodium\CRYPTO_SECRETBOX_KEYBYTES); $decoded = $data; $nonce = mb_substr($decoded, 0, \Sodium\CRYPTO_SECRETBOX_NONCEBYTES, '8bit'); $ciphertext = mb_substr($decoded, \Sodium\CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit'); $decrypted = \Sodium\crypto_secretbox_open($ciphertext, $nonce, $key); if ($decrypted === false) { _logBaseWrite("_appBaseDecryptERR!"); _screenBaseCleanUp(); exit; } return $decrypted; }
function _logBase() { _logBaseWrite(date('l jS \\of F Y h:i:s A'), "BOOT"); }
function _gridBaseLoad($fn) { if (!_configBaseQuery("loaded")) { _gridBaseInit(); _logBaseWrite("_gridBaseLoad NOT LOADED"); return; } $afp = _configBaseGet("targetdir") . "/" . $fn; if (file_exists($afp)) { system("cp {$afp} {$afp}." . time()); $t1 = file_get_contents(_configBaseGet("targetdir") . "/" . $fn); $t1 = _appBaseDecrypt($t1); $t2 = base64_decode($t1); $t3 = gzdecode($t2); $t4 = json_decode($t3, true); $data = $t4; _configBaseSet("grid", $data['grid']); $config = $data['config']; _configBaseQuery("config", $config); } else { _gridBaseInit(); } }