예제 #1
0
 public static function getMenuPhp()
 {
     global $neardBins, $neardLang;
     $tplVersions = TplApp::getMenu($neardLang->getValue(Lang::VERSIONS), self::MENU_VERSIONS, get_called_class());
     $tplSettings = TplApp::getMenu($neardLang->getValue(Lang::SETTINGS), self::MENU_SETTINGS, get_called_class());
     $tplExtensions = TplApp::getMenu($neardLang->getValue(Lang::EXTENSIONS), self::MENU_EXTENSIONS, get_called_class());
     return $tplVersions[TplApp::SECTION_CALL] . PHP_EOL . $tplSettings[TplApp::SECTION_CALL] . PHP_EOL . $tplExtensions[TplApp::SECTION_CALL] . PHP_EOL . TplAestan::getItemNotepad(basename($neardBins->getPhp()->getConf()), $neardBins->getPhp()->getConf()) . PHP_EOL . TplAestan::getItemNotepad($neardLang->getValue(Lang::MENU_ERROR_LOGS), $neardBins->getPhp()->getErrorLog()) . PHP_EOL . PHP_EOL . $tplVersions[TplApp::SECTION_CONTENT] . PHP_EOL . PHP_EOL . $tplSettings[TplApp::SECTION_CONTENT] . $tplExtensions[TplApp::SECTION_CONTENT];
 }
예제 #2
0
 public static function getMenuGitRepos()
 {
     global $neardTools;
     $result = '';
     foreach ($neardTools->getGit()->findRepos() as $repo) {
         $result .= TplAestan::getItemConsole(basename($repo), TplAestan::GLYPH_GIT, $neardTools->getConsole()->getTabTitleGit(), $neardTools->getConsole()->getTabTitleGit($repo), $repo) . PHP_EOL;
     }
     return $result;
 }
 public static function getMenuHosts()
 {
     global $neardLang;
     $items = '';
     $actions = '';
     foreach (Util::getWindowsHosts() as $host) {
         $tplSwitchHost = TplApp::getActionMulti(self::ACTION_SWITCH_HOST, array($host['ip'], $host['domain'], $host['enabled']), array($host['domain'] . ' (' . $host['ip'] . ')', $host['enabled'] ? TplAestan::GLYPH_CHECK : ''), false, get_called_class());
         // Item
         $items .= $tplSwitchHost[TplApp::SECTION_CALL] . PHP_EOL;
         // Action
         $actions .= PHP_EOL . $tplSwitchHost[TplApp::SECTION_CONTENT];
     }
     $items .= TplAestan::getItemSeparator() . PHP_EOL . TplAestan::getItemNotepad(basename(HOSTS_FILE), HOSTS_FILE) . PHP_EOL;
     return $items . $actions;
 }
 public static function getMenuMariadbService()
 {
     global $neardLang, $neardBins;
     $tplChangePort = TplApp::getActionMulti(self::ACTION_CHANGE_PORT, null, array($neardLang->getValue(Lang::MENU_CHANGE_PORT), TplAestan::GLYPH_NETWORK), false, get_called_class());
     $isLaunchStartup = $neardBins->getMariadb()->isLaunchStartup();
     $tplLaunchStartup = TplApp::getActionMulti(self::ACTION_LAUNCH_STARTUP, array($isLaunchStartup ? Config::DISABLED : Config::ENABLED), array($neardLang->getValue(Lang::MENU_LAUNCH_STARTUP_SERVICE), $isLaunchStartup ? TplAestan::GLYPH_CHECK : ''), false, get_called_class());
     $result = TplAestan::getItemActionServiceStart($neardBins->getMariadb()->getService()->getName()) . PHP_EOL . TplAestan::getItemActionServiceStop($neardBins->getMariadb()->getService()->getName()) . PHP_EOL . TplAestan::getItemActionServiceRestart($neardBins->getMariadb()->getService()->getName()) . PHP_EOL . TplAestan::getItemSeparator() . PHP_EOL . TplApp::getActionRun(Action::CHECK_PORT, array($neardBins->getMariadb()->getName(), $neardBins->getMariadb()->getPort()), array(sprintf($neardLang->getValue(Lang::MENU_CHECK_PORT), $neardBins->getMariadb()->getPort()), TplAestan::GLYPH_LIGHT)) . PHP_EOL . $tplChangePort[TplApp::SECTION_CALL] . PHP_EOL . $tplLaunchStartup[TplApp::SECTION_CALL] . PHP_EOL;
     $isInstalled = $neardBins->getMariadb()->getService()->isInstalled();
     if (!$isInstalled) {
         $tplInstallService = TplApp::getActionMulti(self::ACTION_INSTALL_SERVICE, null, array($neardLang->getValue(Lang::MENU_INSTALL_SERVICE), TplAestan::GLYPH_SERVICE_INSTALL), $isInstalled, get_called_class());
         $result .= $tplInstallService[TplApp::SECTION_CALL] . PHP_EOL . PHP_EOL . $tplInstallService[TplApp::SECTION_CONTENT] . PHP_EOL;
     } else {
         $tplRemoveService = TplApp::getActionMulti(self::ACTION_REMOVE_SERVICE, null, array($neardLang->getValue(Lang::MENU_REMOVE_SERVICE), TplAestan::GLYPH_SERVICE_REMOVE), !$isInstalled, get_called_class());
         $result .= $tplRemoveService[TplApp::SECTION_CALL] . PHP_EOL . PHP_EOL . $tplRemoveService[TplApp::SECTION_CONTENT] . PHP_EOL;
     }
     $result .= $tplChangePort[TplApp::SECTION_CONTENT] . PHP_EOL . $tplLaunchStartup[TplApp::SECTION_CONTENT] . PHP_EOL;
     return $result;
 }
