-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a certificate system. Fix connection for use certificate object.
- Loading branch information
Showing
70 changed files
with
432 additions
and
291 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,4 @@ composer.phar | |
composer.lock | ||
|
||
# Other files | ||
/.idea/ | ||
/demo/config.php | ||
/atlassian-ide-plugin.xml |
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 |
---|---|---|
|
@@ -23,6 +23,6 @@ | |
}, | ||
|
||
"autoload": { | ||
"psr-0": { "Apple\\ApnPush": "src/" } | ||
"psr-4": { "Apple\\ApnPush\\": "src/" } | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the AppleApnPush package | ||
* | ||
* (c) Vitaliy Zhuk <zhuk2205@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code | ||
*/ | ||
|
||
namespace Apple\ApnPush\Certificate; | ||
|
||
use Apple\ApnPush\Exception\CertificateFileNotFoundException; | ||
|
||
/** | ||
* Base certificate | ||
*/ | ||
class Certificate implements CertificateInterface | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $path; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $passPhrase; | ||
|
||
/** | ||
* Construct | ||
* | ||
* @param string $path | ||
* @param string $passPhrase | ||
* | ||
* @throws CertificateFileNotFoundException | ||
*/ | ||
public function __construct($path, $passPhrase) | ||
{ | ||
if (!file_exists($path) || !is_file($path)) { | ||
throw new CertificateFileNotFoundException(sprintf( | ||
'The certificate file "%s" was not found.', | ||
$path | ||
)); | ||
} | ||
|
||
$this->path = $path; | ||
$this->passPhrase = $passPhrase; | ||
} | ||
|
||
/** | ||
* Get path | ||
* | ||
* @return string | ||
*/ | ||
public function getPath() | ||
{ | ||
return $this->path; | ||
} | ||
|
||
/** | ||
* Get pass phrase | ||
* | ||
* @return string | ||
*/ | ||
public function getPassPhrase() | ||
{ | ||
return $this->passPhrase; | ||
} | ||
} |
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,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the AppleApnPush package | ||
* | ||
* (c) Vitaliy Zhuk <zhuk2205@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code | ||
*/ | ||
|
||
namespace Apple\ApnPush\Certificate; | ||
|
||
/** | ||
* All certificate should implement this interface | ||
*/ | ||
interface CertificateInterface | ||
{ | ||
/** | ||
* Get path | ||
* | ||
* @return string | ||
*/ | ||
public function getPath(); | ||
|
||
/** | ||
* Get pass phrase | ||
* | ||
* @return string | ||
*/ | ||
public function getPassPhrase(); | ||
} |
Oops, something went wrong.