- Exception
- ErrorException
- LogicException
- BadFunctionCallException
- BadMethodCallException
- DomainException
- InvalidArgumentException
- LengthException
- OutOfRangeException
- BadFunctionCallException
- RuntimeException
This file contains 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
SELECT 'ColName1', 'ColName2', 'ColName3' | |
UNION ALL | |
SELECT ColName1, ColName2, ColName3 | |
FROM YourTable | |
INTO OUTFILE '/path/outfile' |
This file contains 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 | |
global $user; | |
$original_user = $user; | |
$old_state = drupal_save_session(); | |
drupal_save_session(FALSE); | |
$user = user_load(1); | |
// Take your action here where you pretend to be the user with UID = 1 (typically the admin user on a site) | |
// If your code fails, it's not a problem because the session will not be saved | |
$user = $original_user; | |
drupal_save_session($old_state); |
This file contains 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
<input type="button" id="cancelBtn" value="Cancel All AJAX" /> | |
$.xhrPool.abortAll = function() { | |
$(this).each(function(idx, jqXHR) { | |
jqXHR.abort(); | |
}); | |
$.xhrPool = []; | |
}; |
This file contains 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 | |
// You may have wondered how a PHP function defined as below behaves: | |
function &config_byref() | |
{ | |
static $var = "hello"; | |
return $var; | |
} | |
// the value we get is "hello" | |
$byref_initial = config_byref(); |
This file contains 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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Follow this instructions: | |
|-------------------------------------------------------------------------- | |
| | |
| Laravel takes a dead simple approach to your application environments | |
| so you can just specify a machine name for the host that matches a | |
| given environment, then we will automatically detect it for you. |
This file contains 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 YOURTHEME_preprocess_PANEL_LAYOUT(&$variables) { | |
$variables['messages'] = theme('status_messages'); | |
} |
This file contains 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 YOURTHEME_preprocess_panels_pane(&$variables) { | |
// dpm('type: ' . $variables['pane']->type); | |
if ($variables['pane']->type == 'block') { | |
dpm('subtype: ' . $variables['pane']->subtype); | |
} | |
} | |
?> |
This file contains 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 | |
// Just alter the cardinality selection with this hook and provide only one value | |
function _form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) { | |
if ($form['#field']['type'] == '<your field type>') { | |
$form['field']['cardinality']['#options'] = array(1); | |
} | |
} |
This file contains 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
drush php-eval 'cache_clear_all("*", "cache", TRUE);'` |