Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
unused_modules
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
unused_modules
Commits
cd0d4fd6
Commit
cd0d4fd6
authored
10 years ago
by
Niels de Feyter
Browse files
Options
Downloads
Patches
Plain Diff
Improved PHP Doc comments.
parent
7e670726
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unused_modules.module
+21
-9
21 additions, 9 deletions
unused_modules.module
with
21 additions
and
9 deletions
unused_modules.module
+
21
−
9
View file @
cd0d4fd6
...
...
@@ -69,7 +69,13 @@ function unused_modules_menu() {
/**
* Page callback.
*
* Returns a table with projects with their (submodule) status.
* Returns a table with orphaned projects.
*
* @param string $op
* Either 'all' or 'disabled'.
*
* @return string
* themed table.
*/
function
unused_modules_show_projects
(
$op
=
'all'
)
{
$modules
=
_unused_modules_get_modules_by_project
();
...
...
@@ -110,9 +116,15 @@ function unused_modules_show_projects($op = 'all') {
/**
* Page callback.
*
* Returns a table with modules with their (submodule & project) status.
* Returns a table with orphaned modules.
*
* @param string $op
* Either 'all' or 'disabled'.
*
* @return string
* themed table.
*/
function
unused_modules_show_modules
(
$op
)
{
function
unused_modules_show_modules
(
$op
=
'all'
)
{
$modules
=
_unused_modules_get_modules_by_project
();
$header
=
array
(
...
...
@@ -157,7 +169,7 @@ function unused_modules_show_modules($op) {
/**
* Returns an array with all available modules.
*
*
o
bject module
*
O
bject module
* ->uri
* ->filename
* ->name
...
...
@@ -301,7 +313,7 @@ function _unused_modules_add_project_path(&$modules) {
// Get length of each module path in a project.
$lengths
=
array_map
(
'strlen'
,
$project_paths
);
// Sort by value (lowest number first)
// Sort by value (lowest number first)
.
asort
(
$lengths
);
// Get lowest key.
reset
(
$lengths
);
...
...
@@ -359,8 +371,8 @@ function _unused_modules_add_info_file_information(&$modules) {
$module
->
info_file
=
substr_replace
(
$module
->
uri
,
".info"
,
-
7
);
if
(
!
file_exists
(
$module
->
info_file
))
{
$error
M
essage
=
"No .info file found for module '"
.
$module
->
name
.
"'"
;
throw
new
Exception
(
$error
M
essage
);
$error
_m
essage
=
"No .info file found for module '"
.
$module
->
name
.
"'"
;
throw
new
Exception
(
$error
_m
essage
);
}
$info_file
=
explode
(
PHP_EOL
,
file_get_contents
(
$module
->
info_file
));
...
...
@@ -378,8 +390,8 @@ function _unused_modules_add_info_file_information(&$modules) {
// Throw error if no project information is found.
// This should only be the case for sandbox modules.
if
(
!
isset
(
$module
->
project
))
{
$error
M
essage
=
"No project information found for module '"
.
$module
->
name
.
"'"
;
throw
new
Exception
(
$error
M
essage
);
$error
_m
essage
=
"No project information found for module '"
.
$module
->
name
.
"'"
;
throw
new
Exception
(
$error
_m
essage
);
}
}
catch
(
Exception
$e
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment