Skip to content

Commit 8a2a875

Browse files
committed
Use deployment namespace.
1 parent be7447a commit 8a2a875

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/Deployer.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
class Deployer {
1313

14+
const DEFAULT_NAMESPACE = 'wp2static-addon-s3/default';
15+
1416
// prepare deploy, if modifies URL structure, should be an action
1517
// $this->prepareDeploy();
1618

@@ -24,6 +26,8 @@ public function upload_files( string $processed_site_path ) : void {
2426
return;
2527
}
2628

29+
$namespace = self::DEFAULT_NAMESPACE;
30+
2731
// instantiate S3 client
2832
$s3 = self::s3_client();
2933

@@ -58,7 +62,7 @@ public function upload_files( string $processed_site_path ) : void {
5862
5963
$cache_key = str_replace( $processed_site_path, '', $filename );
6064

61-
if ( \WP2Static\DeployCache::fileisCached( $cache_key ) ) {
65+
if ( \WP2Static\DeployCache::fileisCached( $cache_key, $namespace ) ) {
6266
continue;
6367
}
6468

@@ -93,7 +97,7 @@ public function upload_files( string $processed_site_path ) : void {
9397
$result = $s3->putObject( $put_data );
9498

9599
if ( $result['@metadata']['statusCode'] === 200 ) {
96-
\WP2Static\DeployCache::addFile( $cache_key );
100+
\WP2Static\DeployCache::addFile( $cache_key, $namespace );
97101

98102
if ( $cf_max_paths >= count( $cf_stale_paths ) ) {
99103
$cf_key = $cache_key;

0 commit comments

Comments
 (0)