-
Notifications
You must be signed in to change notification settings - Fork 0
/
aliyun-opensearch.php
43 lines (39 loc) · 1.58 KB
/
aliyun-opensearch.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/*
Plugin Name: AliYun Open Search
Plugin URI: http://www.aliyun.com/product/opensearch/
Description: Aliyun Open Search is a hosting service for structured data searching. Supporting data structures, sorting and data processing freedom to customize. Aliyun Open Search provides a simple, low cost, stable and efficient search solution for your sites or applications.
Author: Aliyun
Version: dev
Author URI: http://www.aliyun.com/product/opensearch/
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found.');
exit('404 Not Found.');
}
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path(__FILE__) . 'includes/AliyunOpenSearch.php';
define('ALI_OPENSEARCH_PLUGIN_NAME', 'aliyun-open-search');
$aos_version_file = plugin_dir_path(__FILE__) . 'VERSION';
if (is_file($aos_version_file)) {
define('ALI_OPENSEARCH_PLUGIN_VERSION', file_get_contents($aos_version_file));
} else {
define('ALI_OPENSEARCH_PLUGIN_VERSION', 'dev');
}
$aliyun_opensearch = new AliyunOpenSearch(ALI_OPENSEARCH_PLUGIN_NAME, ALI_OPENSEARCH_PLUGIN_VERSION);
$aliyun_opensearch->initialize();
$frontend = new AliyunOpenSearchFrontend(
$aliyun_opensearch->getPluginName(),
$aliyun_opensearch->getVersion(),
AliyunOpenSearchClient::autoload()
);
$admin = new AliyunOpenSearchAdmin(
$aliyun_opensearch->getPluginName(),
$aliyun_opensearch->getVersion(),
AliyunOpenSearchClient::autoload()
);
$aliyun_opensearch->run($admin, $frontend);