Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/PrintBuilder.php b/src/PrintBuilder.php
index 7da7a04..a0d846c 100644
--- a/src/PrintBuilder.php
+++ b/src/PrintBuilder.php
@@ -52,6 +52,9 @@ class PrintBuilder implements PrintBuilderInterface {
* {@inheritdoc}
*/
public function deliverPrintable(array $entities, PrintEngineInterface $print_engine, $force_download = FALSE, $use_default_css = TRUE) {
+ if (empty($entities)) {
+ throw new PrintEngineException('access denied.');
@awm086
awm086 / gist:1c6a43139f51567d83bd
Created December 19, 2014 21:11
Turn off StrictHostKeyChecking for vagrant user
# Turn off StrictHostKeyChecking for vagrant user
config.vm.provision :shell do |shell|
file = "/root/.ssh/config"
shell.inline = "mkdir -p /root/.ssh/ && touch #{file} " +
" && grep -q 'StrictHostKeyChecking' #{file} || echo 'StrictHostKeyChecking no' >> #{file}"
end
xdebug.ini
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
;Uncomment the following to enable xdebug. Check phpinfo always to see loaded modules and proper conf
;xdebug.profiler_enable = 0
;xdebug.profiler_enable_trigger = 1
;xdebug.remote_enable = 0
;xdebug.auto_trace = 0
;xdebug.profiler_output_dir = /tmp
@awm086
awm086 / fix_permission.sh
Created October 23, 2013 20:06
fix drupal permission
#!/bin/bash
if [ $(id -u) != 0 ]; then
printf "This script must be run as root.\n"
exit 1
fi
drupal_path=${1%/}
drupal_user=${2}
httpd_group="${3:-www-data}"
#!/bin/bash
#
# Original for 5.3 by Ruben Barkow (rubo77) http://www.entikey.z11.de/
# release 1 PHP5.4 to 5.3 by Emil Terziev ( foxy ) Bulgaria
# Originally Posted by Bachstelze http://ubuntuforums.org/showthread.php?p=9080474#post9080474
# OK, here's how to do the Apt magic to get PHP packages from the precise repositories:
echo "Am I root? "
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then