|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Wordlift\Vocabulary; |
|
4
|
|
|
|
|
5
|
|
|
use Wordlift\Api\Default_Api_Service; |
|
6
|
|
|
use Wordlift\Api\User_Agent; |
|
7
|
|
|
use Wordlift\Vocabulary\Api\Background_Analysis_Endpoint; |
|
8
|
|
|
use Wordlift\Vocabulary\Api\Entity_Rest_Endpoint; |
|
9
|
|
|
use Wordlift\Vocabulary\Api\Reconcile_Progress_Endpoint; |
|
10
|
|
|
use Wordlift\Vocabulary\Api\Tag_Rest_Endpoint; |
|
11
|
|
|
use Wordlift\Vocabulary\Cache\Cache_Service_Factory; |
|
12
|
|
|
use Wordlift\Vocabulary\Dashboard\Term_Matches_Widget; |
|
13
|
|
|
use Wordlift\Vocabulary\Data\Term_Count\Cached_Term_count_Manager; |
|
14
|
|
|
use Wordlift\Vocabulary\Data\Term_Count\Term_Count_Factory; |
|
15
|
|
|
use Wordlift\Vocabulary\Data\Term_Data\Term_Data_Factory; |
|
16
|
|
|
use Wordlift\Vocabulary\Hooks\Tag_Created_Hook; |
|
17
|
|
|
use Wordlift\Vocabulary\Hooks\Term_Page_Hook; |
|
18
|
|
|
use Wordlift\Vocabulary\Jsonld\Post_Jsonld; |
|
19
|
|
|
use Wordlift\Vocabulary\Pages\Match_Terms; |
|
20
|
|
|
use Wordlift\Vocabulary\Tabs\Settings_Tab; |
|
21
|
|
|
|
|
22
|
|
|
class Vocabulary_Loader { |
|
23
|
|
|
|
|
24
|
|
|
public function init_vocabulary() { |
|
25
|
|
|
|
|
26
|
|
|
$configuration_service = \Wordlift_Configuration_Service::get_instance(); |
|
27
|
|
|
|
|
28
|
|
|
$api_service = new Default_Api_Service( |
|
29
|
|
|
apply_filters( 'wl_api_base_url', 'https://api.wordlift.io' ), |
|
30
|
|
|
60, |
|
31
|
|
|
User_Agent::get_user_agent(), |
|
32
|
|
|
$configuration_service->get_key() |
|
33
|
|
|
); |
|
34
|
|
|
|
|
35
|
|
|
$cache_service = Cache_Service_Factory::get_cache_service(); |
|
36
|
|
|
|
|
37
|
|
|
|
|
38
|
|
|
$analysis_service = new Analysis_Service( $api_service, $cache_service ); |
|
|
|
|
|
|
39
|
|
|
|
|
40
|
|
|
$term_data_factory = new Term_Data_Factory( $analysis_service ); |
|
41
|
|
|
|
|
42
|
|
|
$tag_rest_endpoint = new Tag_Rest_Endpoint( $term_data_factory ); |
|
43
|
|
|
$tag_rest_endpoint->register_routes(); |
|
44
|
|
|
|
|
45
|
|
|
$entity_rest_endpoint = new Entity_Rest_Endpoint(); |
|
46
|
|
|
$entity_rest_endpoint->register_routes(); |
|
47
|
|
|
|
|
48
|
|
|
$post_jsonld = new Post_Jsonld(); |
|
49
|
|
|
$post_jsonld->enhance_post_jsonld(); |
|
50
|
|
|
|
|
51
|
|
|
$term_count = Term_Count_Factory::get_instance( Term_Count_Factory::CACHED_TERM_COUNT ); |
|
52
|
|
|
new Match_Terms( $term_count ); |
|
53
|
|
|
|
|
54
|
|
|
$analysis_background_service = new Analysis_Background_Service( $analysis_service ); |
|
55
|
|
|
|
|
56
|
|
|
|
|
57
|
|
|
new Tag_Created_Hook( $analysis_background_service ); |
|
58
|
|
|
|
|
59
|
|
|
new Background_Analysis_Endpoint( $analysis_background_service, $cache_service ); |
|
60
|
|
|
|
|
61
|
|
|
$reconcile_progress_endpoint = new Reconcile_Progress_Endpoint(); |
|
62
|
|
|
$reconcile_progress_endpoint->register_routes(); |
|
63
|
|
|
|
|
64
|
|
|
|
|
65
|
|
|
$term_page_hook = new Term_Page_Hook( $term_data_factory ); |
|
66
|
|
|
$term_page_hook->connect_hook(); |
|
67
|
|
|
|
|
68
|
|
|
$dashboard_widget = new Term_Matches_Widget( $term_count ); |
|
69
|
|
|
$dashboard_widget->connect_hook(); |
|
70
|
|
|
|
|
71
|
|
|
$cached_term_count_manager = new Cached_Term_count_Manager(); |
|
72
|
|
|
$cached_term_count_manager->connect_hook(); |
|
73
|
|
|
|
|
74
|
|
|
$settings_tab = new Settings_Tab(); |
|
75
|
|
|
$settings_tab->connect_hook(); |
|
76
|
|
|
|
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
|
|
82
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: