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 | |
function sap_soap_menu() { | |
$items['sap/getusers'] = array( | |
'page callback' => 'sap_soap_users', | |
'access arguments' => array('access content'), | |
'type' => MENU_NORMAL_ITEM, | |
); | |
return $items; | |
} |
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 | |
/** | |
* Implements hook_entity_info(). | |
*/ | |
function dance_code_entity_info() { | |
$ents['proficiency'] = array( | |
'label' => t('Proficiency Status'), | |
'plural label' => t('Proficiency Statuses'), | |
'fieldable' => TRUE, |
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 | |
/* | |
* https://gist.github.com/marktheunissen/2596787 | |
*/ | |
function oi_migrate_migrate_api() { | |
$api = array( | |
'api' => 2, | |
'groups' => 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 | |
class MyMigration extends Migration { | |
public $base_dir; | |
/** | |
* Constructor. | |
*/ | |
public function __construct() { | |
parent::__construct(); |
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
These files import ONE database table (users) into Drupal. | |
Some key issues to note for the record: | |
* getting the name of the hook right in planetmath.module | |
(it should be MODULENAME_migrate_api). | |
* make sure to clear the cache after the module is | |
imported (drush cc all). This should help identify any | |
coding errors! |
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
{ | |
"title": "this is a title", | |
"content": "this is a body", | |
"date": "2009-01-01", | |
"url":"http://oldsite.com/123/test", | |
"image": "test.jpg", | |
"id": 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
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME}\.php -f | |
RewriteRule ^(.*)$ $1.php |
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 | |
# Take a MySQL DB dump excluding some tables. | |
# | |
# Usage: | |
# ./drupal-quick-dump user host database | |
USER="$1" | |
HOST="$2" | |
DB="$3" | |
DATE=`date +%Y%m%d` |
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/php -q | |
<?php | |
/** | |
* @file | |
* Script to automate the transfer of all databases and files from one | |
* environment to another using Acquia Cloud API. | |
*/ |
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 | |
// Let's say for argument sake $query is a database query that checks for the | |
// presence of an existing record and returns FALSE if nothing is found. In this | |
// example, we need to check for an existing record and update the row if it | |
// exists or create a new entry if it doesn't. | |
/** | |
* Bad | |
*/ |
NewerOlder