Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
01889f01
Commit
01889f01
authored
Aug 06, 2015
by
David Mudrák
Browse files
MDL-43896 admin: Drop support for the $module syntax in version.php
parent
e28004e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/classes/plugin_manager.php
View file @
01889f01
...
...
@@ -288,15 +288,24 @@ class core_plugin_manager {
foreach
(
$plugintypes
as
$type
=>
$typedir
)
{
$plugs
=
core_component
::
get_plugin_list
(
$type
);
foreach
(
$plugs
as
$plug
=>
$fullplug
)
{
$module
=
new
stdClass
();
$plugin
=
new
stdClass
();
$plugin
->
version
=
null
;
$module
=
$plugin
;
include
(
$fullplug
.
'/version.php'
);
// Check if the legacy $module syntax is still used.
if
(
!
is_object
(
$module
)
or
(
!
empty
((
array
)
$module
)))
{
debugging
(
'Unsupported $module syntax detected in version.php of the '
.
$type
.
'_'
.
$plug
.
' plugin.'
);
$skipcache
=
true
;
}
$this
->
presentplugins
[
$type
][
$plug
]
=
$plugin
;
}
}
$cache
->
set
(
'present'
,
$this
->
presentplugins
);
if
(
empty
(
$skipcache
))
{
$cache
->
set
(
'present'
,
$this
->
presentplugins
);
}
}
/**
...
...
lib/upgradelib.php
View file @
01889f01
...
...
@@ -600,12 +600,18 @@ function upgrade_plugins_modules($startcallback, $endcallback, $verbose) {
throw
new
plugin_defective_exception
(
$component
,
'Missing version.php'
);
}
// TODO: Support for $module will end with Moodle 2.10 by MDL-43896. Was deprecated for Moodle 2.7 by MDL-43040.
$module
=
new
stdClass
();
$plugin
=
new
stdClass
();
$plugin
->
version
=
null
;
$module
=
$plugin
;
require
(
$fullmod
.
'/version.php'
);
// Defines $plugin with version etc.
$plugin
=
clone
(
$module
);
// Check if the legacy $module syntax is still used.
if
(
!
is_object
(
$module
)
or
(
!
empty
((
array
)
$module
)))
{
throw
new
plugin_defective_exception
(
$component
,
'Unsupported $module syntax detected in version.php'
);
}
// Prepare the record for the {modules} table.
$module
=
clone
(
$plugin
);
unset
(
$module
->
version
);
unset
(
$module
->
component
);
unset
(
$module
->
dependencies
);
...
...
mod/upgrade.txt
View file @
01889f01
...
...
@@ -3,7 +3,11 @@ information provided here is intended especially for developers.
=== 3.0 ===
* Function scorm_view_display was renamed to scorm_print_launch to avoid confussion with new function scorm_view.
* Dropped support for the $module in mod/xxx/version.php files (deprecated
since 2.7). All activity modules must use the $plugin syntax now. See
https://docs.moodle.org/dev/version.php for details (MDL-43896).
* Function scorm_view_display was renamed to scorm_print_launch to avoid
confussion with new function scorm_view.
=== 2.9 ===
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment