There is a possible happen due to incorrect alias of folder too. So, go to /var/www/html and use the following command to check folder's alias:
ll -Z
To change folder alias, use the following code
chcon -R -t httpd_sys_content_t foldername
ll -Z
chcon -R -t httpd_sys_content_t foldername
mysqldump -u root -p --all-databases > alldb.sql
mysqldump -u root -p --opt --all-databases > alldb.sql
mysqldump -u root -p --all-databases --skip-lock-tables > alldb.sql
mysql -u root -p < alldb.sql
scp command. scp uses the SSH protocol to copy files across system by extending the syntax of cp.scp /path/to/local/file username@hostname:/path/to/remote/file
scp username1@hostname1:/path/to/file username2@hostname2:/path/to/other/file
scp username@hostname:/path/to/remote/file /path/to/local/file
/**
* Update default image on field base.
*/
function mymodule_update_7300() {
$field_name = 'field_fb_article_image';
$filename = 'images.png';
$source = drupal_get_path('module', 'mymodule') . '/includes/images' . '/' . $filename;
// Load field info.
$field = field_info_field($field_name);
// Create new file object and get new fid.
if (file_exists($source)) {
$file = new stdClass;
$file->filename = $filename;
$file->timestamp = REQUEST_TIME;
$file->uri = $source;
$file->filemime = file_get_mimetype($source);
$file->uid = 1;
$file->status = 1;
$file = file_copy($file, 'public://files', FILE_EXISTS_REPLACE);
$fid = $file->fid;
// Replace old fid with new fid.
$field['settings']['default_image'] = (string) $fid;
// Update field.
field_update_field($field);
}
}
/**
* Disabled PSL Newsletter module
* Implements hook_update_N()
*/
function mymodule_update_7300(&$sandbox) {
module_disable(array('newsletter'));
return 'Newsletter has been disabled';
}
/** Comment **/
/**
* Implements hook_menu().
*/
function mymodule_menu() {
// track url
$items['getSession'] = array(
'page callback' => 'mymodule_getSession_ajax',
'access callback' => TRUE
);
return $items;
}
/**
* Called by ajax request to getSession
*/
function mymodule_getSession_ajax() {
if(isset($_POST['action'])) {
$action = $_POST['action'];
unset($_POST['action']);
}
else {
$action = 'default';
}
mymodule_getSession('ajax', $action, $_POST);
}
/**
*
* @param string $type ajax|server This informs the function if it should use the current request or REFERER as the url
* @param string $action action to send
* @param array $vars Associative array of variables to send as custom vars
*/
function mymodule_getSession($type, $action, $vars=array()){
$url = $_SERVER['HTTP_REFERER'];
$params = parse_url($url);
$result = array();
$customVariable = ['MemberID', 'EmailID', 'SpecialtyID'];
if(isset($params['query'])){
parse_str($params['query'], $query);
foreach ($query as $key => $value) {
if(in_array($key, $customVariable))
{
$_SESSION['_custom_variables'][$key] = $value;
}
}
}
$result = $_SESSION['_custom_variables'];
print drupal_json_output($result);
exit();
}
/** Comment **/
(function ($) {
jQuery(document).ready(function() {
var mysession = getSession();
console.log(mysession);
/*
* Get Session Function
* @action is the name of the page
* @actionType is either 'page_view' or 'link'
*/
function getSession() {
// add action and action type
var data = {action:'custom_variables'};
var basePath = '';
var result;
if ( (Drupal.settings.basePath != undefined) && (Drupal.settings.basePath != '/') ) {
basePath = Drupal.settings.basePath;
}
basePath = basePath + '/getSession';
basePath = basePath.replace('//', '/');
jQuery.ajax({
url: basePath,
type:'POST',
dataType:'json',
data:data,
async:(jQuery.browser.safari || jQuery.browser.mozilla) ? false : true,
success: function(data) {
// for this current implementation, there is no need for action upon success
result = data;
},
error: function(xhr, status, error) {
// error
}
});
return result;
}
})
}
)(jQuery);