/**
  * XMP Var Dump
  * var_dump with <xmp>
  * @author albertdiones@gmail.com
  * @since ADD MVC 0.0
  */
 static function var_dump()
 {
     $args = func_get_args();
     if (!$args) {
         $args[0] = static::get_declared_globals();
     }
     $var = self::return_var_dump($args);
     if (add::current_controller()->content_type() == 'text/plain') {
         $output = "\r\nFile Line:" . self::caller_file_line() . "\r\n" . $var . "\r\n";
     } else {
         $output = "<div style='clear:both'><b>" . self::caller_file_line() . "</b><xmp>" . $var . "</xmp></div>";
     }
     self::restricted_echo($output);
     return $args[0];
 }
 /**
  * content_type()
  *
  * @since ADD MVC 0.8
  */
 public static function content_type($new_content_type = null)
 {
     if ($new_content_type == 'text/plain') {
         ini_set('html_errors', 0);
     }
     return add::current_controller()->content_type($new_content_type);
 }
 /**
  * canonicalize URL to the current controller
  *
  * @since ADD MVC 0.5
  */
 static function canonicalize_path()
 {
     if (add::current_controller()->path() != "{$_GET['add_mvc_path']}") {
         add::current_controller()->redirect();
     }
 }
Example #4
0
<?php

/**
 * Created by PhpStorm.
 * @author albert
 * Date: 1/18/16
 * Time: 3:41 AM
 */
require 'add_configure.php';
$current_controller = add::current_controller();
$current_controller->execute();
<?php

require '../config.php';
require $C->add_dir . '/init.php';
date_default_timezone_set('UTC');
$G_errors = array();
session_start();
session_set_cookie_params(3600, $C->path, $C->domain, true);
#add::canonicalize_path();
add::current_controller()->page();
<?php

require 'add_configure.php';
#add::ca nonicalize_path();
add::current_controller()->execute();