php Copyright 2009-2014 Vaimo AB Vaimo reserves all rights in the Prog

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Copyright (c) 2009-2014 Vaimo AB
*
* Vaimo reserves all rights in the Program as delivered. The Program
* or any portion thereof may not be reproduced in any form whatsoever without
* the written consent of Vaimo, except as provided by licence. A licence
* under Vaimo's rights in the Program may be available directly from
* Vaimo.
*
* Disclaimer:
* THIS NOTICE MAY NOT BE REMOVED FROM THE PROGRAM BY ANY USER THEREOF.
* THE PROGRAM IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE PROGRAM OR THE USE OR OTHER DEALINGS
* IN THE PROGRAM.
*
* @category Vaimo
* @package Vaimo_Konga
* @copyright Copyright (c) 2009-2014 Vaimo AB
* @author Igor Sydorenko <igor.sydorenko@vaimo.com>
*/
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('memory_limit', '4096M');
include '../../app/Mage.php';
Mage::app();
if (!Mage_Index_Model_Lock::getInstance()->setLock(Enterprise_Index_Model_Observer::REINDEX_FULL_LOCK, true)) {
exit('Full reindex process is already running.' . PHP_EOL);
}
/** @var $client Enterprise_Mview_Model_Client */
$client = Mage::getModel('enterprise_mview/client');
// Refresh stock item index
$client->init('cataloginventory_stock_status');
$client->execute('enterprise_cataloginventory/index_action_refresh_changelog');
// Refresh product price index
$client->init('catalog_product_index_price');
$client->execute('enterprise_catalog/index_action_product_price_refresh_changelog');
// Refresh product flat index
$client->init('catalog_product_flat');
$client->execute('enterprise_catalog/index_action_product_flat_refresh_changelog');
// Refresh category product index
$client->init('catalog_category_product_index');
$client->execute('enterprise_catalog/index_action_catalog_category_product_refresh_changelog');
Mage_Index_Model_Lock::getInstance()->releaseLock(Enterprise_Index_Model_Observer::REINDEX_FULL_LOCK, true);