private static function execute_view($__melody_response = null, $buffer, $class, $req) { $__melody_response = is_null($__melody_response) ? new Response() : $__melody_response; // permet d'accéder aux différentes variables directement dans la view $vars = $__melody_response->viewvars; if (!empty($__melody_response->viewpath)) { if ($__melody_response->viewpath[1]) { list($apps, $file) = $__melody_response->viewpath[0]; $path = Tools::pathfor($apps, 'views' . DIRECTORY_SEPARATOR . $file, '.php'); } else { $path = Tools::pathfor(array_filter(!is_null(FrontController::$apps) ? FrontController::$apps : array()), 'views' . DIRECTORY_SEPARATOR . $__melody_response->viewpath[0], '.php'); } ob_start(); include $path; $output = ob_get_clean(); if ($__melody_response->cache) { Cache::create('controller', $class . '_' . FrontController::$method, $output, $__melody_response->cache_mode, $__melody_response->expiration); } return $output; } return $buffer; }
static function Host_getConfigFromPath($path) { $cachename = 'action_' . implode('_', array_filter($path)); if (false === ($cache = Cache::get('coreconfig/host', $cachename))) { $bufferedpath = ''; $bufferedconfig = array(); $isLast = true; $path = array_filter($path); $config = array(); if (isset(self::$hosts['base_config']['path']['/'])) { $bufferedconfig = self::$hosts['base_config']['path']['/']; if ($bufferedconfig['recursive']) { $config = $bufferedconfig; } } if (isset(self::$hosts['path']['/'])) { $bufferedconfig = self::$hosts['path']['/']; } if ($bufferedconfig['recursive']) { $config = $bufferedconfig; } while ($key = array_shift($path)) { $bufferedpath .= '/' . $key; if (isset(self::$hosts['path'][$bufferedpath])) { $isLast = true; $bufferedconfig = self::$hosts['path'][$bufferedpath]; if ($bufferedconfig['recursive']) { $config = $bufferedconfig; } } else { $isLast = false; } } if ($isLast) { Cache::create('coreconfig/host', $cachename, $bufferedconfig, 'on_demand'); return $bufferedconfig; } else { Cache::create('coreconfig/host', $cachename, $config, 'on_demand'); return $config; } } else { return $cache; } }