Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49221

Automatically Download modules during profile installation

$
0
0

Hey all,

I don't know if anything like this already exists, but I've written a script to add to install profiles that will go out and fetch via FTP the latest version of any missing modules from the Drupal projects repository.

I'd consider this a development version of the script, but it seems to be working fairly well, with some cool features, like preferring files that are NOT marked 'alpha', 'beta', or 'dev', but it will use these if it can't find something better.

To use, place the attached file in the folder with your profile (rename with proper .php extension only), and make your _profile_modules() look something like this:

<?php
function myProfileName_profile_modules() {

 
$modules_list = array(
 
   
// Enable required core modules first.
   
'block', 'filter', 'node', 'system', 'user', 'watchdog',
  
   
// Enable optional core modules next.
   
'color', 'help', 'menu', 'path', 'taxonomy', 'upload',

   
// Then, enable any contributed modules here.
   
'views', 'views_ui', 'content', 'content_access', 'devel', 'admin_menu', 'date_api', 'date_timezone', 'calendar', 'calendar_ical', 'image', 'imagefield', 'gmap', 'location', 'user_status', 'loginmenu',
   
    );

 
// Additional module packages to download, because the package name might not match the module name; or we might want to have a module available, but not enabled right away.
 
$other_packages = array ('cck', 'date', 'image_gallery', 'send', 'mimemail', 'simplenews' );

   
  require_once(
'getmods.php');
 
profile_download_modules(array_merge($modules_list, $other_packages), 5); // Second argument is the Drupal version to look for.
 
 
return $modules_list;
}
?>

Please try this out & make comments & submit improvements.

Thanks!

-Matt


Viewing all articles
Browse latest Browse all 49221

Trending Articles