The Profiler Builder module may be of interest to users of the Profiler module, so it would be nice if a link to the module could be added to the Profiler project page to spread the word.

 

 

Original issue summary

I was about to build a profiler install profile when I realized there was a lot of lines to copy and paste / type. I'm building a distribution sitting around 90 modules (and generally am lazy) so I wrote this little module to attempt to help build the .info file faster.

What this does: Activate the module then go to admin/settings/profiler_builder
It will generate 3 text fields:

The first one is a list of all modules installed, grouped by their package as listed in their .info files. This helps kick start the process of converting an existing site into an install profile.

The second one grabs all variables and writes them out in a profiler manner. This is a ton of variables for most but it's at least a comprehensive list that can be easier to hack apart instead of build / copy by hand.

The third text field is the same .info information for profiler but in drush format. I don't use drush so I really don't know the format all that well but it was a first stab.

None of these are intended to be the end all perfect file but they at least can help when building profiler profiles (I hope)!

I've also attached a screenshot along with the code in case anyone wanted to glance quickly as to what this does. This is 6.x though it's like 2 queries so shouldn't be hard to port.

Comments

btopro’s picture

StatusFileSize
new2.71 KB

updated code to allow for deeper array structures and removed features dependency

markwk’s picture

Nice working little module. I'm not sure this quite fits inside of profiler, since profiler is a library for the actual installation. Might be better posting as a full project or at least a sandbox and just provide a link on profiler home page to this.

I teach Drupal to Chinese students and this would be a nice little tool for showing them how to create simple and easy installation profiles.

Thanks btopro for your "laziness" ;)

gmclelland’s picture

Thanks @btopro, great module - huge time saver along with the profiler module. +1 for a separate module

bisonbleu’s picture

Kudo @btopro for this little gem!

I've just spent 3 days crafting a 90+ module installation profile - and debugging it! Typos are deadly. And so are modules that don't respect conventions (e.g. Google Analytics where project name = "google_analytics" but module name = "googleanalytics".

The variables field is particularly useful for customization.

Great work!

btopro’s picture

Yeah it's definitely not perfect but I'd love to improve upon it and release it to it's own project page if it doesn't fit here as part of the main package (understandable). It seems to have problems with endlines in the variables (like email messages). If anyone knows of a blacklist of variables that shouldn't be added (like drupal private key) that'd be really useful in extending this module. I'll have to add some functionality to it in the next few weeks but could use a kick-started in some areas if someone wants to take a stab.

bisonbleu’s picture

Profiler Builder ran fine locally. But when I installed it on a remote server I got the following errors.

    recoverable fatal error: Object of class stdClass could not be converted to string in /home/.../sites/all/modules/profiler_builder/profiler_builder.module on line 125.
    recoverable fatal error: Object of class stdClass could not be converted to string in /home/.../sites/all/modules/profiler_builder/profiler_builder.module on line 125.
    recoverable fatal error: Object of class stdClass could not be converted to string in /home/.../sites/all/modules/profiler_builder/profiler_builder.module on line 125.
    recoverable fatal error: Object of class stdClass could not be converted to string in /home/.../sites/all/modules/profiler_builder/profiler_builder.module on line 130.
    recoverable fatal error: Object of class stdClass could not be converted to string in /home/.../sites/all/modules/profiler_builder/profiler_builder.module on line 125.
    recoverable fatal error: Object of class stdClass could not be converted to string in /home/.../sites/all/modules/profiler_builder/profiler_builder.module on line 125.

Couls it be related to French accents in the .info text field? Here is a sample.

variables[captcha_description_fr] = Cette question permet de s'assurer que vous êtes un utilisateur humain et non un logiciel automatisé de pollupostage.

markwk’s picture

@btopro: why don't you throw it into a sandbox or github for now? I glanced at strongarm and didn't notice that it was doing anything about any variables in particular.

btopro’s picture

I'm thinking the accents might be an issue, or the ' character. Haven't seen if it handles quotation marks nicely at all.

@markwk: not sure what you mean about strongarm, it'll have it's own place soon, working through decoupling a lot of modules for release this week.

markwk’s picture

@btopro: strongarm handles variables for features so the premise was that it might be checking whether certain variables should be avoided....

btopro’s picture

Oh i gotcha, I think this is upstream from that unless strongarm has a blacklist

btopro’s picture

Split off as a new project -- http://drupal.org/project/profiler_builder

bisonbleu’s picture

Cool! :-)

gmclelland’s picture

Very nice

q0rban’s picture

Great stuff! I've wanted to do this from the inception of Profiler, but just haven't had the time. The ultimate goal for this project is to integrate Drush Make, Profiler, and Update API into one seamless solution for managing Drupal sites. I just haven't had time to realize that vision. Thanks for taking the initiative here! I see some ways to improve some of this code, but overall it gets the job done. Kudos!

I agree, this should not get packaged with this library, unless it is a drush command or some other non-module solution. I think it will make things too confusing. Thanks again!

btopro’s picture

I figured as much, it seemed like the next logical step :). Code definitely has room for improvement which I'll probably provide as I get closer to a release of my platform using this project to generate the file and save me tons of time. Great work on this library, this really should be part of Drupal core and the way that distributions are created in the first place. I think it would safe so much time and argument about "how much stuff" Drupal ships with. 3 or 4 great "use case" type of install profiles could be generated to give people an idea of what's possible out of the box with this API.

markwk’s picture

Ported to D7 with patch http://drupal.org/node/1307512 or download directly from github: https://github.com/markwk/profiler_builder7

btopro’s picture

mark can you mirror this post in the issue queue for http://drupal.org/project/profiler_builder

markwk’s picture

Already did...

gmclelland’s picture

@q0rban - How about adding a link to http://drupal.org/project/profiler_builder from the profiler module page. Might help get some more visibility/testing.

btopro’s picture

+1 code isn't on d.o, at this moment but it will be in the near future and I don't want to be the only maintainer on it if anyone else wants to pick it up and clean it up some more.

btopro’s picture

Just to wrap up this thread. D6 and D7 versions of the profiler builder module are now on drupal.org

deciphered’s picture

Status: Active » Closed (won't fix)

And yet you forgot to actually wrap up this thread :-)

markwk’s picture

Status: Closed (won't fix) » Active
deciphered’s picture

Title: Profiler Builder prototype (code attached) » Make a link to Profiler Builder on projet page.
Category: feature » task

Updating issue name so that some action may possible be taken.

deciphered’s picture

Issue summary: View changes

Updated issue summary.

deciphered’s picture

Issue summary: View changes

Updated issue summary.

btopro’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

+1 I think this makes profiler files much easier to build faster or at least get a good starting point... and I'm completely not saying that because I started the project or anything...

...

q0rban’s picture

Status: Active » Fixed

Good idea... Added!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.