function _hosting_subdirs_is_a_subdir_site in Hosting 7.4
Same name and namespace in other branches
- 7.3 subdirs/hosting_subdirs.module \_hosting_subdirs_is_a_subdir_site()
Helper function to determine whether a hosted site is using a subdirectory URL.
3 calls to _hosting_subdirs_is_a_subdir_site()
- drush_hosting_subdirs_post_hosting_task in subdirs/
hosting_subdirs.drush.inc - Implements drush_HOOK_post_COMMAND().
- drush_hosting_subdirs_pre_hosting_task in subdirs/
hosting_subdirs.drush.inc - Implements drush_HOOK_pre_COMMAND().
- hosting_subdirs_post_hosting_import_task in subdirs/
hosting_subdirs.module - Implements hook_post_hosting_import_task().
File
- subdirs/
hosting_subdirs.module, line 161 - Allow sites to be installed in subdirectories.
Code
function _hosting_subdirs_is_a_subdir_site($site) {
// If the site isn't using re-direction, then it isn't a subdir site.
if (!isset($site->redirection) || !$site->redirection) {
return FALSE;
}
// If the site isn't re-directing to a subdir, then it isn't a subdir site.
if (!hosting_subdirs_is_a_subdir($site->redirection)) {
return FALSE;
}
// If the site is re-directing to a custom alias, leave it alone.
if ($site->title != hosting_site_get_domain($site->redirection)) {
return FALSE;
}
return TRUE;
}