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 | |
/** | |
* Implements hook_page_alter(). | |
*/ | |
function code_syntax_highlighting_bundle_page_alter() { | |
// Add the JS and CSS assets if the page is supposed to have code syntax highlighting. | |
$current_object = menu_get_object(); | |
if (in_array($current_object->type, config_get('code_syntax_highlighting_bundle.settings','csh_enabled_node_types'), TRUE)) { | |
backdrop_add_css(backdrop_get_path('module', 'code_syntax_highlighting_bundle') | |
. '/libraries/highlightjs/styles/' . config_get('code_syntax_highlighting_bundle.settings','csh_theme') . '.css'); |
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
{ | |
"require": { | |
"behat/mink-extension": "~2.3", | |
"behat/mink-goutte-driver": "~1.2", | |
"behat/mink-selenium2-driver": "~1.3" | |
}, | |
"minimum-stability": "dev", | |
"prefer-stable": true, | |
"config": { | |
"bin-dir": "bin/" |
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
default: | |
# Ignore certain tags so they don't have to be excluded on the commandline. | |
gherkin: | |
filters: | |
tags: "~@broken" | |
# Not sure if this is the best, but it sounds nice. | |
formatters: | |
pretty: true | |
suites: | |
my_suite: |
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
# Install a site. | |
$HOME/.composer/vendor/bin/drush si --db-url=mysql://backdrop:backdrop@127.0.0.1/backdrop -y | |
# Boot up the server. | |
$HOME/.composer/vendor/bin/drush backdrop-runserver 127.0.0.1:8057 > /dev/null 2>&1 | |
# Enable a module. | |
$HOME/.composer/vendor/bin/drush en ${MODULE_NAME} -y |
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
# This function takes the output of the last command and exits if it failed. | |
earlyexit() { | |
CODE="$?" | |
if [ "${CODE}" != "0" ]; then | |
echo --- | |
echo Exiting on failure... | |
echo --- | |
exit 1 | |
fi | |
echo Script succeeded. |
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
# This function takes the output of the last command and exits if it failed. | |
earlyexit() { | |
CODE="$?" | |
if [ "${CODE}" != "0" ]; then | |
echo --- | |
echo Exiting on failure... | |
echo --- | |
exit 1 | |
fi | |
echo Script succeeded. |
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
#!/usr/bin/env bash | |
cd ${ROOT_DIR}/backdrop | |
# Enable Testing module. | |
$HOME/.composer/vendor/bin/drush en simpletest -y | |
# Run SimpleTests. | |
php ./core/scripts/run-tests.sh --url http://127.0.0.1:8057 --php ~/.phpenv/versions/$(phpenv version-name)/bin/php "${SIMPLETEST_CLASSES}" | |
earlyexit |
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
language: php | |
# We want to avoid sudo. This allow us to use Travis docker infrastructure, which means builds start faster and have more CPU available. | |
sudo: false | |
git: | |
depth: 1 | |
php: | |
- '7.1' |
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
# Clone down Backdrop. | |
cd $ROOT_DIR | |
echo "Cloning Backdrop repo..." | |
git clone --branch 1.x --depth 1 https://github.com/backdrop/backdrop.git ${ROOT_DIR}/backdrop | |
# ...bunch more stuff... | |
# Clone down and install contrib modules. | |
for i in $(echo ${ADD_CONTRIB_MODULES} | sed "s/ / /g") | |
do |
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 | |
function user_roles($members_only = FALSE, $permission = NULL, $full_objects = FALSE) { | |
$user_roles = &backdrop_static(__FUNCTION__); | |
if (!isset($user_roles)) { | |
$user_roles = array(); | |
// @todo: Consider a cache get here instead of reading from disk. | |
$names = config_get_names_with_prefix('user.role.'); | |