This file contains hidden or 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
| $task = rules_scheduler_task_load([tid]); | |
| rules_scheduler_run_task($task); |
This file contains hidden or 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 MODULE_node_view($node, $view_mode, $langcode) { | |
| if ($view_mode == 'full' && node_is_page($node)) { | |
| //It is safe to call drupal_goto() from here | |
| } | |
| } |
This file contains hidden or 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
| # Clean URL for files in Drupal | |
| # | |
| # Replace : http://www.site.com/sites/default/files/myfile.txt | |
| # by : http://www.site.com/files/myfile.txt | |
| # Be careful to put this rule before any other blocking rule. | |
| RewriteRule ^files/(.*)$ /sites/default/files/$1 [L] |
This file contains hidden or 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
| CAST(text_column AS CHARACTER VARYING(255)) |
This file contains hidden or 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 | |
| ctools_include('cleanstring'); | |
| $clean_string = ctools_cleanstring($string_to_clean); | |
| ?> |
This file contains hidden or 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
| $backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS); | |
| $variables = array('@backtrace' => json_encode($backtrace, JSON_PRETTY_PRINT)); | |
| watchdog('MODULE', 'Things happend, here\'s a backtrace:<br><pre>@backtrace</pre>', $variables, WATCHDOG_ERROR); |
This file contains hidden or 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
| sudo du -d 1 -x -c -g / |
This file contains hidden or 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
| perl -lne 'print $& if /bot/' /var/log/httpd/access_log | wc -l |
This file contains hidden or 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
| #!/bin/bash | |
| # Backup/duplicate a Drupal website and its database. | |
| # Usage: sh backup.sh | |
| # Prompt for website to backup. | |
| read -p "Website directory to backup (/var/www/html/drupal): " WEBSITE_DIRECTORY | |
| if [ -z "$WEBSITE_DIRECTORY" ]; then | |
| WEBSITE_DIRECTORY="/var/www/html/drupal" | |
| fi |
OlderNewer