/** * Method to access all config info. * * This method does not return by reference so that the config data is unmodified for all requests. * * @param $item Optional configuration item specifier or dot syntax specifier. * @return Config item or the entire config. */ public function getConfig($item = null) { if ($item === null) { return $this->config; } else { try { return ArrayTools::dotPath($this->config, $item); } catch (Exception $e) { echo "<pre>" . __METHOD__ . ' ' . $e->getMessage() . "</pre>\n"; } } }
public function loadScript($filename, $path = null) { if (file_exists($filename)) { if (is_readable($filename)) { ob_start(); require_once $filename; $localVariables = compact(array_keys(get_defined_vars())); $result = array(); $result['vars'] = $localVariables; $result['output'] = ob_get_clean(); } else { throw new FileException($filename . ' not readable.'); } } else { throw new FileException($filename . " doesn't exist."); } if ($path !== null) { try { $result = ArrayTools::dotPath($result, $path); } catch (Exception $e) { $result = false; } } return $result; }