add and check plugin base class

This commit is contained in:
Andrew Dolgov 2012-12-23 15:29:16 +04:00
parent 7252abe3ea
commit 5a0e03923f
11 changed files with 21 additions and 10 deletions

11
classes/plugin.php Normal file
View File

@ -0,0 +1,11 @@
<?php
class Plugin {
private $link;
private $host;
function __construct($host) {
$this->link = $host->get_link();
$this->host = $host;
}
}
?>

View File

@ -59,7 +59,7 @@ class PluginHost {
if (file_exists($file)) require_once $file;
if (class_exists($class)) {
if (class_exists($class) && is_subclass_of($class, "Plugin")) {
$plugin = new $class($this);
$this->register_plugin($class, $plugin);

View File

@ -1,5 +1,5 @@
<?php
class Flattr {
class Flattr extends Plugin {
private $link;
private $host;

View File

@ -1,5 +1,5 @@
<?php
class GooglePlus {
class GooglePlus extends Plugin {
private $link;
private $host;

View File

@ -1,5 +1,5 @@
<?php
class Identica {
class Identica extends Plugin {
private $link;
private $host;

View File

@ -1,5 +1,5 @@
<?php
class Mail {
class Mail extends Plugin {
private $link;
private $host;

View File

@ -1,5 +1,5 @@
<?php
class Note {
class Note extends Plugin {
private $link;
private $host;

View File

@ -1,5 +1,5 @@
<?php
class Pinterest {
class Pinterest extends Plugin {
private $link;
private $host;

View File

@ -1,5 +1,5 @@
<?php
class Pocket {
class Pocket extends Plugin {
private $link;
private $host;

View File

@ -1,5 +1,5 @@
<?php
class RedditImgur {
class RedditImgur extends Plugin {
private $link;
private $host;

View File

@ -1,5 +1,5 @@
<?php
class Share {
class Share extends Plugin {
private $link;
private $host;