Skip to content

Commit

Permalink
Corrected some Log stuff
Browse files Browse the repository at this point in the history
Added credits
  • Loading branch information
andreherberth committed May 10, 2017
1 parent 90f41ef commit 99809f2
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* Downloads composer, runs create-project flarum/flarum and remove itself.
* Author: Andre Herberth
* License: MIT
* DISCLAIMER: THIS IS DIRTY. USE WITH CARE. SUGGESTIONS ARE WANTED. It was written as a
* DISCLAIMER: THIS IS DIRTY. USE WITH CARE.
* Credits: Luceos for his advice, and some good code.
* ibrahimk157 for listening to my rants, and testing my very unstable code.
*/
use Composer\Command\CreateProjectCommand;
use Composer\Command\RequireCommand;
Expand All @@ -16,25 +18,8 @@

//Set error reporting
error_reporting(E_ALL);

//Attempt at fixing Github - Need a new one, as this one is the same Lucious used in his concept.
const GITHUB_TOKEN = 'ec785da935d5535e151f7b3386190265f00e8fe2';

//Increase Memory Limit. First attempt at setting 1G. If this fails, check if memory is 512 or more. Die if not.
$ini_get_option_details = ini_get_all();
if ( $ini_get_option_details['memory_limit']['access'] & INI_USER ) {
ini_set('memory_limit', '1G');
// phlog('Memory: Attempte to set 1GB Memory Limit. ');
// phlog('Memory: Set to' . ini_get['memory_limit'] );
}
if ( $ini_get_option_details['memory_limit'] >= '512M' ) {
// phlog('Memory: ' . ini_get['memory_limit'] );
} else {
// phlog('Memory: Not enough memory. Memory set at: ' .ini_get['memory_limit'] );
die();
}


//Then check if this was allowed.
if ( !defined('ABSPATH') ) {
define('ABSPATH', dirname(__FILE__) . '/');
Expand All @@ -45,6 +30,18 @@
touch($tmppath . 'install.log');
}

//Increase Memory Limit. First attempt at setting 1G. Die if not.
$ini_get_option_details = ini_get_all();
if ( $ini_get_option_details['memory_limit']['access'] & INI_USER ) {
ini_set('memory_limit', '512M');
phlog('Memory:', 'Attempting to set 512M Memory Limit.', $tmppath . 'install.log');
} else {

phlog('Memory: ', 'Can not change memory', $tmppath . 'install.log');
die("Not enough memory!");
}


/**
* phlog handles log requests and saves them to temp/install.log
* phlog($type, $message, $tmppath . 'install.log')
Expand Down Expand Up @@ -380,6 +377,8 @@ function poll(url, equalname, replacewith1, dmsg, fmsg) {
console.log('Error: ' + err.status);
$(".install").replaceWith('<h2 class="instal1">Error:' + err.status + '</h2>');
});


});

//On Click Prepare
Expand Down

0 comments on commit 99809f2

Please sign in to comment.