@@ 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); |
@@ 1175-1178 (lines=4) @@ | ||
1172 | $file_path = !is_readable($file_path) ? EE_ADMIN_PAGES . basename($this->_get_dir()) . '/help_tours/' . $tour . '.class.php' : $file_path; |
|
1173 | ||
1174 | //if file is STILL not readable then let's do a EE_Error so its more graceful than a fatal error. |
|
1175 | if ( !is_readable($file_path) ) { |
|
1176 | 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__ ); |
|
1177 | return; |
|
1178 | } |
|
1179 | ||
1180 | require_once $file_path; |
|
1181 | if ( !class_exists( $tour ) ) { |