Logo Search packages:      
Sourcecode: aegir-provision version File versions  Download package

_provision_drupal_create_directories ( url,
profile = NULL 
)

Create the directories needed to host a drupal site

Also maintains permissions on existing directories.

Definition at line 218 of file provision_drupal.drush.inc.

Referenced by drush_provision_drupal_pre_provision_install().

                                                                     {  
  $paths = array(
    "sites/$url"                 => 0755,
    "sites/$url/files"           => 02770,
    "sites/$url/files/tmp"       => 02770,
    "sites/$url/files/images"    => 02770,
    "sites/$url/files/pictures"  => 02770,
    "sites/$url/themes"          => 0755,
    "sites/$url/modules"         => 0755,  
  );
  $grps = array(
    "sites/$url/files",
    "sites/$url/files/tmp",
    "sites/$url/files/images",
    "sites/$url/files/pictures",
  );

  foreach ($paths as $path => $perm) {
    if (!is_dir($path)) {
      provision_path("mkdir", $path, TRUE, 
        dt("Created <code>@path</code>"),
        dt("Could not create <code>@path</code>"),
        'DRUSH_PERM_ERROR');
    }

    provision_path("chmod_recursive", $path, $perm, 
      dt("Changed permissions of <code>@path</code> to @confirm"),
      dt("Could not change permissions <code>@path</code> to @confirm")
      );
  }
  foreach ($grps as $path) {
      provision_path("chown_recursive", $path, drush_get_option('script_user'), 
      dt("Changed ownership of <code>@path</code>"),
      dt("Could not change ownership <code>@path</code>"),
     'DRUSH_PERM_ERROR' );
    provision_path("chgrp_recursive", $path, drush_get_option('web_group'),
      dt("Changed group ownership of <code>@path</code>"),
      dt("Could not change group ownership <code>@path</code>"));
  }
}


Generated by  Doxygen 1.6.0   Back to index