<?php
/**
 * @version 0.1.0
 * @link http://www.xapp-studio.com
 * @author XApp-Studio.com support@xapp-studio.com
 * @license : GPL v2. http://www.gnu.org/licenses/gpl-2.0.html
 */

class SQLConfig
{
    public static $cache = null;

    public static function setCache($query,$valid)
    {
        if(!SQLConfig::getFromCache($query)){
            return SQLConfig::$cache->set_cache(md5($query).'.q',$valid);
        }
    }

    public static function getFromCache($query)
    {

        if(SQLConfig::$cache==null){
            SQLConfig::$cache = new SimpleCache();
            SQLConfig::$cache->cache_time=1000;

        }
        return SQLConfig::$cache->get_cache(md5($query).'.q');
    }

    public static $sqlBlackList = array('INSERT','UPDATE','DELETE','password');

    public static $sqlWhiteList = array(
'J1NFTEVDVCAjX19lYXN5YmxvZ19jYXRlZ29yeS5pZCByZWZJZCwgI19fZWFzeWJsb2dfY2F0ZWdvcnkudGl0bGUgdGl0bGUsICNfX2Vhc3libG9nX2NhdGVnb3J5LnB1Ymxpc2hlZCBwdWJsaXNoZWQsICNfX2Vhc3libG9nX2NhdGVnb3J5LnBhcmVudF9pZCBncm91cElkLCAjX19lYXN5YmxvZ19jYXRlZ29yeS5hdmF0YXIgaWNvbiBGUk9NICNfX2Vhc3libG9nX2NhdGVnb3J5Jw==',
'J1NFTEVDVCAjX19lYXN5YmxvZ19jYXRlZ29yeS5pZCByZWZJZCwgI19fZWFzeWJsb2dfY2F0ZWdvcnkudGl0bGUgdGl0bGUsICNfX2Vhc3libG9nX2NhdGVnb3J5LmRlc2NyaXB0aW9uIGRlc2NyaXB0aW9uLCAjX19lYXN5YmxvZ19jYXRlZ29yeS5wdWJsaXNoZWQgcHVibGlzaGVkLCAjX19lYXN5YmxvZ19jYXRlZ29yeS5wYXJlbnRfaWQgZ3JvdXBJZCwgI19fZWFzeWJsb2dfY2F0ZWdvcnkuYXZhdGFyIGljb24gRlJPTSAjX19lYXN5YmxvZ19jYXRlZ29yeSc=',
'J1NFTEVDVCAjX19lYXN5YmxvZ190YWcuaWQgcmVmSWQsICNfX2Vhc3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