which takes advantage of the $_ENV
variable
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 c4m_og_access() { | |
if (!og_context_is_init()) { | |
// OG context wasn't called yet, so we can't call og_context() ourself yet. | |
return; | |
} | |
if (!$og_context = og_context()) { | |
// No OG context. | |
return; | |
} |
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
$plugin = array( | |
'label' => t('Articles'), | |
'resource' => 'articles', | |
'name' => 'articles__1_7', | |
'entity_type' => 'node', | |
'bundle' => 'article', | |
'description' => t('Export the article content type using view modes.'), | |
'class' => 'RestfulEntityBaseNode', | |
'authentication_types' => TRUE, | |
'authentication_optional' => 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
return array('uploaded a moment. file: ' . $name); | |
``return parent::createEntity();`` |
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
{ | |
"_links": { | |
"self": { | |
"href": "http://s4ba560702504edc.s3.simplytest.me/node/1" | |
}, | |
"type": { | |
"href": "http://s4ba560702504edc.s3.simplytest.me/rest/type/node/article" | |
}, | |
"http://s4ba560702504edc.s3.simplytest.me/rest/relation/node/article/uid": [ | |
{ |
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
UPDATE `users` SET `mail`=concat(mail, '.test') WHERE `uid` > 0 |
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 | |
* Contains RestfulTokenAuthenticationTestCase. | |
*/ | |
class RestfulTokenAuthenticationTestCase extends DrupalWebTestCase { | |
public static function getInfo() { |
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
/** | |
* Implements hook_ctools_plugin_directory(). | |
*/ | |
function pluggable_node_access_ctools_plugin_directory($module, $plugin) { | |
if ($module == 'pluggable_node_access') { | |
return 'plugins/' . $plugin; | |
} | |
} | |
// /plugins/pluggable_node_access |
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
/** | |
* Overrides \OgSelectionHandler::buildEntityFieldQuery | |
*/ | |
public function buildEntityFieldQuery($match = NULL, $match_operator = 'CONTAINS') { | |
$query = parent::public function buildEntityFieldQuery($match, $match_operator); | |
$field_mode = $this->instance['field_mode']; | |
if ($field_mode == 'default') { | |
$query->fieldCondition('', array(),'IN'); | |
} |
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
/** | |
* Implements hook_watchdog(). | |
*/ | |
function example_user_watchdog(array $log_entry) { | |
if ($log_entry['message'] != 'Session opened for %name.') { | |
return; | |
} | |
logs_http_register_event($log_entry); | |
} |