Skip to content

Commit

Permalink
Define TFA_VERSION from env vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
kovshenin committed Apr 2, 2024
1 parent cd578ef commit c5d8cba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,12 @@ 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 ( defined( 'TFA_VERSION' ) && version_compare( TFA_VERSION, '4.6.0', '>=' ) && ! defined( 'TACHYON_SERVER_VERSION' ) ) {
if ( version_compare( TFA_VERSION, '4.6.0', '>=' ) && ! defined( 'TACHYON_SERVER_VERSION' ) ) {
define( 'TACHYON_SERVER_VERSION', '3.0.0' );
}

Expand Down

0 comments on commit c5d8cba

Please sign in to comment.