/** * Determines if an url is active or not. * * @param array $item the item config * @return bool true if active */ protected function isItemActive($item) { if (!isset($item['url'])) { return false; } if (isset($this->isActiveCallback)) { return call_user_func($this->isActiveCallback, $item); } else { return \asinfotrack\yii2\toolbox\helpers\Url::isUrlActive($item['url']); } }
/** * Prepares the server section * * @return array the configuration of the section */ protected function sectionServer() { $extCheck = ['Zend OPcache', 'memcache', 'apc', 'xcache', 'redis', 'wincache', 'Zend Data Cache', 'curl', 'odbc', 'intl', 'gd', 'imagick', 'openssl', 'xdebug']; $extensions = []; foreach ($extCheck as $ext) { $hasExt = extension_loaded($ext); $extensions[] = Html::tag('span', $ext, ['class' => 'label label-' . ($hasExt ? 'success' : 'danger')]); } $ret = ['Host' => AsiUrl::getHost(), 'Localhost detected' => $this->valueBool(AsiUrl::isLocalhost()), 'PHP version' => phpversion(), 'PHP info' => $this->valueModal('PHP info', $this->phpInfo), 'Relevant extensions' => implode(' ', $extensions)]; if (ServerConfig::extOpCacheLoaded()) { $ret['OpCache enabled'] = $this->valueBool(ServerConfig::opCacheEnabled()); } return $ret; }