ok
Direktori : /proc/thread-self/root/var/softaculous/faveo/ |
Current File : //proc/thread-self/root/var/softaculous/faveo/_clone.php |
<?php ////////////////////////////////////////////////////////////// //=========================================================== // clone.php //=========================================================== // SOFTACULOUS // Version : 4.2.8 // Inspired by the DESIRE to be the BEST OF ALL // ---------------------------------------------------------- // Started by: Alons // Date: 10th Jan 2009 // Time: 21:00 hrs // Site: http://www.softaculous.com/ (SOFTACULOUS) // ---------------------------------------------------------- // Please Read the Terms of use at http://www.softaculous.com // ---------------------------------------------------------- //=========================================================== // (c)Softaculous Inc. //=========================================================== ////////////////////////////////////////////////////////////// if(!defined('SOFTACULOUS')){ die('Hacking Attempt'); } //The Install process function __clone(){ global $__settings, $error, $software, $globals, $replace_data, $source_data; //Do we meet the Minimum software requirements __requirements(); if(!empty($error)){ return false; } $temp = parse_url($source_data['softurl']); $source_data['relativeurl'] = $temp['path']; $temp = parse_url($__settings['softurl']); $__settings['relativeurl'] = $temp['path']; // .env $file = sfile($__settings['softpath'].'/.env'); if(empty($file)){ $error[] = 'Could not read the .env file to get APP_KEY.'; return false; } soft_preg_replace('/APP_KEY=base64:(.*?)\n/is', $file, $APP_KEY, 1); $__settings['APP_KEY'] = base64_encode(srandstr(32)); soft_preg_replace('/JWT_SECRET=([a-zA-Z0-9]*)/is', $file, $JWT_SECRET, 1); $__settings['JWT_SECRET'] = __random(32); $replace_data[$APP_KEY] = $__settings['APP_KEY']; $replace_data[$JWT_SECRET] = $__settings['JWT_SECRET']; //FCM_SERVER_KEY, FCM_SENDER_ID Not updated in clone because its same for particular version. sclone_replace($replace_data, $__settings['softpath'].'/.env', true); // create symlink if($globals['os'] != 'windows'){ // Have to remove this files so symlinks can be created srm($__settings['softpath'].'/vendor/bin/phpunit'); srm($__settings['softpath'].'/vendor/bin/np'); srm($__settings['softpath'].'/vendor/bin/psysh'); srm($__settings['softpath'].'/vendor/bin/var-dump-server'); srm($__settings['softpath'].'/vendor/bin/phpspec'); srm($__settings['softpath'].'/vendor/bin/php-parse'); srm($__settings['softpath'].'/vendor/bin/codacycoverage'); srm($__settings['softpath'].'/vendor/bin/doctrine-dbal'); srm($__settings['softpath'].'/vendor/phpspec/phpspec/CHANGES.md'); //php function to prepare symlinks on all platforms symlink($__settings['softpath'].'/vendor/phpunit/phpunit/phpunit', $__settings['softpath'].'/vendor/bin/phpunit'); symlink($__settings['softpath'].'/vendor/sly/notification-pusher/np', $__settings['softpath'].'/vendor/bin/np'); symlink($__settings['softpath'].'/vendor/psy/psysh/bin/psysh', $__settings['softpath'].'/vendor/bin/psysh'); symlink($__settings['softpath'].'/vendor/symfony/var-dumper/Resources/bin/var-dump-server', $__settings['softpath'].'/vendor/bin/var-dump-server'); symlink($__settings['softpath'].'/vendor/phpspec/phpspec/bin/phpspec', $__settings['softpath'].'/vendor/bin/phpspec'); symlink($__settings['softpath'].'/vendor/nikic/php-parser/bin/php-parse', $__settings['softpath'].'/vendor/bin/php-parse'); symlink($__settings['softpath'].'/vendor/codacy/coverage/bin/codacycoverage', $__settings['softpath'].'/vendor/bin/codacycoverage'); symlink($__settings['softpath'].'/vendor/doctrine/dbal/bin/doctrine-dbal', $__settings['softpath'].'/vendor/bin/doctrine-dbal'); symlink($__settings['softpath'].'/vendor/phpspec/phpspec/CHANGES-v4.md', $__settings['softpath'].'/vendor/phpspec/phpspec/CHANGES.md'); } if(sfile_exists($__settings['softpath'].'/.htaccess')){ // If the installation is on root domain we need to change the below relative URL if(is_dom_root($source_data['softpath'])){ $replace_data['RewriteBase \'/\''] = 'RewriteBase \''.$__settings['relativeurl'].'\''; $replace_data['RewriteBase /'] = 'RewriteBase '.$__settings['relativeurl']; }elseif(is_dom_root($__settings['softpath'])){ $replace_data['RewriteBase \''.$source_data['relativeurl'].'\''] = 'RewriteBase \'/\''; $replace_data['RewriteBase '.$source_data['relativeurl']] = 'RewriteBase /'; } sclone_replace($replace_data, $__settings['softpath'].'/.htaccess', true); } // Deleting the cache and views Directory $tmp = sfile($__settings['softpath'].'/storage/framework/cache/.gitignore'); @srm($__settings['softpath'].'/storage/framework/cache/'); @smkdir($__settings['softpath'].'/storage/framework/cache/', $globals['odc']); swrite($__settings['softpath'].'/storage/framework/cache/.gitignore', $tmp, 1); $tmp = sfile($__settings['softpath'].'/storage/framework/views/.gitignore'); @srm($__settings['softpath'].'/storage/framework/views/'); @smkdir($__settings['softpath'].'/storage/framework/views/', $globals['odc']); swrite($__settings['softpath'].'/storage/framework/views/.gitignore', $tmp, 1); //CHMOD @schmod($__settings['softpath'].'/vendor/', $globals['odc'], 1); @schmod($__settings['softpath'].'/storage/', $globals['odc'], 1); @schmod($__settings['softpath'].'/bootstrap/cache/', $globals['odc'], 1); @schmod($__settings['softpath'].'/public/uploads/', $globals['odc'], 1); } //Check whether the Minimum Software configuration matches function __requirements(){ global $__settings, $error, $software; return true; } function __random($length = 16){ $string = ''; while (($len = strlen($string)) < $length) { $size = $length - $len; $bytes = srandstr($size); $string .= substr(str_replace(array('/', '+', '='), '', base64_encode($bytes)), 0, $size); } return $string; } ?>