Skip to content

Commit

Permalink
Merge pull request #869 from humanmade/backport-863-to-v17-branch
Browse files Browse the repository at this point in the history
[Backport v17-branch] Set the TACHYON_SERVER_VERSION
  • Loading branch information
kovshenin authored Apr 3, 2024
2 parents 858a314 + c5d8cba commit 6a6e1bb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,15 @@ function load_plugins() {
define( 'TACHYON_URL', get_main_site_url( '/tachyon' ) );
}

// Define TFA_VERSION from the environment variable.
defined( 'TFA_VERSION' ) || define( 'TFA_VERSION', getenv( 'TFA_VERSION' ) ?: '0' );

// Set the Tachyon Server version if it's not already defined. This is used to flag to Tachyon that we
// have a version of Tachyon that supports the newer "presign" query parameter.
if ( version_compare( TFA_VERSION, '4.6.0', '>=' ) && ! defined( 'TACHYON_SERVER_VERSION' ) ) {
define( 'TACHYON_SERVER_VERSION', '3.0.0' );
}

if ( $config['s3-uploads'] ) {
add_filter( 'upload_dir', __NAMESPACE__ . '\\set_s3_uploads_bucket_url_hostname', 20 );
require_once Altis\ROOT_DIR . '/vendor/humanmade/s3-uploads/s3-uploads.php';
Expand Down

0 comments on commit 6a6e1bb

Please sign in to comment.