晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /proc/thread-self/root/scripts/ |
Upload File : |
#!/usr/local/cpanel/3rdparty/bin/perl
# cpanel - scripts/locale_import 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
use strict;
use Getopt::Param ();
use Cpanel::Locale::Utils::XML ();
my $prm = Getopt::Param->new(
{
'no_args_help' => 1,
'help_coderef' => sub {
print <<"END_USAGE";
$0 [--locale={locale_tag} [--locale=… --locale=… …]] [--import={path} [--import=… --import=… …]] [--quiet] [--no-rebuild]
Import locales in XML format into the Locale database.
Options:
--help Show this help screen
--quiet Show less output than normal.
--locale={locale_tag} Specify a locale to import. You can pass the flag multiple times in order to import multiple locales.
This works on files in paths that `/usr/local/cpanel/scripts/locale_export --locale={locale_tag}` created.
--import={file} Specify the path to an XML file that is importable. You can pass the flag multiple times in order to import multiple files.
This uses files in any arbitrary location and name.
--no-rebuild Do not rebuild the locale database after importing the XML file(s).
--type={import_type} Specify the import type as "xml" or "xlf" rather than guessing based on the file extension.
You must specify at least one --locale or --import flag.
The XML files that this script works with are created via /usr/local/cpanel/scripts/locale_export.
If nothing was imported the script will exit with an error status. To examine the reasons nothing was imported do not use --quiet.
END_USAGE
exit;
},
}
);
my $overwrite_keys = $prm->get_param('overwrite-keys') ? 1 : 0;
my $verbose = $prm->get_param('quiet') ? 0 : 1;
my $type = $prm->get_param('type') || '';
my @files;
for my $loc ( $prm->get_param('locale') ) {
if ( -e "/var/cpanel/locale/export/$loc.xlf" ) {
push @files, "/var/cpanel/locale/export/$loc.xlf";
}
elsif ( -e "/var/cpanel/locale/export/$loc.xml" ) {
push @files, "/var/cpanel/locale/export/$loc.xml";
}
else {
print "Could not import “$loc” locale because it does not have an export file.\n" if $verbose;
}
}
my $euid_home;
for my $file ( $prm->get_param('import') ) {
# expand ~/ that was treated as a string and not expanded by the shell before being put in @ARGV
if ( substr( $file, 0, 2 ) eq '~/' ) {
$euid_home ||= ( getpwuid($>) )[7]; # only look it up if needed, and only look it up one time
substr( $file, 0, 2, "$euid_home/" );
}
if ( -e $file ) {
push @files, $file;
}
else {
print "Could not import “$file” because that file does not exist.\n" if $verbose;
}
}
if (@files) {
my @recompile_flags;
for my $file (@files) {
my $error = '';
print "Importing “$file” …\n" if $verbose;
my $locale_tag;
if ( $type eq 'xml' ) {
$locale_tag = Cpanel::Locale::Utils::XML::xml_file_to_locale( $file, \$error );
}
elsif ( $type eq 'xlf' ) {
$locale_tag = Cpanel::Locale::Utils::XML::xlf_file_to_locale( $file, \$error );
}
else {
$locale_tag = Cpanel::Locale::Utils::XML::xml_to_locale( $file, \$error );
}
if ($locale_tag) {
push @recompile_flags, "--locale=$locale_tag";
}
else {
$error ||= 'An unknown error has occurred.';
print "\tError: $error\n" if $verbose;
next;
}
}
if (@recompile_flags) {
if ( $prm->get_param('no-rebuild') ) {
print "Skipping database rebuild.\n" if $verbose;
}
else {
# We do @recompile_flags as an array and then join it here so we could
# easily switch to array context system() and/or saferun() based call
my $cmd = join( ' ', '/usr/local/cpanel/bin/build_locale_databases', @recompile_flags );
system( $verbose ? $cmd : "$cmd > /dev/null" );
}
}
else {
print "None of the files were importable\n";
exit(1);
}
}
else {
print "No files to import\n" if $verbose;
exit 1;
}