public function __construct($args)
 {
     global $neardBs, $neardCore, $neardConfig, $neardBins, $neardTools, $neardApps, $neardHomepage;
     if (file_exists($neardCore->getExec())) {
         return;
     }
     // Start loading
     Util::startLoading();
     // Refresh hostname
     $neardConfig->replace(Config::CFG_HOSTNAME, gethostname());
     // Refresh launch startup
     $neardConfig->replace(Config::CFG_LAUNCH_STARTUP, Util::isLaunchStartup() ? Config::ENABLED : Config::DISABLED);
     // Check browser
     $currentBrowser = $neardConfig->getBrowser();
     if (empty($currentBrowser) || !file_exists($currentBrowser)) {
         $neardConfig->replace(Config::CFG_BROWSER, Vbs::getDefaultBrowser());
     }
     // Rebuild hosts file
     Util::refactorWindowsHosts();
     // Process neard.ini
     file_put_contents($neardBs->getIniFilePath(), Util::utf8ToCp1252(TplApp::process()));
     // Process Console config
     TplConsole::process();
     // Process Sublimetext config
     TplSublimetext::process();
     // Process Websvn config
     TplWebsvn::process();
     // Process Gitlist config
     TplGitlist::process();
     // Refresh PEAR version cache file
     $neardBins->getPhp()->getPearVersion();
     // Rebuild alias homepage
     $neardHomepage->refreshAliasContent();
 }
 public static function process()
 {
     global $neardLang;
     $tplStart = TplApp::getActionMulti(self::ACTION_START, null, array($neardLang->getValue(Lang::MENU_START_SERVICES), TplAestan::GLYPH_SERVICES_START), false, get_called_class());
     $tplStop = TplApp::getActionMulti(self::ACTION_STOP, null, array($neardLang->getValue(Lang::MENU_STOP_SERVICES), TplAestan::GLYPH_SERVICES_STOP), false, get_called_class());
     $tplRestart = TplApp::getActionMulti(self::ACTION_RESTART, null, array($neardLang->getValue(Lang::MENU_RESTART_SERVICES), TplAestan::GLYPH_SERVICES_RESTART), false, get_called_class());
     // Items
     $items = $tplStart[TplApp::SECTION_CALL] . PHP_EOL . $tplStop[TplApp::SECTION_CALL] . PHP_EOL . $tplRestart[TplApp::SECTION_CALL] . PHP_EOL;
     // Actions
     $actions = PHP_EOL . $tplStart[TplApp::SECTION_CONTENT] . PHP_EOL . $tplStop[TplApp::SECTION_CONTENT] . PHP_EOL . $tplRestart[TplApp::SECTION_CONTENT];
     return array($items, $actions);
 }
 public static function getActionSwitchNodejsVersion($version)
 {
     global $neardBs, $neardCore, $neardBins;
     return TplApp::getActionRun(Action::SWITCH_VERSION, array($neardBins->getNodejs()->getName(), $version)) . PHP_EOL . TplAppReload::getActionReload() . PHP_EOL . TplApp::getActionExec() . PHP_EOL;
 }
 public static function getActionLaunchStartupMariadb($launchStartup)
 {
     global $neardBins;
     return TplApp::getActionRun(Action::LAUNCH_STARTUP_SERVICE, array($neardBins->getMariadb()->getName(), $launchStartup)) . PHP_EOL . TplAppReload::getActionReload();
 }
 public static function getItemRemove($sName)
 {
     global $neardLang;
     return TplApp::getActionRun(Action::SERVICE, array($sName, ActionService::REMOVE), array($neardLang->getValue(Lang::MENU_REMOVE_SERVICE), TplAestan::GLYPH_SERVICE_REMOVE));
 }
 public static function process()
 {
     global $neardLang;
     return TplApp::getActionRun(Action::CLEAR_FOLDERS, null, array($neardLang->getValue(Lang::MENU_CLEAR_FOLDERS), TplAestan::GLYPH_TRASHCAN));
 }
 public static function getActionLaunchStartup($launchStartup)
 {
     global $neardBins;
     return TplApp::getActionRun(Action::LAUNCH_STARTUP, array($launchStartup)) . PHP_EOL . TplAppReload::getActionReload() . PHP_EOL;
 }
 public static function getActionSwitchLang($lang)
 {
     return TplApp::getActionRun(Action::SWITCH_LANG, array($lang)) . PHP_EOL . TplAppReload::getActionReload();
 }
 public static function getActionChangeBrowser()
 {
     return TplApp::getActionRun(Action::CHANGE_BROWSER) . PHP_EOL . TplAppReload::getActionReload();
 }
 public static function getActionGenSslCertificate()
 {
     return TplApp::getActionRun(Action::GEN_SSL_CERTIFICATE);
 }
 public static function getActionStatus($status)
 {
     global $neardBins;
     return TplApp::getActionRun(Action::SWITCH_ONLINE, array($status)) . PHP_EOL . TplService::getActionRestart(BinApache::SERVICE_NAME) . PHP_EOL . TplService::getActionRestart(BinFilezilla::SERVICE_NAME) . PHP_EOL . TplAppReload::getActionReload() . PHP_EOL;
 }
 public static function getActionRestart()
 {
     return TplApp::getActionRun(Action::MANUAL_RESTART) . PHP_EOL . TplApp::getActionExec() . PHP_EOL;
 }
 public static function process()
 {
     global $neardLang;
     return TplApp::getMenu($neardLang->getValue(Lang::LOGS), self::MENU, get_called_class());
 }
 public static function getActionSwitchLogsVerbose($verbose)
 {
     return TplApp::getActionRun(Action::SWITCH_LOGS_VERBOSE, array($verbose)) . PHP_EOL . TplAppReload::getActionReload();
 }
 public static function getActionExit()
 {
     return TplApp::getActionRun(Action::QUIT) . PHP_EOL . 'Action: exit';
 }
 public static function getActionRefreshGitReposStartup($scanStartup)
 {
     return TplApp::getActionRun(Action::REFRESH_REPOS_STARTUP, array(ActionRefreshRepos::GIT, $scanStartup)) . PHP_EOL . TplAppReload::getActionReload() . PHP_EOL;
 }
 public static function getActionSwitchHost($ip, $domain, $enabled)
 {
     $switch = $enabled ? ActionSwitchHost::SWITCH_OFF : ActionSwitchHost::SWITCH_ON;
     return TplApp::getActionRun(Action::SWITCH_HOST, array($ip, $domain, $switch)) . PHP_EOL . TplAppReload::getActionReload() . PHP_EOL;
 }
 public static function getActionSwitchPhpExtension($extension, $switch)
 {
     global $neardBins;
     $switch = $switch == ActionSwitchPhpExtension::SWITCH_OFF ? ActionSwitchPhpExtension::SWITCH_ON : ActionSwitchPhpExtension::SWITCH_OFF;
     return TplApp::getActionRun(Action::SWITCH_PHP_EXTENSION, array($extension, $switch)) . PHP_EOL . TplService::getActionRestart(BinApache::SERVICE_NAME) . PHP_EOL . TplAppReload::getActionReload() . PHP_EOL;
 }
 public static function getActionReload()
 {
     return TplApp::getActionRun(Action::RELOAD) . PHP_EOL . 'Action: resetservices' . PHP_EOL . 'Action: readconfig';
 }