Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.8.0
- * @ Author : DeZender
- * @ Release on : 25.09.2017
- * @ Official site : http://DeZender.Net
- *
- */
- namespace App\Libraries;
- class APIStoreService
- {
- const SERVER = 'https://portal.cnv.vn/api/';
- public $client = null;
- public $cache = null;
- public function __construct(\GuzzleHttp\Client $client, \Illuminate\Contracts\Cache\Factory $cache)
- {
- $this->client = $client;
- $this->cache = $cache;
- }
- /**
- * @return void
- */
- public function checkForUpdateForCore()
- {
- if (!($this->cache->has( 'check_for_update_for_core' ))) {
- $url = static::SERVER . 'check-for-update/core.json';
- $request = $this->client->request( 'GET', $url );
- if ($request->getStatusCode( ) == 200) {
- app( 'helper' )->load( 'utilities' );
- $content = json_decode( $request->getBody( ), true );
- Storage::put( 'check_for_update_for_core.db', serialize( $content['data'] ) );
- $cfg = config( 'cnv' );
- $cfg['latest_version'] = strval( $content['latest_version'] );
- $contentCfg = '<?php' . "\n" . 'return ' . var_export_short( $cfg ) . ';';
- @file_put_contents( config_path( 'cnv.php' ), $contentCfg );
- $this->cache->put( 'check_for_update_for_core', true, 60 * 24 );
- }
- }
- }
- public function getAllModules($page = 1)
- {
- $url = static::SERVER . 'modules.json?page=' . $page;
- $request = $this->client->request( 'GET', $url );
- ........................................................................
- ........................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement