Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Projects
Groups
Snippets
Sign up now
Login
Sign in
Toggle navigation
Menu
Open sidebar
project
provision
Commits
59e436c4
Commit
59e436c4
authored
Sep 06, 2014
by
Grazyna Jaworska
Browse files
Remove redundant file_exists() if is_readable() is also used.
parent
c1967c5a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Provision/Config.php
View file @
59e436c4
...
...
@@ -126,7 +126,7 @@ class Provision_Config {
drush_command_invoke_all_ref
(
'provision_config_load_templates_alter'
,
$templates
,
$this
);
if
(
!
empty
(
$templates
)
&&
is_array
(
$templates
))
{
foreach
(
$templates
as
$file
)
{
if
(
file_exists
(
$file
)
&&
is_readable
(
$file
))
{
if
(
is_readable
(
$file
))
{
drush_log
(
"Template loaded A:
$file
"
);
return
file_get_contents
(
$file
);
}
...
...
@@ -144,7 +144,7 @@ class Provision_Config {
$file
=
$base_dir
.
'/'
.
$this
->
template
;
if
(
file_exists
(
$file
)
&&
is_readable
(
$file
))
{
if
(
is_readable
(
$file
))
{
drush_log
(
"Template loaded B:
$file
"
);
return
file_get_contents
(
$file
);
}
...
...
Provision/Config/Data/Store.php
View file @
59e436c4
...
...
@@ -105,7 +105,7 @@ class Provision_Config_Data_Store extends Provision_Config {
if
(
!
$this
->
locked
)
{
// Once we have the lock we dont need to worry about it changing
// from under us.
if
(
file_exists
(
$this
->
filename
())
&&
is_readable
(
$this
->
filename
()))
{
if
(
is_readable
(
$this
->
filename
()))
{
include
(
$this
->
filename
());
$data_key
=
$this
->
key
;
if
(
isset
(
${$data_key}
)
&&
is_array
(
${$data_key}
))
{
...
...
Provision/FileSystem.php
View file @
59e436c4
...
...
@@ -288,7 +288,7 @@ class Provision_FileSystem extends Provision_ChainedState {
$this
->
tokens
=
array
(
'@path'
=>
$path
,
'@target'
=>
$target
);
if
(
file_exists
(
$path
)
&&
is_readable
(
$path
))
{
if
(
is_readable
(
$path
))
{
if
(
is_writeable
(
dirname
(
$target
))
&&
!
file_exists
(
$target
)
&&
!
is_dir
(
$target
))
{
$this
->
mkdir
(
$target
);
$oldcwd
=
getcwd
();
...
...
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