As the sun rises and the forest mist clears, and the clouds return and the caves darken, these changes of light and shadow are the morning and evening in the mountains. Wildflowers bloom with their subtle fragrance, fine trees flourish with their dense shade, the wind and frost are pure and clean, and the water recedes to reveal the rocks—these are the four seasons in the mountains. Going out in the morning and returning in the evening, the scenery of the four seasons is different, and the joy is endless.至于负者歌于途,行者休于树,前者呼,后者应,伛偻提携,往来而不绝者,滁人游也。临溪而渔,溪深而鱼肥,酿泉为酒,泉香而酒洌,山肴野蔌,杂然而前陈者,太守宴也。宴酣之乐,非丝非竹,射者中,弈者胜,觥筹交错,起坐而喧哗者,众宾欢也。苍颜白发,颓然乎其间者,太守醉也。
<?php
/**
* @package Polylang
*
* The aim of these functions is to be stubed in unit tests.
*
* /!\ THE CODE IN THIS FILE MUST BE COMPATIBLE WITH PHP 5.6.
*/
/**
* Tells if a constant is defined.
*
* @since 3.5
*
* @param string $constant_name Name of the constant.
* @return bool True if the constant is defined, false otherwise.
*
* @phpstan-param non-falsy-string $constant_name
*/
function pll_has_constant( $constant_name ) {
return defined( $constant_name ); // phpcs:ignore WordPressVIPMinimum.Constants.ConstantString.NotCheckingConstantName
}
/**
* Returns the value of a constant if it is defined.
*
* @since 3.5
*
* @param string $constant_name Name of the constant.
* @param mixed $default Optional. Value to return if the constant is not defined. Defaults to `null`.
* @return mixed The value of the constant.
*
* @phpstan-template D of int|float|string|bool|array|null
* @phpstan-param non-falsy-string $constant_name
* @phpstan-param D $default
* @phpstan-return D
*/
function pll_get_constant( $constant_name, $default = null ) {
if ( ! pll_has_constant( $constant_name ) ) {
return $default;
}
/** @phpstan-var D $return */
$return = constant( $constant_name );
return $return;
}
/**
* Defines a constant if it is not already defined.
*
* @since 3.5
*
* @param string $constant_name Name of the constant.
* @param mixed $value Value to set.
* @return bool True on success, false on failure or already defined.
*
* @phpstan-param non-falsy-string $constant_name
* @phpstan-param int|float|string|bool|array|null $value
*/
function pll_set_constant( $constant_name, $value ) {
if ( pll_has_constant( $constant_name ) ) {
return false;
}
return define( $constant_name, $value ); // phpcs:ignore WordPressVIPMinimum.Constants.ConstantString.NotCheckingConstantName
}