checkVirtualLoaders(); if (true === $bool) { self::$offload_instance = new VirtualFileSystem($this->offloadName); } } protected function checkVirtualLoaders() { if ( class_exists('\Stack\Config') ) // Bitpoke Stack MU { $this->offloadName = 'stack'; return true; } elseif (defined('STACK_MEDIA_BUCKET')) { $this->offloadName = 'stack'; return true; } elseif (class_exists('\S3_Uploads\Plugin')) { $this->offloadName = 's3-uploads-human'; return true; } /* (Doesn't work) elseif (function_exists('ud_check_stateless_media')) { $this->offloadName = 'wp-stateless'; return true; } */ return false; } // If As3cfInit is called check WpOffload runtime. This is later in order than plugins_loaded! public function initS3Offload($as3cf) { if (is_null(self::$offload_instance)) { $this->offloadName = 'wp-offload'; self::$offload_instance = new wpOffload($as3cf); } else { Log::addError('Instance is not null - other virtual component has loaded! (' . $this->offloadName . ')'); } } public function getOffloadName() { return $this->offloadName; } } Offloader::getInstance(); // init