-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
355 additions
and
223 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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
|
||
/** | ||
* Datei für ... | ||
* | ||
* @version 1.0 / 2020-02-18 | ||
* @author akrys | ||
*/ | ||
namespace FriendsOfRedaxo\addon\UsageCheck; | ||
|
||
use FriendsOfRedaxo\addon\UsageCheck\Exception\CloneException; | ||
use rex_addon; | ||
|
||
/** | ||
* Description of Addon | ||
* | ||
* @author akrys | ||
*/ | ||
final class Addon | ||
{ | ||
/** | ||
* Addon | ||
* @var \rex_addon | ||
*/ | ||
private $addon; | ||
|
||
/** | ||
* Version holen, besser direkt über die yml-Datei | ||
* @return string | ||
*/ | ||
public function getVersion() | ||
{ | ||
return $this->addon->getVersion(); | ||
} | ||
|
||
/** | ||
* Name holen, besser direkt über die yml-Datei | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
$page = $this->addon->getProperty('page'); | ||
return $page['title']; | ||
} | ||
// <editor-fold defaultstate="collapsed" desc="Singleton"> | ||
/** | ||
* Instance | ||
* @var Error | ||
*/ | ||
private static $instance = null; | ||
|
||
/** | ||
* create Singleton Instance | ||
* @return Error | ||
*/ | ||
public static function getInstance() | ||
{ | ||
if (self::$instance == null) { | ||
self::$instance = new self(); | ||
} | ||
return self::$instance; | ||
} | ||
|
||
/** | ||
* Konstuktor | ||
*/ | ||
final private function __construct() | ||
{ | ||
$this->addon = rex_addon::get(Config::NAME); | ||
} | ||
|
||
/** | ||
* forbid cloning | ||
*/ | ||
final public function __clone() | ||
{ | ||
throw new CloneException(); | ||
} | ||
// </editor-fold> | ||
} |
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
Oops, something went wrong.