You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
die('Failed to detect the local Easy!Appointments version, please move the patch.php script in the root directory of your Easy!Appointments installation.');
33
+
if (!file_exists($config_file_path)) {
34
+
die(
35
+
'Failed to detect the local Easy!Appointments version, please move the patch.php script in the root directory of your Easy!Appointments installation.'
36
+
);
36
37
}
37
38
38
39
$contents = file_get_contents($config_file_path);
39
40
40
-
if ($contents === FALSE)
41
-
{
42
-
die('Could not read the local configuration file, please check the file permissions make sure it is readable: ' . $config_file_path);
41
+
if ($contents === false) {
42
+
die(
43
+
'Could not read the local configuration file, please check the file permissions make sure it is readable: ' .
die('Could not read the remote "files.json", make sure the "allow_url_fopen" configuration is "On" inside your "php.ini" file:' . php_ini_loaded_file());
76
+
if ($files_json_contents === false) {
77
+
die(
78
+
'Could not read the remote "files.json", make sure the "allow_url_fopen" configuration is "On" inside your "php.ini" file:' .
die('Could not read the remote "' . basename($pending_patch['url']) . '", make sure the "allow_url_fopen" configuration is "On" inside your "php.ini" file.');
119
+
if ($patch_contents === false) {
120
+
die(
121
+
'Could not read the remote "' .
122
+
basename($pending_patch['url']) .
123
+
'", make sure the "allow_url_fopen" configuration is "On" inside your "php.ini" file.'
124
+
);
120
125
}
121
126
122
-
if (empty($patch_contents))
123
-
{
127
+
if (empty($patch_contents)) {
124
128
die('No contents received while fetching: ' . $pending_patch['url']);
125
129
}
126
130
@@ -132,14 +136,12 @@ function apply_pending_patches($local_version, $pending_patches)
132
136
133
137
$patch_body_lines = explode("\n", $patch_body);
134
138
135
-
array_shift($patch_body_lines); // Remove the first @@ line of the patch body.
139
+
array_shift($patch_body_lines); // Remove the first @@ line of the patch body.
136
140
137
141
$original_code_lines = [];
138
142
139
-
foreach ($patch_body_linesas$patch_line)
140
-
{
141
-
if ( ! empty($patch_line[0]) && $patch_line[0] !== '+')
142
-
{
143
+
foreach ($patch_body_linesas$patch_line) {
144
+
if (!empty($patch_line[0]) && $patch_line[0] !== '+') {
143
145
$original_code_lines[] = substr($patch_line, 1);
144
146
}
145
147
}
@@ -148,10 +150,8 @@ function apply_pending_patches($local_version, $pending_patches)
148
150
149
151
$modified_code_lines = [];
150
152
151
-
foreach ($patch_body_linesas$patch_line)
152
-
{
153
-
if ( ! empty($patch_line[0]) && $patch_line[0] !== '-')
154
-
{
153
+
foreach ($patch_body_linesas$patch_line) {
154
+
if (!empty($patch_line[0]) && $patch_line[0] !== '-') {
155
155
$modified_code_lines[] = substr($patch_line, 1);
156
156
}
157
157
}
@@ -160,9 +160,11 @@ function apply_pending_patches($local_version, $pending_patches)
$message = 'IMPORTANT: The patch "' . basename($pending_patch['url']) . '" cannot be applied, because your local codebase is customized. Download and apply it manually: ' . $pending_patch['url'];
214
+
$message =
215
+
'IMPORTANT: The patch "' .
216
+
basename($pending_patch['url']) .
217
+
'" cannot be applied, because your local codebase is customized. Download and apply it manually: ' .
0 commit comments