예제 #5
0
 public static function getMenuLogs()
 {
     global $neardBs;
     $files = array();
     if ($handle = opendir($neardBs->getLogsPath())) {
         while (false !== ($file = readdir($handle))) {
             if ($file != "." && $file != ".." && Util::endWith($file, '.log')) {
                 $files[] = $file;
             }
         }
         closedir($handle);
     }
     ksort($files);
     $result = '';
     foreach ($files as $file) {
         $result .= TplAestan::getItemNotepad(basename($file), $neardBs->getLogsPath() . '/' . $file) . PHP_EOL;
     }
     return $result;
 }
 public static function getMenuNodejs()
 {
     global $neardBins, $neardLang, $neardTools;
     $tplVersions = TplApp::getMenu($neardLang->getValue(Lang::VERSIONS), self::MENU_VERSIONS, get_called_class());
     return $tplVersions[TplApp::SECTION_CALL] . PHP_EOL . TplAestan::getItemConsole($neardLang->getValue(Lang::CONSOLE), TplAestan::GLYPH_CONSOLE, $neardTools->getConsole()->getTabTitleNodejs()) . PHP_EOL . $tplVersions[TplApp::SECTION_CONTENT];
 }
예제 #7
0
 private static function getSectionMenuLeft()
 {
     global $neardBs, $neardLang;
     $tplNodejs = TplAppNodejs::process();
     $tplApache = TplAppApache::process();
     $tplPhp = TplAppPhp::process();
     $tplMysql = TplAppMysql::process();
     $tplMariadb = TplAppMariadb::process();
     $tplFilezilla = TplAppFilezilla::process();
     $tplGit = TplAppGit::process();
     $tplSvn = TplAppSvn::process();
     $tplLogs = TplAppLogs::process();
     $tplHosts = TplAppHosts::process();
     $tplTools = TplAppTools::process();
     $tplServices = TplAppServices::process();
     $tplOnline = TplAppOnline::process();
     return '[Menu.Left]' . PHP_EOL . TplAestan::getItemLink($neardLang->getValue(Lang::MENU_LOCALHOST), 'http://localhost') . PHP_EOL . TplAestan::getItemLink($neardLang->getValue(Lang::MENU_LOCALHOST) . ' (SSL)', 'https://localhost') . PHP_EOL . TplAestan::getItemExplore($neardLang->getValue(Lang::MENU_WWW_DIRECTORY), $neardBs->getWwwPath()) . PHP_EOL . TplAestan::getItemSeparator() . PHP_EOL . $tplNodejs[self::SECTION_CALL] . PHP_EOL . $tplApache[self::SECTION_CALL] . PHP_EOL . $tplPhp[self::SECTION_CALL] . PHP_EOL . $tplMysql[self::SECTION_CALL] . PHP_EOL . $tplMariadb[self::SECTION_CALL] . PHP_EOL . $tplFilezilla[self::SECTION_CALL] . PHP_EOL . TplAestan::getItemSeparator() . PHP_EOL . $tplGit[self::SECTION_CALL] . PHP_EOL . $tplSvn[self::SECTION_CALL] . PHP_EOL . TplAestan::getItemSeparator() . PHP_EOL . $tplLogs[self::SECTION_CALL] . PHP_EOL . $tplHosts[self::SECTION_CALL] . PHP_EOL . $tplTools[self::SECTION_CALL] . PHP_EOL . TplAestan::getItemSeparator() . PHP_EOL . $tplServices[self::SECTION_CALL] . TplAestan::getItemSeparator() . PHP_EOL . $tplOnline[self::SECTION_CALL] . PHP_EOL . PHP_EOL . $tplNodejs[self::SECTION_CONTENT] . PHP_EOL . $tplApache[self::SECTION_CONTENT] . PHP_EOL . $tplPhp[self::SECTION_CONTENT] . PHP_EOL . $tplMysql[self::SECTION_CONTENT] . PHP_EOL . $tplMariadb[self::SECTION_CONTENT] . PHP_EOL . $tplFilezilla[self::SECTION_CONTENT] . PHP_EOL . $tplGit[self::SECTION_CONTENT] . PHP_EOL . $tplSvn[self::SECTION_CONTENT] . PHP_EOL . $tplLogs[self::SECTION_CONTENT] . PHP_EOL . $tplHosts[self::SECTION_CONTENT] . PHP_EOL . $tplTools[self::SECTION_CONTENT] . PHP_EOL . $tplServices[self::SECTION_CONTENT] . PHP_EOL . $tplOnline[self::SECTION_CONTENT];
 }
 public static function getMenuApacheVhosts()
 {
     global $neardLang, $neardBins;
     $tplAddVhost = TplApp::getActionMulti(self::ACTION_ADD_VHOST, null, array($neardLang->getValue(Lang::MENU_ADD_VHOST), TplAestan::GLYPH_ADD), false, get_called_class());
     // Items
     $items = $tplAddVhost[TplApp::SECTION_CALL] . PHP_EOL . TplAestan::getItemSeparator() . PHP_EOL;
     // Actions
     $actions = PHP_EOL . $tplAddVhost[TplApp::SECTION_CONTENT];
     foreach ($neardBins->getApache()->getVhosts() as $vhost) {
         $tplEditVhost = TplApp::getActionMulti(self::ACTION_EDIT_VHOST, array($vhost), array(sprintf($neardLang->getValue(Lang::MENU_EDIT_VHOST), $vhost), TplAestan::GLYPH_FILE), false, get_called_class());
         // Items
         $items .= $tplEditVhost[TplApp::SECTION_CALL] . PHP_EOL;
         // Actions
         $actions .= PHP_EOL . PHP_EOL . $tplEditVhost[TplApp::SECTION_CONTENT];
     }
     return $items . $actions;
 }
 public static function getMenuTools()
 {
     global $neardLang, $neardTools;
     $tplGenSslCertificate = TplApp::getActionMulti(self::ACTION_GEN_SSL_CERTIFICATE, null, array($neardLang->getValue(Lang::MENU_GEN_SSL_CERTIFICATE), TplAestan::GLYPH_SSL_CERTIFICATE), false, get_called_class());
     return TplAestan::getItemConsole($neardLang->getValue(Lang::GIT), TplAestan::GLYPH_GIT, $neardTools->getConsole()->getTabTitleGit()) . PHP_EOL . TplAestan::getItemConsole($neardLang->getValue(Lang::SVN), TplAestan::GLYPH_SVN, $neardTools->getConsole()->getTabTitleSvn()) . PHP_EOL . TplAestan::getItemConsole($neardLang->getValue(Lang::PEAR), TplAestan::GLYPH_CONSOLE, $neardTools->getConsole()->getTabTitlePear()) . PHP_EOL . TplAestan::getItemExe($neardLang->getValue(Lang::XDC), $neardTools->getXdc()->getExe(), TplAestan::GLYPH_CONSOLE) . PHP_EOL . TplAestan::getItemLink($neardLang->getValue(Lang::WEBGRIND), 'webgrind/', true) . PHP_EOL . $tplGenSslCertificate[TplApp::SECTION_CALL] . PHP_EOL . $tplGenSslCertificate[TplApp::SECTION_CONTENT];
 }