Making WordPress.org

Changeset 8065


Ignore:
Timestamp:
01/10/2019 05:45:59 AM (6 years ago)
Author:
dd32
Message:

API: Serve Happy: Move the Serve-Happy config constants out from the API and into a global mu-plugin to allow it to be used in other WordPress.org pages.

Props flixos90, dd32.
See #4009.

Location:
sites/trunk
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/core/serve-happy/1.0/include.php

    r6806 r8065  
    2727    return array(
    2828        'recommended_version' => RECOMMENDED_PHP,
     29        'minimum_version'     => MINIMUM_PHP,
    2930        'is_supported'        => version_compare( $php_version, SUPPORTED_PHP, '>=' ),
    3031        'is_secure'           => version_compare( $php_version, SECURE_PHP, '>=' ),
  • sites/trunk/api.wordpress.org/public_html/core/serve-happy/1.0/index.php

    r6728 r8065  
    77
    88require __DIR__ . '/include.php';
    9 require __DIR__ . '/config.php';
     9require WPORGPATH . 'wp-content/mu-plugins/pub/servehappy-config.php';
    1010
    1111// Output the API response.
  • sites/trunk/api.wordpress.org/public_html/core/serve-happy/1.0/tests/bootstrap.php

    r6728 r8065  
    2222}
    2323
    24 require dirname( __DIR__ ) . '/config.php';
    2524require dirname( __DIR__ ) . '/include.php';
     25if ( defined( 'WPORGPATH' ) ) {
     26    // Running on WordPress.org, include the main mu-plugins config
     27    require WPORGPATH . 'wp-content/mu-plugins/pub/servehappy-config.php';
     28} else {
     29    // Assume meta-environment.
     30    require dirname( dirname( dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) ) ) . '/wordpress.org/public_html/wp-content/mu-plugins/pub/servehappy-config.php';
     31}
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/servehappy-config.php

    r8064 r8065  
    11<?php
    22namespace WordPressdotorg\API\Serve_Happy;
     3/**
     4 * Plugin Name: Servehappy Versions
     5 * Description: Defines PHP version constants used by the Servehappy API and throughout wordpress.org.
     6 * Version:     1.0
     7 * Author:      WordPress.org
     8 * Author URI:  https://wordpress.org/
     9 * License:     GPLv2 or later
     10 */
    311
    412// The latest branch of PHP which WordPress.org recommends.
    513define( 'RECOMMENDED_PHP', '7.3' );
     14
     15// The oldest branch of PHP which WordPress core still works with.
     16define( 'MINIMUM_PHP', '5.2.4' );
    617
    718// The lowest branch of PHP which is actively supported.
Note: See TracChangeset for help on using the changeset viewer.