An automated way of locating unused modules?
Originally posted to http://drupal.org/node/1017416: I have a list of 60+ modules that I download, via drush, to each new Drupal
site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6? --Jim -- My IM and Skype details are at http://state68.com/contact
There can be a performance hit if apache is looking for .htaccess files in ea module dir, but this is configurable. and this drush command will give you a list of all disabled modules drush -l sitename pm-list --pipe --type=module --status=disabled On Sun, Jan 9, 2011 at 7:04 PM, James Benstead <james.benstead@gmail.com>wrote:
Originally posted to http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new Drupal
site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at http://state68.com/contact
-- -- -- Steve Power Principal Consultant Mobile: +44 (0) 7747 027 243 Fax: +44 (0)160 421 2871 Skype: steev_initsix www.initsix.co.uk :: Initsix Heavy Engineering Limited -- This email and any attachments to it may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Initsix Heavy Engineering Limited. If you are not the intended recipient of this email, you must neither take any action based upon its contents, nor copy or show it to anyone. Please contact the sender if you believe you have received this email in error. Initsix Heavy Engineering Limited Registered in the UK: 5036938 Registered Address: 243 Kettering Road, Northampton, NN2 7DU, England.
I don't think you'd even need a module to do this. You can get a list of currently used modules by doing: SELECT name FROM system WHERE type='module' AND status='1'; You could likely write a quick script to compare the list returned by that SQL statement to your modules list. Thanks, Cameron On Sun, Jan 9, 2011 at 12:04, James Benstead <james.benstead@gmail.com>wrote:
Originally posted to http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new Drupal
site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at http://state68.com/contact
Thanks, Cameron - doesn't that just show which modules are enabled, though? Say I'd enabled a module but then found that it wasn't necessary for the launched site, but had forgotten to disable that module. As I understand it, that module would still show up with status='1' but the site wouldn't actually be using it. --Jim -- My IM and Skype details are at http://state68.com/contact On 9 January 2011 19:26, Cameron Eagans <cweagans@gmail.com> wrote:
I don't think you'd even need a module to do this. You can get a list of currently used modules by doing:
SELECT name FROM system WHERE type='module' AND status='1';
You could likely write a quick script to compare the list returned by that SQL statement to your modules list.
Thanks, Cameron
On Sun, Jan 9, 2011 at 12:04, James Benstead <james.benstead@gmail.com>wrote:
Originally posted to http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new
Drupal site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at http://state68.com/contact
I believe the original question is not whether a module is enabled or not but whether an enabled module is actually being used *at all.* It's up to the site builder to pay attention and know the purposes of each enabled. To me this seems like is an administrative issue, rather than a technical issue. On Sun, Jan 9, 2011 at 11:26 AM, Cameron Eagans <cweagans@gmail.com> wrote:
I don't think you'd even need a module to do this. You can get a list of currently used modules by doing:
SELECT name FROM system WHERE type='module' AND status='1';
You could likely write a quick script to compare the list returned by that SQL statement to your modules list.
Thanks, Cameron
On Sun, Jan 9, 2011 at 12:04, James Benstead <james.benstead@gmail.com>wrote:
Originally posted to http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new
Drupal site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at http://state68.com/contact
I agree with Carl it is an administrative task and should be let to site Admins, but could the modules list page feature a "last used" timestamp column to help site admins know when it was the last time a module was used? This info could be helpful for the auditing purposes James explained in his other posting. Inviato da iPad Il giorno 09/gen/2011, alle ore 20:55, Carl Wiedemann <carl.wiedemann@gmail.com> ha scritto:
I believe the original question is not whether a module is enabled or not but whether an enabled module is actually being used *at all.*
It's up to the site builder to pay attention and know the purposes of each enabled. To me this seems like is an administrative issue, rather than a technical issue.
On Sun, Jan 9, 2011 at 11:26 AM, Cameron Eagans <cweagans@gmail.com> wrote: I don't think you'd even need a module to do this. You can get a list of currently used modules by doing:
SELECT name FROM system WHERE type='module' AND status='1';
You could likely write a quick script to compare the list returned by that SQL statement to your modules list.
Thanks, Cameron
On Sun, Jan 9, 2011 at 12:04, James Benstead <james.benstead@gmail.com> wrote: Originally posted to http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new Drupal site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at http://state68.com/contact
I guess this is almost an AI module, as it would take a whole set of parameters (like Gábor said) and somehow classify the modules according to a certain "degree of use". The monitor could then issue some report about all modules below a certain threshold, to which it would expect a reaction from the site administrator wethere to mark them as "needed" or to disable them. This later reaction could even be a learning process for the classifier itself, or just a "don't mess with nuclear missiles" flag on that specific module, causing it to miss the next round of classifying. On Mon, Jan 10, 2011 at 7:10 AM, Giovani Spagnolo < giovani@telematicsfreedom.org> wrote:
I agree with Carl it is an administrative task and should be let to site Admins, but could the modules list page feature a "last used" timestamp column to help site admins know when it was the last time a module was used? This info could be helpful for the auditing purposes James explained in his other posting.
Inviato da iPad
Il giorno 09/gen/2011, alle ore 20:55, Carl Wiedemann < carl.wiedemann@gmail.com> ha scritto:
I believe the original question is not whether a module is enabled or not but whether an enabled module is actually being used *at all.*
It's up to the site builder to pay attention and know the purposes of each enabled. To me this seems like is an administrative issue, rather than a technical issue.
On Sun, Jan 9, 2011 at 11:26 AM, Cameron Eagans < <cweagans@gmail.com> cweagans@gmail.com> wrote:
I don't think you'd even need a module to do this. You can get a list of currently used modules by doing:
SELECT name FROM system WHERE type='module' AND status='1';
You could likely write a quick script to compare the list returned by that SQL statement to your modules list.
Thanks, Cameron
On Sun, Jan 9, 2011 at 12:04, James Benstead < <james.benstead@gmail.com> james.benstead@gmail.com> wrote:
Originally posted to <http://drupal.org/node/1017416> http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new
Drupal site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at <http://state68.com/contact> http://state68.com/contact
-- Franz http://ciudaddelpico.com Sent from my laptop
That's really interesting - would be an interesting problem to try and define the metric for such a module. Almost certainly something for any version 2+. Thanks. --Jim -- My IM and Skype details are at http://state68.com/contact On 11 January 2011 11:32, Franz Glauber <franz.glauber@gmail.com> wrote:
I guess this is almost an AI module, as it would take a whole set of parameters (like Gábor said) and somehow classify the modules according to a certain "degree of use". The monitor could then issue some report about all modules below a certain threshold, to which it would expect a reaction from the site administrator wethere to mark them as "needed" or to disable them. This later reaction could even be a learning process for the classifier itself, or just a "don't mess with nuclear missiles" flag on that specific module, causing it to miss the next round of classifying.
On Mon, Jan 10, 2011 at 7:10 AM, Giovani Spagnolo < giovani@telematicsfreedom.org> wrote:
I agree with Carl it is an administrative task and should be let to site Admins, but could the modules list page feature a "last used" timestamp column to help site admins know when it was the last time a module was used? This info could be helpful for the auditing purposes James explained in his other posting.
Inviato da iPad
Il giorno 09/gen/2011, alle ore 20:55, Carl Wiedemann < carl.wiedemann@gmail.com> ha scritto:
I believe the original question is not whether a module is enabled or not but whether an enabled module is actually being used *at all.*
It's up to the site builder to pay attention and know the purposes of each enabled. To me this seems like is an administrative issue, rather than a technical issue.
On Sun, Jan 9, 2011 at 11:26 AM, Cameron Eagans < <cweagans@gmail.com> cweagans@gmail.com> wrote:
I don't think you'd even need a module to do this. You can get a list of currently used modules by doing:
SELECT name FROM system WHERE type='module' AND status='1';
You could likely write a quick script to compare the list returned by that SQL statement to your modules list.
Thanks, Cameron
On Sun, Jan 9, 2011 at 12:04, James Benstead <<james.benstead@gmail.com> james.benstead@gmail.com> wrote:
Originally posted to <http://drupal.org/node/1017416> http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new
Drupal site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at <http://state68.com/contact> http://state68.com/contact
-- Franz
Sent from my laptop
I would add one little thing to that query: SELECT name FROM system WHERE type='module' AND status='1' AND filename NOT LIKE 'module/%'; That way you don't get Drupal's core modules in the list. Jamie Holly http://www.intoxination.net http://www.hollyit.net On 1/9/2011 2:26 PM, Cameron Eagans wrote:
I don't think you'd even need a module to do this. You can get a list of currently used modules by doing:
SELECT name FROM system WHERE type='module' AND status='1';
You could likely write a quick script to compare the list returned by that SQL statement to your modules list.
Thanks, Cameron
On Sun, Jan 9, 2011 at 12:04, James Benstead <james.benstead@gmail.com <mailto:james.benstead@gmail.com>> wrote:
Originally posted to http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new Drupal site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at http://state68.com/contact
Although I agree with Carl that this is an administrative rather than a technical issue, I think that the module I have in mind would still be useful for site auditing purposes: for example, when taking over a site that has been put together by another Drupal shop. Assuming that such a module would be desirable, the question remains: would it be technically possible to build such a module? --Jim -- My IM and Skype details are at http://state68.com/contact On 9 January 2011 19:55, Jamie Holly <hovercrafter@earthlink.net> wrote:
I would add one little thing to that query:
SELECT name FROM system WHERE type='module' AND status='1' AND filename NOT LIKE 'module/%';
That way you don't get Drupal's core modules in the list.
Jamie Hollyhttp://www.intoxination.net http://www.hollyit.net
On 1/9/2011 2:26 PM, Cameron Eagans wrote:
I don't think you'd even need a module to do this. You can get a list of currently used modules by doing:
SELECT name FROM system WHERE type='module' AND status='1';
You could likely write a quick script to compare the list returned by that SQL statement to your modules list.
Thanks, Cameron
On Sun, Jan 9, 2011 at 12:04, James Benstead <james.benstead@gmail.com>wrote:
Originally posted to http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new
Drupal site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at http://state68.com/contact
On Sun, Jan 9, 2011 at 8:58 PM, James Benstead <james.benstead@gmail.com> wrote:
Although I agree with Carl that this is an administrative rather than a technical issue, I think that the module I have in mind would still be useful for site auditing purposes: for example, when taking over a site that has been put together by another Drupal shop. Assuming that such a module would be desirable, the question remains: would it be technically possible to build such a module?
It is probably technically possible to write monitoring which gets to **a close guess**. Whether a module is used or not can only be determined in runtime environments. You can monitor the use of modules (eg. inclusion of their files, last access time of their include files, use of the module's strings for translation, etc.). However, assume a module's job is to launch a missile in case of nuclear attack. That module will not be used / useful until a nuclear attack happens, but then its value would be essential. So you can monitor its use but whether in the given time sample the module should have done something or not depends on its role. (Replace missile example with sending mail notifications only under certain rare circumstances, automated blocking of spammers on the site, things that kick in when on high load, things that kick in when running site updates but not on the runtime site, etc). Gábor
Thanks Gábor, that answers my question - looks like it might be an interesting and potentially useful project; I'll post back if and when I get some time to work on it. --Jim -- My IM and Skype details are at http://state68.com/contact On 9 January 2011 20:18, Gábor Hojtsy <gabor@hojtsy.hu> wrote:
On Sun, Jan 9, 2011 at 8:58 PM, James Benstead <james.benstead@gmail.com> wrote:
Although I agree with Carl that this is an administrative rather than a technical issue, I think that the module I have in mind would still be useful for site auditing purposes: for example, when taking over a site that has been put together by another Drupal shop. Assuming that such a module would be desirable, the question remains: would it be technically possible to build such a module?
It is probably technically possible to write monitoring which gets to **a close guess**. Whether a module is used or not can only be determined in runtime environments. You can monitor the use of modules (eg. inclusion of their files, last access time of their include files, use of the module's strings for translation, etc.).
However, assume a module's job is to launch a missile in case of nuclear attack. That module will not be used / useful until a nuclear attack happens, but then its value would be essential. So you can monitor its use but whether in the given time sample the module should have done something or not depends on its role. (Replace missile example with sending mail notifications only under certain rare circumstances, automated blocking of spammers on the site, things that kick in when on high load, things that kick in when running site updates but not on the runtime site, etc).
Gábor
If you have devel, you could probably scan the query log for a close guess. As for the "launch a missle" scenario, consider simple things like Throttle, which will disable certain things - possibly even your monitoring. Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. ________________________________ From: James Benstead <james.benstead@gmail.com> To: development@drupal.org Sent: Sun, January 9, 2011 3:36:27 PM Subject: Re: [development] An automated way of locating unused modules? Thanks Gábor, that answers my question - looks like it might be an interesting and potentially useful project; I'll post back if and when I get some time to work on it. --Jim -- My IM and Skype details are at http://state68.com/contact On 9 January 2011 20:18, Gábor Hojtsy <gabor@hojtsy.hu> wrote: On Sun, Jan 9, 2011 at 8:58 PM, James Benstead <james.benstead@gmail.com> wrote:
Although I agree with Carl that this is an administrative rather than a technical issue, I think that the module I have in mind would still be useful for site auditing purposes: for example, when taking over a site that has been put together by another Drupal shop. Assuming that such a module would be desirable, the question remains: would it be technically possible to build such a module?
It is probably technically possible to write monitoring which gets to **a close guess**. Whether a module is used or not can only be determined in runtime environments. You can monitor the use of modules (eg. inclusion of their files, last access time of their include files, use of the module's strings for translation, etc.).
However, assume a module's job is to launch a missile in case of nuclear attack. That module will not be used / useful until a nuclear attack happens, but then its value would be essential. So you can monitor its use but whether in the given time sample the module should have done something or not depends on its role. (Replace missile example with sending mail notifications only under certain rare circumstances, automated blocking of spammers on the site, things that kick in when on high load, things that kick in when running site updates but not on the runtime site, etc).
Gábor
Thanks, Nancy - as long as the performance impact for end users is as close to zero as possible then I'm not too bothered about the performance impact for admins when they go to the modules admin page; this is an edge case, in my opinion. Also thanks for the reminder about the Devel query log; I'll look at building that into the module if and when I get a chance to write it. --Jim -- My IM and Skype details are at http://state68.com/contact On 9 January 2011 23:49, nan wich <nan_wich@bellsouth.net> wrote:
If you have devel, you could probably scan the query log for a close guess. As for the "launch a missle" scenario, consider simple things like Throttle, which will disable certain things - possibly even your monitoring.
*Nancy*
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
------------------------------ *From:* James Benstead <james.benstead@gmail.com> *To:* development@drupal.org *Sent:* Sun, January 9, 2011 3:36:27 PM *Subject:* Re: [development] An automated way of locating unused modules?
Thanks Gábor, that answers my question - looks like it might be an interesting and potentially useful project; I'll post back if and when I get some time to work on it.
--Jim -- My IM and Skype details are at http://state68.com/contact
On 9 January 2011 20:18, Gábor Hojtsy <gabor@hojtsy.hu> wrote:
On Sun, Jan 9, 2011 at 8:58 PM, James Benstead <james.benstead@gmail.com> wrote:
Although I agree with Carl that this is an administrative rather than a technical issue, I think that the module I have in mind would still be useful for site auditing purposes: for example, when taking over a site that has been put together by another Drupal shop. Assuming that such a module would be desirable, the question remains: would it be technically possible to build such a module?
It is probably technically possible to write monitoring which gets to **a close guess**. Whether a module is used or not can only be determined in runtime environments. You can monitor the use of modules (eg. inclusion of their files, last access time of their include files, use of the module's strings for translation, etc.).
However, assume a module's job is to launch a missile in case of nuclear attack. That module will not be used / useful until a nuclear attack happens, but then its value would be essential. So you can monitor its use but whether in the given time sample the module should have done something or not depends on its role. (Replace missile example with sending mail notifications only under certain rare circumstances, automated blocking of spammers on the site, things that kick in when on high load, things that kick in when running site updates but not on the runtime site, etc).
Gábor
On 01/09/2011 12:18 PM, Gábor Hojtsy wrote:
However, assume a module's job is to launch a missile in case of nuclear attack. That module will not be used / useful until a nuclear attack happens, but then its value would be essential. Although we are hoping very much, Gábor, that you have not written such a module.
Rob Thorne Torenware Networks http://www.torenware.com
OOPS for disabled modules should be: SELECT name FROM system WHERE type='module' AND status='0' AND filename NOT LIKE 'module/%'; Jamie Holly http://www.intoxination.net http://www.hollyit.net On 1/9/2011 2:55 PM, Jamie Holly wrote:
I would add one little thing to that query:
SELECT name FROM system WHERE type='module' AND status='1' AND filename NOT LIKE 'module/%';
That way you don't get Drupal's core modules in the list.
Jamie Holly http://www.intoxination.net http://www.hollyit.net
On 1/9/2011 2:26 PM, Cameron Eagans wrote:
I don't think you'd even need a module to do this. You can get a list of currently used modules by doing:
SELECT name FROM system WHERE type='module' AND status='1';
You could likely write a quick script to compare the list returned by that SQL statement to your modules list.
Thanks, Cameron
On Sun, Jan 9, 2011 at 12:04, James Benstead <james.benstead@gmail.com <mailto:james.benstead@gmail.com>> wrote:
Originally posted to http://drupal.org/node/1017416:
I have a list of 60+ modules that I download, via drush, to each new Drupal site that I build. I then enable whatever modules are needed for the specific site I'm working on as I carry out the build.
This means that once the site is launched, there may be modules that are not being called by Drupal core but that are still enabled and/or installed.
Is there an automated way - a specific module, for example - that will tell me which of the modules that are enabled on a site are being called by Drupal core?
Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
The answer to the second question seems to be "no". And It doesn't seem that such a module does exist - would it be technically possible to write this module for D6?
--Jim -- My IM and Skype details are at http://state68.com/contact
There clearly IS a performance impact if you go to the modules admin page. Plus, the system table is larger, so there is (minimal) impact there. Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr. ________________________________ From: James Benstead Secondly, is there any performance implication for having lots of modules installed on a site if they are not enabled?
participants (10)
-
Cameron Eagans -
Carl Wiedemann -
Franz Glauber -
Giovani Spagnolo -
Gábor Hojtsy -
James Benstead -
Jamie Holly -
nan wich -
Rob Thorne -
Steve Power