function hosting_platform_insert in Hosting 7.4
Same name and namespace in other branches
- 5 platform/hosting_platform.module \hosting_platform_insert()
- 6.2 platform/hosting_platform.module \hosting_platform_insert()
- 7.3 platform/hosting_platform.module \hosting_platform_insert()
Implements hook_insert().
1 call to hosting_platform_insert()
- hosting_platform_update in platform/
hosting_platform.module - Implements hook_update().
File
- platform/
hosting_platform.module, line 560 - Platform node type definition.
Code
function hosting_platform_insert($node) {
if (empty($node->no_verify)) {
hosting_add_task($node->nid, 'verify');
}
$id = db_insert('hosting_platform')
->fields(array(
'vid' => $node->vid,
'nid' => $node->nid,
'git_remote' => $node->git_remote,
'git_reference' => $node->git_reference,
'git_reset' => (int) $node->git_reset,
'git_root' => hosting_path_normalize($node->git_root),
'git_docroot' => $node->git_docroot,
'publish_path' => hosting_path_normalize($node->publish_path),
'makefile' => isset($node->makefile) ? $node->makefile : (isset($node->frommakefile['makefile']) ? $node->frommakefile['makefile'] : ''),
'verified' => isset($node->verified) ? $node->verified : 0,
'web_server' => $node->web_server,
'status' => isset($node->platform_status) ? $node->platform_status : 0,
'make_working_copy' => isset($node->frommakefile['make_working_copy']) ? $node->frommakefile['make_working_copy'] : 0,
))
->execute();
if (!isset($node->old_vid)) {
hosting_context_register($node->nid, 'platform_' . preg_replace("/[!\\W]/", "", $node->title));
}
}