@@ 1499-1502 (lines=4) @@ | ||
1496 | //if the file is located remotely, download it to our uploads DIR, because wp_genereate_attachmnet_metadata needs the file to be local |
|
1497 | if(strpos($guid,$wp_upload_dir['url']) === FALSE){ |
|
1498 | //image is located remotely. download it and place it in the uploads directory |
|
1499 | if( ! is_readable($guid)){ |
|
1500 | $migration_stage->add_error(sprintf(__("Could not create image attachment from non-existent file: %s", "event_espresso"),$guid)); |
|
1501 | return 0; |
|
1502 | } |
|
1503 | $contents= file_get_contents($guid); |
|
1504 | if($contents === FALSE){ |
|
1505 | $migration_stage->add_error(sprintf(__("Could not read image at %s, and therefore couldnt create an attachment post for it.", "event_espresso"),$guid)); |
|
@@ 1504-1507 (lines=4) @@ | ||
1501 | return 0; |
|
1502 | } |
|
1503 | $contents= file_get_contents($guid); |
|
1504 | if($contents === FALSE){ |
|
1505 | $migration_stage->add_error(sprintf(__("Could not read image at %s, and therefore couldnt create an attachment post for it.", "event_espresso"),$guid)); |
|
1506 | return false; |
|
1507 | } |
|
1508 | $local_filepath = $wp_upload_dir['path'].DS.basename($guid); |
|
1509 | $savefile = fopen($local_filepath, 'w'); |
|
1510 | fwrite($savefile, $contents); |
@@ 1168-1171 (lines=4) @@ | ||
1165 | $file_path = !is_readable($file_path) ? EE_ADMIN_PAGES . basename($this->_get_dir()) . '/help_tours/' . $tour . '.class.php' : $file_path; |
|
1166 | ||
1167 | //if file is STILL not readable then let's do a EE_Error so its more graceful than a fatal error. |
|
1168 | if ( !is_readable($file_path) ) { |
|
1169 | EE_Error::add_error( sprintf( __('The file path given for the help tour (%s) is not a valid path. Please check that the string you set for the help tour on this route (%s) is the correct spelling', 'event_espresso'), $file_path, $tour ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1170 | return; |
|
1171 | } |
|
1172 | ||
1173 | require_once $file_path; |
|
1174 | if ( !class_exists( $tour ) ) { |
@@ 150-160 (lines=11) @@ | ||
147 | if ( is_array($active_names) ) { |
|
148 | foreach ( $active_names as $name => $class ) { |
|
149 | $active = new $class(); |
|
150 | if ( ! $active instanceof EE_Messenger ) { |
|
151 | //we've got an error so let's bubble up the error_object to be caught by caller. |
|
152 | //todo: would be better to just catch the errors and then return any aggregated errors later. |
|
153 | EE_Error::add_error( |
|
154 | sprintf( |
|
155 | __( 'The "%1$s" messenger is not installed or is invalid', 'event_espresso' ), |
|
156 | $class |
|
157 | ), |
|
158 | __FILE__, __FUNCTION__, __LINE__ |
|
159 | ); |
|
160 | } |
|
161 | $this->_active_messengers[$name] = $active; |
|
162 | $this->_active_message_types[$name] = ! empty( $_actives[$name]['settings'][$name . '-message_types'] ) |
|
163 | ? $_actives[$name]['settings'][$name . '-message_types'] |