2012-07-17 20:54:58 +04:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
* Copyright 2005-2013 the original author or authors.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2012-07-18 16:29:28 +04:00
|
|
|
* Base plugin class
|
2012-07-17 20:54:58 +04:00
|
|
|
*/
|
2012-07-18 16:29:28 +04:00
|
|
|
abstract Class Plugin {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor must set this value to true after successful initialization
|
|
|
|
* failures
|
|
|
|
* @var boolean
|
|
|
|
*/
|
2012-08-01 13:19:26 +04:00
|
|
|
public $initialized = false;
|
2012-07-18 16:29:28 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An array of plugin configuration
|
|
|
|
* @var array
|
|
|
|
*/
|
2012-08-01 13:19:26 +04:00
|
|
|
protected $config = array();
|
2012-07-17 20:54:58 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns plugin weight. Weight is used for determine loading order and as default
|
|
|
|
* listner priority.
|
|
|
|
*
|
|
|
|
* @return int Plugin weight
|
|
|
|
*/
|
2012-07-18 16:29:28 +04:00
|
|
|
abstract public function getWeight();
|
2012-07-17 20:54:58 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Register events
|
|
|
|
*/
|
2012-07-18 16:29:28 +04:00
|
|
|
abstract public function registerEvents();
|
2012-07-17 20:54:58 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Register listeners
|
|
|
|
*/
|
2012-07-18 16:29:28 +04:00
|
|
|
abstract public function registerListeners();
|
2012-07-17 20:54:58 +04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|