$file_data['cdnfsd.engine'] = 'cloudfront'; $file_data['cdnfsd.enabled'] = $file_data['cdn.enabled']; if ( isset( $file_data['cdn.cloudfront_fsd.access_key'] ) ) { $file_data['cdnfsd.cloudfront.access_key'] = $file_data['cdn.cloudfront_fsd.access_key']; $file_data['cdnfsd.cloudfront.distribution_domain'] = $file_data['cdn.cloudfront_fsd.distribution_domain']; $file_data['cdnfsd.cloudfront.secret_key'] = $file_data['cdn.cloudfront_fsd.secret_key']; $file_data['cdnfsd.cloudfront.distribution_id'] = $file_data['cdn.cloudfront_fsd.distribution_id']; } } } $file_data['version'] = W3TC_VERSION; return $file_data; } /** * Sets an extension configuration if it exists in the provided data array. * * This method migrates extension-specific settings to the proper structure * within the configuration data. * * @param array $w3tc_a Reference to the configuration data array. * @param string $w3tc_extension The extension key to check and migrate. * * @return void */ private function _set_if_exists_extension( &$w3tc_a, $w3tc_extension ) { if ( isset( $w3tc_a['extensions.settings'] ) && isset( $w3tc_a['extensions.settings'][ $w3tc_extension ] ) ) { $w3tc_a[ $w3tc_extension ] = $w3tc_a['extensions.settings'][ $w3tc_extension ]; unset( $w3tc_a['extensions.settings'][ $w3tc_extension ] ); } } /** * Migrates an existing key to a nested configuration structure. * * This method checks if the specified key exists in the data array and, if so, * moves its value to the designated nested configuration structure. * * @param array $w3tc_a Reference to the configuration data array. * @param string $old_key The existing key to check in the data array. * @param string $new_key0 The primary key for the new nested structure. * @param string $new_key1 The secondary key for the new nested structure. * * @return void */ private function _set_if_exists( &$w3tc_a, $old_key, $new_key0, $new_key1 ) { if ( isset( $w3tc_a[ $old_key ] ) ) { $w3tc_a[ $new_key0 ][ $new_key1 ] = $w3tc_a[ $old_key ]; unset( $w3tc_a[ $old_key ] ); } } }