Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Eric Rasmussen
UNL-CMS
Commits
1d13df0c
Commit
1d13df0c
authored
Feb 28, 2013
by
Eric Rasmussen
Browse files
Merge remote-tracking branch 'origin/issue-604' into issue-604
parents
eb4b8c48
aeb55195
Changes
3
Hide whitespace changes
Inline
Side-by-side
profiles/unl_profile/unl_profile.install
View file @
1d13df0c
...
...
@@ -296,20 +296,6 @@ EOF;
);
user_save
(
$account
,
$userData
);
}
if
(
$row
->
migration_url
)
{
// If there's a site to migrate, add the job to the queue.
require_once
drupal_get_path
(
'module'
,
'unl_migration'
)
.
'/unl_migration.php'
;
$migration
=
new
Unl_Migration_Tool
(
$row
->
migration_url
,
$row
->
migration_path
,
$frontier_config
[
'unl_frontier_username'
],
$frontier_config
[
'unl_frontier_password'
],
FALSE
);
DrupalQueue
::
get
(
'unl_migration'
,
TRUE
)
->
createItem
(
Unl_Migration_Tool
::
save_to_disk
(
$migration
));
}
}
}
...
...
sites/all/modules/unl_migration/unl_migration.module
View file @
1d13df0c
...
...
@@ -31,31 +31,3 @@ function unl_migration_permission() {
),
);
}
/**
* Implementation of hook_cron().
*/
function
unl_migration_cron
()
{
_unl_migration_cron_migration_step
();
}
/**
* If a site is being migrated via cron jobs, do some work towards that migration.
*/
function
_unl_migration_cron_migration_step
()
{
// We don't want this running as system user, only the web user.
if
(
PHP_SAPI
==
'cli'
)
{
return
;
}
$queue
=
DrupalQueue
::
get
(
'unl_migration'
);
if
(
$queue
->
numberOfItems
()
>
0
)
{
require_once
dirname
(
__FILE__
)
.
DIRECTORY_SEPARATOR
.
'unl_migration.php'
;
$item
=
$queue
->
claimItem
(
120
);
$queue
->
deleteItem
(
$item
);
if
(
unl_migration_queue_step
(
$item
->
data
))
{
module_load_include
(
'module'
,
'unl_multisite'
);
_unl_multisite_send_site_created_email
();
}
}
}
sites/all/modules/unl_migration/unl_migration.php
View file @
1d13df0c
...
...
@@ -112,16 +112,6 @@ function unl_migration_step($migration, &$context)
$context
[
'sandbox'
][
'duration'
]
=
min
(
300
,
ceil
(
$context
[
'sandbox'
][
'duration'
]
*
1.5
));
}
function
unl_migration_queue_step
(
$migration_storage_file
)
{
$migration
=
Unl_Migration_Tool
::
load_from_disk
(
$migration_storage_file
);
if
(
$migration
->
migrate
(
60
))
{
return
TRUE
;
}
DrupalQueue
::
get
(
'unl_migration'
,
TRUE
)
->
createItem
(
Unl_Migration_Tool
::
save_to_disk
(
$migration
));
return
FALSE
;
}
class
Unl_Migration_Tool
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment