<?php
namespace modul_application;
class ESPCM_InstallDB {
public static function get_write_file() {
$func_items[] = array('name' => './');
$func_items[] = array('name' => './espcms_datacache/');
$func_items[] = array('name' => './espcms_includes/');
$func_items[] = array('name' => './upload/');
$func_items[] = array('name' => './upfile/');
return $func_items;
}
public static function connect_service($ac_name = array(), $post = array(), $isjson = true) {
global $espcms_db_version;
if (!$ac_name || !preg_match("/^[\w]+$/i", $ac_name)) {
return false;
}
$post['siteurl'] = espcms_host('AP');
$post['vol'] = $espcms_db_version;
$send_add = espcms_decrypt(ESPCMS_QUERST_ADD_LONG, ESPCMS_ADD_ENCODE);
$response = espcms_curl_post($send_add . $ac_name, espcms_array_to_xml($post));
if (!$response) {
return false;
}
if ($isjson) {
$response_josn = json_decode($response, true);
if (is_array($response_josn)) {
return $response_josn;
} else {
return false;
}
} elseif (!$isjson && $response) {
return $response;
} else {
return false;
}
}
}