// credentials. Instead, we instantiate a FileTransferLocal and invoke
// update_authorize_run_update() directly.
//if (fileowner($project_real_location) == fileowner(conf_path())) {
- if (is_writeable(conf_path())) {
+ if (apps_installer_has_write_access()) {
module_load_include('inc', 'update', 'update.authorize');
$filetransfer = new FileTransferLocal(DRUPAL_ROOT);
apps_run_install($filetransfer, $updates); //this is our change
}
/**
+ * Check whether Apps has write access to libraries and modules directories.
+ *
+ * @return boolean
+ */
+function apps_installer_has_write_access() {
+ $libraries_dir = (is_dir('sites/all/libraries')) ? 'sites/all/libraries' : 'sites/all';
+ return is_writable(drupal_realpath($libraries_dir)) && is_writable(drupal_realpath('sites/all/modules'));
+}
+
+
+/**
* Implements hook_block_info().
*/
function apps_block_info() {
*
*/
function apps_profile_install_tasks($install_state, $apps_server) {
+ // Need to include the apps.module file because on installs the profile
+ // collects all install tasks before any modules are enabled
+ module_load_include('module', 'apps');
+
// Only use apps forms during interactive installs.
$tasks = array();
if ($install_state['interactive']) {
'apps_profile_authorize_transfer_' . $apps_server_name => array(
'display' => FALSE,
'type' => 'form',
- 'run' => (!is_writeable(conf_path()) && isset($_SESSION['apps']))?INSTALL_TASK_RUN_IF_NOT_COMPLETED:INSTALL_TASK_SKIP,
+ 'run' => (!apps_installer_has_write_access() && isset($_SESSION['apps']))?INSTALL_TASK_RUN_IF_NOT_COMPLETED:INSTALL_TASK_SKIP,
'function' => 'apps_profile_authorize_transfer',
),
'apps_profile_install_app_modules_' . $apps_server_name => array(