@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -595,8 +595,6 @@ |
||
595 | 595 | * converts it into a "remote" filepath (the filepath the currently-in-use |
596 | 596 | * $wp_filesystem needs to use access the folder or file). |
597 | 597 | * See http://wordpress.stackexchange.com/questions/124900/using-wp-filesystem-in-plugins |
598 | - * @param WP_Filesystem_Base $wp_filesystem we aren't initially sure which one |
|
599 | - * is in use, so you need to provide it |
|
600 | 598 | * @param string $local_filepath the filepath to the folder/file locally |
601 | 599 | * @return string the remote filepath (eg the filepath the filesystem method, eg |
602 | 600 | * ftp or ssh, will use to access the folder |
@@ -27,30 +27,30 @@ discard block |
||
27 | 27 | * @throws EE_Error |
28 | 28 | * @return WP_Filesystem_Base |
29 | 29 | */ |
30 | - private static function _get_wp_filesystem( $filepath = null) { |
|
31 | - if( apply_filters( |
|
30 | + private static function _get_wp_filesystem($filepath = null) { |
|
31 | + if (apply_filters( |
|
32 | 32 | 'FHEE__EEH_File___get_wp_filesystem__allow_using_filesystem_direct', |
33 | - $filepath && EEH_File::is_in_uploads_folder( $filepath ), |
|
34 | - $filepath ) ) { |
|
35 | - if( ! EEH_File::$_wp_filesystem_direct instanceof WP_Filesystem_Direct ) { |
|
36 | - require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); |
|
33 | + $filepath && EEH_File::is_in_uploads_folder($filepath), |
|
34 | + $filepath )) { |
|
35 | + if ( ! EEH_File::$_wp_filesystem_direct instanceof WP_Filesystem_Direct) { |
|
36 | + require_once(ABSPATH.'wp-admin/includes/class-wp-filesystem-base.php'); |
|
37 | 37 | $method = 'direct'; |
38 | - $wp_filesystem_direct_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method ); |
|
38 | + $wp_filesystem_direct_file = apply_filters('filesystem_method_file', ABSPATH.'wp-admin/includes/class-wp-filesystem-'.$method.'.php', $method); |
|
39 | 39 | //check constants defined, just like in wp-admin/includes/file.php's WP_Filesystem() |
40 | - if ( ! defined('FS_CHMOD_DIR') ) { |
|
41 | - define('FS_CHMOD_DIR', ( fileperms( ABSPATH ) & 0777 | 0755 ) ); |
|
40 | + if ( ! defined('FS_CHMOD_DIR')) { |
|
41 | + define('FS_CHMOD_DIR', (fileperms(ABSPATH) & 0777 | 0755)); |
|
42 | 42 | } |
43 | - if ( ! defined('FS_CHMOD_FILE') ) { |
|
44 | - define('FS_CHMOD_FILE', ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ) ); |
|
43 | + if ( ! defined('FS_CHMOD_FILE')) { |
|
44 | + define('FS_CHMOD_FILE', (fileperms(ABSPATH.'index.php') & 0777 | 0644)); |
|
45 | 45 | } |
46 | - require_once( $wp_filesystem_direct_file ); |
|
47 | - EEH_File::$_wp_filesystem_direct = new WP_Filesystem_Direct( array() ); |
|
46 | + require_once($wp_filesystem_direct_file); |
|
47 | + EEH_File::$_wp_filesystem_direct = new WP_Filesystem_Direct(array()); |
|
48 | 48 | } |
49 | 49 | return EEH_File::$_wp_filesystem_direct; |
50 | 50 | } |
51 | 51 | global $wp_filesystem; |
52 | 52 | // no filesystem setup ??? |
53 | - if ( ! $wp_filesystem instanceof WP_Filesystem_Base ) { |
|
53 | + if ( ! $wp_filesystem instanceof WP_Filesystem_Base) { |
|
54 | 54 | // if some eager beaver's just trying to get in there too early... |
55 | 55 | // let them do it, because we are one of those eager beavers! :P |
56 | 56 | /** |
@@ -63,34 +63,34 @@ discard block |
||
63 | 63 | * and there may be troubles if the WP files are owned by a different user |
64 | 64 | * than the server user. But both of these issues should exist in 4.4 and earlier too |
65 | 65 | */ |
66 | - if ( FALSE && ! did_action( 'wp_loaded' )) { |
|
66 | + if (FALSE && ! did_action('wp_loaded')) { |
|
67 | 67 | $msg = __('An attempt to access and/or write to a file on the server could not be completed due to a lack of sufficient credentials.', 'event_espresso'); |
68 | - if ( WP_DEBUG ) { |
|
69 | - $msg .= '<br />' . __('The WP Filesystem can not be accessed until after the "wp_loaded" hook has run, so it\'s best not to attempt access until the "admin_init" hookpoint.', 'event_espresso'); |
|
68 | + if (WP_DEBUG) { |
|
69 | + $msg .= '<br />'.__('The WP Filesystem can not be accessed until after the "wp_loaded" hook has run, so it\'s best not to attempt access until the "admin_init" hookpoint.', 'event_espresso'); |
|
70 | 70 | } |
71 | - throw new EE_Error( $msg ); |
|
71 | + throw new EE_Error($msg); |
|
72 | 72 | } else { |
73 | 73 | // should be loaded if we are past the wp_loaded hook... |
74 | - if ( ! function_exists( 'WP_Filesystem' )) { |
|
75 | - require_once( ABSPATH . 'wp-admin/includes/file.php' ); |
|
76 | - require_once( ABSPATH . 'wp-admin/includes/template.php' ); |
|
74 | + if ( ! function_exists('WP_Filesystem')) { |
|
75 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
76 | + require_once(ABSPATH.'wp-admin/includes/template.php'); |
|
77 | 77 | } |
78 | 78 | // turn on output buffering so that we can capture the credentials form |
79 | 79 | ob_start(); |
80 | - $credentials = request_filesystem_credentials( '' ); |
|
80 | + $credentials = request_filesystem_credentials(''); |
|
81 | 81 | // store credentials form for the time being |
82 | 82 | EEH_File::$_credentials_form = ob_get_clean(); |
83 | 83 | // basically check for direct or previously configured access |
84 | - if ( ! WP_Filesystem( $credentials ) ) { |
|
84 | + if ( ! WP_Filesystem($credentials)) { |
|
85 | 85 | // if credentials do NOT exist |
86 | - if ( $credentials === FALSE ) { |
|
87 | - add_action( 'admin_notices', array( 'EEH_File', 'display_request_filesystem_credentials_form' ), 999 ); |
|
88 | - throw new EE_Error( __('An attempt to access and/or write to a file on the server could not be completed due to a lack of sufficient credentials.', 'event_espresso')); |
|
89 | - } elseif( is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->get_error_code() ) { |
|
90 | - add_action( 'admin_notices', array( 'EEH_File', 'display_request_filesystem_credentials_form' ), 999 ); |
|
86 | + if ($credentials === FALSE) { |
|
87 | + add_action('admin_notices', array('EEH_File', 'display_request_filesystem_credentials_form'), 999); |
|
88 | + throw new EE_Error(__('An attempt to access and/or write to a file on the server could not be completed due to a lack of sufficient credentials.', 'event_espresso')); |
|
89 | + } elseif (is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code()) { |
|
90 | + add_action('admin_notices', array('EEH_File', 'display_request_filesystem_credentials_form'), 999); |
|
91 | 91 | throw new EE_Error( |
92 | 92 | sprintf( |
93 | - __( 'WP Filesystem Error: $1%s', 'event_espresso' ), |
|
93 | + __('WP Filesystem Error: $1%s', 'event_espresso'), |
|
94 | 94 | $wp_filesystem->errors->get_error_message() ) ); |
95 | 95 | } |
96 | 96 | } |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | * display_request_filesystem_credentials_form |
104 | 104 | */ |
105 | 105 | public static function display_request_filesystem_credentials_form() { |
106 | - if ( ! empty( EEH_File::$_credentials_form )) { |
|
107 | - echo '<div class="updated espresso-notices-attention"><p>' . EEH_File::$_credentials_form . '</p></div>'; |
|
106 | + if ( ! empty(EEH_File::$_credentials_form)) { |
|
107 | + echo '<div class="updated espresso-notices-attention"><p>'.EEH_File::$_credentials_form.'</p></div>'; |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
@@ -122,29 +122,29 @@ discard block |
||
122 | 122 | * @throws EE_Error |
123 | 123 | * @return bool |
124 | 124 | */ |
125 | - public static function verify_filepath_and_permissions( $full_file_path = '', $file_name = '', $file_ext = '', $type_of_file = '' ) { |
|
125 | + public static function verify_filepath_and_permissions($full_file_path = '', $file_name = '', $file_ext = '', $type_of_file = '') { |
|
126 | 126 | // load WP_Filesystem and set file permissions |
127 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path ); |
|
128 | - $full_file_path = EEH_File::standardise_directory_separators( $full_file_path ); |
|
129 | - if ( ! $wp_filesystem->is_readable( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) )) { |
|
130 | - $file_name = ! empty( $type_of_file ) ? $file_name . ' ' . $type_of_file : $file_name; |
|
131 | - $file_name .= ! empty( $file_ext ) ? ' file' : ' folder'; |
|
127 | + $wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path); |
|
128 | + $full_file_path = EEH_File::standardise_directory_separators($full_file_path); |
|
129 | + if ( ! $wp_filesystem->is_readable(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path))) { |
|
130 | + $file_name = ! empty($type_of_file) ? $file_name.' '.$type_of_file : $file_name; |
|
131 | + $file_name .= ! empty($file_ext) ? ' file' : ' folder'; |
|
132 | 132 | $msg = sprintf( |
133 | - __( 'The requested %1$s could not be found or is not readable, possibly due to an incorrect filepath, or incorrect file permissions.%2$s', 'event_espresso' ), |
|
133 | + __('The requested %1$s could not be found or is not readable, possibly due to an incorrect filepath, or incorrect file permissions.%2$s', 'event_espresso'), |
|
134 | 134 | $file_name, |
135 | 135 | '<br />' |
136 | 136 | ); |
137 | - if ( EEH_File::exists( $full_file_path )) { |
|
138 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path, $type_of_file ); |
|
137 | + if (EEH_File::exists($full_file_path)) { |
|
138 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_file_path, $type_of_file); |
|
139 | 139 | } else { |
140 | 140 | // no file permissions means the file was not found |
141 | 141 | $msg .= sprintf( |
142 | - __( 'Please ensure the following path is correct: "%s".', 'event_espresso' ), |
|
142 | + __('Please ensure the following path is correct: "%s".', 'event_espresso'), |
|
143 | 143 | $full_file_path |
144 | 144 | ); |
145 | 145 | } |
146 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
147 | - throw new EE_Error( $msg . '||' . $msg ); |
|
146 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
147 | + throw new EE_Error($msg.'||'.$msg); |
|
148 | 148 | } |
149 | 149 | return FALSE; |
150 | 150 | } |
@@ -161,24 +161,24 @@ discard block |
||
161 | 161 | * @param string $type_of_file - general type of file (ie: "module"), this is only used to improve error messages |
162 | 162 | * @return string |
163 | 163 | */ |
164 | - private static function _permissions_error_for_unreadable_filepath( $full_file_path = '', $type_of_file = '' ){ |
|
164 | + private static function _permissions_error_for_unreadable_filepath($full_file_path = '', $type_of_file = '') { |
|
165 | 165 | // load WP_Filesystem and set file permissions |
166 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path ); |
|
166 | + $wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path); |
|
167 | 167 | // check file permissions |
168 | - $perms = $wp_filesystem->getchmod( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ); |
|
169 | - if ( $perms ) { |
|
168 | + $perms = $wp_filesystem->getchmod(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path)); |
|
169 | + if ($perms) { |
|
170 | 170 | // file permissions exist, but way be set incorrectly |
171 | - $type_of_file = ! empty( $type_of_file ) ? $type_of_file . ' ' : ''; |
|
172 | - $type_of_file .= ! empty( $type_of_file ) ? 'file' : 'folder'; |
|
171 | + $type_of_file = ! empty($type_of_file) ? $type_of_file.' ' : ''; |
|
172 | + $type_of_file .= ! empty($type_of_file) ? 'file' : 'folder'; |
|
173 | 173 | return sprintf( |
174 | - __( 'File permissions for the requested %1$s are currently set at "%2$s". The recommended permissions are 644 for files and 755 for folders.', 'event_espresso' ), |
|
174 | + __('File permissions for the requested %1$s are currently set at "%2$s". The recommended permissions are 644 for files and 755 for folders.', 'event_espresso'), |
|
175 | 175 | $type_of_file, |
176 | 176 | $perms |
177 | 177 | ); |
178 | 178 | } else { |
179 | 179 | // file exists but file permissions could not be read ?!?! |
180 | 180 | return sprintf( |
181 | - __( 'Please ensure that the server and/or PHP configuration allows the current process to access the following file: "%s".', 'event_espresso' ), |
|
181 | + __('Please ensure that the server and/or PHP configuration allows the current process to access the following file: "%s".', 'event_espresso'), |
|
182 | 182 | $full_file_path |
183 | 183 | ); |
184 | 184 | } |
@@ -196,35 +196,35 @@ discard block |
||
196 | 196 | * can't write to it |
197 | 197 | * @return bool false if folder isn't writable; true if it exists and is writeable, |
198 | 198 | */ |
199 | - public static function ensure_folder_exists_and_is_writable( $folder = '' ){ |
|
200 | - if ( empty( $folder )) { |
|
199 | + public static function ensure_folder_exists_and_is_writable($folder = '') { |
|
200 | + if (empty($folder)) { |
|
201 | 201 | return false; |
202 | 202 | } |
203 | 203 | // remove ending DS |
204 | - $folder = EEH_File::standardise_directory_separators( rtrim( $folder, '/\\' )); |
|
205 | - $parent_folder = EEH_File::get_parent_folder( $folder ); |
|
204 | + $folder = EEH_File::standardise_directory_separators(rtrim($folder, '/\\')); |
|
205 | + $parent_folder = EEH_File::get_parent_folder($folder); |
|
206 | 206 | // add DS to folder |
207 | - $folder = EEH_File::end_with_directory_separator( $folder ); |
|
208 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $folder ); |
|
209 | - if ( ! $wp_filesystem->is_dir( EEH_File::convert_local_filepath_to_remote_filepath( $folder ) ) ) { |
|
207 | + $folder = EEH_File::end_with_directory_separator($folder); |
|
208 | + $wp_filesystem = EEH_File::_get_wp_filesystem($folder); |
|
209 | + if ( ! $wp_filesystem->is_dir(EEH_File::convert_local_filepath_to_remote_filepath($folder))) { |
|
210 | 210 | //ok so it doesn't exist. Does its parent? Can we write to it? |
211 | - if( ! EEH_File::ensure_folder_exists_and_is_writable( $parent_folder ) ) { |
|
211 | + if ( ! EEH_File::ensure_folder_exists_and_is_writable($parent_folder)) { |
|
212 | 212 | return false; |
213 | 213 | } |
214 | - if ( ! EEH_File::verify_is_writable( $parent_folder, 'folder' )) { |
|
214 | + if ( ! EEH_File::verify_is_writable($parent_folder, 'folder')) { |
|
215 | 215 | return false; |
216 | 216 | } else { |
217 | - if ( ! $wp_filesystem->mkdir( EEH_File::convert_local_filepath_to_remote_filepath( $folder ) ) ) { |
|
218 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
219 | - $msg = sprintf( __( '"%s" could not be created.', 'event_espresso' ), $folder ); |
|
220 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $folder ); |
|
221 | - throw new EE_Error( $msg ); |
|
217 | + if ( ! $wp_filesystem->mkdir(EEH_File::convert_local_filepath_to_remote_filepath($folder))) { |
|
218 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
219 | + $msg = sprintf(__('"%s" could not be created.', 'event_espresso'), $folder); |
|
220 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($folder); |
|
221 | + throw new EE_Error($msg); |
|
222 | 222 | } |
223 | 223 | return false; |
224 | 224 | } |
225 | - EEH_File::add_htaccess_deny_from_all( $folder ); |
|
225 | + EEH_File::add_htaccess_deny_from_all($folder); |
|
226 | 226 | } |
227 | - } elseif ( ! EEH_File::verify_is_writable( $folder, 'folder' )) { |
|
227 | + } elseif ( ! EEH_File::verify_is_writable($folder, 'folder')) { |
|
228 | 228 | return false; |
229 | 229 | } |
230 | 230 | return true; |
@@ -239,15 +239,15 @@ discard block |
||
239 | 239 | * @throws EE_Error |
240 | 240 | * @return bool |
241 | 241 | */ |
242 | - public static function verify_is_writable( $full_path = '', $file_or_folder = 'folder' ){ |
|
242 | + public static function verify_is_writable($full_path = '', $file_or_folder = 'folder') { |
|
243 | 243 | // load WP_Filesystem and set file permissions |
244 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $full_path ); |
|
245 | - $full_path = EEH_File::standardise_directory_separators( $full_path ); |
|
246 | - if ( ! $wp_filesystem->is_writable( EEH_File::convert_local_filepath_to_remote_filepath( $full_path ) ) ) { |
|
247 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
248 | - $msg = sprintf( __( 'The "%1$s" %2$s is not writable.', 'event_espresso' ), $full_path, $file_or_folder ); |
|
249 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_path ); |
|
250 | - throw new EE_Error( $msg ); |
|
244 | + $wp_filesystem = EEH_File::_get_wp_filesystem($full_path); |
|
245 | + $full_path = EEH_File::standardise_directory_separators($full_path); |
|
246 | + if ( ! $wp_filesystem->is_writable(EEH_File::convert_local_filepath_to_remote_filepath($full_path))) { |
|
247 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
248 | + $msg = sprintf(__('The "%1$s" %2$s is not writable.', 'event_espresso'), $full_path, $file_or_folder); |
|
249 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_path); |
|
250 | + throw new EE_Error($msg); |
|
251 | 251 | } |
252 | 252 | return FALSE; |
253 | 253 | } |
@@ -264,25 +264,25 @@ discard block |
||
264 | 264 | * @throws EE_Error |
265 | 265 | * @return bool |
266 | 266 | */ |
267 | - public static function ensure_file_exists_and_is_writable( $full_file_path = '' ) { |
|
267 | + public static function ensure_file_exists_and_is_writable($full_file_path = '') { |
|
268 | 268 | // load WP_Filesystem and set file permissions |
269 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path ); |
|
270 | - $full_file_path = EEH_File::standardise_directory_separators( $full_file_path ); |
|
271 | - $parent_folder = EEH_File::get_parent_folder( $full_file_path ); |
|
272 | - if ( ! EEH_File::exists( $full_file_path )) { |
|
273 | - if( ! EEH_File::ensure_folder_exists_and_is_writable( $parent_folder ) ) { |
|
269 | + $wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path); |
|
270 | + $full_file_path = EEH_File::standardise_directory_separators($full_file_path); |
|
271 | + $parent_folder = EEH_File::get_parent_folder($full_file_path); |
|
272 | + if ( ! EEH_File::exists($full_file_path)) { |
|
273 | + if ( ! EEH_File::ensure_folder_exists_and_is_writable($parent_folder)) { |
|
274 | 274 | return false; |
275 | 275 | } |
276 | - if ( ! $wp_filesystem->touch( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ) ) { |
|
277 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
278 | - $msg = sprintf( __( 'The "%s" file could not be created.', 'event_espresso' ), $full_file_path ); |
|
279 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path ); |
|
280 | - throw new EE_Error( $msg ); |
|
276 | + if ( ! $wp_filesystem->touch(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path))) { |
|
277 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
278 | + $msg = sprintf(__('The "%s" file could not be created.', 'event_espresso'), $full_file_path); |
|
279 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_file_path); |
|
280 | + throw new EE_Error($msg); |
|
281 | 281 | } |
282 | 282 | return false; |
283 | 283 | } |
284 | 284 | } |
285 | - if ( ! EEH_File::verify_is_writable( $full_file_path, 'file' )) { |
|
285 | + if ( ! EEH_File::verify_is_writable($full_file_path, 'file')) { |
|
286 | 286 | return false; |
287 | 287 | } |
288 | 288 | return true; |
@@ -294,15 +294,15 @@ discard block |
||
294 | 294 | * @param string $file_or_folder_path |
295 | 295 | * @return string parent folder, ENDING with a directory separator |
296 | 296 | */ |
297 | - public static function get_parent_folder( $file_or_folder_path ) { |
|
297 | + public static function get_parent_folder($file_or_folder_path) { |
|
298 | 298 | //find the last DS, ignoring a DS on the very end |
299 | 299 | //eg if given "/var/something/somewhere/", we want to get "somewhere"'s |
300 | 300 | //parent folder, "/var/something/" |
301 | - $ds = strrpos( $file_or_folder_path, DS, -2 ); |
|
302 | - return substr( $file_or_folder_path, 0, $ds + 1 ); |
|
301 | + $ds = strrpos($file_or_folder_path, DS, -2); |
|
302 | + return substr($file_or_folder_path, 0, $ds + 1); |
|
303 | 303 | } |
304 | 304 | |
305 | - public static function ensure_folder_exists_recursively( $folder ) { |
|
305 | + public static function ensure_folder_exists_recursively($folder) { |
|
306 | 306 | |
307 | 307 | } |
308 | 308 | |
@@ -313,12 +313,12 @@ discard block |
||
313 | 313 | * @param string $full_file_path |
314 | 314 | * @return string |
315 | 315 | */ |
316 | - public static function get_file_contents( $full_file_path = '' ){ |
|
317 | - $full_file_path = EEH_File::standardise_directory_separators( $full_file_path ); |
|
318 | - if ( EEH_File::verify_filepath_and_permissions( $full_file_path, EEH_File::get_filename_from_filepath( $full_file_path ) , EEH_File::get_file_extension( $full_file_path ))) { |
|
316 | + public static function get_file_contents($full_file_path = '') { |
|
317 | + $full_file_path = EEH_File::standardise_directory_separators($full_file_path); |
|
318 | + if (EEH_File::verify_filepath_and_permissions($full_file_path, EEH_File::get_filename_from_filepath($full_file_path), EEH_File::get_file_extension($full_file_path))) { |
|
319 | 319 | // load WP_Filesystem and set file permissions |
320 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path ); |
|
321 | - return $wp_filesystem->get_contents(EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ); |
|
320 | + $wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path); |
|
321 | + return $wp_filesystem->get_contents(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path)); |
|
322 | 322 | } |
323 | 323 | return ''; |
324 | 324 | } |
@@ -333,26 +333,26 @@ discard block |
||
333 | 333 | * @throws EE_Error |
334 | 334 | * @return bool |
335 | 335 | */ |
336 | - public static function write_to_file( $full_file_path = '', $file_contents = '', $file_type = '' ){ |
|
337 | - $full_file_path = EEH_File::standardise_directory_separators( $full_file_path ); |
|
338 | - $file_type = ! empty( $file_type ) ? rtrim( $file_type, ' ' ) . ' ' : ''; |
|
339 | - $folder = EEH_File::remove_filename_from_filepath( $full_file_path ); |
|
340 | - if ( ! EEH_File::verify_is_writable( $folder, 'folder' )) { |
|
341 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
342 | - $msg = sprintf( __( 'The %1$sfile located at "%2$s" is not writable.', 'event_espresso' ), $file_type, $full_file_path ); |
|
343 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path ); |
|
344 | - throw new EE_Error( $msg ); |
|
336 | + public static function write_to_file($full_file_path = '', $file_contents = '', $file_type = '') { |
|
337 | + $full_file_path = EEH_File::standardise_directory_separators($full_file_path); |
|
338 | + $file_type = ! empty($file_type) ? rtrim($file_type, ' ').' ' : ''; |
|
339 | + $folder = EEH_File::remove_filename_from_filepath($full_file_path); |
|
340 | + if ( ! EEH_File::verify_is_writable($folder, 'folder')) { |
|
341 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
342 | + $msg = sprintf(__('The %1$sfile located at "%2$s" is not writable.', 'event_espresso'), $file_type, $full_file_path); |
|
343 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_file_path); |
|
344 | + throw new EE_Error($msg); |
|
345 | 345 | } |
346 | 346 | return FALSE; |
347 | 347 | } |
348 | 348 | // load WP_Filesystem and set file permissions |
349 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path ); |
|
349 | + $wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path); |
|
350 | 350 | // write the file |
351 | - if ( ! $wp_filesystem->put_contents(EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ), $file_contents )) { |
|
352 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
353 | - $msg = sprintf( __( 'The %1$sfile located at "%2$s" could not be written to.', 'event_espresso' ), $file_type, $full_file_path ); |
|
354 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_file_path, 'f' ); |
|
355 | - throw new EE_Error( $msg ); |
|
351 | + if ( ! $wp_filesystem->put_contents(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path), $file_contents)) { |
|
352 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
353 | + $msg = sprintf(__('The %1$sfile located at "%2$s" could not be written to.', 'event_espresso'), $file_type, $full_file_path); |
|
354 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_file_path, 'f'); |
|
355 | + throw new EE_Error($msg); |
|
356 | 356 | } |
357 | 357 | return FALSE; |
358 | 358 | } |
@@ -368,9 +368,9 @@ discard block |
||
368 | 368 | * @param string $full_file_path |
369 | 369 | * @return bool |
370 | 370 | */ |
371 | - public static function exists( $full_file_path = '' ) { |
|
372 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path ); |
|
373 | - return $wp_filesystem->exists( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ) ? TRUE : FALSE; |
|
371 | + public static function exists($full_file_path = '') { |
|
372 | + $wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path); |
|
373 | + return $wp_filesystem->exists(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path)) ? TRUE : FALSE; |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | |
@@ -382,9 +382,9 @@ discard block |
||
382 | 382 | * @param string $full_file_path |
383 | 383 | * @return bool |
384 | 384 | */ |
385 | - public static function is_readable( $full_file_path = '' ) { |
|
386 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $full_file_path ); |
|
387 | - if( $wp_filesystem->is_readable( EEH_File::convert_local_filepath_to_remote_filepath( $full_file_path ) ) ) { |
|
385 | + public static function is_readable($full_file_path = '') { |
|
386 | + $wp_filesystem = EEH_File::_get_wp_filesystem($full_file_path); |
|
387 | + if ($wp_filesystem->is_readable(EEH_File::convert_local_filepath_to_remote_filepath($full_file_path))) { |
|
388 | 388 | return true; |
389 | 389 | } else { |
390 | 390 | return false; |
@@ -400,8 +400,8 @@ discard block |
||
400 | 400 | * @param string $full_file_path |
401 | 401 | * @return string |
402 | 402 | */ |
403 | - public static function remove_filename_from_filepath( $full_file_path = '' ) { |
|
404 | - return pathinfo( $full_file_path, PATHINFO_DIRNAME ); |
|
403 | + public static function remove_filename_from_filepath($full_file_path = '') { |
|
404 | + return pathinfo($full_file_path, PATHINFO_DIRNAME); |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | * @param string $full_file_path |
412 | 412 | * @return string |
413 | 413 | */ |
414 | - public static function get_filename_from_filepath( $full_file_path = '' ) { |
|
415 | - return pathinfo( $full_file_path, PATHINFO_BASENAME ); |
|
414 | + public static function get_filename_from_filepath($full_file_path = '') { |
|
415 | + return pathinfo($full_file_path, PATHINFO_BASENAME); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -422,8 +422,8 @@ discard block |
||
422 | 422 | * @param string $full_file_path |
423 | 423 | * @return string |
424 | 424 | */ |
425 | - public static function get_file_extension( $full_file_path = '' ) { |
|
426 | - return pathinfo( $full_file_path, PATHINFO_EXTENSION ); |
|
425 | + public static function get_file_extension($full_file_path = '') { |
|
426 | + return pathinfo($full_file_path, PATHINFO_EXTENSION); |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | |
@@ -434,15 +434,15 @@ discard block |
||
434 | 434 | * @param string $folder |
435 | 435 | * @return bool |
436 | 436 | */ |
437 | - public static function add_htaccess_deny_from_all( $folder = '' ) { |
|
438 | - $folder = EEH_File::standardise_and_end_with_directory_separator( $folder ); |
|
439 | - if ( ! EEH_File::exists( $folder . '.htaccess' ) ) { |
|
440 | - if ( ! EEH_File::write_to_file( $folder . '.htaccess', 'deny from all', '.htaccess' )) { |
|
437 | + public static function add_htaccess_deny_from_all($folder = '') { |
|
438 | + $folder = EEH_File::standardise_and_end_with_directory_separator($folder); |
|
439 | + if ( ! EEH_File::exists($folder.'.htaccess')) { |
|
440 | + if ( ! EEH_File::write_to_file($folder.'.htaccess', 'deny from all', '.htaccess')) { |
|
441 | 441 | return FALSE; |
442 | 442 | } |
443 | 443 | } |
444 | - if ( ! EEH_File::exists( $folder . 'index.html' ) ) { |
|
445 | - if ( ! EEH_File::write_to_file( $folder . 'index.html', 'cheating huh?', '.html' )) { |
|
444 | + if ( ! EEH_File::exists($folder.'index.html')) { |
|
445 | + if ( ! EEH_File::write_to_file($folder.'index.html', 'cheating huh?', '.html')) { |
|
446 | 446 | return FALSE; |
447 | 447 | } |
448 | 448 | } |
@@ -457,11 +457,11 @@ discard block |
||
457 | 457 | * @param string $file_path |
458 | 458 | * @return string |
459 | 459 | */ |
460 | - public static function get_classname_from_filepath_with_standard_filename( $file_path ){ |
|
460 | + public static function get_classname_from_filepath_with_standard_filename($file_path) { |
|
461 | 461 | //extract file from path |
462 | - $filename = basename( $file_path ); |
|
462 | + $filename = basename($file_path); |
|
463 | 463 | //now remove the first period and everything after |
464 | - $pos_of_first_period = strpos( $filename,'.' ); |
|
464 | + $pos_of_first_period = strpos($filename, '.'); |
|
465 | 465 | return substr($filename, 0, $pos_of_first_period); |
466 | 466 | } |
467 | 467 | |
@@ -473,8 +473,8 @@ discard block |
||
473 | 473 | * @param string $file_path |
474 | 474 | * @return string |
475 | 475 | */ |
476 | - public static function standardise_directory_separators( $file_path ){ |
|
477 | - return str_replace( array( '\\', '/' ), DS, $file_path ); |
|
476 | + public static function standardise_directory_separators($file_path) { |
|
477 | + return str_replace(array('\\', '/'), DS, $file_path); |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | |
@@ -485,8 +485,8 @@ discard block |
||
485 | 485 | * @param string $file_path |
486 | 486 | * @return string |
487 | 487 | */ |
488 | - public static function end_with_directory_separator( $file_path ){ |
|
489 | - return rtrim( $file_path, '/\\' ) . DS; |
|
488 | + public static function end_with_directory_separator($file_path) { |
|
489 | + return rtrim($file_path, '/\\').DS; |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | |
@@ -496,8 +496,8 @@ discard block |
||
496 | 496 | * @param $file_path |
497 | 497 | * @return string |
498 | 498 | */ |
499 | - public static function standardise_and_end_with_directory_separator( $file_path ){ |
|
500 | - return self::end_with_directory_separator( self::standardise_directory_separators( $file_path )); |
|
499 | + public static function standardise_and_end_with_directory_separator($file_path) { |
|
500 | + return self::end_with_directory_separator(self::standardise_directory_separators($file_path)); |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | |
@@ -514,21 +514,21 @@ discard block |
||
514 | 514 | * if $index_numerically == FALSE (Default) keys are what the class names SHOULD be; |
515 | 515 | * and values are their filepaths |
516 | 516 | */ |
517 | - public static function get_contents_of_folders( $folder_paths = array(), $index_numerically = FALSE ){ |
|
517 | + public static function get_contents_of_folders($folder_paths = array(), $index_numerically = FALSE) { |
|
518 | 518 | $class_to_folder_path = array(); |
519 | - foreach( $folder_paths as $folder_path ){ |
|
520 | - $folder_path = self::standardise_and_end_with_directory_separator( $folder_path ); |
|
519 | + foreach ($folder_paths as $folder_path) { |
|
520 | + $folder_path = self::standardise_and_end_with_directory_separator($folder_path); |
|
521 | 521 | // load WP_Filesystem and set file permissions |
522 | - $files_in_folder = glob( $folder_path . '*' ); |
|
522 | + $files_in_folder = glob($folder_path.'*'); |
|
523 | 523 | $class_to_folder_path = array(); |
524 | - if ( $files_in_folder ) { |
|
525 | - foreach( $files_in_folder as $file_path ){ |
|
524 | + if ($files_in_folder) { |
|
525 | + foreach ($files_in_folder as $file_path) { |
|
526 | 526 | //only add files, not folders |
527 | - if ( ! is_dir( $file_path )) { |
|
528 | - if ( $index_numerically ) { |
|
527 | + if ( ! is_dir($file_path)) { |
|
528 | + if ($index_numerically) { |
|
529 | 529 | $class_to_folder_path[] = $file_path; |
530 | 530 | } else { |
531 | - $classname = self::get_classname_from_filepath_with_standard_filename( $file_path ); |
|
531 | + $classname = self::get_classname_from_filepath_with_standard_filename($file_path); |
|
532 | 532 | $class_to_folder_path[$classname] = $file_path; |
533 | 533 | } |
534 | 534 | } |
@@ -548,39 +548,39 @@ discard block |
||
548 | 548 | * @return boolean success |
549 | 549 | * @throws EE_Error |
550 | 550 | */ |
551 | - public static function copy( $source_file, $destination_file, $overwrite = FALSE ){ |
|
552 | - $full_source_path = EEH_File::standardise_directory_separators( $source_file ); |
|
553 | - if( ! EEH_File::exists( $full_source_path ) ){ |
|
554 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
555 | - $msg = sprintf( __( 'The file located at "%2$s" is not readable or doesn\'t exist.', 'event_espresso' ), $full_source_path ); |
|
556 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_source_path ); |
|
557 | - throw new EE_Error( $msg ); |
|
551 | + public static function copy($source_file, $destination_file, $overwrite = FALSE) { |
|
552 | + $full_source_path = EEH_File::standardise_directory_separators($source_file); |
|
553 | + if ( ! EEH_File::exists($full_source_path)) { |
|
554 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
555 | + $msg = sprintf(__('The file located at "%2$s" is not readable or doesn\'t exist.', 'event_espresso'), $full_source_path); |
|
556 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_source_path); |
|
557 | + throw new EE_Error($msg); |
|
558 | 558 | } |
559 | 559 | return FALSE; |
560 | 560 | } |
561 | 561 | |
562 | - $full_dest_path = EEH_File::standardise_directory_separators( $destination_file ); |
|
563 | - $folder = EEH_File::remove_filename_from_filepath( $full_dest_path ); |
|
564 | - if ( ! EEH_File::verify_is_writable( $folder, 'folder' )) { |
|
565 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
566 | - $msg = sprintf( __( 'The file located at "%2$s" is not writable.', 'event_espresso' ), $full_dest_path ); |
|
567 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_dest_path ); |
|
568 | - throw new EE_Error( $msg ); |
|
562 | + $full_dest_path = EEH_File::standardise_directory_separators($destination_file); |
|
563 | + $folder = EEH_File::remove_filename_from_filepath($full_dest_path); |
|
564 | + if ( ! EEH_File::verify_is_writable($folder, 'folder')) { |
|
565 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
566 | + $msg = sprintf(__('The file located at "%2$s" is not writable.', 'event_espresso'), $full_dest_path); |
|
567 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_dest_path); |
|
568 | + throw new EE_Error($msg); |
|
569 | 569 | } |
570 | 570 | return FALSE; |
571 | 571 | } |
572 | 572 | |
573 | 573 | // load WP_Filesystem and set file permissions |
574 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $destination_file ); |
|
574 | + $wp_filesystem = EEH_File::_get_wp_filesystem($destination_file); |
|
575 | 575 | // write the file |
576 | 576 | if ( ! $wp_filesystem->copy( |
577 | - EEH_File::convert_local_filepath_to_remote_filepath( $full_source_path ), |
|
578 | - EEH_File::convert_local_filepath_to_remote_filepath( $full_dest_path ), |
|
577 | + EEH_File::convert_local_filepath_to_remote_filepath($full_source_path), |
|
578 | + EEH_File::convert_local_filepath_to_remote_filepath($full_dest_path), |
|
579 | 579 | $overwrite )) { |
580 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
581 | - $msg = sprintf( __( 'Attempted writing to file %1$s, but could not, probably because of permissions issues', 'event_espresso' ), $full_source_path ); |
|
582 | - $msg .= EEH_File::_permissions_error_for_unreadable_filepath( $full_source_path, 'f' ); |
|
583 | - throw new EE_Error( $msg ); |
|
580 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
581 | + $msg = sprintf(__('Attempted writing to file %1$s, but could not, probably because of permissions issues', 'event_espresso'), $full_source_path); |
|
582 | + $msg .= EEH_File::_permissions_error_for_unreadable_filepath($full_source_path, 'f'); |
|
583 | + throw new EE_Error($msg); |
|
584 | 584 | } |
585 | 585 | return FALSE; |
586 | 586 | } |
@@ -592,9 +592,9 @@ discard block |
||
592 | 592 | * @param string $filepath |
593 | 593 | * @return boolean |
594 | 594 | */ |
595 | - public static function is_in_uploads_folder( $filepath ) { |
|
595 | + public static function is_in_uploads_folder($filepath) { |
|
596 | 596 | $uploads = wp_upload_dir(); |
597 | - return strpos( $filepath, $uploads[ 'basedir' ] ) === 0 ? true : false; |
|
597 | + return strpos($filepath, $uploads['basedir']) === 0 ? true : false; |
|
598 | 598 | } |
599 | 599 | |
600 | 600 | /** |
@@ -608,9 +608,9 @@ discard block |
||
608 | 608 | * @return string the remote filepath (eg the filepath the filesystem method, eg |
609 | 609 | * ftp or ssh, will use to access the folder |
610 | 610 | */ |
611 | - public static function convert_local_filepath_to_remote_filepath( $local_filepath ) { |
|
612 | - $wp_filesystem = EEH_File::_get_wp_filesystem( $local_filepath ); |
|
613 | - return str_replace( WP_CONTENT_DIR . DS, $wp_filesystem->wp_content_dir(), $local_filepath ); |
|
611 | + public static function convert_local_filepath_to_remote_filepath($local_filepath) { |
|
612 | + $wp_filesystem = EEH_File::_get_wp_filesystem($local_filepath); |
|
613 | + return str_replace(WP_CONTENT_DIR.DS, $wp_filesystem->wp_content_dir(), $local_filepath); |
|
614 | 614 | } |
615 | 615 | } |
616 | 616 | // End of file EEH_File.helper.php |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <h4><a href="[EDIT_ATTENDEE_LINK]">[FNAME] [LNAME]</a></h4> |
2 | 2 | <ul> |
3 | 3 | <li> |
4 | - <strong><?php _e( 'Registration Code:', 'event_espresso' ); ?></strong> |
|
4 | + <strong><?php _e('Registration Code:', 'event_espresso'); ?></strong> |
|
5 | 5 | <a href="[EDIT_ATTENDEE_LINK]">[REGISTRATION_CODE]</a> |
6 | 6 | </li> |
7 | 7 | <li> |
8 | - <strong><?php _e( 'Tickets:', 'event_espresso' ); ?></strong> |
|
8 | + <strong><?php _e('Tickets:', 'event_espresso'); ?></strong> |
|
9 | 9 | <ul>[TICKET_LIST]</ul> |
10 | 10 | </li> |
11 | 11 | </ul> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | <tbody> |
4 | 4 | <tr> |
5 | 5 | <td> |
6 | - <p class="callout"><strong><?php _e( 'Event:', 'event_espresso' ); ?> [EVENT_LINK]</strong></p> |
|
6 | + <p class="callout"><strong><?php _e('Event:', 'event_espresso'); ?> [EVENT_LINK]</strong></p> |
|
7 | 7 | </td> |
8 | 8 | </tr> |
9 | 9 | </tbody> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | <tbody> |
17 | 17 | <tr> |
18 | 18 | <td> |
19 | - <h3><?php _e( 'Registrant(s):', 'event_espresso' ); ?></h3> |
|
19 | + <h3><?php _e('Registrant(s):', 'event_espresso'); ?></h3> |
|
20 | 20 | [ATTENDEE_LIST] |
21 | 21 | </td> |
22 | 22 | </tr> |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | |
34 | 34 | protected function _set_admin_pages() { |
35 | - $this->admin_registered_pages = array( 'events_edit' => TRUE ); |
|
35 | + $this->admin_registered_pages = array('events_edit' => TRUE); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -45,17 +45,17 @@ discard block |
||
45 | 45 | |
46 | 46 | protected function _set_with_messengers() { |
47 | 47 | $this->_with_messengers = array( |
48 | - 'html' => array( 'pdf' ) |
|
48 | + 'html' => array('pdf') |
|
49 | 49 | ); |
50 | 50 | } |
51 | 51 | |
52 | 52 | |
53 | 53 | |
54 | - protected function _get_data_for_context( $context, EE_Registration $registration, $id ) { |
|
54 | + protected function _get_data_for_context($context, EE_Registration $registration, $id) { |
|
55 | 55 | //receipt message type data handler is 'Gateways' and it expects a transaction object. |
56 | 56 | $transaction = $registration->transaction(); |
57 | - if ( $transaction instanceof EE_Transaction ) { |
|
58 | - return array( $transaction ); |
|
57 | + if ($transaction instanceof EE_Transaction) { |
|
58 | + return array($transaction); |
|
59 | 59 | } |
60 | 60 | return array(); |
61 | 61 | } |
@@ -5,7 +5,9 @@ |
||
5 | 5 | * @subpackage plugin api, messages |
6 | 6 | * @since 4.5.0 |
7 | 7 | */ |
8 | -if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
8 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
9 | + exit('No direct script access allowed'); |
|
10 | +} |
|
9 | 11 | |
10 | 12 | /** |
11 | 13 | * Use this to register or deregister a new message template pack variation for the EE messages system. |
@@ -87,12 +87,12 @@ |
||
87 | 87 | |
88 | 88 | |
89 | 89 | /** |
90 | - * used to set the valid shortcodes for the receipt message type |
|
91 | - * |
|
92 | - * @since 4.5.0 |
|
93 | - * |
|
94 | - * @return void |
|
95 | - */ |
|
90 | + * used to set the valid shortcodes for the receipt message type |
|
91 | + * |
|
92 | + * @since 4.5.0 |
|
93 | + * |
|
94 | + * @return void |
|
95 | + */ |
|
96 | 96 | protected function _set_valid_shortcodes() { |
97 | 97 | $this->_valid_shortcodes['purchaser'] = array( |
98 | 98 | 'attendee_list', 'attendee', 'datetime_list', 'datetime', 'event_list', 'event', 'event_meta', 'messenger', 'organization', 'primary_registration_list', 'primary_registration_details', 'ticket_list', 'ticket', 'transaction', 'venue', 'line_item_list', 'payment_list', 'line_item', 'payment' |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('NO direct script access allowed'); |
5 | 5 | |
6 | 6 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |