PATH:
home
/
sparklp6
/
public_html
/
sparklerfilters-org
/
administrator
/
components
/
com_j2store
/
models
<?php /** * @package J2Store * @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org * @license GNU GPL v3 or later */ defined('_JEXEC') or die; //F0FModel class J2StoreModelEupdates extends F0FModel { private $url = 'http://cdn.j2store.net/extensions.json'; public function getUpdates() { $updates = array(); $all_plugins = $this->folder('j2store')->getList(); $json = $this->sendRequest($this->url); $update_data = array(); if(!empty($json)) { $registry = new JRegistry($json); $update_data = $registry->toArray(); }else { return $updates; } //get plugins that have updates foreach($all_plugins as $plugin) { if(isset($update_data[$plugin->element])) { //load manifest cache to get the version $manifest = json_decode($plugin->manifest_cache); if($manifest) { $version = (string) $manifest->version; if(version_compare($update_data[$plugin->element], $version, 'gt')) { $plugin->current_version = $version; $plugin->new_version = $update_data[$plugin->element]; $updates[] = $plugin; } } } } return $updates; } private function sendRequest($request_url) { $curl = curl_init(); // Set some options - we are passing in a useragent too here curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => $request_url )); // Send the request & save response to $resp $resp = curl_exec($curl); // Close request to clear up some resources curl_close($curl); return $resp; } public function getDownloadIdStatus($download_id){ $message_data = array(); if( J2Store::isPro () && !empty($download_id) ){ $url = 'https://www.j2store.org/index.php?j2storetask=getj2subscription&download_id='.$download_id; $json = $this->sendRequest($url); if(!empty($json)) { $registry = new JRegistry($json); $response_data = $registry->toArray(); if(isset($response_data['valid']) && $response_data['valid']){ $config = J2Store::config(); $config->saveOne('downloadid',$download_id); } return $response_data; } } return $message_data; } }
[-] shippings.php
[edit]
[-] coupons.php
[edit]
[-] productoptions.php
[edit]
[-] inventories.php
[edit]
[-] configurations.php
[edit]
[-] orders.php
[edit]
[+]
fields
[-] productprices.php
[edit]
[-] index.html
[edit]
[-] customers.php
[edit]
[-] apps.php
[edit]
[-] productoptionvalues.php
[edit]
[-] myprofiles.php
[edit]
[-] queues.php
[edit]
[-] emailtemplates.php
[edit]
[-] eupdates.php
[edit]
[+]
behavior
[-] reports.php
[edit]
[-] invoicetemplates.php
[edit]
[-] addresses.php
[edit]
[-] taxprofiles.php
[edit]
[-] orderhistories.php
[edit]
[-] manufacturers.php
[edit]
[-] carts.php
[edit]
[-] orderitems.php
[edit]
[-] storeprofiles.php
[edit]
[-] products.php
[edit]
[-] geozones.php
[edit]
[-] currencies.php
[edit]
[-] cartitems.php
[edit]
[-] filtergroups.php
[edit]
[-] orderdownloads.php
[edit]
[-] options.php
[edit]
[-] appstores.php
[edit]
[-] customfields.php
[edit]
[-] vouchers.php
[edit]
[-] vendors.php
[edit]
[-] shippingtroubles.php
[edit]
[-] updates.php
[edit]
[-] variants.php
[edit]
[+]
..
[-] promotions.php
[edit]
[-] cartadmins.php
[edit]
[-] producttags.php
[edit]
[-] payments.php
[edit]