* Add zentao api get.

This commit is contained in:
caoyanyi
2023-03-02 14:51:35 +08:00
parent 7989ef5e0f
commit a261f37af4
3 changed files with 38 additions and 15 deletions
+5 -5
View File
@@ -514,7 +514,7 @@ class adminModel extends model
* @access public
* @return array
*/
public function getExtensionsByAPI($type = 'plugin', $limit = 6, $hasInternet = true)
public function getExtensionsByAPI($type = 'plugin', $limit = 6, $hasInternet = false)
{
if($hasInternet)
{
@@ -643,11 +643,11 @@ class adminModel extends model
*/
public function checkInternet()
{
$timeoutMS = 400;
$curl = curl_init();
$timeout = 3;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $this->config->admin->apiSite);
curl_setopt($curl, CURLOPT_TIMEOUT_MS, $timeoutMS);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, $timeoutMS);
curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);