-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #2520 Rewrite both http & https versions of the URLs to the CD…
…N URL (PR #2589) * move and rename files to new architecture * use home_url() instead of get_option( 'home' ) * add service provider for the CDN module * improve tests code Co-authored-by: Tonya Mork <[email protected]>
- Loading branch information
1 parent
48d9cde
commit 28e7b00
Showing
49 changed files
with
3,437 additions
and
691 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
namespace WP_Rocket\Engine\CDN; | ||
|
||
use League\Container\ServiceProvider\AbstractServiceProvider; | ||
|
||
/** | ||
* Service provider for WP Rocket CDN | ||
* | ||
* @since 3.5.5 | ||
*/ | ||
class ServiceProvider extends AbstractServiceProvider { | ||
/** | ||
* The provides array is a way to let the container | ||
* know that a service is provided by this service | ||
* provider. Every service that is registered via | ||
* this service provider must have an alias added | ||
* to this array or it will be ignored. | ||
* | ||
* @var array | ||
*/ | ||
protected $provides = [ | ||
'cdn', | ||
'cdn_subscriber', | ||
]; | ||
|
||
/** | ||
* Registers the services in the container | ||
* | ||
* @return void | ||
*/ | ||
public function register() { | ||
$options = $this->getContainer()->get( 'options' ); | ||
|
||
$this->getContainer()->share( 'cdn', 'WP_Rocket\Engine\CDN\CDN' ) | ||
->withArgument( $options ); | ||
$this->getContainer()->share( 'cdn_subscriber', 'WP_Rocket\Engine\CDN\Subscriber' ) | ||
->withArgument( $options ) | ||
->withArgument( $this->getContainer()->get( 'cdn' ) ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.