Loading inc/class-s3-uploads-wp-cli-command.php +7 −14 Original line number Diff line number Diff line Loading @@ -19,16 +19,17 @@ class S3_Uploads_WP_CLI_Command extends WP_CLI_Command { // Attempt to copy the file to S3 WP_CLI::print_value( 'Attempting to upload file '. $s3_path ); // Set Error Handler so we can catch it if it fails set_error_handler( array( $this, 'copy_fail' ) ); // Copies canolda from the test dir, upto S3 // Copy canola from the test dir, upto S3 $copy = copy( dirname( dirname(__FILE__) ) . '/tests/data/canola.jpg', $s3_path ); restore_error_handler(); // Check that copy worked if ( ! $copy ) { WP_CLI::error( 'Failed to copy / write to S3 - check your policy?' ); return; } WP_CLI::print_value( 'File uploaded to S3 successfully' ); Loading @@ -48,14 +49,6 @@ class S3_Uploads_WP_CLI_Command extends WP_CLI_Command { } /** * Used to handle when we failed uploading. * Alternative is annon. function, but that breaks < PHP 5.3 */ public function copy_fail() { WP_CLI::error( 'Failed to copy / write to S3 - check your policy?' ); } /** * @subcommand migrate-attachments * @synopsis [--delete-local] Loading Loading
inc/class-s3-uploads-wp-cli-command.php +7 −14 Original line number Diff line number Diff line Loading @@ -19,16 +19,17 @@ class S3_Uploads_WP_CLI_Command extends WP_CLI_Command { // Attempt to copy the file to S3 WP_CLI::print_value( 'Attempting to upload file '. $s3_path ); // Set Error Handler so we can catch it if it fails set_error_handler( array( $this, 'copy_fail' ) ); // Copies canolda from the test dir, upto S3 // Copy canola from the test dir, upto S3 $copy = copy( dirname( dirname(__FILE__) ) . '/tests/data/canola.jpg', $s3_path ); restore_error_handler(); // Check that copy worked if ( ! $copy ) { WP_CLI::error( 'Failed to copy / write to S3 - check your policy?' ); return; } WP_CLI::print_value( 'File uploaded to S3 successfully' ); Loading @@ -48,14 +49,6 @@ class S3_Uploads_WP_CLI_Command extends WP_CLI_Command { } /** * Used to handle when we failed uploading. * Alternative is annon. function, but that breaks < PHP 5.3 */ public function copy_fail() { WP_CLI::error( 'Failed to copy / write to S3 - check your policy?' ); } /** * @subcommand migrate-attachments * @synopsis [--delete-local] Loading