Skip to content

Commit

Permalink
Drop env helper method.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed Apr 10, 2015
1 parent 0864a46 commit ea24ea7
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 47 deletions.
2 changes: 1 addition & 1 deletion wp-content/themes/boilerplate/config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
|
*/

'debug' => env('APP_DEBUG'),
'debug' => getenv('WP_DEBUG'),

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion wp-content/themes/boilerplate/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
ga('create', '<?php echo getenv('GOOGLE_ANALYTICS_KEY'); ?>', 'auto');
ga('send', 'pageview');
</script>
<?php wp_footer(); ?>
<?php wp_foote(); ?>
</body>
</html>
2 changes: 1 addition & 1 deletion wp-content/themes/boilerplate/index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php get_header(); dd('hej');?>
<?php get_header(); ?>

<main role="main">
<?php
Expand Down
44 changes: 0 additions & 44 deletions wp-content/themes/boilerplate/library/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,6 @@
* file that was distributed with this source code.
*/

use Illuminate\Support\Str;

if (!function_exists('env')) {
/**
* Gets the value of an environment variable. Supports boolean, empty and null.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
function env($key, $default = null)
{
$value = getenv($key);

if (!$value) {
return value($default);
}

switch (strtolower($value)) {
case 'true':
case '(true)':
return true;

case 'false':
case '(false)':
return false;

case 'empty':
case '(empty)':
return '';

case 'null':
case '(null)':
return;
}

if (Str::startsWith($value, '"') && Str::endsWith($value, '"')) {
return substr($value, 1, -1);
}

return $value;
}
}

if (!function_exists('format_bytes')) {

/**
Expand Down

0 comments on commit ea24ea7

Please sign in to comment.