statusAction()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
/**
4
 *
5
 *
6
 * @category Mygento
7
 * @package Mygento_Geoip
8
 * @copyright 2014 NKS LLC. (https://www.mygento.ru)
9
 */
10
class Mygento_Geoip_Adminhtml_GeoipController extends Mage_Adminhtml_Controller_Action
11
{
12
13
    public function statusAction()
14
    {
15
        $_realSize = filesize(Mage::getModel('geoip/info')->getArchivePath());
16
        $_totalSize = Mage::getSingleton('core/session')->getData('_geoip_file_size');
17
        $result = $_totalSize ? $_realSize / $_totalSize * 100 : 0;
18
        $this->getResponse()->setBody($result);
19
    }
20
21
    public function synchronizeAction()
22
    {
23
        $result = Mage::getModel('geoip/info')->update();
24
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
25
    }
26
}
27