Plugin Directory

Changeset 2501781


Ignore:
Timestamp:
03/23/2021 12:50:48 PM (5 years ago)
Author:
homanp
Message:

Initiate global instance of background request.

Location:
request-io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • request-io/tags/1.0/request-io.php

    r2501690 r2501781  
    2727    {
    2828        // Setup background request
    29         add_action('plugins_loaded', array($this, 'create_background_request'));
     29        add_action('init', array($this, 'create_background_request'));
    3030        // Hook into the admin menu
    3131        add_action('admin_menu', array($this, 'create_plugin_settings_page'));
     
    263263
    264264    public function create_background_request() {
    265         $this->update_cache_request = new Request_IO_Background_Process();
     265        global $async_request;
     266        $async_request = new Request_IO_Background_Process();
    266267    }
    267268   
     
    293294            strpos($_SERVER['REQUEST_URI'], '.xml') === false
    294295        ) {
    295             $this->update_cache_request->data(array('api_url' => $api_url, 'home_url' => $this->siteUrl()));
    296             $this->update_cache_request->dispatch();
     296            global $async_request;
     297            $async_request->data(array('api_url' => $api_url, 'home_url' => $this->siteUrl()));
     298            $async_request->dispatch();
    297299        }
    298300       
  • request-io/trunk/request-io.php

    r2501690 r2501781  
    2727    {
    2828        // Setup background request
    29         add_action('plugins_loaded', array($this, 'create_background_request'));
     29        add_action('init', array($this, 'create_background_request'));
    3030        // Hook into the admin menu
    3131        add_action('admin_menu', array($this, 'create_plugin_settings_page'));
     
    263263
    264264    public function create_background_request() {
    265         $this->update_cache_request = new Request_IO_Background_Process();
     265        global $async_request;
     266        $async_request = new Request_IO_Background_Process();
    266267    }
    267268   
     
    293294            strpos($_SERVER['REQUEST_URI'], '.xml') === false
    294295        ) {
    295             $this->update_cache_request->data(array('api_url' => $api_url, 'home_url' => $this->siteUrl()));
    296             $this->update_cache_request->dispatch();
     296            global $async_request;
     297            $async_request->data(array('api_url' => $api_url, 'home_url' => $this->siteUrl()));
     298            $async_request->dispatch();
    297299        }
    298300       
Note: See TracChangeset for help on using the changeset viewer.