本文整理匯總了PHP中Typecho_Plugin::factory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Typecho_Plugin::factory方法的具體用法?PHP Typecho_Plugin::factory怎麽用?PHP Typecho_Plugin::factory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Typecho_Plugin
的用法示例。
在下文中一共展示了Typecho_Plugin::factory方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: activate
public static function activate()
{
$msg = Access_Plugin::install();
Helper::addPanel(1, self::$panel, 'Access控製台', 'Access插件控製台', 'subscriber');
Typecho_Plugin::factory('Widget_Archive')->header = array('Access_Plugin', 'start');
return _t($msg);
}
示例2: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
Typecho_Plugin::factory('admin/write-post.php')->bottom = array('XiaMiPlayer_Plugin', 'Insert');
Typecho_Plugin::factory('admin/write-page.php')->bottom = array('XiaMiPlayer_Plugin', 'Insert');
Typecho_Plugin::factory('Widget_Archive')->header = array('XiaMiPlayer_Plugin', 'header');
Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('XiaMiPlayer_Plugin', 'ParseXiaMi');
}
示例3: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
Typecho_Plugin::factory('Widget_Archive')->header = array('CodeBox_Plugin', 'addheader');
Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('CodeBox_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('CodeBox_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Abstract_Comments')->contentEx = array('CodeBox_Plugin', 'parse');
}
示例4: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
if (false == Typecho_Http_Client::get()) {
throw new Typecho_Plugin_Exception(_t('對不起, 您的主機不支持 php-curl 擴展而且沒有打開 allow_url_fopen 功能, 無法正常使用此功能'));
}
Typecho_Plugin::factory('admin/menu.php')->navBar = array('Qiniu_Plugin', 'render');
}
示例5: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('TableOfContents_Plugin', 'replace');
Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('TableOfContents_Plugin', 'replace');
Typecho_Plugin::factory('Widget_Archive')->header = array('TableOfContents_Plugin', 'header');
Typecho_Plugin::factory('Widget_Archive')->footer = array('TableOfContents_Plugin', 'footer');
}
示例6: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('GithubCard_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('GithubCard_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Abstract_Comments')->contentEx = array('GithubCard_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Archive')->footer = array('GithubCard_Plugin', 'footer');
}
示例7: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
Typecho_Plugin::factory('Widget_Abstract_Contents')->filter = array('JWPlayer_Plugin', 'jwfilter');
Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('JWPlayer_Plugin', 'jwparse');
Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('JWPlayer_Plugin', 'jwparse');
Typecho_Plugin::factory('Widget_Archive')->header = array('JWPlayer_Plugin', 'jwjs');
}
示例8: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
$db = Typecho_Db::get();
$prefix = $db->getPrefix();
// 查看數
if (!array_key_exists('viewsNum', $db->fetchRow($db->select()->from('table.contents')))) {
$db->query('ALTER TABLE `' . $prefix . 'contents` ADD `viewsNum` INT(10) DEFAULT 0;');
}
// 喜歡數
if (!array_key_exists('likesNum', $db->fetchRow($db->select()->from('table.contents')))) {
$db->query('ALTER TABLE `' . $prefix . 'contents` ADD `likesNum` INT(10) DEFAULT 0;');
}
//增加瀏覽數
Typecho_Plugin::factory('Widget_Archive')->singleHandle = array('Jianshu_Plugin', 'viewCounter');
//把新增的字段添加到查詢中
Typecho_Plugin::factory('Widget_Archive')->select = array('Jianshu_Plugin', 'selectHandle');
//處理內容
Typecho_Plugin::factory('Widget_Archive')->beforeRender = array('Jianshu_Plugin', 'beforeRender');
//處理用戶字段
Typecho_Plugin::factory('Widget_Abstract_Users')->filter = array('Jianshu_Plugin', 'filterUser');
//sitemap
Helper::addRoute('sitemap', '/sitemap.xml', 'Jianshu_Action', 'sitemap');
//工具提供的操作
Helper::addAction('tools', 'Jianshu_Action');
}
示例9: activate
public static function activate()
{
// 觸發機製
Typecho_Plugin::factory('index.php')->begin = array('TypechoXcache_Plugin', 'getCache');
Typecho_Plugin::factory('index.php')->end = array('TypechoXcache_Plugin', 'setCache');
Typecho_Plugin::factory('Widget_Feedback')->finishComment = array('TypechoXcache_Plugin', 'finish');
Typecho_Plugin::factory('Widget_Contents_Post_Edit')->finishPublish = array('TypechoXcache_Plugin', 'clearCache');
// $cache_dir = './usr/plugins/TypechoXcache/Cache/';
// if (!file_exists($cache_dir)) {
// if (mkdir($cache_dir, 0777) && chmod($cache_dir, 0777)) {
// return ('建立緩存文件夾成功, 插件成功激活!');
// } else {
// throw new Typecho_Plugin_Exception('建立緩存文件夾失敗, 請檢查權限設置!');
// }
// } else {
// // 這邊 return 一個在頂部的提示
// return ('緩存文件夾已存在, 插件成功激活!');
// }
// Typecho_Plugin::factory('admin/menu.php')->navBar = array('TypechoXcache_Plugin', 'render');
if (!function_exists('xcache_count')) {
throw new Typecho_Plugin_Exception('開啟插件失敗,缺少xcache環境!');
} else {
return '開啟成功!';
}
// xcache_count();
}
示例10: activate
public static function activate()
{
Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('Prismjs_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Abstract_Comments')->contentEx = array('Prismjs_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Archive')->header = array('Prismjs_Plugin', 'header');
Typecho_Plugin::factory('Widget_Archive')->footer = array('Prismjs_Plugin', 'footer');
}
示例11: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
//注入CSS
Typecho_Plugin::factory('Widget_Archive')->header = array(__CLASS__, 'outputHeader');
Typecho_Plugin::factory('Widget_Archive')->footer = array(__CLASS__, 'outputFooter');
return _t('日曆插件啟動成功');
}
示例12: activate
public static function activate()
{
$meg = Robots_Plugin::install();
Helper::addPanel(1, 'Robots/Logs.php', '蜘蛛日誌', '查看蜘蛛日誌', 'administrator');
Typecho_Plugin::factory('Widget_Archive')->header = array('Robots_Plugin', 'isbot');
return _t($meg);
}
示例13: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
$info = DomainTheme_Plugin::install();
Helper::addPanel(1, 'DomainTheme/manage-domaintheme.php', '域名模板', '管理域名模板', 'administrator');
Helper::addAction('DomainTheme-edit', 'DomainTheme_Action');
Typecho_Plugin::factory('Widget_Archive')->handleInit = array(__CLASS__, 'run');
return _t($info);
}
示例14: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('GoogleCodePrettify_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('GoogleCodePrettify_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Abstract_Comments')->contentEx = array('GoogleCodePrettify_Plugin', 'parse');
Typecho_Plugin::factory('Widget_Archive')->header = array('GoogleCodePrettify_Plugin', 'header');
Typecho_Plugin::factory('Widget_Archive')->footer = array('GoogleCodePrettify_Plugin', 'footer');
}
示例15: activate
/**
* 激活插件方法,如果激活失敗,直接拋出異常
*
* @access public
* @return void
* @throws Typecho_Plugin_Exception
*/
public static function activate()
{
Typecho_Plugin::factory('Widget_Upload')->uploadHandle = array('SCS_Plugin', 'uploadHandle');
Typecho_Plugin::factory('Widget_Upload')->modifyHandle = array('SCS_Plugin', 'modifyHandle');
Typecho_Plugin::factory('Widget_Upload')->deleteHandle = array('SCS_Plugin', 'deleteHandle');
Typecho_Plugin::factory('Widget_Upload')->attachmentHandle = array('SCS_Plugin', 'attachmentHandle');
return _t('請設置SCS的信息,以使插件正常使用!');
}