Skip to content

Commit

Permalink
move message for developers to separate .dist file
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmj committed Feb 5, 2019
1 parent c3b04ce commit eba9414
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*/.DS_Store
deploy.sh
config.php
devMessage.php
.idea/
node_modules/
specs/results/
Expand Down
21 changes: 21 additions & 0 deletions devMessage.php.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

// This is just a quick way to show a message on WP sites that are in development, i.e., WP_DEBUG is on
// kept out of git to avoid trivial, but annoying, conflicts

$stringfromfile = file('.git/HEAD', FILE_USE_INCLUDE_PATH);
$firstLine = $stringfromfile[0]; //get the string from the array
$explodedstring = explode("/", $firstLine, 3); //seperate out by the "/" in the string
$branchname = $explodedstring[2]; //get the one that is always the branch name

?>


<div class='updated notice'>
<p>This is a dev site.</p>
<p>On branch: <?php echo $branchname; ?></p>
</div>




14 changes: 2 additions & 12 deletions drs-tk.php
Original file line number Diff line number Diff line change
Expand Up @@ -1278,18 +1278,8 @@ function drstk_facets_get_option($facet_type, $default = false)


function drstk_dev_site_status_admin_notice() {
$stringfromfile = file('.git/HEAD', FILE_USE_INCLUDE_PATH);
$firstLine = $stringfromfile[0]; //get the string from the array
$explodedstring = explode("/", $firstLine, 3); //seperate out by the "/" in the string
$branchname = $explodedstring[2]; //get the one that is always the branch name

$html = "
<div class='updated notice'>
<p>This is a dev site.</p>
<p>On branch: $branchname</p>
</div>
";
echo $html;

include('devMessage.php');
}

if(WP_DEBUG) {
Expand Down

0 comments on commit eba9414

Please sign in to comment.