本文整理汇总了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的信息,以使插件正常使用!');
}