-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e9ca116
Showing
18 changed files
with
1,004 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.idea | ||
.DS_Store | ||
plugin/vendor | ||
build/* | ||
plugin/renderer/item/positions.config | ||
plugin/composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Algolia integration for ZOO | ||
|
||
Plugin to allow any ZOO item to be indexed into an algolia index. | ||
Each ZOO application has its own Algolia configuration, allowing for different indexes per-application. | ||
|
||
Each ZOO type can be mapped through a simple drag and drop configuration using the standard ZOO layouts. | ||
|
||
## Installation | ||
|
||
Download [a release here on github](https://github.com/Weble/ZOOalgolia/releases) and install it using Joomla Installer. | ||
|
||
## Usage | ||
|
||
1. Install the plugin | ||
2. Enable it | ||
3. Go into your ZOO application instance configuration and fill in the required settings  | ||
4. Go into the ZOO layout configuration and map your type. Use the "Label" to set the key of that property.  | ||
|
||
Now, every time you create / save / delete an item from zoo, it will be instantly indexed in Algolia. | ||
|
||
## Console Commands | ||
|
||
If you have [JoomlaCommands](https://github.com/Weble/JoomlaCommands) installed, the plugin provides an handy `algolia:sync` command to deal with syncing from the command line | ||
|
||
```php bin/console algolia:sync {--app=[ID] --type=[type] --ids=1,2,3}``` | ||
|
||
## Build from source | ||
|
||
```./build.sh``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Remove old files | ||
rm -f build/*.zip | ||
|
||
# Zip Plugin | ||
cd plugin/ | ||
composer install | ||
zip -qr ../build/plg_system_zooalgolia.zip ./* | ||
|
||
cd ../ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"require": { | ||
"php": "^7.4 || ^8.0", | ||
"algolia/algoliasearch-client-php": "^3.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Weble\\ZOOAlgolia\\": [ | ||
"src" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"platform": { | ||
"php": "7.4.22" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<applications> | ||
<application group="all"> | ||
<params group="application-config"> | ||
<param name="algolia_app_id" type="text" description="Algolia Application Id" label="Algolia App Id" default="" /> | ||
<param name="algolia_search_key" type="text" description="Algolia Search Key" label="Algolia Search Key" default="" /> | ||
<param name="algolia_secret_key" type="text" description="Algolia Secret Key" label="Algolia Secret Key" default="" /> | ||
<param name="algolia_index" type="text" description="Algolia Index name" label="Algolia Index Name" default="" /> | ||
</params> | ||
</application> | ||
</applications> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
use Joomla\CMS\Factory; | ||
|
||
defined('_JEXEC') or die('Restricted access'); | ||
|
||
class plgSystemZooalgoliaInstallerScript | ||
{ | ||
public const MIN_PHP = '7.4'; | ||
|
||
public function preflight($type, $parent) | ||
{ | ||
$app = Factory::getApplication(); | ||
$msg = null; | ||
|
||
if (!in_array($type, ['install', 'update'])) { | ||
return; | ||
} | ||
|
||
// check minimum PHP version | ||
if (!version_compare(PHP_VERSION, self::MIN_PHP, 'ge')) { | ||
$msg = sprintf('You need PHP %s or later to install this extension.', self::minPHP); | ||
} | ||
|
||
if ($msg) { | ||
$app->enqueueMessage($msg, 'warning'); | ||
|
||
return false; | ||
} | ||
} | ||
|
||
function install($parent) | ||
{ | ||
// $db = \JFactory::getDBO(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<html><body bgcolor="#FFFFFF"></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
defined('_JEXEC') or die('Restricted access'); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<html><body bgcolor="#FFFFFF"></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<metadata> | ||
<layout name="algolia"> | ||
<name>Algolia</name> | ||
<description>Map ZOO items to Algolia</description> | ||
</layout> | ||
</metadata> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0"?> | ||
<renderer> | ||
<positions layout="algolia"> | ||
<position name="search">Search</position> | ||
</positions> | ||
</renderer> |
Oops, something went wrong.