mirror of
https://ghproxy.net/https://github.com/elementor/wp2static-addon-s3.git
synced 2025-08-17 19:51:26 +08:00
parent
3254498c4c
commit
6c2881485e
1 changed files with 28 additions and 18 deletions
|
@ -107,19 +107,23 @@ class Deployer {
|
|||
continue;
|
||||
}
|
||||
|
||||
$result = $s3->putObject( $put_data );
|
||||
try {
|
||||
$result = $s3->putObject( $put_data );
|
||||
|
||||
if ( $result['@metadata']['statusCode'] === 200 ) {
|
||||
\WP2Static\DeployCache::addFile( $cache_key, $namespace, $hash );
|
||||
if ( $result['@metadata']['statusCode'] === 200 ) {
|
||||
\WP2Static\DeployCache::addFile( $cache_key, $namespace, $hash );
|
||||
|
||||
if ( $cf_max_paths >= count( $cf_stale_paths ) ) {
|
||||
$cf_key = $cache_key;
|
||||
if ( 0 === substr_compare( $cf_key, '/index.html', -11 ) ) {
|
||||
$cf_key = substr( $cf_key, 0, -10 );
|
||||
if ( $cf_max_paths >= count( $cf_stale_paths ) ) {
|
||||
$cf_key = $cache_key;
|
||||
if ( 0 === substr_compare( $cf_key, '/index.html', -11 ) ) {
|
||||
$cf_key = substr( $cf_key, 0, -10 );
|
||||
}
|
||||
$cf_key = str_replace( ' ', '%20', $cf_key );
|
||||
array_push( $cf_stale_paths, $cf_key );
|
||||
}
|
||||
$cf_key = str_replace( ' ', '%20', $cf_key );
|
||||
array_push( $cf_stale_paths, $cf_key );
|
||||
}
|
||||
} catch ( AwsException $e ) {
|
||||
WsLog::l( 'Error uploading file ' . $filename . ': ' . $e->getMessage() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -156,19 +160,25 @@ class Deployer {
|
|||
continue;
|
||||
}
|
||||
|
||||
$result = $s3->putObject( $put_data );
|
||||
try {
|
||||
$result = $s3->putObject( $put_data );
|
||||
|
||||
if ( $result['@metadata']['statusCode'] === 200 ) {
|
||||
\WP2Static\DeployCache::addFile( $cache_key, $namespace, $hash );
|
||||
if ( $result['@metadata']['statusCode'] === 200 ) {
|
||||
\WP2Static\DeployCache::addFile( $cache_key, $namespace, $hash );
|
||||
|
||||
if ( $cf_max_paths >= count( $cf_stale_paths ) ) {
|
||||
$cf_key = $cache_key;
|
||||
if ( 0 === substr_compare( $cf_key, '/index.html', -11 ) ) {
|
||||
$cf_key = substr( $cf_key, 0, -10 );
|
||||
if ( $cf_max_paths >= count( $cf_stale_paths ) ) {
|
||||
$cf_key = $cache_key;
|
||||
if ( 0 === substr_compare( $cf_key, '/index.html', -11 ) ) {
|
||||
$cf_key = substr( $cf_key, 0, -10 );
|
||||
}
|
||||
$cf_key = str_replace( ' ', '%20', $cf_key );
|
||||
array_push( $cf_stale_paths, $cf_key );
|
||||
}
|
||||
$cf_key = str_replace( ' ', '%20', $cf_key );
|
||||
array_push( $cf_stale_paths, $cf_key );
|
||||
}
|
||||
} catch ( AwsException $e ) {
|
||||
WsLog::l(
|
||||
'Error uploading redirect ' . $redirect['url'] . ': ' . $e->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue