<commit_before><?php session_start();
require('./eqdkp.check.php'); //=> Check if an EQdkp Hosting is still existing

define("HOST", "12.34.567.89"); //=> set SERVER ID
define("PORT", 1234); //=> set PORT
define("PATH", "enterprise/control/agent.php"); //=> set Plesk API-Path
define("LOGIN", "username"); //=> set API-Username
define("PASSWD", "password"); //=> set API-Password
define("PROTO_VER", "1.6.6.0");

$mysql = $_SESSION["mysql"]; //=> set MySQL-Database name
$sub_id = '1'; //=> Subdomain ID of the Webspace in Plesk
$proto = PROTO_VER;
$data =<<<EOF
<?xml version="1.0" encoding="UTF-8" ?>
<packet version="$proto">
<database>
    <add-db>
     <webspace-id>$sub_id</webspace-id>
      <name>$mysql</name>
     <type>mysql</type>
    </add-db>
</database>
</packet>
EOF;

function write_callback($ch, $data){
$xml = simplexml_load_string($data);
$mysql_status = $xml->database->{'add-db'}->result->status;
$mysql_id = $xml->database->{'add-db'}->result->id;

if($mysql_status != error){
	$subdomain = $_SESSION["subdomain"];
	$con = mysqli_connect("localhost","mysqluser",'mysqlpasswd');
	mysqli_select_db($con, "guilddrive_v4");
	$sql ="insert aktiv_eqdkp_subscription (mysql_id, subdomain) values ('$mysql_id','$subdomain')";
	mysqli_query($con, $sql);
	exit("&nbsp;<img width=\"11\" height=\"11\" src=\"../images/ok.png\"/>");
}else{
	$mysql_errcode = $xml->database->{'add-db'}->result->errcode;
	$mysql_errtext = $xml->database->{'add-db'}->result->errtext;
	exit("$mysql_errcode: $mysql_errtext");
}
		
return strlen($data);
}

function sendCommand()
{
$url = "https://" . HOST . ":" . PORT . "/" . PATH;

$headers = array(
"HTTP_AUTH_LOGIN: " . LOGIN,
"HTTP_AUTH_PASSWD: " . <PASSWORD>,
"HTTP_PRETTY_PRINT: TRUE",
"Content-Type: text/xml",
);<commit_msg>Update create_eqdkp_mysql.php<commit_after><?php session_start();

define("HOST", "--.--.---.--"); //=> set server IP
define("PORT", "----"); //=> set PORT
define("PATH", "enterprise/control/agent.php"); //=> set plesk api-path
define("LOGIN", "username"); //=> set api-username
define("PASSWD", "password"); //=> set api-password
define("PROTO_VER", "1.6.6.0"); //=> set protocol version

$mysql = $_SESSION["mysql"]; //=> set mysql-database name
$sub_id = '1'; //=> plesk webspace ID from created subdomain
$proto = PROTO_VER;
$data =<<<EOF
<?xml version="1.0" encoding="UTF-8" ?>
<packet version="$proto">
<database>
    <add-db>
     <webspace-id>$sub_id</webspace-id>
      <name>$mysql</name>
     <type>mysql</type>
    </add-db>
</database>
</packet>
EOF;

function write_callback($ch, $data){
$xml = simplexml_load_string($data);
$mysql_status = $xml->database->{'add-db'}->result->status;

if($mysql_status != error){
	exit("&nbsp;<img width=\"11\" height=\"11\" src=\"../images/ok.png\"/>");
	}else{
	$mysql_errcode = $xml->database->{'add-db'}->result->errcode;
	$mysql_errtext = $xml->database->{'add-db'}->result->errtext;
	exit("$mysql_errcode: $mysql_errtext");
	}
		
return strlen($data);
}

function sendCommand()
{
$url = "https://" . HOST . ":" . PORT . "/" . PATH;

$headers = array(
"HTTP_AUTH_LOGIN: " . LOGIN,
"HTTP_AUTH_PASSWD: " . <PASSWORD>WD,
"HTTP_PRETTY_PRINT: TRUE",
"Content-Type: text/xml",
);
{'fraction_non_alphanumeric': 0.2396875, 'fraction_numerical': 0.011875, 'mean_word_length': 4.746858168761221, 'pattern_counts': {'":': 2, '<': 41, '<?xml version=': 2, '>': 77, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 15}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1539609', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1179, 'n_words': 221}