Version Notes
WARNING: Updated Doofinder PHP Library. This is a big update. Remember to clear Magento Cache!!!
Download this release
Release Info
Developer | Carlos Escribano Rey |
Extension | Doofinder_Feed |
Version | 1.7.0 |
Comparing to | |
See all releases |
Code changes from version 1.6.13 to 1.7.0
- app/code/community/Doofinder/Feed/Block/Adminhtml/Log/View.php +1 -1
- app/code/community/Doofinder/Feed/Block/Adminhtml/Map/Additional.php +1 -1
- app/code/community/Doofinder/Feed/Block/Integration.php +1 -1
- app/code/community/Doofinder/Feed/Block/Settings/Buttons/Generate.php +1 -1
- app/code/community/Doofinder/Feed/Block/Settings/Buttons/ViewLog.php +1 -1
- app/code/community/Doofinder/Feed/Block/Settings/Panel/Crondescription.php +1 -1
- app/code/community/Doofinder/Feed/Block/Settings/Panel/Datetime.php +1 -1
- app/code/community/Doofinder/Feed/Block/Settings/Panel/Description.php +1 -1
- app/code/community/Doofinder/Feed/Block/Settings/Panel/File.php +1 -1
- app/code/community/Doofinder/Feed/Block/Settings/Panel/Layerdescription.php +1 -1
- app/code/community/Doofinder/Feed/Block/Settings/Panel/Message.php +1 -1
- app/code/community/Doofinder/Feed/Helper/Data.php +2 -2
- app/code/community/Doofinder/Feed/Helper/Log.php +2 -2
- app/code/community/Doofinder/Feed/Helper/Search.php +11 -13
- app/code/community/Doofinder/Feed/Helper/Tax.php +2 -2
- app/code/community/Doofinder/Feed/Model/Adminhtml/System/Config/Backend/Cron.php +1 -1
- app/code/community/Doofinder/Feed/Model/Config.php +2 -2
- app/code/community/Doofinder/Feed/Model/Cron.php +1 -1
- app/code/community/Doofinder/Feed/Model/Generator.php +2 -2
- app/code/community/Doofinder/Feed/Model/Log.php +1 -1
- app/code/community/Doofinder/Feed/Model/Map/Product/Abstract.php +2 -2
- app/code/community/Doofinder/Feed/Model/Map/Product/Associated.php +2 -2
- app/code/community/Doofinder/Feed/Model/Map/Product/Bundle.php +2 -2
- app/code/community/Doofinder/Feed/Model/Map/Product/Configurable.php +2 -2
- app/code/community/Doofinder/Feed/Model/Map/Product/Downloadable.php +2 -2
- app/code/community/Doofinder/Feed/Model/Map/Product/Grouped.php +2 -2
- app/code/community/Doofinder/Feed/Model/Map/Product/Simple.php +2 -2
- app/code/community/Doofinder/Feed/Model/Map/Product/Virtual.php +2 -2
- app/code/community/Doofinder/Feed/Model/Mysql4/Cron.php +1 -1
- app/code/community/Doofinder/Feed/Model/Mysql4/Cron/Collection.php +1 -1
- app/code/community/Doofinder/Feed/Model/Mysql4/Log.php +1 -1
- app/code/community/Doofinder/Feed/Model/Mysql4/Log/Collection.php +1 -1
- app/code/community/Doofinder/Feed/Model/Observers/Autoloader.php +10 -0
- app/code/community/Doofinder/Feed/Model/Observers/Feed.php +1 -1
- app/code/community/Doofinder/Feed/Model/Observers/Logs.php +1 -1
- app/code/community/Doofinder/Feed/Model/Observers/Schedule.php +1 -1
- app/code/community/Doofinder/Feed/Model/Resource/Mysql4/Setup.php +1 -1
- app/code/community/Doofinder/Feed/Model/System/Config/Backend/Map/Additional.php +1 -1
- app/code/community/Doofinder/Feed/Model/System/Config/Reset.php +1 -1
- app/code/community/Doofinder/Feed/Model/System/Config/Source/Product/Attributes.php +1 -1
- app/code/community/Doofinder/Feed/Model/Tools.php +2 -2
- app/code/community/Doofinder/Feed/controllers/DoofinderFeedFeedController.php +1 -1
- app/code/community/Doofinder/Feed/controllers/DoofinderFeedLogController.php +1 -1
- app/code/community/Doofinder/Feed/controllers/FeedController.php +2 -2
- app/code/community/Doofinder/Feed/controllers/IndexController.php +2 -2
- app/code/community/Doofinder/Feed/etc/config.xml +9 -1
- lib/Doofinder/doofinder_api.php +0 -804
- lib/Doofinder/doofinder_management_api.php +0 -408
- lib/Doofinder/errors.php +0 -48
- package.xml +5 -5
app/code/community/Doofinder/Feed/Block/Adminhtml/Log/View.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Adminhtml_Log_View extends Mage_Adminhtml_Block_Widget_Grid
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Adminhtml_Log_View extends Mage_Adminhtml_Block_Widget_Grid
|
app/code/community/Doofinder/Feed/Block/Adminhtml/Map/Additional.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Adminhtml_Map_Additional extends Mage_Adminhtml_Block_System_Config_Form_Field
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Adminhtml_Map_Additional extends Mage_Adminhtml_Block_System_Config_Form_Field
|
app/code/community/Doofinder/Feed/Block/Integration.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Integration extends Mage_Core_Block_Abstract
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Integration extends Mage_Core_Block_Abstract
|
app/code/community/Doofinder/Feed/Block/Settings/Buttons/Generate.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Buttons_Generate extends Mage_Adminhtml_Block_System_Config_Form_Field
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Buttons_Generate extends Mage_Adminhtml_Block_System_Config_Form_Field
|
app/code/community/Doofinder/Feed/Block/Settings/Buttons/ViewLog.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Buttons_ViewLog extends Mage_Adminhtml_Block_System_Config_Form_Field
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Buttons_ViewLog extends Mage_Adminhtml_Block_System_Config_Form_Field
|
app/code/community/Doofinder/Feed/Block/Settings/Panel/Crondescription.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_CronDescription extends Doofinder_Feed_Block_Settings_Panel_Description
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_CronDescription extends Doofinder_Feed_Block_Settings_Panel_Description
|
app/code/community/Doofinder/Feed/Block/Settings/Panel/Datetime.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_Datetime extends Mage_Adminhtml_Block_System_Config_Form_Field
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_Datetime extends Mage_Adminhtml_Block_System_Config_Form_Field
|
app/code/community/Doofinder/Feed/Block/Settings/Panel/Description.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_Description extends Mage_Adminhtml_Block_System_Config_Form_Field
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_Description extends Mage_Adminhtml_Block_System_Config_Form_Field
|
app/code/community/Doofinder/Feed/Block/Settings/Panel/File.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_File extends Mage_Adminhtml_Block_System_Config_Form_Field
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_File extends Mage_Adminhtml_Block_System_Config_Form_Field
|
app/code/community/Doofinder/Feed/Block/Settings/Panel/Layerdescription.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_LayerDescription extends Doofinder_Feed_Block_Settings_Panel_Description
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_LayerDescription extends Doofinder_Feed_Block_Settings_Panel_Description
|
app/code/community/Doofinder/Feed/Block/Settings/Panel/Message.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_Message extends Mage_Adminhtml_Block_System_Config_Form_Field
|
6 |
/**
|
7 |
* @category blocks
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Block_Settings_Panel_Message extends Mage_Adminhtml_Block_System_Config_Form_Field
|
app/code/community/Doofinder/Feed/Helper/Data.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Helpers
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Data helper for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Helper_Data extends Mage_Core_Helper_Abstract
|
6 |
/**
|
7 |
* @category Helpers
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Data helper for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Helper_Data extends Mage_Core_Helper_Abstract
|
app/code/community/Doofinder/Feed/Helper/Log.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Helpers
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Log helper for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Helper_Log extends Mage_Core_Helper_Abstract
|
6 |
/**
|
7 |
* @category Helpers
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Log helper for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Helper_Log extends Mage_Core_Helper_Abstract
|
app/code/community/Doofinder/Feed/Helper/Search.php
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
<?php
|
2 |
-
require_once(Mage::getBaseDir('lib') . DS. 'Doofinder' . DS .'doofinder_api.php');
|
3 |
|
4 |
class Doofinder_Feed_Helper_Search extends Mage_Core_Helper_Abstract
|
5 |
{
|
@@ -23,28 +22,27 @@ class Doofinder_Feed_Helper_Search extends Mage_Core_Helper_Abstract
|
|
23 |
$hashId = Mage::getStoreConfig('doofinder_search/internal_settings/hash_id', Mage::app()->getStore());
|
24 |
$apiKey = Mage::getStoreConfig('doofinder_search/internal_settings/api_key', Mage::app()->getStore());
|
25 |
$limit = Mage::getStoreConfig('doofinder_search/internal_settings/request_limit', Mage::app()->getStore());
|
26 |
-
$ids = false;
|
27 |
|
28 |
-
$
|
29 |
-
$
|
30 |
|
31 |
// Store objects
|
32 |
-
$this->_lastSearch = $
|
33 |
-
$this->_lastResults = $
|
34 |
|
35 |
-
return $this->retrieveIds($
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
* Retrieve ids from Doofinder Results
|
40 |
*
|
41 |
-
* @param
|
42 |
* @return array
|
43 |
*/
|
44 |
-
protected function retrieveIds(DoofinderResults $
|
45 |
{
|
46 |
-
$ids =
|
47 |
-
foreach($
|
48 |
$ids[] = $result['id'];
|
49 |
}
|
50 |
|
@@ -61,8 +59,8 @@ class Doofinder_Feed_Helper_Search extends Mage_Core_Helper_Abstract
|
|
61 |
$limit = Mage::getStoreConfig('doofinder_search/internal_settings/total_limit', Mage::app()->getStore());
|
62 |
$ids = $this->retrieveIds($this->_lastResults);
|
63 |
|
64 |
-
while (count($ids) < $limit && ($
|
65 |
-
$ids = array_merge($ids, $this->retrieveIds($
|
66 |
}
|
67 |
|
68 |
return $ids;
|
1 |
<?php
|
|
|
2 |
|
3 |
class Doofinder_Feed_Helper_Search extends Mage_Core_Helper_Abstract
|
4 |
{
|
22 |
$hashId = Mage::getStoreConfig('doofinder_search/internal_settings/hash_id', Mage::app()->getStore());
|
23 |
$apiKey = Mage::getStoreConfig('doofinder_search/internal_settings/api_key', Mage::app()->getStore());
|
24 |
$limit = Mage::getStoreConfig('doofinder_search/internal_settings/request_limit', Mage::app()->getStore());
|
|
|
25 |
|
26 |
+
$client = new \Doofinder\Api\Search\Client($hashId, $apiKey);
|
27 |
+
$results = $client->query($queryText, null, ['rpp' => $limit, 'transformer' => 'onlyid', 'filter' => []]);
|
28 |
|
29 |
// Store objects
|
30 |
+
$this->_lastSearch = $client;
|
31 |
+
$this->_lastResults = $results;
|
32 |
|
33 |
+
return $this->retrieveIds($results);
|
34 |
}
|
35 |
|
36 |
/**
|
37 |
* Retrieve ids from Doofinder Results
|
38 |
*
|
39 |
+
* @param \Doofinder\Api\Search\Results $results
|
40 |
* @return array
|
41 |
*/
|
42 |
+
protected function retrieveIds(DoofinderResults $results)
|
43 |
{
|
44 |
+
$ids = [];
|
45 |
+
foreach ($results->getResults() as $result) {
|
46 |
$ids[] = $result['id'];
|
47 |
}
|
48 |
|
59 |
$limit = Mage::getStoreConfig('doofinder_search/internal_settings/total_limit', Mage::app()->getStore());
|
60 |
$ids = $this->retrieveIds($this->_lastResults);
|
61 |
|
62 |
+
while (count($ids) < $limit && ($results = $this->_lastSearch->nextPage())) {
|
63 |
+
$ids = array_merge($ids, $this->retrieveIds($results));
|
64 |
}
|
65 |
|
66 |
return $ids;
|
app/code/community/Doofinder/Feed/Helper/Tax.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Helpers
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Tax helper for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Helper_Tax extends Mage_Tax_Helper_Data
|
6 |
/**
|
7 |
* @category Helpers
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Tax helper for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Helper_Tax extends Mage_Tax_Helper_Data
|
app/code/community/Doofinder/Feed/Model/Adminhtml/System/Config/Backend/Cron.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Adminhtml_System_Config_Backend_Cron extends Mage_Core_Model_Config_Data {
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Adminhtml_System_Config_Backend_Cron extends Mage_Core_Model_Config_Data {
|
app/code/community/Doofinder/Feed/Model/Config.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Config model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Config extends Mage_Core_Model_Config_Data
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Config model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Config extends Mage_Core_Model_Config_Data
|
app/code/community/Doofinder/Feed/Model/Cron.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Cron extends Mage_Core_Model_Abstract {
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Cron extends Mage_Core_Model_Abstract {
|
app/code/community/Doofinder/Feed/Model/Generator.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Generator model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
if (!defined('DS'))
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Generator model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
if (!defined('DS'))
|
app/code/community/Doofinder/Feed/Model/Log.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Log extends Mage_Core_Model_Abstract {
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Log extends Mage_Core_Model_Abstract {
|
app/code/community/Doofinder/Feed/Model/Map/Product/Abstract.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Abstract Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Abstract extends Varien_Object
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Abstract Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Abstract extends Varien_Object
|
app/code/community/Doofinder/Feed/Model/Map/Product/Associated.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Associated Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Associated
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Associated Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Associated
|
app/code/community/Doofinder/Feed/Model/Map/Product/Bundle.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Bundle Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Bundle
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Bundle Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Bundle
|
app/code/community/Doofinder/Feed/Model/Map/Product/Configurable.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Configurable Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Configurable
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Configurable Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Configurable
|
app/code/community/Doofinder/Feed/Model/Map/Product/Downloadable.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Downloadable Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Downloadable
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Downloadable Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Downloadable
|
app/code/community/Doofinder/Feed/Model/Map/Product/Grouped.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Grouped Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Grouped
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Grouped Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Grouped
|
app/code/community/Doofinder/Feed/Model/Map/Product/Simple.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Simple Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Simple
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Simple Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Simple
|
app/code/community/Doofinder/Feed/Model/Map/Product/Virtual.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Virtual Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Virtual
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Virtual Product Map Model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Map_Product_Virtual
|
app/code/community/Doofinder/Feed/Model/Mysql4/Cron.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Mysql4_Cron extends Mage_Core_Model_Mysql4_Abstract {
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Mysql4_Cron extends Mage_Core_Model_Mysql4_Abstract {
|
app/code/community/Doofinder/Feed/Model/Mysql4/Cron/Collection.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Mysql4_Cron_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Mysql4_Cron_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract {
|
app/code/community/Doofinder/Feed/Model/Mysql4/Log.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract {
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract {
|
app/code/community/Doofinder/Feed/Model/Mysql4/Log/Collection.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
app/code/community/Doofinder/Feed/Model/Observers/Autoloader.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Doofinder_Feed_Model_Observers_Autoloader
|
4 |
+
{
|
5 |
+
public function addAutoloader()
|
6 |
+
{
|
7 |
+
require_once(Mage::getBaseDir('lib') . DS. 'php-doofinder' . DS .'autoload.php');
|
8 |
+
return $this;
|
9 |
+
}
|
10 |
+
}
|
app/code/community/Doofinder/Feed/Model/Observers/Feed.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
require_once(Mage::getBaseDir('lib') . DS. 'Doofinder' . DS .'doofinder_management_api.php');
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
require_once(Mage::getBaseDir('lib') . DS. 'Doofinder' . DS .'doofinder_management_api.php');
|
app/code/community/Doofinder/Feed/Model/Observers/Logs.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Observers_Logs
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Observers_Logs
|
app/code/community/Doofinder/Feed/Model/Observers/Schedule.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Observers_Schedule
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Observers_Schedule
|
app/code/community/Doofinder/Feed/Model/Resource/Mysql4/Setup.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Resource_Mysql4_Setup extends Mage_Core_Model_Resource_Setup {
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_Resource_Mysql4_Setup extends Mage_Core_Model_Resource_Setup {
|
app/code/community/Doofinder/Feed/Model/System/Config/Backend/Map/Additional.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_System_Config_Backend_Map_Additional extends Mage_Adminhtml_Model_System_Config_Backend_Serialized
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_System_Config_Backend_Map_Additional extends Mage_Adminhtml_Model_System_Config_Backend_Serialized
|
app/code/community/Doofinder/Feed/Model/System/Config/Reset.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_System_Config_Reset extends Mage_Core_Model_Config_Data
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_System_Config_Reset extends Mage_Core_Model_Config_Data
|
app/code/community/Doofinder/Feed/Model/System/Config/Source/Product/Attributes.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_System_Config_Source_Product_Attributes
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_Model_System_Config_Source_Product_Attributes
|
app/code/community/Doofinder/Feed/Model/Tools.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Tools model for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Tools extends Varien_Object
|
6 |
/**
|
7 |
* @category Models
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Tools model for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_Model_Tools extends Varien_Object
|
app/code/community/Doofinder/Feed/controllers/DoofinderFeedFeedController.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category controllers
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_DoofinderFeedFeedController extends Mage_Adminhtml_Controller_Action
|
6 |
/**
|
7 |
* @category controllers
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_DoofinderFeedFeedController extends Mage_Adminhtml_Controller_Action
|
app/code/community/Doofinder/Feed/controllers/DoofinderFeedLogController.php
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
/**
|
7 |
* @category controllers
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_DoofinderFeedLogController extends Mage_Adminhtml_Controller_Action
|
6 |
/**
|
7 |
* @category controllers
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
class Doofinder_Feed_DoofinderFeedLogController extends Mage_Adminhtml_Controller_Action
|
app/code/community/Doofinder/Feed/controllers/FeedController.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category controllers
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Feed controller for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_FeedController extends Mage_Core_Controller_Front_Action
|
6 |
/**
|
7 |
* @category controllers
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Feed controller for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_FeedController extends Mage_Core_Controller_Front_Action
|
app/code/community/Doofinder/Feed/controllers/IndexController.php
CHANGED
@@ -6,13 +6,13 @@
|
|
6 |
/**
|
7 |
* @category controllers
|
8 |
* @package Doofinder_Feed
|
9 |
-
* @version 1.
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Index controller for Doofinder Feed
|
14 |
*
|
15 |
-
* @version 1.
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_IndexController extends Mage_Core_Controller_Front_Action
|
6 |
/**
|
7 |
* @category controllers
|
8 |
* @package Doofinder_Feed
|
9 |
+
* @version 1.7.0
|
10 |
*/
|
11 |
|
12 |
/**
|
13 |
* Index controller for Doofinder Feed
|
14 |
*
|
15 |
+
* @version 1.7.0
|
16 |
* @package Doofinder_Feed
|
17 |
*/
|
18 |
class Doofinder_Feed_IndexController extends Mage_Core_Controller_Front_Action
|
app/code/community/Doofinder/Feed/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
|
4 |
<modules>
|
5 |
<Doofinder_Feed>
|
6 |
-
<version>1.
|
7 |
</Doofinder_Feed>
|
8 |
</modules>
|
9 |
<global>
|
@@ -78,6 +78,14 @@
|
|
78 |
</doofinder_feed>
|
79 |
</observers>
|
80 |
</catalog_product_save_after>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
</events>
|
82 |
</global>
|
83 |
|
3 |
|
4 |
<modules>
|
5 |
<Doofinder_Feed>
|
6 |
+
<version>1.7.0</version>
|
7 |
</Doofinder_Feed>
|
8 |
</modules>
|
9 |
<global>
|
78 |
</doofinder_feed>
|
79 |
</observers>
|
80 |
</catalog_product_save_after>
|
81 |
+
<resource_get_tablename>
|
82 |
+
<observers>
|
83 |
+
<doofinder_feed>
|
84 |
+
<class>doofinder_feed/observers_autoloader</class>
|
85 |
+
<method>addAutoloader</method>
|
86 |
+
</doofinder_feed>
|
87 |
+
</observers>
|
88 |
+
</resource_get_tablename>
|
89 |
</events>
|
90 |
</global>
|
91 |
|
lib/Doofinder/doofinder_api.php
DELETED
@@ -1,804 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Author:: JoeZ99 (<jzarate@gmail.com>). all credit to Gilles Devaux (<gilles.devaux@gmail.com>) (https://github.com/flaptor/indextank-php)
|
4 |
-
*
|
5 |
-
* License:: Apache License, Version 2.0
|
6 |
-
*
|
7 |
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
8 |
-
* not use this file except in compliance with the License. You may obtain
|
9 |
-
* a copy of the License at
|
10 |
-
*
|
11 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12 |
-
*
|
13 |
-
* Unless required by applicable law or agreed to in writing, software
|
14 |
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15 |
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16 |
-
* License for the specific language governing permissions and limitations
|
17 |
-
* under the License.
|
18 |
-
*/
|
19 |
-
|
20 |
-
|
21 |
-
class DoofinderApi{
|
22 |
-
/*
|
23 |
-
* Basic client for an account.
|
24 |
-
* It needs an API url to be constructed.
|
25 |
-
* Its only method is to query the doofinder search server
|
26 |
-
* Returns a DoofinderResults object
|
27 |
-
*/
|
28 |
-
|
29 |
-
const URL_SUFFIX = '-search.doofinder.com';
|
30 |
-
const DEFAULT_TIMEOUT = 10000;
|
31 |
-
const DEFAULT_RPP = 10;
|
32 |
-
const DEFAULT_PARAMS_PREFIX = 'dfParam_';
|
33 |
-
const DEFAULT_API_VERSION = '4';
|
34 |
-
const VERSION = '5.2.5';
|
35 |
-
|
36 |
-
private $api_key = null; // user API_KEY
|
37 |
-
private $hashid = null; // hashid of the doofinder account
|
38 |
-
|
39 |
-
private $apiVersion = null;
|
40 |
-
private $url = null;
|
41 |
-
private $results = null;
|
42 |
-
private $query = null;
|
43 |
-
private $search_options = array(); // assoc. array with doofinder options to be sent as request parameters
|
44 |
-
|
45 |
-
private $page = 1; // the page of the search results we're at
|
46 |
-
private $queryName = null; // the name of the last successfull query made
|
47 |
-
private $lastQuery = null; // the last successfull query made
|
48 |
-
private $total = null; // total number of results obtained
|
49 |
-
private $maxScore = null;
|
50 |
-
private $paramsPrefix = self::DEFAULT_PARAMS_PREFIX;
|
51 |
-
private $serializationArray = null;
|
52 |
-
private $queryParameter = 'query'; // the parameter used for querying
|
53 |
-
private $allowedParameters = array('page', 'rpp', 'timeout', 'types', 'filter', 'query_name', 'transformer'); // request parameters that doofinder handle
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Constructor. account's hashid and api version set here
|
57 |
-
*
|
58 |
-
* @param string $hashid the account's hashid
|
59 |
-
* @param boolean $fromParams if set, the object is unserialized from GET or POST params
|
60 |
-
* @param array $init_options. associative array with some options:
|
61 |
-
* -'prefix' (default: 'dfParam_')=> the prefix to use when serializing.
|
62 |
-
* -'queryParameter' (default: 'query') => the parameter used for querying
|
63 |
-
* -'apiVersion' (default: '4')=> the api of the search server to query
|
64 |
-
* -'restrictedRequest'(default: $_REQUEST): =>restrict request object
|
65 |
-
* to look for params when unserializing. either 'get' or 'post'
|
66 |
-
* @throws DoofinderException if $hashid is not a md5 hash or api is no 4, 3.0 or 1.0
|
67 |
-
*/
|
68 |
-
function __construct($hashid, $api_key, $fromParams=false, $init_options = array()){
|
69 |
-
$zone_key_array = explode('-', $api_key);
|
70 |
-
|
71 |
-
if(2 === count($zone_key_array)){
|
72 |
-
$this->api_key = $zone_key_array[1];
|
73 |
-
$this->zone = $zone_key_array[0];
|
74 |
-
$this->url = "https://" . $this->zone . self::URL_SUFFIX;
|
75 |
-
} else {
|
76 |
-
throw new DoofinderException("API Key is no properly set.");
|
77 |
-
}
|
78 |
-
|
79 |
-
if(array_key_exists('prefix', $init_options)){
|
80 |
-
$this->paramsPrefix = $init_options['prefix'];
|
81 |
-
}
|
82 |
-
|
83 |
-
|
84 |
-
$this->allowedParameters = array_map(array($this, 'addprefix'), $this->allowedParameters);
|
85 |
-
|
86 |
-
|
87 |
-
if(array_key_exists('queryParameter', $init_options)){
|
88 |
-
$this->queryParameter = $init_options['queryParameter'];
|
89 |
-
} else {
|
90 |
-
$this->queryParameter = $this->paramsPrefix.$this->queryParameter;
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
$this->apiVersion = array_key_exists('apiVersion', $init_options) ?
|
95 |
-
$init_options['apiVersion'] : self::DEFAULT_API_VERSION;
|
96 |
-
$this->serializationArray = $_REQUEST;
|
97 |
-
if(array_key_exists('restrictedRequest', $init_options))
|
98 |
-
{
|
99 |
-
switch(strtolower($init_options['restrictedRequest'])){
|
100 |
-
case 'get':
|
101 |
-
$this->serializationArray = $_GET;
|
102 |
-
break;
|
103 |
-
case 'post':
|
104 |
-
$this->serializationArray = $_POST;
|
105 |
-
break;
|
106 |
-
}
|
107 |
-
}
|
108 |
-
$patt = '/^[0-9a-f]{32}$/i';
|
109 |
-
if(!preg_match($patt, $hashid))
|
110 |
-
{
|
111 |
-
throw new DoofinderException("Wrong hashid");
|
112 |
-
}
|
113 |
-
if(!in_array($this->apiVersion, array('5', '4', '3.0','1.0')))
|
114 |
-
{
|
115 |
-
throw new DoofinderException('Wrong API');
|
116 |
-
}
|
117 |
-
$this->hashid = $hashid;
|
118 |
-
if($fromParams)
|
119 |
-
{
|
120 |
-
$this->fromQuerystring();
|
121 |
-
}
|
122 |
-
|
123 |
-
}
|
124 |
-
|
125 |
-
private function addprefix($value){
|
126 |
-
return $this->paramsPrefix.$value;
|
127 |
-
}
|
128 |
-
|
129 |
-
/*
|
130 |
-
* translateFilter
|
131 |
-
*
|
132 |
-
* translates a range filter to the new ES format
|
133 |
-
* 'from'=>9, 'to'=>20 to 'gte'=>9, 'lte'=>20
|
134 |
-
*
|
135 |
-
* @param array $filter
|
136 |
-
* @return array the translated filter
|
137 |
-
*/
|
138 |
-
private function translateFilter($filter){
|
139 |
-
$new_filter = array();
|
140 |
-
foreach($filter as $key => $value){
|
141 |
-
if ($key === 'from') {
|
142 |
-
$new_filter['gte'] = $value;
|
143 |
-
} else if ($key === 'to') {
|
144 |
-
$new_filter['lte'] = $value;
|
145 |
-
} else {
|
146 |
-
$new_filter[$key] = $value;
|
147 |
-
}
|
148 |
-
}
|
149 |
-
return $new_filter;
|
150 |
-
}
|
151 |
-
|
152 |
-
private function reqHeaders(){
|
153 |
-
$headers = array();
|
154 |
-
$headers[] = 'Expect:'; //Fixes the HTTP/1.1 417 Expectation Failed
|
155 |
-
$authHeaderName = $this->apiVersion == '4' ? 'API Token: ' : 'authorization: ';
|
156 |
-
$headers[] = $authHeaderName . $this->api_key; //API Authorization
|
157 |
-
return $headers;
|
158 |
-
}
|
159 |
-
|
160 |
-
private function apiCall($entry_point='search', $params=array()){
|
161 |
-
$params['hashid'] = $this->hashid;
|
162 |
-
$args = http_build_query($this->sanitize($params)); // remove any null value from the array
|
163 |
-
|
164 |
-
$url = $this->url.'/'.$this->apiVersion.'/'.$entry_point.'?'.$args;
|
165 |
-
|
166 |
-
$session = curl_init($url);
|
167 |
-
curl_setopt($session, CURLOPT_CUSTOMREQUEST, 'GET');
|
168 |
-
curl_setopt($session, CURLOPT_HEADER, false); // Tell curl not to return headers
|
169 |
-
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Tell curl to return the response
|
170 |
-
curl_setopt($session, CURLOPT_HTTPHEADER, $this->reqHeaders()); // Adding request headers
|
171 |
-
$response = curl_exec($session);
|
172 |
-
$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
173 |
-
curl_close($session);
|
174 |
-
|
175 |
-
if (floor($httpCode / 100) == 2) {
|
176 |
-
return $response;
|
177 |
-
}
|
178 |
-
throw new DoofinderException($httpCode.' - '.$response, $httpCode);
|
179 |
-
}
|
180 |
-
|
181 |
-
public function getOptions(){
|
182 |
-
return $this->apiCall('options/'.$this->hashid);
|
183 |
-
}
|
184 |
-
|
185 |
-
/**
|
186 |
-
* query. makes the query to the doofinder search server.
|
187 |
-
* also set several search parameters through it's $options argument
|
188 |
-
*
|
189 |
-
* @param string $query the search query
|
190 |
-
* @param int $page the page number or the results to show
|
191 |
-
* @param array $options query options:
|
192 |
-
* - 'rpp'=> number of results per page. default 10
|
193 |
-
* - 'timeout' => timeout after which the search server drops the conn.
|
194 |
-
* defaults to 10 seconds
|
195 |
-
* - 'types' => types of index to search at. default: all.
|
196 |
-
* - 'filter' => filter to apply. ['color'=>['red','blue'], 'price'=>['from'=>33]]
|
197 |
-
* - any other param will be sent as a request parameter
|
198 |
-
* @return DoofinderResults results
|
199 |
-
*/
|
200 |
-
public function query($query=null, $page=null, $options = array()){
|
201 |
-
if($query){
|
202 |
-
$this->search_options['query'] = $query;
|
203 |
-
}
|
204 |
-
if($page){
|
205 |
-
$this->search_options['page'] = (int)$page;
|
206 |
-
}
|
207 |
-
foreach($options as $optionName => $optionValue){
|
208 |
-
$this->search_options[$optionName] = $options[$optionName];
|
209 |
-
}
|
210 |
-
|
211 |
-
$params = $this->search_options;
|
212 |
-
|
213 |
-
// translate filters
|
214 |
-
if(!empty($params['filter']))
|
215 |
-
{
|
216 |
-
foreach($params['filter'] as $filterName => $filterValue){
|
217 |
-
$params['filter'][$filterName] = $this->translateFilter($filterValue);
|
218 |
-
}
|
219 |
-
}
|
220 |
-
|
221 |
-
// no query? then match all documents
|
222 |
-
if(!$this->optionExists('query') || !trim($this->search_options['query'])){
|
223 |
-
$params['query_name'] = 'match_all';
|
224 |
-
}
|
225 |
-
|
226 |
-
// if filters without query_name, pre-query first to obtain it.
|
227 |
-
if (empty($params['query_name']) && !empty($params['filter']))
|
228 |
-
{
|
229 |
-
$filter = $params['filter'];
|
230 |
-
unset($params['filter']);
|
231 |
-
$dfResults = new DoofinderResults($this->apiCall('search', $params));
|
232 |
-
$params['query_name'] = $dfResults->getProperty('query_name');
|
233 |
-
$params['filter'] = $filter;
|
234 |
-
}
|
235 |
-
$dfResults = new DoofinderResults($this->apiCall('search', $params));
|
236 |
-
$this->page = $dfResults->getProperty('page');
|
237 |
-
$this->total = $dfResults->getProperty('total');
|
238 |
-
$this->search_options['query'] = $dfResults->getProperty('query');
|
239 |
-
$this->maxScore = $dfResults->getProperty('max_score');
|
240 |
-
$this->queryName = $dfResults->getProperty('query_name');
|
241 |
-
$this->lastQuery = $dfResults->getProperty('query');
|
242 |
-
|
243 |
-
return $dfResults;
|
244 |
-
}
|
245 |
-
|
246 |
-
/**
|
247 |
-
* hasNext
|
248 |
-
*
|
249 |
-
* @return boolean true if there is another page of results
|
250 |
-
*/
|
251 |
-
public function hasNext(){
|
252 |
-
return $this->page*$this->getRpp() < $this->total;
|
253 |
-
}
|
254 |
-
|
255 |
-
/**
|
256 |
-
* hasPrev
|
257 |
-
*
|
258 |
-
* @return true if there is a previous page of results
|
259 |
-
*/
|
260 |
-
public function hasPrev(){
|
261 |
-
return ($this->page-1)*$this->getRpp() > 0;
|
262 |
-
}
|
263 |
-
|
264 |
-
|
265 |
-
/**
|
266 |
-
* getPage
|
267 |
-
*
|
268 |
-
* obtain the current page number
|
269 |
-
* @return int the page number
|
270 |
-
*/
|
271 |
-
public function getPage(){
|
272 |
-
return $this->page;
|
273 |
-
}
|
274 |
-
|
275 |
-
/**
|
276 |
-
* setFilter
|
277 |
-
*
|
278 |
-
* set a filter for the query
|
279 |
-
* @param string filterName the name of the filter to set
|
280 |
-
* @param array filter if simple array, terms filter assumed
|
281 |
-
* if 'from', 'to' in keys, range filter assumed
|
282 |
-
*/
|
283 |
-
public function setFilter($filterName, $filter){
|
284 |
-
if(!$this->optionExists('filter')){
|
285 |
-
$this->search_options['filter'] = array();
|
286 |
-
}
|
287 |
-
$this->search_options['filter'][$filterName] = $filter;
|
288 |
-
}
|
289 |
-
|
290 |
-
/**
|
291 |
-
* getFilter
|
292 |
-
*
|
293 |
-
* get conditions for certain filter
|
294 |
-
* @param string filterName
|
295 |
-
* @return array filter conditions: - simple array if terms filter
|
296 |
-
* - 'from', 'to' assoc array if range f.
|
297 |
-
* @return false if no filter definition found
|
298 |
-
*/
|
299 |
-
public function getFilter($filterName){
|
300 |
-
if($this->optionExists('filter') && isset($this->search_options['filter'][$filterName])){
|
301 |
-
return $this->filter[$filterName];
|
302 |
-
}
|
303 |
-
return false;
|
304 |
-
}
|
305 |
-
|
306 |
-
/**
|
307 |
-
* getFilters
|
308 |
-
*
|
309 |
-
* get all filters and their configs
|
310 |
-
* @return array assoc array filterName => filterConditions
|
311 |
-
*/
|
312 |
-
public function getFilters(){
|
313 |
-
return $this->search_options['filter'];
|
314 |
-
}
|
315 |
-
|
316 |
-
|
317 |
-
/**
|
318 |
-
* addTerm
|
319 |
-
*
|
320 |
-
* add a term to a terms filter
|
321 |
-
* @param string filterName the filter to add the term to
|
322 |
-
* @param string term the term to add
|
323 |
-
*/
|
324 |
-
public function addTerm($filterName, $term){
|
325 |
-
if(!$this->optionExists('filter')){
|
326 |
-
$this->search_options['filter'] = array($filterName => array());
|
327 |
-
}
|
328 |
-
if(!isset($this->search_options['filter'][$filterName]))
|
329 |
-
{
|
330 |
-
$this->filter[$filterName] = array();
|
331 |
-
$this->search_options['filter'][$filterName] = array();
|
332 |
-
}
|
333 |
-
$this->filter[$filterName][] = $term;
|
334 |
-
$this->search_options['filter'][$filterName][] = $term;
|
335 |
-
}
|
336 |
-
|
337 |
-
/**
|
338 |
-
* removeTerm
|
339 |
-
*
|
340 |
-
* remove a term from a terms filter
|
341 |
-
* @param string filterName the filter to remove the term from
|
342 |
-
* @param string term the term to be removed
|
343 |
-
*/
|
344 |
-
public function removeTerm($filterName, $term){
|
345 |
-
if($this->optionExists('filter') && isset($this->search_options['filter'][$filterName]) &&
|
346 |
-
in_array($term, $this->search_options['filter'][$filterName]))
|
347 |
-
{
|
348 |
-
function filter_me($value){
|
349 |
-
global $term;
|
350 |
-
return $value != $term;
|
351 |
-
}
|
352 |
-
$this->search_options['filter'][$filterName] =
|
353 |
-
array_filter($this->search_options['filter'][$filterName], 'filter_me');
|
354 |
-
}
|
355 |
-
}
|
356 |
-
|
357 |
-
/**
|
358 |
-
* setRange
|
359 |
-
*
|
360 |
-
* set a range filter
|
361 |
-
* @param string filterName the filter to set
|
362 |
-
* @param int from the lower bound value. included
|
363 |
-
* @param int to the upper bound value. included
|
364 |
-
*/
|
365 |
-
public function setRange($filterName, $from=null, $to=null){
|
366 |
-
if(!$this->optionExists('filter')){
|
367 |
-
$this->search_options['filter'] = array($filterName=>array());
|
368 |
-
}
|
369 |
-
if(!isset($this->search_options['filter'][$filterName]))
|
370 |
-
{
|
371 |
-
$this->search_options['filter'][$filterName] = array();
|
372 |
-
}
|
373 |
-
if($from)
|
374 |
-
{
|
375 |
-
$this->search_options['filter'][$filterName]['from'] = $from;
|
376 |
-
}
|
377 |
-
if($to)
|
378 |
-
{
|
379 |
-
$this->search_options['filter'][$filterName]['to'] = $from;
|
380 |
-
}
|
381 |
-
}
|
382 |
-
|
383 |
-
/**
|
384 |
-
* toQuerystring
|
385 |
-
*
|
386 |
-
* 'serialize' the object's state to querystring params
|
387 |
-
* @param int $page the pagenumber. defaults to the current page
|
388 |
-
*/
|
389 |
-
public function toQuerystring($page=null){
|
390 |
-
|
391 |
-
foreach($this->search_options as $paramName => $paramValue){
|
392 |
-
if($paramName == 'query'){
|
393 |
-
$toParams[$this->queryParameter] = $paramValue;
|
394 |
-
} else {
|
395 |
-
$toParams[$this->paramsPrefix.$paramName] = $paramValue;
|
396 |
-
}
|
397 |
-
}
|
398 |
-
if($page){
|
399 |
-
$toParams[$this->paramsPrefix.'page'] = $page;
|
400 |
-
}
|
401 |
-
return http_build_query($toParams);
|
402 |
-
}
|
403 |
-
|
404 |
-
/**
|
405 |
-
* fromQuerystring
|
406 |
-
*
|
407 |
-
* obtain object's state from querystring params
|
408 |
-
* @param string $params where to obtain params from:
|
409 |
-
* - 'GET' $_GET params (default)
|
410 |
-
* - 'POST' $_POST params
|
411 |
-
*/
|
412 |
-
public function fromQuerystring(){
|
413 |
-
$doofinderReqParams = array_filter(array_keys($this->serializationArray),
|
414 |
-
array($this, 'belongsToDoofinder'));
|
415 |
-
|
416 |
-
foreach($doofinderReqParams as $dfReqParam){
|
417 |
-
if($dfReqParam == $this->queryParameter){
|
418 |
-
$keey = 'query';
|
419 |
-
} else {
|
420 |
-
$keey = substr($dfReqParam, strlen($this->paramsPrefix));
|
421 |
-
}
|
422 |
-
$this->search_options[$keey] = $this->serializationArray[$dfReqParam];
|
423 |
-
}
|
424 |
-
}
|
425 |
-
|
426 |
-
/**
|
427 |
-
* sanitize
|
428 |
-
*
|
429 |
-
* Clean array of keys with empty values
|
430 |
-
*
|
431 |
-
* @param array $params array to be cleaned
|
432 |
-
* @return array array with no empty keys
|
433 |
-
*/
|
434 |
-
private function sanitize($params){
|
435 |
-
$result = array();
|
436 |
-
foreach($params as $name => $value){
|
437 |
-
if (is_array($value)){
|
438 |
-
$result[$name] = $this->sanitize($value);
|
439 |
-
} else if (trim($value)){
|
440 |
-
$result[$name] = $value;
|
441 |
-
}
|
442 |
-
}
|
443 |
-
return $result;
|
444 |
-
}
|
445 |
-
|
446 |
-
/**
|
447 |
-
* belongsToDoofinder
|
448 |
-
*
|
449 |
-
* to know if certain parameter name belongs to doofinder serialization parameters
|
450 |
-
*
|
451 |
-
* @param string $paramName name of the param
|
452 |
-
* @return boolean true or false.
|
453 |
-
*/
|
454 |
-
private function belongsToDoofinder($paramName){
|
455 |
-
if($pos = strpos($paramName, '[')){
|
456 |
-
$paramName = substr($paramName, 0, $pos);
|
457 |
-
}
|
458 |
-
return in_array($paramName, $this->allowedParameters) || $paramName == $this->queryParameter;
|
459 |
-
}
|
460 |
-
|
461 |
-
/**
|
462 |
-
* optionExists
|
463 |
-
*
|
464 |
-
* checks whether a search option is defined in $this->search_options
|
465 |
-
*
|
466 |
-
* @param string $optionName
|
467 |
-
* @return boolean
|
468 |
-
*/
|
469 |
-
private function optionExists($optionName){
|
470 |
-
return array_key_exists($optionName, $this->search_options);
|
471 |
-
}
|
472 |
-
|
473 |
-
/**
|
474 |
-
* nextPage
|
475 |
-
*
|
476 |
-
* obtain the results for the next page
|
477 |
-
* @return DoofinderResults if there are results.
|
478 |
-
* @return null otherwise
|
479 |
-
*/
|
480 |
-
public function nextPage(){
|
481 |
-
if($this->hasNext())
|
482 |
-
{
|
483 |
-
return $this->query($this->lastQuery, $this->page+1 );
|
484 |
-
}
|
485 |
-
return null;
|
486 |
-
}
|
487 |
-
|
488 |
-
|
489 |
-
/**
|
490 |
-
* prevPage
|
491 |
-
*
|
492 |
-
* obtain results for the previous page
|
493 |
-
* @return DoofinderResults
|
494 |
-
* @return null otherwise
|
495 |
-
*/
|
496 |
-
public function prevPage(){
|
497 |
-
if($this->hasPrev())
|
498 |
-
{
|
499 |
-
return $this->query($this->lastQuery, $this->page-1 );
|
500 |
-
}
|
501 |
-
return null;
|
502 |
-
}
|
503 |
-
|
504 |
-
/**
|
505 |
-
* numPages
|
506 |
-
*
|
507 |
-
* @return integer the number of pages
|
508 |
-
*/
|
509 |
-
public function numPages(){
|
510 |
-
return ceil($this->total / $this->getRpp());
|
511 |
-
}
|
512 |
-
|
513 |
-
public function getRpp(){
|
514 |
-
$rpp = $this->optionExists('rpp') ? $this->search_options['rpp'] : null;
|
515 |
-
$rpp = $rpp ? $rpp: self::DEFAULT_RPP;
|
516 |
-
return $rpp;
|
517 |
-
}
|
518 |
-
/**
|
519 |
-
* setApiVersion
|
520 |
-
*
|
521 |
-
* sets the api version to use.
|
522 |
-
* @param string $apiVersion the api version , '1.0' or '3.0' or '4'
|
523 |
-
*/
|
524 |
-
public function setApiVersion($apiVersion){
|
525 |
-
$this->apiVersion = $apiVersion;
|
526 |
-
}
|
527 |
-
|
528 |
-
/**
|
529 |
-
* setPrefix
|
530 |
-
*
|
531 |
-
* sets the prefix that will be used for serialization to querystring params
|
532 |
-
* @param string $prefix the prefix
|
533 |
-
*/
|
534 |
-
public function setPrefix($prefix){
|
535 |
-
$this->paramsPrefix = $prefix;
|
536 |
-
}
|
537 |
-
|
538 |
-
/**
|
539 |
-
* setQueryName
|
540 |
-
*
|
541 |
-
* sets query_name
|
542 |
-
* CAUTION: node will complain if this is wrong
|
543 |
-
*/
|
544 |
-
public function setQueryName($queryName){
|
545 |
-
$this->queryName = $queryName;
|
546 |
-
}
|
547 |
-
|
548 |
-
/**
|
549 |
-
* getFilterType
|
550 |
-
* obtain the filter type (i.e. 'terms' or 'numeric range' from its conditions)
|
551 |
-
* @param array filter conditions
|
552 |
-
* @return string 'terms' or 'numericrange' false otherwise
|
553 |
-
*/
|
554 |
-
private function getFilterType($filter){
|
555 |
-
if(!is_array($filter))
|
556 |
-
{
|
557 |
-
return false;
|
558 |
-
}
|
559 |
-
if(count(array_intersect(array('from', 'to'), array_keys($filter)))>0)
|
560 |
-
{
|
561 |
-
return 'numericrange';
|
562 |
-
}
|
563 |
-
return 'terms';
|
564 |
-
}
|
565 |
-
|
566 |
-
|
567 |
-
}
|
568 |
-
|
569 |
-
/**
|
570 |
-
* @author JoeZ99 <jzarate@gmail.com>
|
571 |
-
*
|
572 |
-
* DoofinderResults
|
573 |
-
*
|
574 |
-
* Very thin wrapper of the results obtained from the doofinder server
|
575 |
-
* it holds to accessor:
|
576 |
-
* - getProperty : get single property of the search results (rpp, page, etc....)
|
577 |
-
* - getResults: get an array with the results
|
578 |
-
*/
|
579 |
-
class DoofinderResults{
|
580 |
-
|
581 |
-
// doofinder status
|
582 |
-
const SUCCESS = 'success'; // everything ok
|
583 |
-
const NOTFOUND = 'notfound'; // no account with the provided hashid found
|
584 |
-
const EXHAUSTED = 'exhausted'; // the account has reached its query limit
|
585 |
-
|
586 |
-
private $properties = null;
|
587 |
-
private $results = null;
|
588 |
-
private $facets = null;
|
589 |
-
private $filter = null;
|
590 |
-
public $status = null;
|
591 |
-
|
592 |
-
/**
|
593 |
-
* Constructor
|
594 |
-
*
|
595 |
-
* @param string $jsonString stringified json returned by doofinder search server
|
596 |
-
*/
|
597 |
-
function __construct($jsonString){
|
598 |
-
$rawResults = json_decode($jsonString, true);
|
599 |
-
foreach($rawResults as $kkey => $vall){
|
600 |
-
if(!is_array($vall)){
|
601 |
-
$this->properties[$kkey] = $vall;
|
602 |
-
}
|
603 |
-
}
|
604 |
-
// doofinder status
|
605 |
-
$this->status = isset($this->properties['doofinder_status'])?
|
606 |
-
$this->properties['doofinder_status'] : self::SUCCESS;
|
607 |
-
|
608 |
-
// results
|
609 |
-
$this->results = array();
|
610 |
-
|
611 |
-
if(isset($rawResults['results']) && is_array($rawResults['results']))
|
612 |
-
{
|
613 |
-
$this->results = $rawResults['results'];
|
614 |
-
}
|
615 |
-
|
616 |
-
// build a friendly filter array
|
617 |
-
$this->filter = array();
|
618 |
-
// reorder filter, before assigning it to $this
|
619 |
-
if(isset($rawResults['filter']))
|
620 |
-
{
|
621 |
-
foreach($rawResults['filter'] as $filterType => $filters)
|
622 |
-
{
|
623 |
-
foreach($filters as $filterName => $filterProperties)
|
624 |
-
{
|
625 |
-
$this->filter[$filterName] = $filterProperties;
|
626 |
-
}
|
627 |
-
}
|
628 |
-
}
|
629 |
-
|
630 |
-
// facets
|
631 |
-
$this->facets = array();
|
632 |
-
if(isset($rawResults['facets']))
|
633 |
-
{
|
634 |
-
$this->facets = $rawResults['facets'];
|
635 |
-
|
636 |
-
// mark "selected" true or false according to filters presence
|
637 |
-
foreach($this->facets as $facetName => $facetProperties){
|
638 |
-
switch($facetProperties['_type']){
|
639 |
-
case 'terms':
|
640 |
-
foreach($facetProperties['terms'] as $pos => $term){
|
641 |
-
if(isset($this->filter[$facetName]) && in_array($term['term'], $this->filter[$facetName])){
|
642 |
-
$this->facets[$facetName]['terms'][$pos]['selected'] = true;
|
643 |
-
} else {
|
644 |
-
$this->facets[$facetName]['terms'][$pos]['selected'] = false;
|
645 |
-
}
|
646 |
-
}
|
647 |
-
break;
|
648 |
-
case 'range':
|
649 |
-
foreach($facetProperties['ranges'] as $pos => $range){
|
650 |
-
$this->facets[$facetName]['ranges'][$pos]['selected_from'] = false;
|
651 |
-
$this->facets[$facetName]['ranges'][$pos]['selected_to'] = false;
|
652 |
-
if(isset($this->filter[$facetName]) && isset($this->filter[$facetName]['gte'])){
|
653 |
-
$this->facets[$facetName]['ranges'][$pos]['selected_from'] = $this->filter[$facetName]['gte'];
|
654 |
-
}
|
655 |
-
if(isset($this->filter[$facetName]) && isset($this->filter[$facetName]['lte'])){
|
656 |
-
$this->facets[$facetName]['ranges'][$pos]['selected_to'] = $this->filter[$facetName]['lte'];
|
657 |
-
}
|
658 |
-
|
659 |
-
}
|
660 |
-
break;
|
661 |
-
}
|
662 |
-
}
|
663 |
-
}
|
664 |
-
}
|
665 |
-
|
666 |
-
/**
|
667 |
-
* getProperty
|
668 |
-
*
|
669 |
-
* get single property from the results
|
670 |
-
* @param string @propertyName: 'results_per_page', 'query', 'max_score', 'page', 'total', 'hashid'
|
671 |
-
* @return mixed the value of the property
|
672 |
-
*/
|
673 |
-
public function getProperty($propertyName){
|
674 |
-
return array_key_exists($propertyName, $this->properties) ?
|
675 |
-
$this->properties[$propertyName]: null;
|
676 |
-
}
|
677 |
-
|
678 |
-
/**
|
679 |
-
* getResults
|
680 |
-
*
|
681 |
-
* @return array search results. at the moment, only the 'cooked' version.
|
682 |
-
* Each result is of the form:
|
683 |
-
* array('header'=>...,
|
684 |
-
* 'body' => ..,
|
685 |
-
* 'price' => ..,
|
686 |
-
* 'href' => ...,
|
687 |
-
* 'image' => ...,
|
688 |
-
* 'type' => ...,
|
689 |
-
* 'id' => ..)
|
690 |
-
*/
|
691 |
-
public function getResults(){
|
692 |
-
return $this->results;
|
693 |
-
}
|
694 |
-
|
695 |
-
/**
|
696 |
-
*
|
697 |
-
* getFacetsNames
|
698 |
-
*
|
699 |
-
* @return array facets names.
|
700 |
-
*/
|
701 |
-
public function getFacetsNames(){
|
702 |
-
return array_keys($this->facets);
|
703 |
-
}
|
704 |
-
|
705 |
-
/**
|
706 |
-
* getFacet
|
707 |
-
*
|
708 |
-
* @param string name the facet name whose results are wanted
|
709 |
-
*
|
710 |
-
* @return array facet search data
|
711 |
-
* - for terms facets
|
712 |
-
* array(
|
713 |
-
* '_type'=> 'terms', // type of facet 'terms' or 'range'
|
714 |
-
* 'missing'=> 3, // # of elements with no value for this facet
|
715 |
-
* 'others'=> 2, // # of terms not present in the search response
|
716 |
-
* 'total'=> 6, // # number of possible terms for this facet
|
717 |
-
* 'terms'=> array(
|
718 |
-
* array('count'=>6, 'term'=>'Blue', 'selected'=>false), // in the response, there are 6 'blue' terms
|
719 |
-
* array('count'=>3, 'term': 'Red', 'selected'=>true), // if 'selected'=>true, that term has been selected as filter
|
720 |
-
* ...
|
721 |
-
* )
|
722 |
-
* )
|
723 |
-
* - for range facets
|
724 |
-
* array(
|
725 |
-
* '_type'=> 'range',
|
726 |
-
* 'ranges'=> array(
|
727 |
-
* array(
|
728 |
-
* 'count'=>6, // in the response, 6 elements within that range.
|
729 |
-
* 'from':0,
|
730 |
-
* 'min': 30
|
731 |
-
* 'max': 90,
|
732 |
-
* 'mean'=>33.2,
|
733 |
-
* 'total'=>432,
|
734 |
-
* 'total_count'=>6,
|
735 |
-
* 'selected_from'=> 34.3 // if present. this value has been used as filter. false otherwise
|
736 |
-
* 'selected_to'=> 99.3 // if present. this value has been used as filter. false otherwise
|
737 |
-
* ),
|
738 |
-
* ...
|
739 |
-
* )
|
740 |
-
* )
|
741 |
-
*
|
742 |
-
*
|
743 |
-
*/
|
744 |
-
public function getFacet($facetName){
|
745 |
-
return $this->facets[$facetName];
|
746 |
-
}
|
747 |
-
|
748 |
-
/**
|
749 |
-
* getFacets
|
750 |
-
*
|
751 |
-
* get the whole facets associative array:
|
752 |
-
* array('color'=>array(...), 'brand'=>array(...))
|
753 |
-
* each array is defined as in getFacet() docstring
|
754 |
-
*
|
755 |
-
* @return array facets assoc. array
|
756 |
-
*/
|
757 |
-
public function getFacets(){
|
758 |
-
return $this->facets;
|
759 |
-
}
|
760 |
-
|
761 |
-
/**
|
762 |
-
* getAppliedFilters
|
763 |
-
*
|
764 |
-
* get the filters the query has defined
|
765 |
-
* array('categories' => array( // filter name . same as facet name
|
766 |
-
* 'Sillas de paseo', // if simple array, it's a terms facet
|
767 |
-
* 'Sacos sillas de paseo'
|
768 |
-
* ),
|
769 |
-
* 'color' => array(
|
770 |
-
* 'red',
|
771 |
-
* 'blue'
|
772 |
-
* ),
|
773 |
-
* 'price' => array(
|
774 |
-
* 'include_upper'=>true, // if 'from' , 'to' keys, it's a range facet
|
775 |
-
* 'from'=>35.19,
|
776 |
-
* 'to'=>9999
|
777 |
-
* )
|
778 |
-
* )
|
779 |
-
* MEANING OF THE EXAMPLE FILTER:
|
780 |
-
* "FROM the query results, filter only results that have ('Sillas de paseo' OR 'Sacos sillas de paseo') categories
|
781 |
-
* AND ('red' OR 'blue') color AND price is BETWEEN 34.3 and 99.3"
|
782 |
-
|
783 |
-
*/
|
784 |
-
public function getAppliedFilters(){
|
785 |
-
return $this->filter;
|
786 |
-
}
|
787 |
-
|
788 |
-
/**
|
789 |
-
* isOk
|
790 |
-
*
|
791 |
-
* checks if all went well
|
792 |
-
* @return boolean true if the status is 'success'.
|
793 |
-
* false if the status is not.
|
794 |
-
*/
|
795 |
-
public function isOk(){
|
796 |
-
return $this->status == self::SUCCESS;
|
797 |
-
}
|
798 |
-
}
|
799 |
-
|
800 |
-
|
801 |
-
class DoofinderException extends Exception{
|
802 |
-
|
803 |
-
}
|
804 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Doofinder/doofinder_management_api.php
DELETED
@@ -1,408 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Author:: JoeZ99 (<jzarate@gmail.com>).
|
4 |
-
*
|
5 |
-
* License:: Apache License, Version 2.0
|
6 |
-
*
|
7 |
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
8 |
-
* not use this file except in compliance with the License. You may obtain
|
9 |
-
* a copy of the License at
|
10 |
-
*
|
11 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
12 |
-
*
|
13 |
-
* Unless required by applicable law or agreed to in writing, software
|
14 |
-
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
15 |
-
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
16 |
-
* License for the specific language governing permissions and limitations
|
17 |
-
* under the License.
|
18 |
-
*/
|
19 |
-
require_once dirname(__FILE__).'/errors.php';
|
20 |
-
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Class to manage the connection with the API servers.
|
24 |
-
*
|
25 |
-
* Needs APIKEY in initialization.
|
26 |
-
* Example: $dma = new DoofinderManagementApi('eu1-d531af87f10969f90792a4296e2784b089b8a875')
|
27 |
-
*/
|
28 |
-
class DoofinderManagementApi
|
29 |
-
{
|
30 |
-
const REMOTE_API_ENDPOINT = "https://%s-api.doofinder.com/v1";
|
31 |
-
const LOCAL_API_ENDPOINT = "http://localhost:8000/api/v1";
|
32 |
-
|
33 |
-
private $apiKey = null;
|
34 |
-
private $clusterRegion = 'eu1';
|
35 |
-
private $token = null;
|
36 |
-
private $baseManagementUrl = null;
|
37 |
-
|
38 |
-
function __construct($apiKey, $local = false){
|
39 |
-
$this->apiKey = $apiKey;
|
40 |
-
$clusterToken = explode('-', $apiKey);
|
41 |
-
$this->clusterRegion = $clusterToken[0];
|
42 |
-
$this->token = $clusterToken[1];
|
43 |
-
if ($local === true){
|
44 |
-
$this->baseManagementUrl = self::LOCAL_API_ENDPOINT;
|
45 |
-
} else {
|
46 |
-
$this->baseManagementUrl = sprintf(self::REMOTE_API_ENDPOINT, $this->clusterRegion);
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Makes the actual request to the API server and normalize response
|
52 |
-
*
|
53 |
-
* @param string $method The HTTP method to use. 'GET|PUT|POST|DELETE'
|
54 |
-
* @param string $entryPoint The path to use. '/<hashid>/items/product'
|
55 |
-
* @param array $params If any, url request parameters
|
56 |
-
* @param array $data If any, body request parameters
|
57 |
-
* @return array Array with both status code and response .
|
58 |
-
*/
|
59 |
-
function managementApiCall($method='GET', $entryPoint='', $params=null, $data=null){
|
60 |
-
$headers = array('Authorization: Token '.$this->token, // for Auth
|
61 |
-
'Content-Type: application/json',
|
62 |
-
'Expect:'); // Fixes the HTTP/1.1 417 Expectation Failed
|
63 |
-
|
64 |
-
$url = $this->baseManagementUrl.'/'.$entryPoint;
|
65 |
-
if (is_array($params) && sizeof($params) > 0){
|
66 |
-
$url .= '?'.http_build_query($params);
|
67 |
-
}
|
68 |
-
|
69 |
-
$session = curl_init($url);
|
70 |
-
curl_setopt($session, CURLOPT_CUSTOMREQUEST, $method);
|
71 |
-
curl_setopt($session, CURLOPT_HEADER, false);
|
72 |
-
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Tell curl to return the response
|
73 |
-
curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // Adding request headers
|
74 |
-
|
75 |
-
if (in_array($method, array('POST', 'PUT'))){
|
76 |
-
curl_setopt($session, CURLOPT_POSTFIELDS, $data);
|
77 |
-
}
|
78 |
-
|
79 |
-
$response = curl_exec($session);
|
80 |
-
$httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);
|
81 |
-
curl_close($session);
|
82 |
-
|
83 |
-
handleErrors($httpCode, $response);
|
84 |
-
|
85 |
-
$return = array('statusCode' => $httpCode);
|
86 |
-
$return['response'] = ($decoded = json_decode($response, true)) ? $decoded : $response;
|
87 |
-
|
88 |
-
return $return;
|
89 |
-
}
|
90 |
-
|
91 |
-
/**
|
92 |
-
* To get info on all possible api entry points
|
93 |
-
* @return array An assoc. array with the different entry points
|
94 |
-
*/
|
95 |
-
function getApiRoot(){
|
96 |
-
$response = $this->managementApiCall();
|
97 |
-
return $response['response'];
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Obtain a list of SearchEngines objects, ready to interact with the API
|
102 |
-
* @return array list of searchEngines objects
|
103 |
-
*/
|
104 |
-
function getSearchEngines(){
|
105 |
-
$searchEngines = array();
|
106 |
-
$apiRoot = $this->getApiRoot();
|
107 |
-
unset($apiRoot['searchengines']);
|
108 |
-
|
109 |
-
foreach($apiRoot as $hashid => $props){
|
110 |
-
$searchEngines[] = new SearchEngine($this, $hashid, $props['name']);
|
111 |
-
}
|
112 |
-
|
113 |
-
return $searchEngines;
|
114 |
-
}
|
115 |
-
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Class with all the capabilities described in the API
|
120 |
-
*
|
121 |
-
* see http://www.doofinder.com/developer/topics/api/management-api
|
122 |
-
*/
|
123 |
-
class SearchEngine {
|
124 |
-
public $name = null;
|
125 |
-
public $hashid = null;
|
126 |
-
|
127 |
-
private $dma = null; // DoofinderManagementApi instance
|
128 |
-
|
129 |
-
function __construct($dma, $hashid, $name){
|
130 |
-
$this->name = $name;
|
131 |
-
$this->hashid = $hashid;
|
132 |
-
$this->dma = $dma;
|
133 |
-
}
|
134 |
-
|
135 |
-
/**
|
136 |
-
* Get a list of searchengine's types
|
137 |
-
*
|
138 |
-
* @return array list of types
|
139 |
-
*/
|
140 |
-
function getDatatypes(){
|
141 |
-
return $this->getTypes();
|
142 |
-
}
|
143 |
-
|
144 |
-
/**
|
145 |
-
* Get a list of searchengine's types
|
146 |
-
*
|
147 |
-
* @return array list of types
|
148 |
-
*/
|
149 |
-
function getTypes(){
|
150 |
-
$result = $this->dma->managementApiCall('GET', "{$this->hashid}/types");
|
151 |
-
return $result['response'];
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Add a type to the searchengine
|
156 |
-
*
|
157 |
-
* @param string $dType the type name
|
158 |
-
* @return new list of searchengine's types
|
159 |
-
*/
|
160 |
-
function addType($dType){
|
161 |
-
$result = $this->dma->managementApiCall('POST', "{$this->hashid}/types", null,
|
162 |
-
json_encode(array('name' => $dType)));
|
163 |
-
return $result['response'];
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Delete a type and all its items. HANDLE WITH CARE
|
168 |
-
*
|
169 |
-
* @param string $dType the Type to delete. All items belonging
|
170 |
-
* to that type will be removed. mandatory
|
171 |
-
* @return boolean true on success
|
172 |
-
*/
|
173 |
-
function deleteType($dType){
|
174 |
-
$result = $this->dma->managementApiCall('DELETE', "{$this->hashid}/types/{$dType}");
|
175 |
-
return $result['statusCode'] == 204;
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Get paginated indexed items belonging to a searchengine's type
|
180 |
-
*
|
181 |
-
* It only paginates forward. Can't go backwards
|
182 |
-
* @param string $dType Type of the items to list
|
183 |
-
* @param string $scrollId identifier of the pagination set
|
184 |
-
* @return array Assoc array with scroll_id ,paginated results and total results.
|
185 |
-
*/
|
186 |
-
public function getScrolledItemsPage($dType, $scrollId = null){
|
187 |
-
$params = $scrollId ? array("scroll_id" => $scrollId) : null;
|
188 |
-
$result = $this->dma->managementApiCall('GET', "{$this->hashid}/items/{$dType}", $params);
|
189 |
-
return array(
|
190 |
-
'scroll_id' => $result['response']['scroll_id'],
|
191 |
-
'results' => $result['response']['results'],
|
192 |
-
'total' => $result['response']['count'],
|
193 |
-
);
|
194 |
-
}
|
195 |
-
|
196 |
-
function items($dType){
|
197 |
-
return new ItemsRS($this, $dType);
|
198 |
-
}
|
199 |
-
|
200 |
-
/**
|
201 |
-
* Get details of a specific item
|
202 |
-
*
|
203 |
-
* @param string $dType Type of the item.
|
204 |
-
* @param string $itemId the id of the item
|
205 |
-
* @return array Assoc array representing the item.
|
206 |
-
*/
|
207 |
-
function getItem($dType, $itemId){
|
208 |
-
$result = $this->dma->managementApiCall('GET', "{$this->hashid}/items/{$dType}/{$itemId}");
|
209 |
-
return $result['response'];
|
210 |
-
}
|
211 |
-
|
212 |
-
/**
|
213 |
-
* Add an item to the search engine
|
214 |
-
*
|
215 |
-
* - If the 'id' field is present, use that as item's id or overwrite an existing
|
216 |
-
* item with that id.
|
217 |
-
* - It the 'id' field is not present, create one.
|
218 |
-
*
|
219 |
-
* @param string $dType type of the. If not provided, first available type is used
|
220 |
-
* @param array $itemDescription Assoc array representation of the item
|
221 |
-
* @return string the id of the item just created
|
222 |
-
*/
|
223 |
-
function addItem($dType, $itemDescription){
|
224 |
-
$result = $this->dma->managementApiCall('POST', "{$this->hashid}/items/{$dType}", null,
|
225 |
-
json_encode($itemDescription));
|
226 |
-
return $result['response']['id'];
|
227 |
-
}
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Add items in bulk to the search engine
|
231 |
-
*
|
232 |
-
* For each item:
|
233 |
-
* - If the 'id' field is present, use that as item's id or overwrite an existing
|
234 |
-
* item with that id.
|
235 |
-
* - It the 'id' field is not present, create one.
|
236 |
-
*
|
237 |
-
* @param string $dType type of the. If not provided, first available type is used
|
238 |
-
* @param array $itemsDescription List of Assoc array representation of the item
|
239 |
-
* @return array List of ids of the added items
|
240 |
-
*/
|
241 |
-
function addItems($dType, $itemsDescription){
|
242 |
-
$result = $this->dma->managementApiCall('POST', "{$this->hashid}/items/{$dType}", null,
|
243 |
-
json_encode($itemsDescription));
|
244 |
-
|
245 |
-
function fetchId($item){
|
246 |
-
return $item['id'];
|
247 |
-
};
|
248 |
-
|
249 |
-
return array_map('fetchId', $result['response']);
|
250 |
-
}
|
251 |
-
|
252 |
-
/**
|
253 |
-
* Update or create an item of the search engine
|
254 |
-
*
|
255 |
-
* In case of conflict between itemDescription's id or $itemId,
|
256 |
-
* the latter is used.
|
257 |
-
*
|
258 |
-
* @param string $dType type of the Item.
|
259 |
-
* @param string $itemId Id of the item to be updated/added
|
260 |
-
* @param array $itemDescription Assoc array representating the item.
|
261 |
-
* @return boolean true on success.
|
262 |
-
*/
|
263 |
-
function updateItem($dType, $itemId, $itemDescription){
|
264 |
-
$result = $this->dma->managementApiCall('PUT', "{$this->hashid}/items/{$dType}/{$itemId}", null,
|
265 |
-
json_encode($itemDescription));
|
266 |
-
return $result['statusCode'] == 200;
|
267 |
-
}
|
268 |
-
|
269 |
-
/**
|
270 |
-
* Bulk update of several items
|
271 |
-
*
|
272 |
-
* Each item description must contain the 'id' field
|
273 |
-
*
|
274 |
-
* @param string $dType type of the items.
|
275 |
-
* @param array $itemsDescription List of assoc array representing items
|
276 |
-
* @return boolean true on success
|
277 |
-
*/
|
278 |
-
function updateItems($dType, $itemsDescription){
|
279 |
-
$result = $this->dma->managementApiCall('PUT', "{$this->hashid}/items/{$dType}", null,
|
280 |
-
json_encode($itemsDescription));
|
281 |
-
return $result['statusCode'] == 200;
|
282 |
-
}
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Delete an item
|
286 |
-
*
|
287 |
-
* @param string $dType type of the item
|
288 |
-
* @param string $itemId id of the item
|
289 |
-
* @return boolean true if success, false if failure
|
290 |
-
*/
|
291 |
-
function deleteItem($dType, $itemId){
|
292 |
-
$result = $this->dma->managementApiCall('DELETE', "{$this->hashid}/items/{$dType}/{$itemId}");
|
293 |
-
return $result['statusCode'] == 204 ;
|
294 |
-
}
|
295 |
-
|
296 |
-
/**
|
297 |
-
* Ask the server to process the search engine's feeds
|
298 |
-
*
|
299 |
-
* @return array Assoc array with:
|
300 |
-
* - 'task_created': boolean true if a new task has been created
|
301 |
-
* - 'task_id': if task created, the id of the task.
|
302 |
-
*/
|
303 |
-
function process(){
|
304 |
-
$result = $this->dma->managementApiCall('POST', "{$this->hashid}/tasks/process");
|
305 |
-
$taskCreated = ($result['statusCode'] == 201);
|
306 |
-
$taskId = $taskCreated ? obtainId($result['response']['link']) : null;
|
307 |
-
return array('task_created'=>$taskCreated, 'task_id' => $taskId);
|
308 |
-
}
|
309 |
-
|
310 |
-
/**
|
311 |
-
* Obtain info of the last processing task sent to the server
|
312 |
-
*
|
313 |
-
* @return array Assoc array with 'state' and 'message' indicating status of the
|
314 |
-
* last asked processing task
|
315 |
-
*/
|
316 |
-
function processInfo(){
|
317 |
-
$result = $this->dma->managementApiCall('GET', "{$this->hashid}/tasks/process");
|
318 |
-
unset($result['response']['task_name']);
|
319 |
-
return $result['response'];
|
320 |
-
}
|
321 |
-
|
322 |
-
/**
|
323 |
-
* Obtain info about how a task is going or its result
|
324 |
-
*
|
325 |
-
* @return array Assoc array with 'state' and 'message' indicating the status
|
326 |
-
* of the task
|
327 |
-
*/
|
328 |
-
function taskInfo($taskId){
|
329 |
-
$result = $this->dma->managementApiCall('GET', "{$this->hashid}/tasks/{$taskId}");
|
330 |
-
unset($result['response']['task_name']);
|
331 |
-
return $result['response'];
|
332 |
-
}
|
333 |
-
|
334 |
-
/**
|
335 |
-
* Obtain logs of the latest feed processing tasks done
|
336 |
-
*
|
337 |
-
* @return array list of arrays representing the logs
|
338 |
-
*/
|
339 |
-
function logs(){
|
340 |
-
$result = $this->dma->managementApiCall("GET", "{$this->hashid}/logs");
|
341 |
-
return $result['response'];
|
342 |
-
}
|
343 |
-
}
|
344 |
-
|
345 |
-
/**
|
346 |
-
* Helper class to iterate through the search engine's items
|
347 |
-
*
|
348 |
-
* Implemets Iterator interface so foreach() can work with ItemRS
|
349 |
-
*/
|
350 |
-
class ItemsRS implements Iterator {
|
351 |
-
|
352 |
-
private $searchEngine = null;
|
353 |
-
private $resultsPage = null;
|
354 |
-
private $scrollId = null;
|
355 |
-
private $position = 0;
|
356 |
-
private $total = null;
|
357 |
-
|
358 |
-
function __construct($searchEngine, $dType){
|
359 |
-
$this->dType = $dType;
|
360 |
-
$this->searchEngine = $searchEngine;
|
361 |
-
}
|
362 |
-
|
363 |
-
private function fetchResults(){
|
364 |
-
$apiResults = $this->searchEngine->getScrolledItemsPage($this->dType, $this->scrollId);
|
365 |
-
$this->total = $apiResults['total'];
|
366 |
-
$this->resultsPage = $apiResults['results'];
|
367 |
-
$this->scrollId = $apiResults['scroll_id'];
|
368 |
-
$this->currentItem = each($this->resultsPage);
|
369 |
-
}
|
370 |
-
|
371 |
-
function rewind(){
|
372 |
-
$this->scrollId = null;
|
373 |
-
$this->fetchResults();
|
374 |
-
}
|
375 |
-
|
376 |
-
function valid(){
|
377 |
-
return $this->position < $this->total;
|
378 |
-
}
|
379 |
-
|
380 |
-
function current(){
|
381 |
-
return $this->currentItem['value'];
|
382 |
-
}
|
383 |
-
|
384 |
-
function key(){
|
385 |
-
return $this->position;
|
386 |
-
}
|
387 |
-
|
388 |
-
function next(){
|
389 |
-
++$this->position;
|
390 |
-
$this->currentItem = each($this->resultsPage);
|
391 |
-
if (!$this->currentItem && $this->position < $this->total){
|
392 |
-
$this->fetchResults();
|
393 |
-
reset($this->resultsPage);
|
394 |
-
$this->currentItem = each($this->resultsPage);
|
395 |
-
}
|
396 |
-
}
|
397 |
-
}
|
398 |
-
|
399 |
-
/**
|
400 |
-
* Extracts identificator from an item or task url.
|
401 |
-
*
|
402 |
-
* @param string $url item or task resource locator
|
403 |
-
* @return the item identificator
|
404 |
-
*/
|
405 |
-
function obtainId($url){
|
406 |
-
preg_match('~/\w{32}/(items/\w+|tasks)/([\w-_]+)/?$~', $url, $matches);
|
407 |
-
return $matches[2];
|
408 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Doofinder/errors.php
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class NotAllowed extends Exception {}
|
4 |
-
|
5 |
-
class BadRequest extends Exception {}
|
6 |
-
|
7 |
-
class QuotaExhausted extends Exception {}
|
8 |
-
|
9 |
-
class WrongResponse extends Exception {}
|
10 |
-
|
11 |
-
class ThrottledResponse extends Exception {}
|
12 |
-
|
13 |
-
function readError($response) {
|
14 |
-
$error = json_decode($response, true);
|
15 |
-
$error = $error['detail'];
|
16 |
-
if (!isset($error)) {
|
17 |
-
$error = $response;
|
18 |
-
}
|
19 |
-
return $error;
|
20 |
-
}
|
21 |
-
|
22 |
-
function handleErrors($statusCode, $response){
|
23 |
-
switch($statusCode)
|
24 |
-
{
|
25 |
-
case 403:
|
26 |
-
throw new NotAllowed("The user does not have permissions to perform this operation: ".readError($response));
|
27 |
-
case 401:
|
28 |
-
throw new NotAllowed("The user hasn't provided valid authorization: ".readError($response));
|
29 |
-
case 404:
|
30 |
-
throw new BadRequest("Not Found: ".readError($response));
|
31 |
-
case 409: // trying to post with an already used id
|
32 |
-
throw new BadRequest("Request conflict: ".readError($response));
|
33 |
-
case 429:
|
34 |
-
if (stripos($response, 'throttled')) {
|
35 |
-
throw new ThrottledResponse(readError($response));
|
36 |
-
} else {
|
37 |
-
throw new QuotaExhausted("The query quota has been reached. No more queries can be requested right now");
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
if ($statusCode >= 500) {
|
42 |
-
throw new WrongResponse("Server error: ".readError($response));
|
43 |
-
}
|
44 |
-
|
45 |
-
if ($statusCode >= 400) {
|
46 |
-
throw new BadRequest("The client made a bad request: ".readError($response));
|
47 |
-
}
|
48 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Doofinder_Feed</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
@@ -48,11 +48,11 @@ Doofinder is fast and innovative. With no doubt, it is the best search engine fo
|
|
48 |
You can get more info and create your account visiting the Doofinder site:
|
49 |

|
50 |
http://www.doofinder.com</description>
|
51 |
-
<notes>
|
52 |
<authors><author><name>Carlos Escribano Rey</name><user>doofinder</user><email>carlos@doofinder.com</email></author></authors>
|
53 |
-
<date>2017-01-
|
54 |
-
<time>
|
55 |
-
<contents><target name="magecommunity"><dir name="Doofinder"><dir name="Feed"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="View.php" hash="
|
56 |
<compatible/>
|
57 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
58 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Doofinder_Feed</name>
|
4 |
+
<version>1.7.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
48 |
You can get more info and create your account visiting the Doofinder site:
|
49 |

|
50 |
http://www.doofinder.com</description>
|
51 |
+
<notes>WARNING: Updated Doofinder PHP Library. This is a big update. Remember to clear Magento Cache!!!</notes>
|
52 |
<authors><author><name>Carlos Escribano Rey</name><user>doofinder</user><email>carlos@doofinder.com</email></author></authors>
|
53 |
+
<date>2017-01-17</date>
|
54 |
+
<time>11:58:27</time>
|
55 |
+
<contents><target name="magecommunity"><dir name="Doofinder"><dir name="Feed"><dir name="Block"><dir name="Adminhtml"><dir name="Log"><file name="View.php" hash="2fa64cfcbbba04f934a956001c1ae9b1"/></dir><dir name="Map"><file name="Additional.php" hash="64f331ffbfb4f6a56d36b19fbd9f7494"/></dir></dir><file name="Integration.php" hash="8e55c6e2f6fcd9ca6e571740ac01764e"/><dir name="Settings"><dir name="Buttons"><file name="Generate.php" hash="d8499ba079fb0c442b41eaf8b929587a"/><file name="ViewLog.php" hash="5db7611da044c02822aeac4cf226287d"/></dir><dir name="Panel"><file name="Cron.php" hash="e93e0471544eef8d6cc1ea5c2a8037dd"/><file name="Crondescription.php" hash="ae569ca65800d86399550bee0aed45f7"/><file name="Datetime.php" hash="74682a75b98d559f887eb72d216cb15c"/><file name="Description.php" hash="a9ead3fae34924fdb0202fb98a31e2f6"/><file name="File.php" hash="e3ed4f01d1d14ce86df73ff6f547f054"/><file name="Hashdescription.php" hash="707aa2f0eff7a1e170e6355787e09e84"/><file name="Layerdescription.php" hash="7f2204ba3957b8c2422adf286966b50c"/><file name="Message.php" hash="9e8d9ba61e05f7c5f9f87e247870df5c"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="cad85048680dacdf18d2b8ed4fcccf45"/><file name="Log.php" hash="ce1b4cba14b4d73c28a7dd0f3d7284b2"/><file name="Search.php" hash="c7d8b0a7e4d8aa0c7e5cf20669e58a65"/><file name="Tax.php" hash="c329496ce8fc968c21c7e6ce52a4d168"/></dir><dir name="Model"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="d9ed798a653ce93e2841acaebc839bb2"/></dir><dir name="Validation"><file name="Hashid.php" hash="5c84ddebe10442c48bc8bca05a9253d1"/></dir></dir></dir></dir><dir name="CatalogSearch"><dir name="Resource"><file name="Fulltext.php" hash="a3ece9fe463669dc6c16a232f7160aba"/></dir></dir><file name="Config.php" hash="1f110581372f2e227e566d695f8c0467"/><file name="Cron.php" hash="1415a2e1dbc71669df63f37f620336d7"/><file name="Generator.php" hash="3e79aab32f94bf05cfd5e06c85d294bd"/><file name="Log.php" hash="cf995d09b460c4c8c29d198394031c78"/><dir name="Map"><dir name="Product"><file name="Abstract.php" hash="e5d0578aa36269453c262afd5cecaba4"/><file name="Associated.php" hash="e22525394cde9dc828b1ad679402f914"/><file name="Bundle.php" hash="abaad01d5ee67c0de21745e72954d6d8"/><file name="Configurable.php" hash="42dd5f332ec46a0f4598ce591fa54b2b"/><file name="Downloadable.php" hash="b6c11bdd6d69d71fa9a895a51ee561b7"/><file name="Grouped.php" hash="2de7aea02a69f22dd41577de18ffa99d"/><file name="Simple.php" hash="731205d8a1943de20536f1baeafcfd48"/><file name="Virtual.php" hash="4d3a687e379b32e03ef076011d232d0c"/></dir></dir><dir name="Mysql4"><dir name="Cron"><file name="Collection.php" hash="54987af88b25fa573dd8523c16f9d00f"/></dir><file name="Cron.php" hash="eb23068861819bb86aaf5b67c6a4b45c"/><dir name="Log"><file name="Collection.php" hash="5711bb5d493299e82eaf6c5d6d5b2d1e"/></dir><file name="Log.php" hash="daffb9486067d0f6289f5795788b82ae"/></dir><dir name="Observers"><file name="Autoloader.php" hash="0522bafc93606cebf529b2bdd977c47a"/><file name="Feed.php" hash="c8a56c5c4b0fe1bbf32a0d2f223cf1bd"/><file name="Logs.php" hash="e3abe532e883c0d0d37f23250c70c7ef"/><file name="Schedule.php" hash="6902ed9c6ccdc66b818621e61860dadb"/></dir><dir name="Resource"><dir name="Mysql4"><file name="Setup.php" hash="3b2e04ba1e5cefadd1d4949af05f1f6d"/></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Map"><file name="Additional.php" hash="571c9652bc9c05606ccd5a555a2c99c7"/></dir><dir name="Total"><file name="Limit.php" hash="a23092ea72cbe81e2779b086ad055bf6"/></dir></dir><file name="Reset.php" hash="7632627c65cb14eaab403556f0ca2d1f"/><dir name="Source"><dir name="Product"><file name="Attributes.php" hash="72ebfbc46404f4845d74c2705cf97d90"/></dir></dir></dir></dir><file name="Tools.php" hash="a6c7d9ab3ad22e629714f64f756055cb"/></dir><dir name="Test"><dir name="Controller"><dir name="Index"><dir name="fixtures"><file name="testConfig.yaml" hash="0a1f21a3417389e0c0a13392c79a7a89"/><file name="testFeed.yaml" hash="694cf25a35a9a301a8ae678866937909"/><file name="testIndex.yaml" hash="0a1f21a3417389e0c0a13392c79a7a89"/></dir><dir name="providers"><file name="testConfig.yaml" hash="0a1f21a3417389e0c0a13392c79a7a89"/><file name="testFeed.yaml" hash="1ea2f638be8fdcea22ef47767ed8d7db"/><file name="testIndex.yaml" hash="0a1f21a3417389e0c0a13392c79a7a89"/></dir></dir><file name="Index.php" hash="2771de706303653d039818bd0f6590ea"/></dir><dir name="Model"><dir name="Product"><dir name="expectations"><file name="testGenerator.yaml" hash="232dda1f4fd88b8ef081393f08044731"/></dir><dir name="fixtures"><file name="testGenerator.yaml" hash="df25e3ca67fd98ab1b933c4951c599ef"/></dir><dir name="providers"><file name="testGenerator.yaml" hash="84779d5dcd8d92abdecf0cd5ee65cfb0"/></dir></dir><file name="Product.php" hash="6c45ae2b36c6cc721ef634855ed6d596"/></dir></dir><dir name="controllers"><file name="DoofinderFeedFeedController.php" hash="6ba2b19d9d06cdabceb02c17e20865aa"/><file name="DoofinderFeedLogController.php" hash="e9dad960daa5ae85e1e5afaab697d213"/><file name="FeedController.php" hash="c636b86d19abbf6433ad0ff0e3562c47"/><file name="IndexController.php" hash="75cbb8c12969d7eda41d36bb9520d804"/></dir><dir name="etc"><file name="config.xml" hash="d7c4f26c10aba5bde8a1f3596f1065bf"/><file name="system.xml" hash="4c69b26ff91eedb582883e83a26b843d"/></dir><dir name="sql"><dir name="doofinder_feed_setup"><file name="mysql4-install-1.5.4.php" hash="9dc5ed4e10febbe75ab1911259a1c9fe"/><file name="mysql4-install-1.5.7.php" hash="85baa03d9c4d76f6b744ba107c21f8da"/><file name="mysql4-upgrade-1.5.4-1.5.5.php" hash="df7158f6d6cdded9bdfc5cb72c1dc8e3"/><file name="mysql4-upgrade-1.5.5-1.5.6.php" hash="0f3ca5263356a0bc83d9352b463944dc"/><file name="mysql4-upgrade-1.5.6-1.5.7.php" hash="b0180770655f36d6723483aa3bd1541f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Doofinder_Feed.xml" hash="9d3b6fbbbec12708461c33260715451c"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="doofinder.xml" hash="a7b9105a4e613086340b042845793d9f"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="doofinder.xml" hash="48a8636096950914917461260416c355"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="doofinder"><file name="admin.js" hash="ca050b0527ae101c75532fbca1c4a274"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="doofinder"><file name="styles.css" hash="d6ec303c3199db3ab4dffa8d2491105e"/></dir></dir></dir></dir></target></contents>
|
56 |
<compatible/>
|
57 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
58 |
</package>
|