/** * Load the controller and run the method * * @static * @return object instance of controller */ public static final function &instance() { if (self::$insta === NULL) { // Include the Controller file require self::$controller; // Make sure the controller class exists try { // Start validation of the controller $class = new ReflectionClass(ucfirst(str_replace('-', '_', X4Route_core::$control) . '_controller')); } catch (ReflectionException $e) { // Controller does not exist $class = new ReflectionClass('X4Page_controller'); } // Create a new controller instance $controller = $class->newInstance(); // caching // only if area is public and _POST is empty if (CACHE && X4Route_core::$folder == 'public' && !X4Route_core::$post) { X4Cache_core::setPrefix(COOKIE); X4Cache_core::setStore(APATH . 'files/tmp/'); // if no cache to read if (!X4Cache_core::Start($_SERVER['REQUEST_URI'], CACHE_TIME)) { self::$caching = true; } else { self::$inst = false; if (DEBUG) { echo X4Bench_core::info('<span>X4WebApp v. {x4wa_version} - execution time: {execution_time} - memory usage: {memory_usage} - queries: {queries} - included files: {included_files}</span>'); } } } if (self::$inst) { try { // Load the controller method $method = $class->getMethod(str_replace('-', '_', X4Route_core::$method)); if ($method->isProtected() or $method->isPrivate()) { // Do not attempt to invoke protected methods throw new ReflectionException('protected controller method'); } // Default arguments $arguments = X4Route_core::$args; } catch (ReflectionException $e) { // Use __call instead $method = $class->getMethod('__call'); // Use arguments in __call format $arguments = array(X4Route_core::$method, X4Route_core::$args); } // Execute the controller method $method->invokeArgs($controller, $arguments); } } return self::$insta; }
echo '</div> </div>'; } ?> </div> </div> <div id="footer"> <p class="text-center small"> <a href="http://www.x3cms.net" title="X3 your next Content Management System">X3 CMS</a> powered by <a href="http://www.cblu.net" title="Cblu.net - Software & Web design">Cblu.net</a><br /> <a href="http://www.x3cms.net/en/x3_cms_legal_notices" title="X3 CMS Legal Notices">X3 CMS Legal Notices</a> </p> <?php if (DEBUG) { // display some info echo X4Bench_core::info('<p class="text-center small">X4WebApp v. {x4wa_version} - execution time: {execution_time} - memory usage: {memory_usage} - queries: {queries} - included files: {included_files}</p>'); } ?> </div> <?php if (!DEBUG) { ?> <script> /* var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXX']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
echo '<div id="msg"><div><p>' . _UNSUPPORTED_BROWSER . '</p></div></div>'; echo '<div class="block"><h4>' . _SUPPORTED_BROWSER . '</h4>', '<a href="http://www.google.com/chrome" title="Google Chrome"><img src="' . THEME_URL . 'img/chrome.png" alt="Google Chrome" /></a>', '<a href="http://www.mozilla.org/firefox/new/" title="Mozilla Firefox"><img src="' . THEME_URL . 'img/firefox.png" alt="Mozilla Firefox" /></a>', '<a href="http://www.opera.com/download/" title="Opera"><img src="' . THEME_URL . 'img/opera.png" alt="Opera" /></a>'; // Windows users and Mac OSX users if (strstr($browser, 'Windows') != '') { echo '<a href="http://support.apple.com/it_IT/downloads/#internet" title="Safari"><img src="' . THEME_URL . 'img/safari.png" alt="Safari" /></a>', '<a href="http://windows.microsoft.com/it-IT/internet-explorer/products/ie/home" title="Internet Explorer"><img src="' . THEME_URL . 'img/ie.png" alt="Internet Explorer" /></a>'; } else { if (strstr($browser, 'Macintosh') != '' || strstr($browser, 'Mac_PowerPC') != '') { echo '<a href="http://support.apple.com/it_IT/downloads/#internet" title="Safari"><img src="' . THEME_URL . 'img/safari.png" alt="Safari" /></a>'; } else { echo '<img src="' . THEME_URL . 'img/safari_gray.png" alt="Safari" />', '<img src="' . THEME_URL . 'img/ie_gray.png" alt="Internet Explorer" />'; } } echo '</div>'; } ?> </div> </div> </div> <div class="band padded clearfix"> <footer class="one-half sm-one-whole push-one-fourth sm-push-none small gray double-padded"> <p class="small acenter"><a href="http://www.x3cms.net" title="X3 your next Content Management System">X3 CMS</a> © <a href="http://www.cblu.net" title="Cblu.net - Software & Web design">Cblu.net</a></p> <?php echo '<p class="xs-hidden xsmall">' . X4Bench_core::info('X4WebApp v. {x4wa_version} © Cblu.net - execution time: {execution_time} - memory usage: {memory_usage} - queries: {queries} - included files: {included_files}'); echo '<br />' . $browser . '</p>'; ?> </div> </div> </body> </html>