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 | |
namespace Nightjar\SS4UpgradeTasks; | |
use Monolog\Handler\StreamHandler; | |
use Monolog\Logger; | |
use Psr\Log\LoggerInterface; | |
use SilverStripe\Assets\File; | |
use SilverStripe\Control\Director; | |
use SilverStripe\Core\ClassInfo; |
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
function gitPullAllLocal() { | |
#if there is a passing argument | |
if [ -z $1 ] | |
then | |
GIT_RELATIVE_DIRECTORY="$(pwd)" | |
else | |
GIT_RELATIVE_DIRECTORY=$1 | |
fi | |
#go to that relative path if exists |
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 | |
/** | |
* Configure SilverStripe using apache environment variables | |
* Usage: Put "require_once('conf/ConfigureFromEnv.php');" into your _config.php file. | |
* Example Apache vhost: | |
* <VirtualHost *:80> | |
* ... | |
* SetEnv SS_ENVIRONMENT_TYPE dev | |
* SetEnv SS_DEFAULT_ADMIN_USERNAME admin |
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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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 | |
if (!function_exists('http_response_code')) { | |
function http_response_code($code = null) | |
{ | |
static $defaultCode = 200; | |
if (null != $code) { | |
switch ($code) { | |
case 100: $text = 'Continue'; break; // RFC2616 |
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 | |
$books = array( | |
1 => 'Genesis', | |
2 => 'Exodus', | |
3 => 'Leviticus', | |
4 => 'Numbers', | |
5 => 'Deuteronomy', | |
6 => 'Joshua', | |
7 => 'Judges', | |
8 => 'Ruth', |
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
git clone <repo-address> | |
git tag -l | |
git checkout <tag-name> | |
git branch -D master | |
git checkout -b master |