55 * @since 2.4.1
66 * @package LiteSpeed
77 * @subpackage LiteSpeed/src/cdn
8- * @author LiteSpeed Technologies <info@litespeedtech.com>
98 */
109
1110namespace LiteSpeed \CDN ;
@@ -26,31 +25,13 @@ class Quic extends Base {
2625 const LOG_TAG = '☁️ ' ;
2726 const TYPE_REG = 'reg ' ;
2827
29- /**
30- * Summary data for CDN configuration.
31- *
32- * @var array
33- */
34- protected $ summary ;
35-
3628 /**
3729 * Force sync flag.
3830 *
3931 * @var bool
4032 */
4133 private $ force = false ;
4234
43- /**
44- * Quic constructor.
45- *
46- * Initializes the summary data.
47- *
48- * @since 2.4.1
49- */
50- public function __construct () {
51- $ this ->summary = self ::get_summary ();
52- }
53-
5435 /**
5536 * Notify CDN new config updated
5637 *
@@ -62,14 +43,15 @@ public function __construct() {
6243 * @return bool|void
6344 */
6445 public function try_sync_conf ( $ force = false ) {
46+ $ cloud_summary = Cloud::get_summary ();
6547 if ($ force ) {
6648 $ this ->force = $ force ;
6749 }
6850
6951 if (!$ this ->conf (self ::O_CDN_QUIC )) {
70- if (!empty ($ this -> summary ['conf_md5 ' ])) {
52+ if (!empty ($ cloud_summary ['conf_md5 ' ])) {
7153 self ::debug ('❌ No QC CDN, clear conf md5! ' );
72- self ::save_summary (array ( 'conf_md5 ' => '' ));
54+ Cloud ::save_summary (array ( 'conf_md5 ' => '' ));
7355 }
7456 return false ;
7557 }
@@ -122,19 +104,19 @@ public function try_sync_conf( $force = false ) {
122104 }
123105
124106 $ conf_md5 = md5 (wp_json_encode ($ options_for_md5 ));
125- if (!empty ($ this -> summary ['conf_md5 ' ])) {
126- if ($ conf_md5 === $ this -> summary ['conf_md5 ' ]) {
107+ if (!empty ($ cloud_summary ['conf_md5 ' ])) {
108+ if ($ conf_md5 === $ cloud_summary ['conf_md5 ' ]) {
127109 if (!$ this ->force ) {
128110 self ::debug ('Bypass sync conf to QC due to same md5 ' , $ conf_md5 );
129111 return ;
130112 }
131113 self ::debug ('!!!Force sync conf even same md5 ' );
132114 } else {
133- self ::debug ('[conf_md5] ' . $ conf_md5 . ' [existing_conf_md5] ' . $ this -> summary ['conf_md5 ' ]);
115+ self ::debug ('[conf_md5] ' . $ conf_md5 . ' [existing_conf_md5] ' . $ cloud_summary ['conf_md5 ' ]);
134116 }
135117 }
136118
137- self ::save_summary (array ( 'conf_md5 ' => $ conf_md5 ));
119+ Cloud ::save_summary (array ( 'conf_md5 ' => $ conf_md5 ));
138120 self ::debug ('sync conf to QC ' );
139121
140122 Cloud::post (Cloud::SVC_D_SYNC_CONF , $ options_for_md5 );
0 commit comments