Version Notes
It requires an account on our servers.
Download this release
Release Info
Developer | SonicAnalytics |
Extension | Sonicanalytics_Xtractor |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/Sonicanalytics/Extractor/Helper/Data.php +3 -0
- app/code/community/Sonicanalytics/Extractor/Helper/dispatch.php +113 -0
- app/code/community/Sonicanalytics/Extractor/Helper/exportModel.php +107 -0
- app/code/community/Sonicanalytics/Extractor/controllers/IndexController.php +24 -0
- app/code/community/Sonicanalytics/Extractor/etc/arquivos_criados.txt +40 -0
- app/code/community/Sonicanalytics/Extractor/etc/config.xml +152 -0
- app/code/community/Sonicanalytics/Extractor/etc/config.xml_funcionando +139 -0
- app/code/community/Sonicanalytics/Extractor/etc/system.xml +106 -0
- app/etc/modules/Sonicanalytics_Extractor.xml +29 -0
- package.xml +28 -0
app/code/community/Sonicanalytics/Extractor/Helper/Data.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sonicanalytics_Extractor_Helper_Data extends Mage_Core_Helper_Abstract {
|
3 |
+
}
|
app/code/community/Sonicanalytics/Extractor/Helper/dispatch.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once '../../../../../Mage.php';
|
4 |
+
/**
|
5 |
+
* This file is called from CLI, so that's why it's including Mage.php directly.
|
6 |
+
*
|
7 |
+
* @author Luiz Gomes <luiz@sonictempus.com>
|
8 |
+
*/
|
9 |
+
|
10 |
+
umask ( 0 );
|
11 |
+
Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );
|
12 |
+
|
13 |
+
echo Mage::getStoreConfig('sonicanalytics_extractor/systab_option/debug_mode');
|
14 |
+
|
15 |
+
define("PAGE_SIZE",1000);
|
16 |
+
// exportModel("catalog/product","catalog_product",43,150);
|
17 |
+
exportFiles();
|
18 |
+
echo "It's over!";
|
19 |
+
|
20 |
+
function exportFiles(){
|
21 |
+
$models = array(
|
22 |
+
"sales/order_item" => "sales_order_item",
|
23 |
+
"sales/order" => "sales_order",
|
24 |
+
"catalog/category" => "catalog_category",
|
25 |
+
"catalog/product" => "catalog_product",
|
26 |
+
"customer/address" => "customer_address",
|
27 |
+
"customer/customer" => "customer_customer"
|
28 |
+
);
|
29 |
+
foreach ($models as $model => $file){
|
30 |
+
$modelSize = Mage::getModel($model)->getCollection()->getSize();
|
31 |
+
for ($i=0; $i < $modelSize; $i += PAGE_SIZE * (PAGE_SIZE/1000)) {
|
32 |
+
// exportModel ( $model, $file, $i/PAGE_SIZE + 1, $i/PAGE_SIZE *(PAGE_SIZE/1000) +1 );
|
33 |
+
// se use this for memory management. the second process is very memory consuming,
|
34 |
+
// and splitting it in two process makes a better performance.
|
35 |
+
|
36 |
+
$shell_command = sprintf ("php -f exportModel.php -- m %s f %s p %d e %d\n", escapeshellcmd($model), escapeshellcmd($file), $i/PAGE_SIZE + 1, $i/PAGE_SIZE *(PAGE_SIZE/1000) +1 );
|
37 |
+
echo ($shell_command);
|
38 |
+
//system($comando);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
function exportModel($modelToExport, $filename, $page=1, $endPage=1 ) {
|
44 |
+
echo "Initial Memory usage = " . memory_get_usage() . "\n";
|
45 |
+
echo "Starting page $page and $endPage\n";
|
46 |
+
$k = ($page-1) * PAGE_SIZE/1000; //file sequence
|
47 |
+
$fileToExport = Mage::getBaseDir () . '\\var\\export\\' . $filename;
|
48 |
+
|
49 |
+
$collection = Mage::getModel ( $modelToExport )->getCollection ()->setPage ( $page, PAGE_SIZE );
|
50 |
+
$count = $collection->count();
|
51 |
+
$lastPage = $count == PAGE_SIZE;
|
52 |
+
$partial = null;
|
53 |
+
|
54 |
+
// do a loop on the entire collection, for each 5000
|
55 |
+
while ( $count != 0 ) {
|
56 |
+
$partial = new Varien_Data_Collection ( );
|
57 |
+
// echo "count = $count, page = $page, k = $k\n";
|
58 |
+
flush();
|
59 |
+
|
60 |
+
$j = 0;
|
61 |
+
// fazer um loop numa pagina
|
62 |
+
foreach ( $collection->getIterator () as $i => $model ) {
|
63 |
+
$loaded = Mage::getModel ( $modelToExport )->load ( $model->getId () );
|
64 |
+
|
65 |
+
// for some reason, the framework doesn't load the categories (and special_prices also!).
|
66 |
+
// we have to load them manually and then convert it from array to flat
|
67 |
+
if ($modelToExport == "catalog/product"){
|
68 |
+
$loaded->getCategoryIds();
|
69 |
+
$ids = $loaded->getCategoryIds();
|
70 |
+
if (!empty($ids))
|
71 |
+
$categories = $ids[0]; // only the first one
|
72 |
+
/*foreach ($ids as $id){
|
73 |
+
$categories = $categories . "$id;";
|
74 |
+
}*/
|
75 |
+
$loaded->setData("categories", $categories);
|
76 |
+
}
|
77 |
+
$partial->addItem ( $loaded );
|
78 |
+
unset($loaded);
|
79 |
+
|
80 |
+
$j ++;
|
81 |
+
if ($j >= 1000) { // if we get to 1000, write a file
|
82 |
+
//$partial->load ();
|
83 |
+
writeXml ( $partial, $fileToExport, $k++ );
|
84 |
+
$partial->clear ();
|
85 |
+
//unset($partial);
|
86 |
+
$j = 0;
|
87 |
+
}
|
88 |
+
|
89 |
+
}// page
|
90 |
+
$collection->clear();
|
91 |
+
if ($k >= $endPage * PAGE_SIZE/1000 || $count < PAGE_SIZE) // last page
|
92 |
+
break;
|
93 |
+
$collection = Mage::getModel ( $modelToExport )->getCollection ()->setPage ( ++ $page, PAGE_SIZE );
|
94 |
+
$count = $collection->count ();
|
95 |
+
}
|
96 |
+
if ($partial->count() > 0)
|
97 |
+
writeXml ( $partial, $fileToExport, $k ++ );
|
98 |
+
|
99 |
+
unset($partial, $loaded, $collection, $categories, $ids, $count, $page, $j, $k, $fileToExport );
|
100 |
+
|
101 |
+
//for ($i=0; $i < 100; $i++){
|
102 |
+
}
|
103 |
+
function writeXml($collection, $fileToWrite, $seq) {
|
104 |
+
$ordered = "00000" . strval($seq);
|
105 |
+
$number = substr($ordered, -5);
|
106 |
+
|
107 |
+
$fh = fopen ( $fileToWrite . "_$number.xml", "a" );
|
108 |
+
fwrite ( $fh, $collection->toXml () );
|
109 |
+
fclose ( $fh );
|
110 |
+
unset($collection, $fileToWrite, $seq);
|
111 |
+
echo "final = " . memory_get_usage() . "\n";
|
112 |
+
|
113 |
+
}
|
app/code/community/Sonicanalytics/Extractor/Helper/exportModel.php
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
require_once 'app/Mage.php';
|
3 |
+
/**
|
4 |
+
* export the model
|
5 |
+
*
|
6 |
+
* @author Luiz Gomes <luiz@sonictempus.com>
|
7 |
+
*/
|
8 |
+
|
9 |
+
umask ( 0 );
|
10 |
+
Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );
|
11 |
+
|
12 |
+
|
13 |
+
define("PAGE_SIZE",1000);
|
14 |
+
$opcoes = getopt("m:f:p:e:", $argv);
|
15 |
+
$model = "customer/customer";//$opcoes["m"];
|
16 |
+
$file = "customer_customer";// $opcoes["f"];
|
17 |
+
$page = 125; //$opcoes["p"];
|
18 |
+
$endPage = 124; $opcoes["e"];
|
19 |
+
exportModel($model, $file, $page, $endPage);
|
20 |
+
|
21 |
+
|
22 |
+
function getopt($opts, $argv) {
|
23 |
+
$opts_array = explode(':', $opts);
|
24 |
+
foreach($opts_array as $opt) {
|
25 |
+
$key = array_search($opt, $argv);
|
26 |
+
if($key && !in_array($argv[$key+1], $opts_array)) {
|
27 |
+
$result[$opt] = trim($argv[$key+1]);
|
28 |
+
} elseif($key) {
|
29 |
+
$result[$opt] = '';
|
30 |
+
}
|
31 |
+
}
|
32 |
+
return $result;
|
33 |
+
}
|
34 |
+
|
35 |
+
function exportModel($modelToExport, $filename, $page=1, $endPage=1 ) {
|
36 |
+
echo "inicial = " . memory_get_usage() . "\n";
|
37 |
+
echo "Iniciando $page e $endPage\n";
|
38 |
+
$k = ($page-1) * PAGE_SIZE/1000; //file sequence
|
39 |
+
$fileToExport = Mage::getBaseDir () . '\\var\\export\\' . $filename;
|
40 |
+
|
41 |
+
$collection = Mage::getModel ( $modelToExport )->getCollection ()->setPage ( $page, PAGE_SIZE );
|
42 |
+
$count = $collection->count();
|
43 |
+
$lastPage = $count == PAGE_SIZE;
|
44 |
+
$partial = null;
|
45 |
+
|
46 |
+
// fazer um loop na colecao toda, a cada 5000
|
47 |
+
while ( $count != 0 ) {
|
48 |
+
$partial = new Varien_Data_Collection ( );
|
49 |
+
echo "count = $count, page = $page, k = $k\n";
|
50 |
+
flush();
|
51 |
+
|
52 |
+
$j = 0;
|
53 |
+
// fazer um loop numa pagina
|
54 |
+
foreach ( $collection->getIterator () as $i => $model ) {
|
55 |
+
$loaded = Mage::getModel ( $modelToExport )->load ( $model->getId () );
|
56 |
+
|
57 |
+
// for some reason, the framework doesn't load the categories (and special_prices also!).
|
58 |
+
// we have to load them manually and then convert it from array to flat
|
59 |
+
if ($modelToExport == "catalog/product"){
|
60 |
+
$loaded->getCategoryIds();
|
61 |
+
$ids = $loaded->getCategoryIds();
|
62 |
+
if (!empty($ids))
|
63 |
+
$categories = $ids[0]; // only the first one
|
64 |
+
/*foreach ($ids as $id){
|
65 |
+
$categories = $categories . "$id;";
|
66 |
+
}*/
|
67 |
+
$loaded->setData("categories", $categories);
|
68 |
+
}
|
69 |
+
$partial->addItem ( $loaded );
|
70 |
+
// unset($loaded);
|
71 |
+
|
72 |
+
$j ++;
|
73 |
+
if ($j >= 1000) { // se chegar a 1000, escrever um arquivo
|
74 |
+
//$partial->load ();
|
75 |
+
writeXml ( $partial, $fileToExport, $k++ );
|
76 |
+
$partial->clear ();
|
77 |
+
//unset($partial);
|
78 |
+
$j = 0;
|
79 |
+
}
|
80 |
+
|
81 |
+
}// pagina
|
82 |
+
$collection->clear();
|
83 |
+
if ($k >= $endPage * PAGE_SIZE/1000 || $count < PAGE_SIZE) {// last page
|
84 |
+
echo "breaking\n";
|
85 |
+
break;
|
86 |
+
}
|
87 |
+
$collection = Mage::getModel ( $modelToExport )->getCollection ()->setPage ( ++ $page, PAGE_SIZE );
|
88 |
+
$count = $collection->count ();
|
89 |
+
}
|
90 |
+
if ($partial->count() > 0)
|
91 |
+
writeXml ( $partial, $fileToExport, $k ++ );
|
92 |
+
|
93 |
+
// unset($partial, $loaded, $collection, $categories, $ids, $count, $page, $j, $k, $fileToExport );
|
94 |
+
|
95 |
+
//for ($i=0; $i < 100; $i++){
|
96 |
+
}
|
97 |
+
function writeXml($collection, $fileToWrite, $seq) {
|
98 |
+
$ordered = "00000" . strval($seq);
|
99 |
+
$number = substr($ordered, -5);
|
100 |
+
|
101 |
+
$fh = fopen ( $fileToWrite . "_$number.xml", "a" );
|
102 |
+
fwrite ( $fh, $collection->toXml () );
|
103 |
+
fclose ( $fh );
|
104 |
+
unset($collection, $fileToWrite, $seq);
|
105 |
+
echo "final = " . memory_get_usage() . "\n";
|
106 |
+
|
107 |
+
}
|
app/code/community/Sonicanalytics/Extractor/controllers/IndexController.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Sonicanalytics_Extractor_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* Index action
|
6 |
+
*/
|
7 |
+
public function indexAction()
|
8 |
+
{
|
9 |
+
//$block = new Mage_Core_Block_Text ();
|
10 |
+
// $block -> setText (" ");
|
11 |
+
//echo $block -> toHtml ();
|
12 |
+
$model_folder = Mage::getBaseDir () . '/var/export/';
|
13 |
+
$model_file = $model_folder . "/sales_order_item.rar";
|
14 |
+
$handle = fopen($model_file, "rb");
|
15 |
+
$contents = '';
|
16 |
+
while (!feof($handle)) {
|
17 |
+
$contents .= fread($handle, 8192);
|
18 |
+
}
|
19 |
+
fclose($handle);
|
20 |
+
|
21 |
+
$this->_prepareDownloadResponse("sales_order_item.rar", $contents);
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
app/code/community/Sonicanalytics/Extractor/etc/arquivos_criados.txt
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
app/etc/modules/Sonicanalytics_Extractor.xml
|
3 |
+
|
4 |
+
app/code/local/Sonicanalytics/Extractor/Block/Extractor.php
|
5 |
+
|
6 |
+
app/code/local/Sonicanalytics/Extractor/controllers/IndexController.php
|
7 |
+
|
8 |
+
app/code/local/Sonicanalytics/Extractor/etc/config.xml
|
9 |
+
|
10 |
+
app/code/local/Sonicanalytics/Extractor/Model/Extractor.php
|
11 |
+
|
12 |
+
app/code/local/Sonicanalytics/Extractor/Model/Mysql4/Extractor.php
|
13 |
+
|
14 |
+
app/code/local/Sonicanalytics/Extractor/Model/Mysql4/Extractor/Collection.php
|
15 |
+
|
16 |
+
app/code/local/Sonicanalytics/Extractor/Model/Status.php
|
17 |
+
|
18 |
+
app/code/local/Sonicanalytics/Extractor/sql/extractor_setup/mysql4-install-0.1.0.php
|
19 |
+
|
20 |
+
app/design/frontend/default/default/layout/extractor.xml
|
21 |
+
|
22 |
+
app/design/frontend/default/default/template/extractor/extractor.phtml
|
23 |
+
|
24 |
+
app/code/local/Sonicanalytics/Extractor/Block/Adminhtml/Extractor.php
|
25 |
+
|
26 |
+
app/code/local/Sonicanalytics/Extractor/Block/Adminhtml/Extractor/Edit.php
|
27 |
+
|
28 |
+
app/code/local/Sonicanalytics/Extractor/Block/Adminhtml/Extractor/Grid.php
|
29 |
+
|
30 |
+
app/code/local/Sonicanalytics/Extractor/Block/Adminhtml/Extractor/Edit/Form.php
|
31 |
+
|
32 |
+
app/code/local/Sonicanalytics/Extractor/Block/Adminhtml/Extractor/Edit/Tabs.php
|
33 |
+
|
34 |
+
app/code/local/Sonicanalytics/Extractor/Block/Adminhtml/Extractor/Edit/Tab/Form.php
|
35 |
+
|
36 |
+
app/code/local/Sonicanalytics/Extractor/controllers/Adminhtml/ExtractorController.php
|
37 |
+
|
38 |
+
app/code/local/Sonicanalytics/Extractor/Helper/Data.php
|
39 |
+
|
40 |
+
app/design/adminhtml/default/default/layout/extractor.xml
|
app/code/community/Sonicanalytics/Extractor/etc/config.xml
ADDED
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Sonicanalytics
|
5 |
+
* @package Sonicanalytics_Extractor
|
6 |
+
* @author Luiz Gomes <luiz@sonictempus.com>
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Sonicanalytics_Extractor>
|
13 |
+
<version>0.1.0</version>
|
14 |
+
</Sonicanalytics_Extractor>
|
15 |
+
</modules>
|
16 |
+
<global>
|
17 |
+
<helpers>
|
18 |
+
<sonicanalytics_extractor>
|
19 |
+
<class>Sonicanalytics_Extractor_Helper</class>
|
20 |
+
</sonicanalytics_extractor>
|
21 |
+
</helpers>
|
22 |
+
<blocks>
|
23 |
+
<sonicanalytics_extractor>
|
24 |
+
<class>Sonicanalytics_Extractor_Block</class>
|
25 |
+
</sonicanalytics_extractor>
|
26 |
+
</blocks>
|
27 |
+
</global>
|
28 |
+
|
29 |
+
<frontend>
|
30 |
+
<routers>
|
31 |
+
<sonicanalytics_extractor>
|
32 |
+
<use>standard</use>
|
33 |
+
<args>
|
34 |
+
<module>Sonicanalytics_Extractor</module>
|
35 |
+
<frontName>extractor</frontName>
|
36 |
+
</args>
|
37 |
+
</sonicanalytics_extractor>
|
38 |
+
</routers>
|
39 |
+
</frontend>
|
40 |
+
|
41 |
+
<adminhtml>
|
42 |
+
<acl>
|
43 |
+
<resources>
|
44 |
+
<admin>
|
45 |
+
<children>
|
46 |
+
<system>
|
47 |
+
<children>
|
48 |
+
<config>
|
49 |
+
<children>
|
50 |
+
<sonicanalytics_extractor>
|
51 |
+
<title>SonicAnalytics Xtractor</title>
|
52 |
+
</sonicanalytics_extractor>
|
53 |
+
</children>
|
54 |
+
</config>
|
55 |
+
</children>
|
56 |
+
</system>
|
57 |
+
</children>
|
58 |
+
</admin>
|
59 |
+
</resources>
|
60 |
+
</acl>
|
61 |
+
<!--
|
62 |
+
<menu>
|
63 |
+
<extractor module="sonicanalytics_extractor">
|
64 |
+
<title>Business Intelligence</title>
|
65 |
+
<sort_order>71</sort_order>
|
66 |
+
<children>
|
67 |
+
<items module="sonicanalytics_extractor">
|
68 |
+
<title>SonicAnalytics Xtractor</title>
|
69 |
+
<sort_order>0</sort_order>
|
70 |
+
<action>extractor</action>
|
71 |
+
</items>
|
72 |
+
</children>
|
73 |
+
</extractor>
|
74 |
+
</menu>
|
75 |
+
<acl>
|
76 |
+
<resources>
|
77 |
+
<all>
|
78 |
+
<title>Allow Everything</title>
|
79 |
+
</all>
|
80 |
+
<admin>
|
81 |
+
<children>
|
82 |
+
<Sonicanalytics_Extractor>
|
83 |
+
<title>SonicAnalytics Xtractor</title>
|
84 |
+
<sort_order>10</sort_order>
|
85 |
+
</Sonicanalytics_Extractor>
|
86 |
+
</children>
|
87 |
+
</admin>
|
88 |
+
</resources>
|
89 |
+
</acl>
|
90 |
+
|
91 |
+
<layout>
|
92 |
+
<updates>
|
93 |
+
<extractor>
|
94 |
+
<file>extractor.xml</file>
|
95 |
+
</extractor>
|
96 |
+
</updates>
|
97 |
+
</layout>
|
98 |
+
</adminhtml>
|
99 |
+
|
100 |
+
<global>
|
101 |
+
|
102 |
+
<models>
|
103 |
+
<extractor>
|
104 |
+
<class>Sonicanalytics_Extractor_Model</class>
|
105 |
+
<resourceModel>extractor_mysql4</resourceModel>
|
106 |
+
</extractor>
|
107 |
+
<extractor_mysql4>
|
108 |
+
<class>Sonicanalytics_Extractor_Model_Mysql4</class>
|
109 |
+
<entities>
|
110 |
+
<extractor>
|
111 |
+
<table>extractor</table>
|
112 |
+
</extractor>
|
113 |
+
</entities>
|
114 |
+
</extractor_mysql4>
|
115 |
+
</models>
|
116 |
+
<resources>
|
117 |
+
<extractor_setup>
|
118 |
+
<setup>
|
119 |
+
<module>Sonicanalytics_Extractor</module>
|
120 |
+
</setup>
|
121 |
+
<connection>
|
122 |
+
<use>core_setup</use>
|
123 |
+
</connection>
|
124 |
+
</extractor_setup>
|
125 |
+
<extractor_write>
|
126 |
+
<connection>
|
127 |
+
<use>core_write</use>
|
128 |
+
</connection>
|
129 |
+
</extractor_write>
|
130 |
+
<extractor_read>
|
131 |
+
<connection>
|
132 |
+
<use>core_read</use>
|
133 |
+
</connection>
|
134 |
+
</extractor_read>
|
135 |
+
</resources>
|
136 |
+
|
137 |
+
<blocks>
|
138 |
+
<extractor>
|
139 |
+
<class>Sonicanalytics_Extractor_Block</class>
|
140 |
+
</extractor>
|
141 |
+
</blocks>
|
142 |
+
|
143 |
+
<helpers>
|
144 |
+
<sonicanalytics_extractor>
|
145 |
+
<class>Sonicanalytics_Extractor_Helper</class>
|
146 |
+
</sonicanalytics_extractor>
|
147 |
+
</helpers>
|
148 |
+
|
149 |
+
</global>
|
150 |
+
-->
|
151 |
+
</adminhtml>
|
152 |
+
</config>
|
app/code/community/Sonicanalytics/Extractor/etc/config.xml_funcionando
ADDED
@@ -0,0 +1,139 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @category Sonicanalytics
|
5 |
+
* @package Sonicanalytics_Extractor
|
6 |
+
* @author Luiz Gomes <luiz@sonictempus.com>
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
+
-->
|
10 |
+
<config>
|
11 |
+
<modules>
|
12 |
+
<Sonicanalytics_Extractor>
|
13 |
+
<version>0.1.0</version>
|
14 |
+
</Sonicanalytics_Extractor>
|
15 |
+
</modules>
|
16 |
+
<global>
|
17 |
+
<helpers>
|
18 |
+
<sonicanalytics_extractor>
|
19 |
+
<class>Sonicanalytics_Extractor_Helper</class>
|
20 |
+
</sonicanalytics_extractor>
|
21 |
+
</helpers>
|
22 |
+
</global>
|
23 |
+
|
24 |
+
<adminhtml>
|
25 |
+
<acl>
|
26 |
+
<resources>
|
27 |
+
<admin>
|
28 |
+
<children>
|
29 |
+
<system>
|
30 |
+
<children>
|
31 |
+
<config>
|
32 |
+
<children>
|
33 |
+
<sonicanalytics_extractor>
|
34 |
+
<title>SonicAnalytics Xtractor</title>
|
35 |
+
</sonicanalytics_extractor>
|
36 |
+
</children>
|
37 |
+
</config>
|
38 |
+
</children>
|
39 |
+
</system>
|
40 |
+
</children>
|
41 |
+
</admin>
|
42 |
+
</resources>
|
43 |
+
</acl>
|
44 |
+
</adminhtml>
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
<!--
|
49 |
+
|
50 |
+
<adminhtml>
|
51 |
+
<menu>
|
52 |
+
<extractor module="extractor">
|
53 |
+
<title>Extractor</title>
|
54 |
+
<sort_order>71</sort_order>
|
55 |
+
<children>
|
56 |
+
<items module="extractor">
|
57 |
+
<title>Manage Items</title>
|
58 |
+
<sort_order>0</sort_order>
|
59 |
+
<action>extractor/adminhtml_extractor</action>
|
60 |
+
</items>
|
61 |
+
</children>
|
62 |
+
</extractor>
|
63 |
+
</menu>
|
64 |
+
<acl>
|
65 |
+
<resources>
|
66 |
+
<all>
|
67 |
+
<title>Allow Everything</title>
|
68 |
+
</all>
|
69 |
+
<admin>
|
70 |
+
<children>
|
71 |
+
<Sonicanalytics_Extractor>
|
72 |
+
<title>Extractor Module</title>
|
73 |
+
<sort_order>10</sort_order>
|
74 |
+
</Sonicanalytics_Extractor>
|
75 |
+
</children>
|
76 |
+
</admin>
|
77 |
+
</resources>
|
78 |
+
</acl>
|
79 |
+
<layout>
|
80 |
+
<updates>
|
81 |
+
<extractor>
|
82 |
+
<file>extractor.xml</file>
|
83 |
+
</extractor>
|
84 |
+
</updates>
|
85 |
+
</layout>
|
86 |
+
</adminhtml>
|
87 |
+
|
88 |
+
<global>
|
89 |
+
|
90 |
+
<models>
|
91 |
+
<extractor>
|
92 |
+
<class>Sonicanalytics_Extractor_Model</class>
|
93 |
+
<resourceModel>extractor_mysql4</resourceModel>
|
94 |
+
</extractor>
|
95 |
+
<extractor_mysql4>
|
96 |
+
<class>Sonicanalytics_Extractor_Model_Mysql4</class>
|
97 |
+
<entities>
|
98 |
+
<extractor>
|
99 |
+
<table>extractor</table>
|
100 |
+
</extractor>
|
101 |
+
</entities>
|
102 |
+
</extractor_mysql4>
|
103 |
+
</models>
|
104 |
+
<resources>
|
105 |
+
<extractor_setup>
|
106 |
+
<setup>
|
107 |
+
<module>Sonicanalytics_Extractor</module>
|
108 |
+
</setup>
|
109 |
+
<connection>
|
110 |
+
<use>core_setup</use>
|
111 |
+
</connection>
|
112 |
+
</extractor_setup>
|
113 |
+
<extractor_write>
|
114 |
+
<connection>
|
115 |
+
<use>core_write</use>
|
116 |
+
</connection>
|
117 |
+
</extractor_write>
|
118 |
+
<extractor_read>
|
119 |
+
<connection>
|
120 |
+
<use>core_read</use>
|
121 |
+
</connection>
|
122 |
+
</extractor_read>
|
123 |
+
</resources>
|
124 |
+
|
125 |
+
<blocks>
|
126 |
+
<extractor>
|
127 |
+
<class>Sonicanalytics_Extractor_Block</class>
|
128 |
+
</extractor>
|
129 |
+
</blocks>
|
130 |
+
|
131 |
+
<helpers>
|
132 |
+
<sonicanalytics_extractor>
|
133 |
+
<class>Sonicanalytics_Extractor_Helper</class>
|
134 |
+
</sonicanalytics_extractor>
|
135 |
+
</helpers>
|
136 |
+
|
137 |
+
</global>
|
138 |
+
-->
|
139 |
+
</config>
|
app/code/community/Sonicanalytics/Extractor/etc/system.xml
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<sonicanalytics_extractor translate="label"
|
5 |
+
module="sonicanalytics_extractor">
|
6 |
+
<label>SonicAnalytics Extractor</label>
|
7 |
+
<sort_order>1</sort_order>
|
8 |
+
</sonicanalytics_extractor>
|
9 |
+
</tabs>
|
10 |
+
|
11 |
+
<sections>
|
12 |
+
<sonicanalytics_extractor translate="label" module="sonicanalytics_extractor">
|
13 |
+
<label>SonicAnalytics Xtractor</label>
|
14 |
+
<tab>general</tab>
|
15 |
+
<frontend_type>text</frontend_type>
|
16 |
+
<sort_order>200</sort_order>
|
17 |
+
<show_in_default>1</show_in_default>
|
18 |
+
<show_in_website>1</show_in_website>
|
19 |
+
<show_in_store>1</show_in_store>
|
20 |
+
<groups>
|
21 |
+
<systab_option translate="label">
|
22 |
+
<label>Xtractor Options</label>
|
23 |
+
<frontend_type>text</frontend_type>
|
24 |
+
<sort_order>10</sort_order>
|
25 |
+
<show_in_default>1</show_in_default>
|
26 |
+
<show_in_website>1</show_in_website>
|
27 |
+
<show_in_store>1</show_in_store>
|
28 |
+
<fields>
|
29 |
+
<login translate="label">
|
30 |
+
<label>Login</label>
|
31 |
+
<frontend_type>text</frontend_type>
|
32 |
+
<sort_order>1</sort_order>
|
33 |
+
<show_in_default>1</show_in_default>
|
34 |
+
<show_in_website>1</show_in_website>
|
35 |
+
<show_in_store>1</show_in_store>
|
36 |
+
</login>
|
37 |
+
<password translate="label">
|
38 |
+
<label>Password</label>
|
39 |
+
<frontend_type>password</frontend_type>
|
40 |
+
<sort_order>2</sort_order>
|
41 |
+
<show_in_default>1</show_in_default>
|
42 |
+
<show_in_website>1</show_in_website>
|
43 |
+
<show_in_store>1</show_in_store>
|
44 |
+
</password>
|
45 |
+
<tar_location translate="label">
|
46 |
+
<label>tar location</label>
|
47 |
+
<frontend_type>text</frontend_type>
|
48 |
+
<sort_order>3</sort_order>
|
49 |
+
<show_in_default>3</show_in_default>
|
50 |
+
<show_in_website>1</show_in_website>
|
51 |
+
<show_in_store>1</show_in_store>
|
52 |
+
<comment>In case it's not accessible on the default path</comment>
|
53 |
+
</tar_location>
|
54 |
+
<gzip_location translate="label">
|
55 |
+
<label>gzip location</label>
|
56 |
+
<frontend_type>text</frontend_type>
|
57 |
+
<sort_order>4</sort_order>
|
58 |
+
<show_in_default>1</show_in_default>
|
59 |
+
<show_in_website>1</show_in_website>
|
60 |
+
<show_in_store>1</show_in_store>
|
61 |
+
<comment>In case it's not accessible on the default path</comment>
|
62 |
+
</gzip_location>
|
63 |
+
<scp_location translate="label">
|
64 |
+
<label>SCP location</label>
|
65 |
+
<frontend_type>text</frontend_type>
|
66 |
+
<sort_order>5</sort_order>
|
67 |
+
<show_in_default>1</show_in_default>
|
68 |
+
<show_in_website>1</show_in_website>
|
69 |
+
<show_in_store>1</show_in_store>
|
70 |
+
<comment>In case it's not accessible on the default path</comment>
|
71 |
+
</scp_location>
|
72 |
+
<server_address translate="label">
|
73 |
+
<label>Server Address</label>
|
74 |
+
<frontend_type>text</frontend_type>
|
75 |
+
<sort_order>5</sort_order>
|
76 |
+
<show_in_default>1</show_in_default>
|
77 |
+
<show_in_website>1</show_in_website>
|
78 |
+
<show_in_store>1</show_in_store>
|
79 |
+
<comment>Only if required. Leave it blank as default</comment>
|
80 |
+
</server_address>
|
81 |
+
<last_update translate="label">
|
82 |
+
<label>Last Update</label>
|
83 |
+
<frontend_type>text</frontend_type>
|
84 |
+
<sort_order>6</sort_order>
|
85 |
+
<show_in_default>1</show_in_default>
|
86 |
+
<show_in_website>1</show_in_website>
|
87 |
+
<show_in_store>1</show_in_store>
|
88 |
+
<comment>Only if required. Leave it blank as default</comment>
|
89 |
+
</last_update>
|
90 |
+
|
91 |
+
<debug_mode translate="label">
|
92 |
+
<label>Debug</label>
|
93 |
+
<frontend_type>select</frontend_type>
|
94 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
95 |
+
<sort_order>6</sort_order>
|
96 |
+
<show_in_default>1</show_in_default>
|
97 |
+
<show_in_website>1</show_in_website>
|
98 |
+
<show_in_store>1</show_in_store>
|
99 |
+
</debug_mode>
|
100 |
+
</fields>
|
101 |
+
</systab_option>
|
102 |
+
</groups>
|
103 |
+
</sonicanalytics_extractor>
|
104 |
+
</sections>
|
105 |
+
|
106 |
+
</config>
|
app/etc/modules/Sonicanalytics_Extractor.xml
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Magento
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Phoenix
|
17 |
+
* @package Phoenix_Moneybookers
|
18 |
+
* @copyright Copyright (c) 2011 Phoenix Medien GmbH & Co. KG (http://www.phoenix-medien.de)
|
19 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
20 |
+
*/
|
21 |
+
-->
|
22 |
+
<config>
|
23 |
+
<modules>
|
24 |
+
<Sonicanalytics_Extractor>
|
25 |
+
<active>true</active>
|
26 |
+
<codePool>community</codePool>
|
27 |
+
</Sonicanalytics_Extractor>
|
28 |
+
</modules>
|
29 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Sonicanalytics_Xtractor</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>GNU General Public License (GPL) </license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>SonicAnalytics provides leading analytics powered by Pentaho plataform. We provide data mining services, analysis services (drill up/down, slice & dice) and self-service reporting, in addition to knowledge discovery (data mining)</summary>
|
10 |
+
<description>SonicAnalytics provides leading analytics powered by Pentaho plataform. We provide data mining services, analysis services (drill up/down, slice & dice) and self-service reporting.
|
11 |
+

|
12 |
+
- Predict the future: Using our very sofisticated technologies and based on the previous orders, answer questions like "What's the probability of a customer that lives in X, ordered the product Y, with payment method Z, with shipping method W, gender S and age group R, order again? Which product ( basket analysis )? ". 
|
13 |
+

|
14 |
+
- Visualize an interactive map with your customers location.
|
15 |
+

|
16 |
+
- Self-service reporting: Don't wait for the IT team to build a custom report for you. Just select the fields and go on.
|
17 |
+

|
18 |
+
Checkout our demo today, see how we can help your business and please, do not hesitate to get in touch with us.
|
19 |
+

|
20 |
+
PS: the extension is free, but to make full use of it, you have to have an account on our servers.</description>
|
21 |
+
<notes>It requires an account on our servers.</notes>
|
22 |
+
<authors><author><name>SonicAnalytics</name><user>luizfox</user><email>luiz@sonictempus.com</email></author></authors>
|
23 |
+
<date>2012-11-13</date>
|
24 |
+
<time>19:52:16</time>
|
25 |
+
<contents><target name="magecommunity"><dir name="Sonicanalytics"><dir name="Extractor"><dir name="Helper"><file name="Data.php" hash="3f09076c7f02d01b2efb5aa68827948f"/><file name="dispatch.php" hash="a0dfaf231656c5f45c45b1f14e2c1ce8"/><file name="exportModel.php" hash="a58026789964750309be854c33d2efe9"/></dir><dir name="controllers"><file name="IndexController.php" hash="d0b880c23658fb9e4c791b48ea2af4b3"/></dir><dir name="etc"><file name="arquivos_criados.txt" hash="7478fe4928a6194563c5d77cf1c930e4"/><file name="config.xml" hash="ab3eb20adde9aba24d6d79fd13029532"/><file name="config.xml_funcionando" hash="f4da52b80ff315e37c1ddb31cf807888"/><file name="system.xml" hash="cee302e934549da87216b54df4f19276"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Sonicanalytics_Extractor.xml" hash="d3c001ac8d2dbb006a6c80abd4a96535"/></dir></target></contents>
|
26 |
+
<compatible/>
|
27 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
28 |
+
</package>
|