v4.5.6 : modification appel api screen
This commit is contained in:
parent
4cc7c0897d
commit
537178f31d
@ -24,7 +24,7 @@ class common {
|
||||
const GROUP_MEMBER = 1;
|
||||
const GROUP_MODERATOR = 2;
|
||||
const GROUP_ADMIN = 3;
|
||||
const ZWII_VERSION = '8.4.5';
|
||||
const ZWII_VERSION = '8.4.6';
|
||||
|
||||
public static $actions = [];
|
||||
public static $coreModuleIds = [
|
||||
@ -601,6 +601,7 @@ class common {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Récupérer une copie d'écran du site Web pour le tag image si le fichier n'existe pas
|
||||
* En local, copie du site décran de ZwiiCMS
|
||||
@ -608,11 +609,8 @@ class common {
|
||||
public function makeImageTag () {
|
||||
if (!file_exists('site/file/source/screenshot.png'))
|
||||
{
|
||||
if ( strpos(helper::baseUrl(false),'localhost') > 0 OR strpos(helper::baseUrl(false),'127.0.0.1') > 0) {
|
||||
$site = 'https://ZwiiCMS.com'; } else {
|
||||
$site = helper::baseUrl(false); }
|
||||
|
||||
$googlePagespeedData = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. $site .'&screenshot=true');
|
||||
if ( strpos(helper::baseUrl(false),'localhost') == 0 AND strpos(helper::baseUrl(false),'127.0.0.1') == 0) {
|
||||
$googlePagespeedData = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. helper::baseUrl(false) .'&screenshot=true');
|
||||
$googlePagespeedData = json_decode($googlePagespeedData, true);
|
||||
$screenshot = $googlePagespeedData['screenshot']['data'];
|
||||
$screenshot = str_replace(array('_','-'),array('/','+'),$screenshot);
|
||||
@ -621,6 +619,8 @@ class common {
|
||||
file_put_contents( 'site/file/source/screenshot.png',$data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accède aux données
|
||||
|
Loading…
Reference in New Issue
Block a user