Making WordPress.org


Ignore:
Timestamp:
10/27/2020 02:41:36 AM (5 years ago)
Author:
dd32
Message:

Theme Directory: Add a callback to an experimental theme-review workflow.

Props dufresnesteven.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/lib/class-github.php

    r10409 r10410  
    11<?php
    2 namespace WordPressdotorg\Plugin_Directory\Clients;
     2namespace WordPressdotorg\Theme_Directory\Lib;
    33use Ahc\Jwt\JWT;
    44
    55/**
    6  * Simple GitHub client.
     6 * Simple GitHub API client.
    77 *
    8  * @package WordPressdotorg\Plugin_Directory\Clients
     8 * @package WordPressdotorg\Theme_Directory
    99 */
    1010class GitHub {
     
    1212    public static function api( $url, $args = null, $headers = [], $method = null ) {
    1313        // Verify the configuration variables are available.
     14        // This re-uses the Plugin Directory constants deliberately.
    1415        if ( ! defined( 'PLUGIN_GITHUB_APP_ID' ) || ! defined( 'PLUGIN_GITHUB_APP_PRIV_KEY' ) ) {
    1516            return false;
     
    2021            $url = 'https://api.github.com' . $url;
    2122        }
    22    
     23
    2324        $request = wp_remote_request(
    2425            $url,
     
    105106        // This should be replaced with an Autoloader.
    106107        if ( ! class_exists( 'Ahc\Jwt\JWT' ) ) {
    107             require_once dirname( __DIR__ ) . '/libs/adhocore-php-jwt/JWTException.php';
    108             require_once dirname( __DIR__ ) . '/libs/adhocore-php-jwt/ValidatesJWT.php';
    109             require_once dirname( __DIR__ ) . '/libs/adhocore-php-jwt/JWT.php';
     108            require_once __DIR__ . '/adhocore-php-jwt/JWTException.php';
     109            require_once __DIR__ . '/adhocore-php-jwt/ValidatesJWT.php';
     110            require_once __DIR__ . '/adhocore-php-jwt/JWT.php';
    110111        }
    111112
Note: See TracChangeset for help on using the changeset viewer.