Commit 59e436c4 authored by omega8cc's avatar omega8cc

Remove redundant file_exists() if is_readable() is also used.

parent c1967c5a
......@@ -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);
}
......
......@@ -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})) {
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment