} $connector = \PhpConsole\Helper::register(); if ($connector->isActiveClient()) { // Apply 'stack' option to PHP Console. //if ( true === $this->options['stack'] ) { //} // Init errors & exceptions handler $handler = \PC::getHandler(); /* You can override default Handler behavior: $handler->setHandleErrors(false); // disable errors handling $handler->setHandleExceptions(false); // disable exceptions handling $handler->setCallOldHandlers(false); // disable passing errors & exceptions to prviously defined handlers */ $handler->start(); // start handling PHP errors & exceptions if (Yare::config('theme.debug.stack')) { $connector->getDebugDispatcher()->detectTraceAndSource = true; $connector->setSourcesBasePath($_SERVER['DOCUMENT_ROOT']); // so files paths on client will be shorter (optional) } //var_dump($_SERVER['DOCUMENT_ROOT']); $connector->setPassword($password); // protect access by password // $connector->enableSslOnlyMode(); // PHP Console clients will be always redirected to HTTPS // $connector->setAllowedIpMasks(array('192.168.*.*')); // Enable eval provider $evalProvider = $connector->getEvalDispatcher()->getEvalProvider(); $evalProvider->disableFileAccessByOpenBaseDir(); // means disable functions like include(), require(), file_get_contents() & etc $evalProvider->addSharedVar('uri', $_SERVER['REQUEST_URI']); // so you can access $_SERVER['REQUEST_URI'] just as $uri in terminal
<?php if (!defined('YARE_MIGRATION')) { define('YARE_MIGRATION', '\\Migration\\'); } if (!defined('YARE_VIEW')) { define('YARE_VIEW', '\\View\\'); } if (!defined('YARE_MODEL')) { define('YARE_MODEL', '\\Model\\'); } class_alias('Yare\\Yare', 'Yare'); $files = array('helpers.php', 'utils.php', 'php-console.php', 'setup.php', 'asset.php', 'admin.php', 'theme.php', 'acf.php', 'templates.php', 'filters.php'); new Yare\Columns(); foreach ($files as $file) { require_once __DIR__ . '/support/' . $file; } $aliases = Yare::config('register.aliases', array()); foreach ($aliases as $alias => $original) { class_alias($original, $alias); } unset($aliases); if (!function_exists('pc')) { function pc($var, $tag = 'debug') { } } foreach (glob(Yare::path('src/support/*.php')) as $file) { require_once $file; } Yare\AdminMenuPage::loader();