This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
# 1 | |
foreach (glob(resource_path() . '/lang/*/*.php') as $file) { | |
preg_match('#^.*/([A-z]*)/([A-z]*).php$#', $file, $matches); | |
$trans[$matches[1]][$matches[2]] = require($file); | |
} | |
foreach ($trans as $lang => $translations) { | |
$fileContents = sprintf('var trans = %s;', json_encode($translations)); | |
file_put_contents(public_path() . '/js/trans.' . $lang . '.js', $fileContents); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Get the hash of the current git HEAD | |
* @param str $branch The git branch to check | |
* @return mixed Either the hash or a boolean false | |
*/ | |
function get_current_git_commit( $branch='master' ) { | |
if ( $hash = file_get_contents( sprintf( '.git/refs/heads/%s', $branch ) ) ) { | |
return $hash; | |
} else { |