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 | |
/** | |
* @file pm_lost.drush.inc | |
* Drush command 'pm-lost' lists projects which are not installed or disabled. | |
* | |
* It can be useful to detect waste modules which was downloaded once and then forgotten. | |
*/ | |
/** | |
* Implementation of hook_drush_command(). |
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 | |
define('DRUPAL_ROOT', getcwd()); | |
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
$user = user_load(1); | |
if ($user) { | |
$edit = (array)$user; |
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
#!/usr/bin/env drush | |
<?php | |
/** | |
* This is Drush script. | |
* Only CIS countries for http://drupal.org/project/countries module. | |
* Оставить включенными только страны СНГ в модуле Сountries 7.x-2.x. | |
*/ | |
// Disable all counties. | |
$cnt = db_update('countries_country') |
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 | |
/* | |
* Use in devel/php or with drush scr. | |
* Compatible with http://drupal.org/project/redirect module. | |
*/ | |
// Some query. | |
$result = db_select('node', 'n') | |
->fields('n', array('nid')) | |
->condition('n.type', 'article') | |
->condition('n.status', 1) |
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
#!/usr/bin/env drush | |
<?php | |
/** | |
* Download modules which are not found on disk but exist in system table. | |
* Tested on Drupal 7. | |
*/ | |
$result = db_query('SELECT * FROM system ORDER BY name'); | |
foreach ($result as $record) { | |
if (!file_exists($record->filename)) { |
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 | |
/** | |
* Define Age formatter for date fields. | |
*/ | |
/** | |
* Implements hook_field_formatter_info(). | |
*/ | |
function kalabro_field_formatter_info() { | |
$formatters = array( |
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 | |
/** | |
* @file | |
* Custom ajax handler for custom_fast_ajax module. | |
*/ | |
define('DRUPAL_ROOT', getcwd()); | |
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
// Include utils. | |
require_once DRUPAL_ROOT . '/includes/common.inc'; |
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 | |
/** | |
* Duuu! Drupal Auto-Update script. Last tested with Drush 7.0. | |
* TODO: | |
* - convert to command. | |
* | |
* Requirements: | |
* - Drush 7 **OR** Core Update module enabled. | |
* - curl (optionally for HTTP site check). | |
* |