Example #1
0
function data_store_delete($key)
{
    $data_lookups = get_lookups();
    $lookup;
    if (isset($data_lookups[$key])) {
        $lookup = $data_lookups[$key];
    } else {
        $lookup = get_lookup_from_file($key, null);
    }
    // $file_name = __PATH_DATA__.$lookup['key'].'.json';
    // // Delete the backup file if it exists.
    // if (file_exists($file_name))
    // {
    // 	unlink($file_name);
    // }
    // Remove the value from memory if it exists.
    $index_lookup = array_search($lookup['key'], array_keys($data_lookups));
    if ($index_lookup !== false) {
        apc_delete($lookup['key']);
        array_splice($data_lookups, $index_lookup, 1);
        save_lookups($data_lookups);
    }
}
Example #2
0
<?php

header('Access-Control-Allow-Origin: *');
if (!defined('__IS_LIVE__')) {
    require_once './CONFIG.php';
}
require_once './data_store.php';
$data_lookups = get_lookups();
echo '<b>LOOKUPS (' . count($data_lookups) . '):</b>';
$keys_lookup = array_keys($data_lookups);
for ($index_lookup = 0; $index_lookup < count($data_lookups); ++$index_lookup) {
    $key = $keys_lookup[$index_lookup];
    $lookup = $data_lookups[$key];
    echo '<br>&nbsp;&nbsp;&nbsp;&nbsp;' . json_encode($lookup);
}