<?php
/**
 * ErrorController
 * Feel free to change this and customize your own error message
 *
 * @author darkredz
 */
class ErrorController extends DooController{

	
	function emailtext(){
		
		$redis = new Redis();
		$redis->connect('120.27.200.79', '6379');
		
		$redis->set('name','leesin');
		echo $redis->get('name');
		die;
		
// 		$trainStatus = $this->get_args ( 'substitution_vars' ) ? $this->get_args ( 'substitution_vars' ) : "";
// 		file_put_contents(DOO::conf ()->SITE_PATH . "upload/invoice/email.json", $trainStatus.PHP_EOL,FILE_APPEND);
	}
	
    public function index(){
        echo '<h1>ERROR 404 not found</h1>';
        echo '<p>This is handler by an internal Route as defined in common.conf.php $config[\'ERROR_404_ROUTE\']</p>
                
<p>Your error document needs to be more than 512 bytes in length. If not IE will display its default error page.</p>

<p>Give some helpful comments other than 404 :(
Also check out the links page for a list of URLs available in this demo.</p>';
    }
	
    function get_args($name) {
    	if (isset ( $_GET [$name] )) {
    		if (is_array ( $_GET [$name] ))
    			return $_GET [$name];
    			else
    				return addslashes ( $_GET [$name] );
    	} elseif (isset ( $_POST [$name] )) {
    		if (is_array ( $_POST [$name] ))
    			return $_POST [$name];
    			else
    				return addslashes ( $_POST [$name] );
    	} else
    		return false;
    }

}
?>