사이트에서 사용 된 모든 활성 모듈 목록


21

사이트에서 사용 된 모든 (활성) 모듈 목록을 갖는 방법이 있습니까?

사이트를 문서화하는 중이며 모든 활성 모듈을 나열하고 싶습니다. 모듈을 가져올 수는 admin/modules있지만 다른 방법이 있어야합니다.

답변:


33

drush pm-list --type=Module --status=enabled설치된 모든 모듈 목록을 얻기 위해 명령을 사용할 수 있습니다 .

핵심 모듈을 제외하려면 drush pm-list --type=Module --no-core --status=enabled


했나요으로 관련 게시물에 당신과 함께 멀티 사이트 환경에 모두 나열 할 수 있습니다 @sites을 수행하여 drush @sites pml --no-core --type=module --status="enabled" -y`그렙를 사용하여 말의 some_module과 필터 | grep some_module`
MediaVince

21

내가 사용하는 두 가지 옵션은 Drush와 사용자 지정 스크립트입니다.

Drush의 경우 다음을 사용할 수 있습니다 drush pm-list.

$ drush help pm-list
Show a list of available extensions (modules and themes).

Options:
 --type                                    Filter by extension type. Choices:
                                           module, theme.
 --status                                  Filter by extension status. Choices:
                                           enabled, disable and/or 'not
                                           installed'. You can use multiple
                                           comma separated values. (i.e.
                                           --status="disabled,not installed").
 --package                                 Filter by project packages. You can
                                           use multiple comma separated values.
                                           (i.e. --package="Core -
                                           required,Other").
 --core                                    Filter out extensions that are not
                                           in drupal core.
 --no-core                                 Filter out extensions that are
                                           provided by drupal core.
 --pipe                                    Returns a space delimited list of
                                           the names of the resulting
                                           extensions.


Aliases: pml

Drupal 6 용이 스크립트를 작성했습니다. Drupal 7의 부트 스트랩을 편집해야하며 경로 확인을 조정할 수도 있습니다. 나는 이것을 DOCROOT에 modules.php라는 파일에 넣고 주변에서 액세스 제한을 추가하여 야생에서 호출되는 것을 방지합니다.

<?php
include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
header('Content-Type: text/plain');

$files = drupal_system_listing('/\.module$/', 'modules', 'name', 0);

system_get_files_database($files, 'module');

ksort($files);

$core_installed = array();
$core_enabled = array();
$core_disabled = array();

$contrib_installed = array();
$contrib_enabled = array();
$contrib_disabled = array();

foreach ($files as $info) {
  $filename = $info->filename;
  $name = $info->name;
  $status = $info->status;

  $contrib = strpos($filename, "sites/all/modules/") === 0;

  if ($contrib) {
    $contrib_installed[] = $name;
    if ($status) $contrib_enabled[] = $name;
    else $contrib_disabled[] = $name;
  } else {
    $core_installed[] = $name;
    if ($status) $core_enabled[] = $name;
    else $core_disabled[] = $name;
  }
}

print "Installed Core Modules: " . join(", ", $core_installed) . "\n\n";
print "Enabled Core Modules: " . join(", ", $core_enabled) . "\n\n";
print "Disabled Core Modules: " . join(", ", $core_disabled) . "\n\n";

print "Installed Contrib Modules: " . join(", ", $contrib_installed) . "\n\n";
print "Enabled Contrib Modules: " . join(", ", $contrib_enabled) . "\n\n";
print "Disabled Contrib Modules: " . join(", ", $contrib_disabled) . "\n\n";

이 스크립트는 다음을 사용하여 drush로 호출 할 수 있습니다. drush scr modules.php



4

예, 모듈 필터 모듈을 확인하십시오 . 모듈을 훨씬 쉽게 관리 할 수있는 뛰어난 관리자 도우미입니다.

모듈 목록 페이지는 상당히 큰 사이트를 다루거나 심지어 고려되는 새롭고 다양한 모듈을 테스트하기위한 개발 사이트를 다룰 때 상당히 커질 수 있습니다. 이 모듈의 목표는 브라우저 검색 기능에 의존하지 않고 원하는 모듈을 신속하게 찾을 수있는 기능입니다. 메뉴 항목과 같은 다양한 모듈 또는 페이지의 다른 위치.

모듈 필터의 설정 페이지를 통해 탭을 활성화하면 새로운 모듈 레이아웃 테마가 구현됩니다. 이 탭 레이아웃은 각 패키지에 대한 탭과 모든 모듈을 알파벳순으로 표시하는 탭을 제공합니다. 필터 텍스트 필드는 각 탭에서 사용할 수 있지만 현재 자동 완성을 지원하지 않습니다.


2

Drush make에는 기본 makefile 생성 기능이 있습니다. 이를 사용하려면 파일을 생성하려는 Drupal 설치로 디렉토리를 변경하고 다음 명령을 실행하십시오.

drush generate-makefile /path/to/make-file.make

모듈 목록과 함께 make-file.make를 얻습니다. 그런 다음이 모듈을 다른 프로젝트에로드 할 수 있습니다. http://www.drush.org/en/master/make/#usage를 읽으십시오


2

drush를 실행할 수있는 명령 줄 액세스 권한이 없으면 웹 UI에서 수행 할 수있는 작업을 찾고있을 수 있습니다. 내가 찾을 수있는 가장 좋은 해결책은 모듈 페이지를 찾은 다음 콘솔 에서이 명령을 실행하는 것입니다.

jQuery('table.sticky-enabled input[checked=checked]')
  .closest('tr')
  .find('td label strong')
  .each(function() {
    console.log(jQuery(this).text());
})

그러면 콘솔에서 활성화 된 모든 모듈이 인쇄되어 원하는 위치에 붙여 넣을 수 있습니다.


2

내가 찾은 가장 간단한 방법은 사용자 지정 모듈이나 Drush 스크립트에 넣어 원하는 형식으로 출력 할 수있는 데이터베이스 쿼리입니다.

$enabled_modules = db_query("SELECT name FROM {system} WHERE type = 'module' AND status = 1"); print implode("\n", $enabled_modules);


2

Forena 모듈을 설치하고 활성화합니다 (공개 유지 업체 인 공개). "administrator"역할이있는 사용자는에 위치한 전달 된 (샘플) 보고서를 탐색 할 수 있으며이 reports/drupaladmin.enabled_contributions질문에 대한 목록이 표시됩니다.

.FRX보고서를 작성하기위한 스펙 ( 파일, XHTML 문서)은 다음과 같습니다.

<?xml version="1.0"?>
<!DOCTYPE root [
<!ENTITY nbsp "&#160;">
]>
<html xmlns:frx="urn:FrxReports">
<head>
<title>Enabled Modules and Themes</title>
<frx:category>Drupal Administration</frx:category>
<frx:options hidden="0" />
<frx:parameters>
</frx:parameters>
<frx:docgen>
</frx:docgen>

</head>
<body>
  <div frx:block="drupal/enabled_modules" id="forena-1">
    <table>
      <thead>
        <tr>
          <th>name</th>
          <th>owner</th>
          <th>weight</th>
        </tr>
      </thead>
      <tbody>
        <tr frx:foreach="*" id="forena-2">
          <td>{name}</td>
          <td>{owner}</td>
          <td>{weight}</td>
        </tr>
      </tbody>
    </table>
  </div>
</body>
</html>

보고서에서 참조 된 데이터 블록 (SQL 문)은 다음과 같습니다.

--ACCESS=access administration pages
SELECT name, owner, weight FROM {system}
WHERE status=1 AND 'module'=type
ORDER BY name

정말 "그것"입니다.

추신 : .FRX자신의 필요에 맞게 파일 및 / 또는 데이터 블록을 자유롭게 조정 (적응)하십시오 .


AND 'module'=type?! 이어야한다AND type = 'module'
ajmedway

@ajmedway 당신이 아마 맞을 것입니다, 왜 "편집을 제안"하지 않습니까? 나는 그것을 기꺼이 승인 할 것입니다 ...
Pierre.Vriens

그것은 내가 생각하는 큰 문제가 아닙니다-조항이 작동합니다. 표현식의 오른쪽에 열 이름이 왼쪽에있는 값을 갖는 것은 일반적이지 않습니다.
ajmedway

0

drush가없는 경우 : 모듈 필터가 활성화 된 상태에서 모듈 페이지로 이동하십시오 (필수는 아니지만 포맷에 적합 함).

그런 다음 소스 페이지를 표시하고 "<"table> "내부의 html 모듈을"< "/ table>에 복사합니다. gedit에 붙여넣고 html (본문, 본문)을 html로 감싸면 사이트를 재 구축 할 때 중요 할 수있는 사용하지 않거나 사용하지 않는 모듈 (확인란이 선택되지 않은 상태로 표시됨)


0

버그 모듈을 발견 한 추가 뷰 시스템 모듈이 없으면 뷰가 트릭을 수행 할 수 있지만 스키마 모듈은 하나의 옵션이지만 버전 번호를 얻지 못합니다.


OP에는 스키마 버전이 아니라 활성화 된 모듈 목록이 필요합니다.
kiamlaluno
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.