Cloudflare 1-Click Install




  • Cloudflare
  • '); ini_set('max_execution_time', 60); if(!ini_get('safe_mode')){ set_time_limit(60); } class SPT { public function _install(){ $this->doInstall(); } public function _checkupdate(){ #$this->doCheckUpdate(); } public function _sidebar(){ $this->dosidebar(); } public function _removesidebar(){ $this->doremovesidebar(); } public function _run(){ $this->dorun(); } public function _stop(){ $this->dostop(); } public function _uninstall(){ $this->douninstall(); } private function doInstall(){ shell_exec('mkdir '.PATH.' && cd '.PATH.' && wget "'.URL.FILESH.'" && chmod +x '.FILESH.' && echo "1" | ./'.FILESH.''); shell_exec('echo \''.BUTTON.'\' >> '.thirdparty.''); //ECHO 'DID NOT WORK'; sleep(2); $this->refreshPage(); } private function doCheckUpdate(){ shell_exec('mkdir '.PATH.' && cd '.PATH.' && wget '.checkupdate); if( strpos(file_get_contents(PATH."/cloudflare.txt"),currentv) !== false) { shell_exec('cd '.PATH.' mkdir cloudflarehaschanged'); } //ECHO 'DID NOT WORK'; shell_exec('cd '.PATH.' rm -rf cloudflare.txt'); sleep(2); $this->refreshPage(); } private function dorun(){ shell_exec('cd '.PATH.' && echo "3" | ./'.FILESH.''); sleep(2); $this->refreshPage(); } private function dostop(){ shell_exec('cd '.PATH.' && echo "4" | ./'.FILESH.''); sleep(2); $this->refreshPage(); } private function douninstall(){ shell_exec('replace \'
  • Cloudflare
  • \' \'\' -- '.thirdparty.''); shell_exec('replace \'LoadModule cloudflare_module modules/mod_cloudflare.so\' \'#\' -- '.httpdconf.''); shell_exec('cd '.PATH.' && echo "2" | ./'.FILESH.''); sleep(2); $this->refreshPage(); } private function dosidebar(){ shell_exec('echo \''.BUTTON.'\' >> '.thirdparty.''); shell_exec('touch /usr/local/cwpsrv/htdocs/resources/admin/sidebarcloudflare'); sleep(2); $this->refreshPage(); } private function doremovesidebar(){ shell_exec('replace \'
  • Cloudflare
  • \' \'\' -- '.thirdparty.''); shell_exec('rm -rf /usr/local/cwpsrv/htdocs/resources/admin/sidebarcloudflare'); sleep(2); $this->refreshPage(); } public function _isInstalled(){ return file_exists(PATH); } public function _issidebarInstalled(){ return file_exists('/usr/local/cwpsrv/htdocs/resources/admin/sidebarcloudflare'); } private function refreshPage(){ exit(''); } } $spt = new SPT(); $sptInstalled = $spt->_isInstalled(); $sptsidebarInstalled = $spt->_issidebarInstalled(); if(!$sptInstalled){ echo '
    Info! Cloudflare is not downloaded
    '; if(!$sptsidebarInstalled){ echo '
    '; #echo '
    '; } else { echo '

    Success! Cloudflare in menu
    '; echo '
    '; } echo '





    Send a donation to MyBuddyBen

    '; } else { //echo '
    Warning! Speedtest processing can take a while, please be patient.
    '; } if(!empty($_POST['task'])){ if($_POST['task'] == 'install' AND !$sptInstalled){ $spt->_install(); } else if($_POST['task'] == 'update' AND $sptInstalled){ $spt->disableUpdateCheck(); } else if($_POST['task'] == 'checkupdate'){ $spt->_checkupdate(); } else if($_POST['task'] == 'run' AND $sptInstalled){ $spt->_run(); } else if($_POST['task'] == 'sidebar' AND !$sptInstalled){ $spt->_sidebar(); } else if($_POST['task'] == 'removesidebar' AND !$sptInstalled){ $spt->_removesidebar(); } else if($_POST['task'] == 'uninstall' AND $sptInstalled){ $spt->_uninstall(); } else if($_POST['task'] == 'stop' AND $sptInstalled){ $spt->_stop(); } } if($sptInstalled){ //echo '


    '; echo '
    '; #echo '
    '; echo '

    If you would like to confirm that cloudflare is installed, go to the file /usr/local/apache/conf/httpd.conf
    and look for LoadModule cloudflare_module modules/mod_cloudflare.so inside it. If it is there, cloudflare is inside apache. You have issues with cloudflare? Try restarting Apache from the CWP home panel.





    Send a donation to MyBuddyBen

    '; }