-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Admin notices are now only shown to users with the
manage_options
…
… capability.
- Loading branch information
Showing
38 changed files
with
316 additions
and
92 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
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
97 changes: 97 additions & 0 deletions
97
classes/Tools/Storage/Driver/Cloudflare/CloudflareUploadInfo.php
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,97 @@ | ||
<?php | ||
// Copyright (c) 2016 Interfacelab LLC. All rights reserved. | ||
// | ||
// Released under the GPLv3 license | ||
// http://www.gnu.org/licenses/gpl-3.0.html | ||
// | ||
// Uses code from: | ||
// Persist Admin Notices Dismissal | ||
// by Agbonghama Collins and Andy Fragen | ||
// | ||
// ********************************************************************** | ||
// This program is distributed in the hope that it will be useful, but | ||
// WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// ********************************************************************** | ||
|
||
namespace MediaCloud\Plugin\Tools\Storage\Driver\Cloudflare; | ||
|
||
|
||
use MediaCloud\Plugin\Tools\Storage\UploadInfo; | ||
|
||
/** | ||
* Class S3UploadInfo | ||
* @package MediaCloud\Plugin\Tools\Storage\Driver\S3 | ||
*/ | ||
class CloudflareUploadInfo extends UploadInfo { | ||
private $key; | ||
private $url; | ||
private $acl; | ||
private $cacheControl; | ||
private $expires; | ||
|
||
/** | ||
* S3UploadInfo constructor. | ||
* | ||
* @param string $url | ||
* @param string $key | ||
* @param string $acl | ||
* @param string $mimeType | ||
* @param string|null $cacheControl | ||
* @param string|null $expires | ||
*/ | ||
public function __construct($url, $key, $mimeType = null, $acl = null, $cacheControl=null, $expires=null) { | ||
$this->url = $url; | ||
$this->key = $key; | ||
$this->acl = $acl; | ||
$this->mimeType = $mimeType; | ||
$this->cacheControl = $cacheControl; | ||
$this->expires = $expires; | ||
} | ||
|
||
public function key() { | ||
return $this->key; | ||
} | ||
|
||
public function url() { | ||
return $this->url; | ||
} | ||
|
||
public function formData() { | ||
return []; | ||
} | ||
|
||
public function cacheControl() { | ||
return $this->cacheControl; | ||
} | ||
|
||
public function expires() { | ||
return $this->expires; | ||
} | ||
|
||
public function acl() { | ||
return $this->acl; | ||
} | ||
|
||
public function mimeType() { | ||
return $this->mimeType; | ||
} | ||
|
||
|
||
/** | ||
* Returns the upload info as an array | ||
* | ||
* @return array | ||
*/ | ||
public function toArray() { | ||
return [ | ||
'key' => $this->key(), | ||
'url' => $this->url(), | ||
'mimeType' => $this->mimeType(), | ||
'formData' => $this->formData(), | ||
'cacheControl' => $this->cacheControl(), | ||
'expires' => $this->expires(), | ||
'acl' => $this->acl() | ||
]; | ||
} | ||
} |
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
Oops, something went wrong.