先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者,盖追先帝之殊遇,欲报之于陛下也。诚宜开张圣听,以光先帝遗德,恢弘志士之气,不宜妄自菲薄,引喻失义,以塞忠谏之路也先帝は天下を興す志半ばにして志半ばにして崩御されました。今、天下は三つに分かれ、益州は疲弊しており、まさに存亡の危機に瀕しております。しかしながら、宮中で職務に励む臣下や、外地で身を顧みず尽力する志士たちがいるのは、ひとえに先帝から受けた格別な恩義を思い、陛下に報いようとする志があるからです。今こそ陛下には広く臣下の意見に耳を傾け、先帝の遺徳を輝かせ、志士たちの士気を高めるべきです。決して自らを卑下したり、不適切な例えを用いて忠言の道を閉ざしたりしてはなりません。鍏堝笣鍒涗笟鏈崐鑰屼腑閬撳穿娈傦紝浠婂ぉ涓嬩笁鍒嗭紝鐩婂窞鐤插紛锛屾璇氬嵄鎬ュ瓨浜′箣绉嬩篃銆傜劧渚嶅崼涔嬭嚕涓嶆噲浜庡唴锛屽繝蹇椾箣澹繕韬簬澶栬€咃紝鐩栬拷鍏堝笣涔嬫畩閬囷紝娆叉姤涔嬩簬闄涗笅涔熴€傝瘹瀹滃紑寮犲湥鍚紝浠ュ厜鍏堝笣閬楀痉锛屾仮寮樺織澹箣姘旓紝涓嶅疁濡勮嚜鑿茶杽锛屽紩鍠诲け涔夛紝浠ュ蹇犺皬涔嬭矾涔
Current path: usr/local/cpanel/scripts/
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - scripts/xfer_rcube_schema_migrate.pl Copyright 2022 cPanel, L.L.C.
# All rights reserved.
# copyright@cpanel.net http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
package scripts::xfer_rcube_schema_migrate;
use strict;
use DBI ();
use Cpanel::Email::RoundCube::DBI ();
## if invoked as a script, there is nothing in the call stack
my $invoked_as_script = !caller();
__PACKAGE__->script(@ARGV) if ($invoked_as_script);
sub script {
## read password from stdin, for security
## see positional argument list below
my ( $package, @args ) = @_;
my $dbpassword = scalar(<STDIN>);
my ( $dbname, $dbhost, $src_version, $dest_version, $dbuser ) = @args;
## SOMEDAY: need RaiseError off, until we are certain the schema in the database is the
## same version as the Roundcube that is installed
## PrintError is off as well; the temporary database, as it is generated via pkgacct's
## mysqldump, will not have the messages, cache, or session table; the various
## schema migration scripts on these tables will spam the whm xfer screen
my $dbh = Cpanel::Email::RoundCube::DBI::mysql_db_connect(
$dbname, $dbhost, $dbuser, $dbpassword,
{ RaiseError => 0, PrintError => 0 }
);
my $rv = do_migration( $dbh, $src_version, $dest_version );
$dbh->disconnect();
unless ($rv) {
die "Roundcube schema migration failed for temp database '$dbname'";
}
}
#NOTE: The $src_dbh is assumed to be USEing the correct DB!
sub do_migration {
my ( $src_dbh, $src_version, $dest_version ) = @_;
## SOMEDAY: there is a trade-off here between communicating the $src_version via
## parameters, and computing the $src_version from reading the cp_schema_table;
## at the moment, I feel more secure in sending it in; eventually, might modify
## pkgacct to include cp_schema_version in the mysqldump, and additionally to
## ensure the table exists here
#NOTE: Should this also call Cpanel::Email::RoundCube::write_version_file()?
#(It would need to pass in the version as a parameter.)
my $opts = { installed_version => $src_version };
return Cpanel::Email::RoundCube::DBI::ensure_schema_update( $src_dbh, 'mysql', $dest_version, $opts );
}
1;