45 lines
1023 B
PHP
45 lines
1023 B
PHP
<?php
|
|
|
|
namespace Utils;
|
|
|
|
use Typecho\Db;
|
|
use Widget\Options;
|
|
|
|
/**
|
|
* 升级程序
|
|
*
|
|
* @category typecho
|
|
* @package Upgrade
|
|
* @copyright Copyright (c) 2008 Typecho team (http://www.typecho.org)
|
|
* @license GNU General Public License 2.0
|
|
*/
|
|
class Upgrade
|
|
{
|
|
/**
|
|
* @param Db $db
|
|
* @param Options $options
|
|
*/
|
|
public static function v1_2_1(Db $db, Options $options)
|
|
{
|
|
$routingTable = $options->routingTable;
|
|
|
|
$routingTable['comment_page'] = [
|
|
'url' => '[permalink:string]/comment-page-[commentPage:digital]',
|
|
'widget' => '\Widget\CommentPage',
|
|
'action' => 'action'
|
|
];
|
|
|
|
$routingTable['feed'] = [
|
|
'url' => '/feed[feed:string:0]',
|
|
'widget' => '\Widget\Feed',
|
|
'action' => 'render'
|
|
];
|
|
|
|
unset($routingTable[0]);
|
|
|
|
$db->query($db->update('table.options')
|
|
->rows(['value' => serialize($routingTable)])
|
|
->where('name = ?', 'routingTable'));
|
|
}
|
|
}
|