Beispiel #1
0
 public function writeHtaccess()
 {
     // Make sure we are called by an expected caller
     if (!class_exists('AdmintoolsHelperServertech')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_admintools/helpers/servertech.php';
     }
     AdmintoolsHelperServertech::checkCaller(array('AdmintoolsControllerHtmaker::apply'));
     // Make and save the .htaccess file
     $htaccess = $this->makeHtaccess();
     JLoader::import('joomla.filesystem.file');
     if (@file_exists(JPATH_ROOT . '/.htaccess')) {
         JFile::copy('.htaccess', '.htaccess.admintools', JPATH_ROOT);
     }
     return JFile::write(JPATH_ROOT . DIRECTORY_SEPARATOR . '.htaccess', $htaccess);
 }
Beispiel #2
0
 public function writeNginXConf()
 {
     // Make sure we are called by an expected caller
     if (!class_exists('AdmintoolsHelperServertech')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_admintools/helpers/servertech.php';
     }
     AdmintoolsHelperServertech::checkCaller(array('AdmintoolsControllerNginxmaker::apply'));
     $nginxConf = $this->makeNginXConf();
     JLoader::import('joomla.filesystem.file');
     if (@file_exists(JPATH_ROOT . '/nginx.conf')) {
         JFile::copy('nginx.conf', 'nginx.conf.admintools', JPATH_ROOT);
     }
     return JFile::write(JPATH_ROOT . DIRECTORY_SEPARATOR . 'nginx.conf', $nginxConf);
 }