A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/2002): Cannot assign requested address

Filename: mysqli/mysqli_driver.php

Line Number: 201

Backtrace:

File: /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php
Line: 343
Function: __construct

File: /www/wwwroot/dash.konsole.xyz/application/controllers/Api.php
Line: 12
Function: __construct

File: /www/wwwroot/dash.konsole.xyz/index.php
Line: 316
Function: require_once

Database Error

数据库发生错误。

无法使用提供的设置连接到数据库服务器。

Filename: core/MY_Controller.php

Line Number: 343


Fatal error: Uncaught Error: Call to a member function close() on string in /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php:349 Stack trace: #0 [internal function]: Index_Controller->__destruct() #1 {main} thrown in /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php on line 349
HEX
HEX
Server: Apache
System: Linux sys.digiflyeg.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User: opal (1023)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/opal/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/languages/UI.php
<?php

namespace WPML\Languages;

use WPML\API\PostTypes;
use WPML\Core\WP\App\Resources;
use WPML\Element\API\Languages;
use WPML\FP\Fns;
use WPML\FP\Lst;
use WPML\FP\Obj;
use WPML\LIB\WP\Hooks;
use WPML\LIB\WP\PostType;
use WPML\Posts\CountPerPostType;
use WPML\Posts\DeleteTranslatedContentOfLanguages;
use WPML\Posts\UntranslatedCount;
use WPML\Setup\Option;
use WPML\TM\ATE\AutoTranslate\Endpoint\ActivateLanguage;
use WPML\TM\ATE\AutoTranslate\Endpoint\CheckLanguageSupport;
use WPML\UIPage;
use function WPML\FP\partial;

class UI implements \IWPML_Backend_Action {

	public function add_hooks() {
		if ( UIPage::isLanguages( $_GET ) ) {

			if ( self::isEditLanguagePage() ) {
				Hooks::onAction( 'admin_enqueue_scripts' )
				     ->then( Fns::unary( partial( [ self::class, 'getData' ], true ) ) )
				     ->then( Resources::enqueueApp( 'languages' ) );
			} else {
				Hooks::onAction( 'admin_enqueue_scripts' )
				     ->then( Fns::unary( partial( [ self::class, 'getData' ], false ) ) )
				     ->then( Resources::enqueueApp( 'languages' ) );
			}

		}
	}

	public static function getData( $editPage ) {
		$getPostTypeName = function ( $postType ) {
			return PostType::getPluralName( $postType )->getOrElse( $postType );
		};

		$data = [
			'endpoints'                 => [
				'checkSupportOfLanguages'           => CheckLanguageSupport::class,
				'skipTranslationOfExistingContent'  => ActivateLanguage::class,
				'postsToTranslatePerTypeCount'      => CountPerPostType::class,
				'deleteTranslatedContentOfLanguage' => DeleteTranslatedContentOfLanguages::class
			],
			'postTypes'                 => Fns::map( $getPostTypeName, PostTypes::getAutomaticTranslatable() ),
			'shouldTranslateEverything' => Option::shouldTranslateEverything(),
		];

		if ( $editPage ) {
			$existingLanguages = Obj::values( Fns::map( function ( $language ) {
				return Lst::concat( $language, [
					'mapping' => [
						'targetId'   => Obj::pathOr( '', [ 'mapping', 'targetId' ], $language ),
						'targetCode' => Obj::pathOr( '', [ 'mapping', 'targetCode' ], $language ),
					]
				] );
			}, \SitePress_EditLanguages::get_active_languages() ) );

			$data = Lst::concat( $data, [ 'existingLanguages' => $existingLanguages ] );
		} else {
			$data = Lst::concat( $data, [
				'existingLangs'             => Languages::getSecondaryCodes(),
				'defaultLang'               => Languages::getDefaultCode(),
				'settingsUrl'               => admin_url( UIPage::getSettings() ),
			] );
		}

		return [ 'name' => 'wpmlLanguagesUI', 'data' => $data ];
	}


	private static function isEditLanguagePage() {
		return (int) Obj::prop( 'trop', $_GET ) === 1;
	}
}