'){ $txt = substr($txt, 0, -2); } return eval($txt); } function ins_error($txt){ echo $txt; die(); } //See if the files exist if(!file_exists($globals['path'].'/enduser/index.php')){ #~~~~~~~~~~~~~~~~~~~~~~~ # We need to LOAD stuff #~~~~~~~~~~~~~~~~~~~~~~~ // Get the Zip Class @ins_eval(gzuncompress(ins_get_web_file($env['webserver'].'/unzip.php'))); if(!class_exists('PclZip')){ ins_error('Could not load the Unzip Class!'); } // Download the Latest Softaculous Version if(!$latest = ins_get_web_file($env['webserver'].'/latest.zip')){ ins_error('Could not download the Softaculous Package!'); } if(!ins_writefile($globals['path'].'/softaculous.zip', $latest, 1)){ ins_error('Could not save the Softaculous Package!'); } $zip = new PclZip($globals['path'].'/softaculous.zip'); $unzipped = $zip->extract(PCLZIP_OPT_EXTRACT_AS_STRING); //Are there any files if($unzipped == 0){ ins_error('Could not UNZIP the Softaculous Package!'); } //Check each file was extracted properly foreach($unzipped as $k => $v){ //No folders needed if($v['folder'] == true){ continue; } if(!ins_writefile($globals['path'].'/'.$v['stored_filename'], $v['content'], 1)){ ins_error('Could not save file - '.$v['stored_filename'].' while UNZIPPING the Softaculous Package!'); } } } $envtype = @implode('', file('/var/cpanel/envtype')); if(trim($envtype) !== 'standard'){ $globals['is_vps'] = 1; } if(!empty($argv[1])){ echo "Fetching a License \n"; // Whats my IP ??? $thisip = ins_get_web_file('http://www.softaculous.com/ip.php'); // Call the NOC API file to issue a license ins_get_web_file('http://www.softaculous.com/noc?nocname='.rawurlencode($argv[1]).'&nocpass='.rawurlencode($argv[2]).'&ca=buy&purchase=1&ips='.rawurlencode($thisip).'&toadd=1M&servertype='.(empty($globals['is_vps']) ? 1 : 2).'&authemail='.rawurlencode($argv[3]).'&autorenew=1'); } #################################### ## BEGIN THE INSTALLATION PROCESS ## #################################### //Some globals vars include_once($globals['path'].'/enduser/globals.php'); //The necessary functions to run this SOFTACULOUS Software include_once($globals['mainfiles'].'/functions.php'); //Load the SOFTPANEL Class if(!class_exists('softpanel')){ include_once($globals['enduser'].'/softpanel.php'); } $softpanel = new softpanel(); //GET the Categories, Scripts and iScripts catsnscripts(); //Load the Functions Language File - This will be from the default Lang Folder load_lang('index'); load_lang('admin/index'); load_lang('admin/cron'); load_lang('admin/softwares'); /////////////////////////////// // INSTALLATION PROCESS STEPS : // 1) CONFIGURE universal.php // 2) FETCH A LICENSE // 3) UPDATE categories.php // 4) UPDATE scripts.php // 5) UPDATE iscripts.php // 6) SET A CRON JOB // 7) SOFTACULOUS.CPANELPLUGIN // 8) CREATE LINKS to enduser // 9) REWRITE this file /////////////////////////////// // 1) CONFIGURE universal.php saveglobals($globals); // 2) FETCH A LICENSE loadlicense(true);//UPDATE as well // 3) UPDATE categories.php updatecats(); // 4) UPDATE scripts.php // 5) UPDATE iscripts.php updatescripts(); // 6) SET A CRON JOB add_cron($globals['cron_time']); // 7) SOFTACULOUS.CPANELPLUGIN @shell_exec('/usr/local/cpanel/bin/register_cpanelplugin '.$globals['path'].'/softaculous.cpanelplugin'); // 8) CREATE LINKS to enduser $cpthemes = filelist('/usr/local/cpanel/base/frontend/', 0, 1); foreach($cpthemes as $k=>$v){ @shell_exec('ln -s '.$globals['enduser'].' '.$k.'/softaculous'); } // 9) REWRITE this file! $data = '\'; ?>'; ins_writefile(__FILE__, $data, 1); @mkdir($globals['softscripts']); @shell_exec('chmod -R 0755 '.$globals['path']); @shell_exec('chmod -R 0755 '.$globals['softscripts']); if(isset($argv)){ // 10) RUN THE CRON //@shell_exec('/usr/bin/php '.$globals['path'].'/cron.php'); foreach($iscripts as $ik => $iv){ $report = updatesoftwares($ik, 0); echo $iv['name'].' - '.implode("\n", $report[$ik]['log'])."\n\r\n\r"; } echo '===================================================== Congratulations, Softaculous was installed successfully Softaculous has been installed at: Path : '.$globals['path'].' Scripts Path : '.$globals['softscripts'].' We request you to please register for updates and notifications at : http://www.softaculous.com/board/index.php?act=register It also inspires us when you register. Registration is free and just a one minute job. If you need any support you can always count on us. Just drop in at our Support Board: http://www.softaculous.com/board Alternatively, you can contact us via Email at support@softaculous.com Thank you for using Softaculous'; // Die as we are in CLI MODE die(); } ##################################### ## FINISHED INSTALLING SOFTACULOUS ## ##################################### echo '
Congratulations, Softaculous was installed successfullySoftaculous has been installed at:Path : '.$globals['path'].' Scripts Path : '.$globals['softscripts'].' The Administration Panel links where you can edit these settings are as follows:
'.$l['updating_files'].'
'; //The necessary JavaScripts echo ' We request you to please register at Softaculous for updates and notifications. It also inspires us when you register. Registration is free and just a one minute job. If you need any support you can always count on us. Just drop in at our Support Board Alternatively, you can contact us via Email at support@softaculous.com. To enter the Softaculous Admin Panel just click on the Softaculous - Instant Installs link in the Plugins Section of WHM. Thank you for using Softaculous |