Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates
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
automatic_updates
Merge requests
!78
Issue
#3243422
: Add a kernel test of WritableFileSystemValidator
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3243422
: Add a kernel test of WritableFileSystemValidator
issue/automatic_updates-3243422:3243422-use-vfs
into
8.x-2.x
Overview
1
Commits
7
Pipelines
0
Changes
3
1 unresolved thread
Hide all comments
Merged
Ted Bowman
requested to merge
issue/automatic_updates-3243422:3243422-use-vfs
into
8.x-2.x
3 years ago
Overview
1
Commits
7
Pipelines
0
Changes
3
1 unresolved thread
Hide all comments
Expand
0
0
Merge request reports
Compare
8.x-2.x
version 5
dde0fe37
3 years ago
version 4
1e1cd3f0
3 years ago
version 3
f2e669ec
3 years ago
version 2
e5a80d67
3 years ago
version 1
7615861b
3 years ago
8.x-2.x (base)
and
version 3
latest version
dde0fe37
7 commits,
3 years ago
version 5
dde0fe37
7 commits,
3 years ago
version 4
1e1cd3f0
6 commits,
3 years ago
version 3
f2e669ec
5 commits,
3 years ago
version 2
e5a80d67
4 commits,
3 years ago
version 1
7615861b
2 commits,
3 years ago
3 files
+
145
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
src/Validator/WritableFileSystemValidator.php
+
18
−
5
Options
@@ -48,27 +48,40 @@ class WritableFileSystemValidator implements EventSubscriberInterface {
}
/**
*
Checks that the file system is
writable.
*
Wrapper around is_
writable
()
.
*
* @param \Drupal\automatic_updates\Event\UpdateEvent $event
* The event object.
* @param string $path
* The path to check.
*
* @return bool
* TRUE if the given path is writable, otherwise FALSE.
*
* @todo It might make sense to use a more sophisticated method of testing
* writability than is_writable(), since it's not clear if that can return
* false negatives/positives due to things like SELinux, exotic file
* systems, and so forth.
*/
protected
function
isWritable
(
string
$path
):
bool
{
return
is_writable
(
$path
);
}
/**
* Checks that the file system is writable.
*
* @param \Drupal\automatic_updates\Event\UpdateEvent $event
* The event object.
*/
public
function
checkPermissions
(
UpdateEvent
$event
):
void
{
$messages
=
[];
if
(
!
is_w
ritable
(
$this
->
appRoot
))
{
if
(
!
$this
->
isW
ritable
(
$this
->
appRoot
))
{
$messages
[]
=
$this
->
t
(
'The Drupal directory "@dir" is not writable.'
,
[
'@dir'
=>
$this
->
appRoot
,
]);
}
$dir
=
$this
->
pathLocator
->
getVendorDirectory
();
if
(
!
is_w
ritable
(
$dir
))
{
if
(
!
$this
->
isW
ritable
(
$dir
))
{
$messages
[]
=
$this
->
t
(
'The vendor directory "@dir" is not writable.'
,
[
'@dir'
=>
$dir
]);
}
Loading