Skip to content

Commit

Permalink
REmoved enviroment check
Browse files Browse the repository at this point in the history
  • Loading branch information
gorriecoe committed Dec 8, 2015
1 parent 787cf89 commit 5d10a62
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions install/PlatoCreative/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,6 @@ public static function getBasepath()
return self::$basePath;
}

/**
* Returns a text description of the current environment type. Assumes
* 'live' if it can't determine an environment type.
* @return string
*/
protected static function getEnvironmentType()
{
$envFile = '_ss_environment.php';
$directory = realpath('.');

// Traverse directories "upwards" until we hit an unreadable directory
// or the root of the drive
do {
// Add the trailing slash we need to concatenate properly
$directory .= DIRECTORY_SEPARATOR;

// If it's readable, go ahead
if (is_readable($directory)) {
// If the file exists, return its path
if (file_exists($directory.$envFile)) {
$file = $directory.$envFile;
}
} else {
// If we can't read the directory, give up
$file = false;
break;
}

// Go up a level
$directory = dirname($directory);

// If these are the same, we've hit the root of the drive
} while (dirname($directory) != $directory);

if ($file) {
include_once $file;

if (defined('SS_ENVIRONMENT_TYPE')) {
return SS_ENVIRONMENT_TYPE;
}
}

return 'dev';
}

/********************** EVENTS **********************/

/**
Expand Down Expand Up @@ -103,13 +58,6 @@ public static function postInstall(Event $event)
exit;
}

// Check environment type
if (self::getEnvironmentType() !== 'dev') {
$io->write('LIVE Environment detected, installer will not complete.');
$io->write('Ensure a _ss_environment.php file exists and is set to DEV.');
exit;
}

$config['BuildType'] = 'bespoke';
if ($buildType = $io->ask('Is this a bespoke build? Y or N: ')) {
if(substr(strtolower($buildType), 0, 1 ) !== "y"){
Expand Down Expand Up @@ -161,5 +109,4 @@ public static function postUpdate(Event $event)
// echo shell_exec('cd ../../ && php framework/cli-script.php dev/build');
$io->write("postUpdate event triggered.");
}

}

0 comments on commit 5d10a62

Please sign in to comment.