Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
091d0927
Commit
091d0927
authored
Aug 26, 2014
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2325689
by sun: Clean up temporary Extension class workarounds.
parent
7e7c7154
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Core/Extension/Extension.php
+10
-53
10 additions, 53 deletions
core/lib/Drupal/Core/Extension/Extension.php
with
10 additions
and
53 deletions
core/lib/Drupal/Core/Extension/Extension.php
+
10
−
53
View file @
091d0927
...
...
@@ -15,11 +15,9 @@ class Extension implements \Serializable {
/**
* The type of the extension (e.g., 'module').
*
* @todo Change to protected once external test dependencies are resolved.
*
* @var string
*/
p
ublic
$type
;
p
rotected
$type
;
/**
* The relative pathname of the extension (e.g., 'core/modules/node/node.info.yml').
...
...
@@ -28,42 +26,12 @@ class Extension implements \Serializable {
*/
protected
$pathname
;
/**
* The internal name of the extension (e.g., 'node').
*
* @todo Remove this property once external test dependencies are resolved.
*
* @var string
*/
public
$name
;
/**
* The relative pathname of the main extension file (e.g., 'core/modules/node/node.module').
*
* @todo Remove this property and do not require .module/.profile files.
* @see https://drupal.org/node/340723
*
* @var string
*/
public
$uri
;
/**
* Same as $uri.
*
* @todo Remove this property once external test dependencies are resolved.
*
* @var string
*/
public
$filename
;
/**
* The filename of the main extension file (e.g., 'node.module').
*
* @todo Rename to $filename once external test dependencies are resolved.
*
* @var string|null
*/
protected
$
_
filename
;
protected
$filename
;
/**
* An SplFileInfo instance for the extension's info file.
...
...
@@ -88,11 +56,7 @@ class Extension implements \Serializable {
public
function
__construct
(
$type
,
$pathname
,
$filename
=
NULL
)
{
$this
->
type
=
$type
;
$this
->
pathname
=
$pathname
;
$this
->
_filename
=
$filename
;
// Set legacy public properties.
$this
->
name
=
$this
->
getName
();
$this
->
uri
=
$this
->
getPath
()
.
'/'
.
$filename
;
$this
->
filename
=
$this
->
uri
;
$this
->
filename
=
$filename
;
}
/**
...
...
@@ -146,8 +110,8 @@ public function getFilename() {
* @return string|null
*/
public
function
getExtensionPathname
()
{
if
(
$this
->
_
filename
)
{
return
$this
->
getPath
()
.
'/'
.
$this
->
_
filename
;
if
(
$this
->
filename
)
{
return
$this
->
getPath
()
.
'/'
.
$this
->
filename
;
}
}
...
...
@@ -157,7 +121,7 @@ public function getExtensionPathname() {
* @return string|null
*/
public
function
getExtensionFilename
()
{
return
$this
->
_
filename
;
return
$this
->
filename
;
}
/**
...
...
@@ -167,8 +131,8 @@ public function getExtensionFilename() {
* TRUE if this extension has a main extension file, FALSE otherwise.
*/
public
function
load
()
{
if
(
$this
->
_
filename
)
{
include_once
DRUPAL_ROOT
.
'/'
.
$this
->
getPath
()
.
'/'
.
$this
->
_
filename
;
if
(
$this
->
filename
)
{
include_once
DRUPAL_ROOT
.
'/'
.
$this
->
getPath
()
.
'/'
.
$this
->
filename
;
return
TRUE
;
}
return
FALSE
;
...
...
@@ -195,7 +159,7 @@ public function serialize() {
$data
=
array
(
'type'
=>
$this
->
type
,
'pathname'
=>
$this
->
pathname
,
'
_
filename'
=>
$this
->
_
filename
,
'filename'
=>
$this
->
filename
,
);
// @todo ThemeHandler::listInfo(), ThemeHandler::rebuildThemeData(), and
...
...
@@ -215,14 +179,7 @@ public function unserialize($data) {
$data
=
unserialize
(
$data
);
$this
->
type
=
$data
[
'type'
];
$this
->
pathname
=
$data
[
'pathname'
];
$this
->
_filename
=
$data
[
'_filename'
];
// Restore legacy public properties.
// @todo Remove these properties and do not require .module/.profile files.
// @see https://drupal.org/node/340723
$this
->
name
=
$this
->
getName
();
$this
->
uri
=
$this
->
getPath
()
.
'/'
.
$this
->
_filename
;
$this
->
filename
=
$this
->
uri
;
$this
->
filename
=
$data
[
'filename'
];
// @todo ThemeHandler::listInfo(), ThemeHandler::rebuildThemeData(), and
// system_list() are adding custom properties to the Extension object.
...
...
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