Version Description
Released November 12th, 2020
- Loads the admin-side scripts on the Clicky settings page only. Props to erommel.
- Deprecates the
clicky_admin_footer
action hook in favour of theYoast\WP\Clicky\admin_footer
hook. - Fixes a frontend CSS bug.
- Fixes a bug where the visitor graph in the admin bar would be shown even if the site information was invalid.
- Fixes a bug where the Clicky blog feed wasn't retrieved properly.
- Stops explicit support for PHP < 5.6 / WP < 5.2.
Download this release
Release Info
Developer | Yoast |
Plugin | Clicky by Yoast |
Version | 2.0 |
Comparing to | |
See all releases |
Code changes from version 1.9 to 2.0
- admin/{class-clicky-admin-page.php → admin-page.php} +22 -13
- admin/{class-clicky-admin.php → admin.php} +14 -16
- admin/{class-clicky-options-admin.php → options-admin.php} +27 -27
- admin/views/admin-page.php +13 -1
- clicky.php +31 -20
- css/dist/adminbar-rtl.css +1 -0
- css/dist/clicky_admin-rtl.css +1 -0
- css/dist/index.php +4 -0
- css/index.php +4 -0
- frontend/{class-clicky-frontend.php → frontend.php} +8 -7
- frontend/views/script.php +2 -2
- frontend/{class-clicky-visitor-graph.php → visitor-graph.php} +16 -17
- includes/{class-clicky-options.php → options.php} +7 -7
- js/index.php +4 -0
- languages/clicky.pot +43 -44
- readme.txt +18 -3
- vendor/autoload.php +1 -1
- vendor/autoload_52.php +0 -7
- vendor/composer/ClassLoader.php +1 -1
- vendor/composer/ClassLoader52.php +0 -271
- vendor/composer/autoload_classmap.php +10 -8
- vendor/composer/autoload_namespaces.php +0 -1
- vendor/composer/autoload_real.php +7 -4
- vendor/composer/autoload_real_52.php +0 -44
- vendor/composer/autoload_static.php +14 -23
- vendor/xrstf/composer-php52/LICENSE +0 -19
- vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php +0 -346
- vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php +0 -271
- vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php +0 -39
admin/{class-clicky-admin-page.php → admin-page.php}
RENAMED
@@ -18,24 +18,34 @@ class Clicky_Admin_Page extends Clicky_Admin {
|
|
18 |
|
19 |
$this->options = $options_admin->get();
|
20 |
|
21 |
-
add_action( '
|
22 |
-
add_action( '
|
23 |
|
24 |
-
add_action( 'admin_head',
|
25 |
}
|
26 |
|
27 |
/**
|
28 |
* Enqueue the styles for the admin page.
|
|
|
|
|
29 |
*/
|
30 |
-
public function config_page_styles() {
|
|
|
|
|
|
|
31 |
wp_enqueue_style( 'clicky-admin-css', CLICKY_PLUGIN_DIR_URL . 'css/dist/clicky_admin.css', null, CLICKY_PLUGIN_VERSION );
|
32 |
}
|
33 |
|
34 |
/**
|
35 |
* Enqueue the scripts for the admin page.
|
|
|
|
|
36 |
*/
|
37 |
-
public function config_page_scripts() {
|
38 |
-
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
/**
|
@@ -52,8 +62,7 @@ class Clicky_Admin_Page extends Clicky_Admin {
|
|
52 |
* @param string $content Content to display.
|
53 |
*/
|
54 |
private function box( $title, $content ) {
|
55 |
-
|
56 |
-
echo '<div class="yoast_box"><h3>' . esc_html( $title ) . '</h3><div class="inside">' . $content . '</div></div>';
|
57 |
}
|
58 |
|
59 |
/**
|
@@ -84,7 +93,7 @@ class Clicky_Admin_Page extends Clicky_Admin {
|
|
84 |
|
85 |
$rss = '';
|
86 |
foreach ( $rss_items as $item ) {
|
87 |
-
$url = preg_replace( '/#.*/', '', esc_url( $item->get_permalink()
|
88 |
$rss .= '<li class="yoast">';
|
89 |
$rss .= '<a href="' . esc_url( $url . '#utm_source=wpadmin&utm_medium=sidebarwidget&utm_term=newsitem&utm_campaign=clickywpplugin' ) . '">' . $item->get_title() . '</a> ';
|
90 |
$rss .= '</li>';
|
@@ -104,7 +113,7 @@ class Clicky_Admin_Page extends Clicky_Admin {
|
|
104 |
* Box with latest news from Clicky.
|
105 |
*/
|
106 |
private function clicky_news() {
|
107 |
-
$this->rss_news( '
|
108 |
}
|
109 |
|
110 |
/**
|
@@ -123,16 +132,16 @@ class Clicky_Admin_Page extends Clicky_Admin {
|
|
123 |
*/
|
124 |
public function i18n_module() {
|
125 |
new yoast_i18n(
|
126 |
-
|
127 |
'textdomain' => 'clicky',
|
128 |
'project_slug' => 'clicky-wordpress-plugin',
|
129 |
'plugin_name' => __( 'Clicky for WordPress', 'clicky' ),
|
130 |
-
'hook' => '
|
131 |
'glotpress_url' => 'http://translate.yoast.com',
|
132 |
'glotpress_name' => __( 'Yoast Translate', 'clicky' ),
|
133 |
'glotpress_logo' => 'https://cdn.yoast.com/wp-content/uploads/i18n-images/Yoast_Translate.svg',
|
134 |
'register_url ' => 'http://translate.yoast.com/projects#utm_source=plugin&utm_medium=promo-box&utm_campaign=clicky-i18n-promo',
|
135 |
-
|
136 |
);
|
137 |
}
|
138 |
}
|
18 |
|
19 |
$this->options = $options_admin->get();
|
20 |
|
21 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'config_page_scripts' ] );
|
22 |
+
add_action( 'admin_enqueue_scripts', [ $this, 'config_page_styles' ] );
|
23 |
|
24 |
+
add_action( 'admin_head', [ $this, 'i18n_module' ] );
|
25 |
}
|
26 |
|
27 |
/**
|
28 |
* Enqueue the styles for the admin page.
|
29 |
+
*
|
30 |
+
* @param string $current_page The current page.
|
31 |
*/
|
32 |
+
public function config_page_styles( $current_page ) {
|
33 |
+
if ( $current_page !== 'settings_page_clicky' ) {
|
34 |
+
return;
|
35 |
+
}
|
36 |
wp_enqueue_style( 'clicky-admin-css', CLICKY_PLUGIN_DIR_URL . 'css/dist/clicky_admin.css', null, CLICKY_PLUGIN_VERSION );
|
37 |
}
|
38 |
|
39 |
/**
|
40 |
* Enqueue the scripts for the admin page.
|
41 |
+
*
|
42 |
+
* @param string $current_page The current page.
|
43 |
*/
|
44 |
+
public function config_page_scripts( $current_page ) {
|
45 |
+
if ( $current_page !== 'settings_page_clicky' ) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
wp_enqueue_script( 'clicky-admin-js', CLICKY_PLUGIN_DIR_URL . 'js/admin.min.js', null, CLICKY_PLUGIN_VERSION, true );
|
49 |
}
|
50 |
|
51 |
/**
|
62 |
* @param string $content Content to display.
|
63 |
*/
|
64 |
private function box( $title, $content ) {
|
65 |
+
echo '<div class="yoast_box"><h3>' . esc_html( $title ) . '</h3><div class="inside">' . wp_kses_post( $content ) . '</div></div>';
|
|
|
66 |
}
|
67 |
|
68 |
/**
|
93 |
|
94 |
$rss = '';
|
95 |
foreach ( $rss_items as $item ) {
|
96 |
+
$url = preg_replace( '/#.*/', '', esc_url( $item->get_permalink() ) );
|
97 |
$rss .= '<li class="yoast">';
|
98 |
$rss .= '<a href="' . esc_url( $url . '#utm_source=wpadmin&utm_medium=sidebarwidget&utm_term=newsitem&utm_campaign=clickywpplugin' ) . '">' . $item->get_title() . '</a> ';
|
99 |
$rss .= '</li>';
|
113 |
* Box with latest news from Clicky.
|
114 |
*/
|
115 |
private function clicky_news() {
|
116 |
+
$this->rss_news( 'https://blog.clicky.com/feed/', __( 'Latest news from Clicky', 'clicky' ) );
|
117 |
}
|
118 |
|
119 |
/**
|
132 |
*/
|
133 |
public function i18n_module() {
|
134 |
new yoast_i18n(
|
135 |
+
[
|
136 |
'textdomain' => 'clicky',
|
137 |
'project_slug' => 'clicky-wordpress-plugin',
|
138 |
'plugin_name' => __( 'Clicky for WordPress', 'clicky' ),
|
139 |
+
'hook' => 'Yoast\WP\Clicky\admin_footer',
|
140 |
'glotpress_url' => 'http://translate.yoast.com',
|
141 |
'glotpress_name' => __( 'Yoast Translate', 'clicky' ),
|
142 |
'glotpress_logo' => 'https://cdn.yoast.com/wp-content/uploads/i18n-images/Yoast_Translate.svg',
|
143 |
'register_url ' => 'http://translate.yoast.com/projects#utm_source=plugin&utm_medium=promo-box&utm_campaign=clicky-i18n-promo',
|
144 |
+
]
|
145 |
);
|
146 |
}
|
147 |
}
|
admin/{class-clicky-admin.php → admin.php}
RENAMED
@@ -15,12 +15,11 @@ class Clicky_Admin {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
public $options =
|
19 |
|
20 |
/**
|
21 |
* Menu slug for WordPress admin.
|
22 |
*
|
23 |
-
* @access private
|
24 |
* @var string
|
25 |
*/
|
26 |
public $hook = 'clicky';
|
@@ -28,31 +27,30 @@ class Clicky_Admin {
|
|
28 |
/**
|
29 |
* Construct of class Clicky_admin.
|
30 |
*
|
31 |
-
* @access private
|
32 |
* @link https://codex.wordpress.org/Function_Reference/add_action
|
33 |
* @link https://codex.wordpress.org/Function_Reference/add_filter
|
34 |
*/
|
35 |
public function __construct() {
|
36 |
$this->options = Clicky_Options::instance()->get();
|
37 |
|
38 |
-
add_filter( 'plugin_action_links',
|
39 |
|
40 |
-
add_action( 'publish_post',
|
41 |
-
add_action( 'admin_notices',
|
42 |
-
add_action( 'admin_menu',
|
43 |
}
|
44 |
|
45 |
/**
|
46 |
* Initialize needed actions.
|
47 |
*/
|
48 |
public function admin_init() {
|
49 |
-
$public_post_types = get_post_types(
|
50 |
|
51 |
foreach ( $public_post_types as $post_type ) {
|
52 |
add_meta_box(
|
53 |
'clicky',
|
54 |
__( 'Clicky Goal Tracking', 'clicky' ),
|
55 |
-
|
56 |
$post_type,
|
57 |
'side'
|
58 |
);
|
@@ -73,7 +71,7 @@ class Clicky_Admin {
|
|
73 |
__( 'Clicky', 'clicky' ),
|
74 |
'manage_options',
|
75 |
$this->hook,
|
76 |
-
|
77 |
);
|
78 |
|
79 |
add_dashboard_page(
|
@@ -81,7 +79,7 @@ class Clicky_Admin {
|
|
81 |
__( 'Clicky Stats', 'clicky' ),
|
82 |
'manage_options',
|
83 |
'clicky_stats',
|
84 |
-
|
85 |
);
|
86 |
}
|
87 |
|
@@ -89,7 +87,7 @@ class Clicky_Admin {
|
|
89 |
* Creates warnings for empty fields in the admin.
|
90 |
*/
|
91 |
public function admin_warnings() {
|
92 |
-
$required_options =
|
93 |
|
94 |
foreach ( $required_options as $option ) {
|
95 |
if ( empty( $this->options[ $option ] ) ) {
|
@@ -148,10 +146,10 @@ class Clicky_Admin {
|
|
148 |
* @param int $post_id The post ID.
|
149 |
*/
|
150 |
public function insert_post( $post_id ) {
|
151 |
-
$clicky_goal =
|
152 |
'id' => (int) filter_input( INPUT_POST, 'clicky_goal_id' ),
|
153 |
'value' => (float) filter_input( INPUT_POST, 'clicky_goal_value' ),
|
154 |
-
|
155 |
update_post_meta( $post_id, '_clicky_goal', $clicky_goal );
|
156 |
}
|
157 |
|
@@ -159,10 +157,10 @@ class Clicky_Admin {
|
|
159 |
* Loads (external) stats page in an iframe.
|
160 |
*/
|
161 |
public function dashboard_page() {
|
162 |
-
$args =
|
163 |
'site_id' => $this->options['site_id'],
|
164 |
'sitekey' => $this->options['site_key'],
|
165 |
-
|
166 |
$iframe_url = add_query_arg( $args, 'https://clicky.com/stats/wp-iframe?' );
|
167 |
|
168 |
require CLICKY_PLUGIN_DIR_PATH . 'admin/views/stats-page.php';
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
public $options = [];
|
19 |
|
20 |
/**
|
21 |
* Menu slug for WordPress admin.
|
22 |
*
|
|
|
23 |
* @var string
|
24 |
*/
|
25 |
public $hook = 'clicky';
|
27 |
/**
|
28 |
* Construct of class Clicky_admin.
|
29 |
*
|
|
|
30 |
* @link https://codex.wordpress.org/Function_Reference/add_action
|
31 |
* @link https://codex.wordpress.org/Function_Reference/add_filter
|
32 |
*/
|
33 |
public function __construct() {
|
34 |
$this->options = Clicky_Options::instance()->get();
|
35 |
|
36 |
+
add_filter( 'plugin_action_links', [ $this, 'add_action_link' ], 10, 2 );
|
37 |
|
38 |
+
add_action( 'publish_post', [ $this, 'insert_post' ] );
|
39 |
+
add_action( 'admin_notices', [ $this, 'admin_warnings' ] );
|
40 |
+
add_action( 'admin_menu', [ $this, 'admin_init' ] );
|
41 |
}
|
42 |
|
43 |
/**
|
44 |
* Initialize needed actions.
|
45 |
*/
|
46 |
public function admin_init() {
|
47 |
+
$public_post_types = get_post_types( [ 'public' => true ] );
|
48 |
|
49 |
foreach ( $public_post_types as $post_type ) {
|
50 |
add_meta_box(
|
51 |
'clicky',
|
52 |
__( 'Clicky Goal Tracking', 'clicky' ),
|
53 |
+
[ $this, 'meta_box_content' ],
|
54 |
$post_type,
|
55 |
'side'
|
56 |
);
|
71 |
__( 'Clicky', 'clicky' ),
|
72 |
'manage_options',
|
73 |
$this->hook,
|
74 |
+
[ new Clicky_Admin_Page(), 'config_page' ]
|
75 |
);
|
76 |
|
77 |
add_dashboard_page(
|
79 |
__( 'Clicky Stats', 'clicky' ),
|
80 |
'manage_options',
|
81 |
'clicky_stats',
|
82 |
+
[ $this, 'dashboard_page' ]
|
83 |
);
|
84 |
}
|
85 |
|
87 |
* Creates warnings for empty fields in the admin.
|
88 |
*/
|
89 |
public function admin_warnings() {
|
90 |
+
$required_options = [ 'site_id', 'site_key', 'admin_site_key' ];
|
91 |
|
92 |
foreach ( $required_options as $option ) {
|
93 |
if ( empty( $this->options[ $option ] ) ) {
|
146 |
* @param int $post_id The post ID.
|
147 |
*/
|
148 |
public function insert_post( $post_id ) {
|
149 |
+
$clicky_goal = [
|
150 |
'id' => (int) filter_input( INPUT_POST, 'clicky_goal_id' ),
|
151 |
'value' => (float) filter_input( INPUT_POST, 'clicky_goal_value' ),
|
152 |
+
];
|
153 |
update_post_meta( $post_id, '_clicky_goal', $clicky_goal );
|
154 |
}
|
155 |
|
157 |
* Loads (external) stats page in an iframe.
|
158 |
*/
|
159 |
public function dashboard_page() {
|
160 |
+
$args = [
|
161 |
'site_id' => $this->options['site_id'],
|
162 |
'sitekey' => $this->options['site_key'],
|
163 |
+
];
|
164 |
$iframe_url = add_query_arg( $args, 'https://clicky.com/stats/wp-iframe?' );
|
165 |
|
166 |
require CLICKY_PLUGIN_DIR_PATH . 'admin/views/stats-page.php';
|
admin/{class-clicky-options-admin.php → options-admin.php}
RENAMED
@@ -21,7 +21,7 @@ class Clicky_Options_Admin extends Clicky_Options {
|
|
21 |
* Class constructor.
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
-
add_action( 'admin_init',
|
25 |
|
26 |
parent::__construct();
|
27 |
}
|
@@ -30,7 +30,7 @@ class Clicky_Options_Admin extends Clicky_Options {
|
|
30 |
* Register the needed option and its settings sections.
|
31 |
*/
|
32 |
public function admin_init() {
|
33 |
-
register_setting( self::$option_group, parent::$option_name,
|
34 |
|
35 |
$this->register_basic_settings();
|
36 |
$this->register_advanced_settings();
|
@@ -44,24 +44,24 @@ class Clicky_Options_Admin extends Clicky_Options {
|
|
44 |
add_settings_section(
|
45 |
'basic-settings',
|
46 |
__( 'Basic settings', 'clicky' ),
|
47 |
-
|
48 |
'clicky'
|
49 |
);
|
50 |
|
51 |
-
$clicky_settings =
|
52 |
'site_id' => __( 'Site ID', 'clicky' ),
|
53 |
'site_key' => __( 'Site Key', 'clicky' ),
|
54 |
'admin_site_key' => __( 'Admin Site Key', 'clicky' ),
|
55 |
-
|
56 |
foreach ( $clicky_settings as $key => $label ) {
|
57 |
-
$args =
|
58 |
'name' => 'clicky[' . $key . ']',
|
59 |
'value' => $this->options[ $key ],
|
60 |
-
|
61 |
add_settings_field(
|
62 |
$key,
|
63 |
$label,
|
64 |
-
|
65 |
'clicky',
|
66 |
'basic-settings',
|
67 |
$args
|
@@ -71,14 +71,14 @@ class Clicky_Options_Admin extends Clicky_Options {
|
|
71 |
add_settings_section(
|
72 |
'clicky-like',
|
73 |
__( 'Like this plugin?', 'clicky' ),
|
74 |
-
|
75 |
'clicky'
|
76 |
);
|
77 |
|
78 |
add_settings_section(
|
79 |
'clicky-support',
|
80 |
__( 'Need support?', 'clicky' ),
|
81 |
-
|
82 |
'clicky'
|
83 |
);
|
84 |
}
|
@@ -89,33 +89,33 @@ class Clicky_Options_Admin extends Clicky_Options {
|
|
89 |
private function register_advanced_settings() {
|
90 |
add_settings_section( 'clicky-advanced', __( 'Advanced Settings', 'clicky' ), null, 'clicky-advanced' );
|
91 |
|
92 |
-
$advanced_settings =
|
93 |
-
'disable_stats' =>
|
94 |
'label' => __( 'Disable Admin Bar stats', 'clicky' ),
|
95 |
'desc' => __( 'If you don\'t want to display the stats in your admin menu, check this box.', 'clicky' ),
|
96 |
-
|
97 |
-
'ignore_admin' =>
|
98 |
'label' => __( 'Ignore Admin users', 'clicky' ),
|
99 |
'desc' => __( 'If you are using a caching plugin, such as W3 Total Cache or WP-Supercache, please ensure that you have it configured to NOT use the cache for logged in users. Otherwise, admin users <em>will still</em> be tracked.', 'clicky' ),
|
100 |
-
|
101 |
-
'cookies_disable' =>
|
102 |
'label' => __( 'Disable cookies', 'clicky' ),
|
103 |
'desc' => __( 'If you don\'t want Clicky to use cookies on your site, check this button. By doing so, uniqueness will instead be determined based on their IP address.', 'clicky' ),
|
104 |
-
|
105 |
-
'track_names' =>
|
106 |
'label' => __( 'Track names of commenters', 'clicky' ),
|
107 |
-
|
108 |
-
|
109 |
foreach ( $advanced_settings as $key => $arr ) {
|
110 |
-
$args =
|
111 |
'name' => $key,
|
112 |
'value' => isset( $this->options[ $key ] ) ? $this->options[ $key ] : false,
|
113 |
'desc' => isset( $arr['desc'] ) ? $arr['desc'] : '',
|
114 |
-
|
115 |
add_settings_field(
|
116 |
$key,
|
117 |
$arr['label'],
|
118 |
-
|
119 |
'clicky-advanced',
|
120 |
'clicky-advanced',
|
121 |
$args
|
@@ -130,19 +130,19 @@ class Clicky_Options_Admin extends Clicky_Options {
|
|
130 |
add_settings_section(
|
131 |
'clicky-outbound',
|
132 |
__( 'Outbound Links', 'clicky' ),
|
133 |
-
|
134 |
'clicky-advanced'
|
135 |
);
|
136 |
|
137 |
-
$args =
|
138 |
'name' => 'clicky[outbound_pattern]',
|
139 |
'value' => $this->options['outbound_pattern'],
|
140 |
'desc' => __( 'For instance: <code>/out/,/go/</code>', 'clicky' ),
|
141 |
-
|
142 |
add_settings_field(
|
143 |
'outbound_pattern',
|
144 |
__( 'Outbound Link Pattern', 'clicky' ),
|
145 |
-
|
146 |
'clicky-advanced',
|
147 |
'clicky-outbound',
|
148 |
$args
|
21 |
* Class constructor.
|
22 |
*/
|
23 |
public function __construct() {
|
24 |
+
add_action( 'admin_init', [ $this, 'admin_init' ] );
|
25 |
|
26 |
parent::__construct();
|
27 |
}
|
30 |
* Register the needed option and its settings sections.
|
31 |
*/
|
32 |
public function admin_init() {
|
33 |
+
register_setting( self::$option_group, parent::$option_name, [ $this, 'sanitize_options_on_save' ] );
|
34 |
|
35 |
$this->register_basic_settings();
|
36 |
$this->register_advanced_settings();
|
44 |
add_settings_section(
|
45 |
'basic-settings',
|
46 |
__( 'Basic settings', 'clicky' ),
|
47 |
+
[ $this, 'basic_settings_intro' ],
|
48 |
'clicky'
|
49 |
);
|
50 |
|
51 |
+
$clicky_settings = [
|
52 |
'site_id' => __( 'Site ID', 'clicky' ),
|
53 |
'site_key' => __( 'Site Key', 'clicky' ),
|
54 |
'admin_site_key' => __( 'Admin Site Key', 'clicky' ),
|
55 |
+
];
|
56 |
foreach ( $clicky_settings as $key => $label ) {
|
57 |
+
$args = [
|
58 |
'name' => 'clicky[' . $key . ']',
|
59 |
'value' => $this->options[ $key ],
|
60 |
+
];
|
61 |
add_settings_field(
|
62 |
$key,
|
63 |
$label,
|
64 |
+
[ $this, 'input_text' ],
|
65 |
'clicky',
|
66 |
'basic-settings',
|
67 |
$args
|
71 |
add_settings_section(
|
72 |
'clicky-like',
|
73 |
__( 'Like this plugin?', 'clicky' ),
|
74 |
+
[ $this, 'like_text' ],
|
75 |
'clicky'
|
76 |
);
|
77 |
|
78 |
add_settings_section(
|
79 |
'clicky-support',
|
80 |
__( 'Need support?', 'clicky' ),
|
81 |
+
[ $this, 'support_text' ],
|
82 |
'clicky'
|
83 |
);
|
84 |
}
|
89 |
private function register_advanced_settings() {
|
90 |
add_settings_section( 'clicky-advanced', __( 'Advanced Settings', 'clicky' ), null, 'clicky-advanced' );
|
91 |
|
92 |
+
$advanced_settings = [
|
93 |
+
'disable_stats' => [
|
94 |
'label' => __( 'Disable Admin Bar stats', 'clicky' ),
|
95 |
'desc' => __( 'If you don\'t want to display the stats in your admin menu, check this box.', 'clicky' ),
|
96 |
+
],
|
97 |
+
'ignore_admin' => [
|
98 |
'label' => __( 'Ignore Admin users', 'clicky' ),
|
99 |
'desc' => __( 'If you are using a caching plugin, such as W3 Total Cache or WP-Supercache, please ensure that you have it configured to NOT use the cache for logged in users. Otherwise, admin users <em>will still</em> be tracked.', 'clicky' ),
|
100 |
+
],
|
101 |
+
'cookies_disable' => [
|
102 |
'label' => __( 'Disable cookies', 'clicky' ),
|
103 |
'desc' => __( 'If you don\'t want Clicky to use cookies on your site, check this button. By doing so, uniqueness will instead be determined based on their IP address.', 'clicky' ),
|
104 |
+
],
|
105 |
+
'track_names' => [
|
106 |
'label' => __( 'Track names of commenters', 'clicky' ),
|
107 |
+
],
|
108 |
+
];
|
109 |
foreach ( $advanced_settings as $key => $arr ) {
|
110 |
+
$args = [
|
111 |
'name' => $key,
|
112 |
'value' => isset( $this->options[ $key ] ) ? $this->options[ $key ] : false,
|
113 |
'desc' => isset( $arr['desc'] ) ? $arr['desc'] : '',
|
114 |
+
];
|
115 |
add_settings_field(
|
116 |
$key,
|
117 |
$arr['label'],
|
118 |
+
[ $this, 'input_checkbox' ],
|
119 |
'clicky-advanced',
|
120 |
'clicky-advanced',
|
121 |
$args
|
130 |
add_settings_section(
|
131 |
'clicky-outbound',
|
132 |
__( 'Outbound Links', 'clicky' ),
|
133 |
+
[ $this, 'outbound_explanation' ],
|
134 |
'clicky-advanced'
|
135 |
);
|
136 |
|
137 |
+
$args = [
|
138 |
'name' => 'clicky[outbound_pattern]',
|
139 |
'value' => $this->options['outbound_pattern'],
|
140 |
'desc' => __( 'For instance: <code>/out/,/go/</code>', 'clicky' ),
|
141 |
+
];
|
142 |
add_settings_field(
|
143 |
'outbound_pattern',
|
144 |
__( 'Outbound Link Pattern', 'clicky' ),
|
145 |
+
[ $this, 'input_text' ],
|
146 |
'clicky-advanced',
|
147 |
'clicky-outbound',
|
148 |
$args
|
admin/views/admin-page.php
CHANGED
@@ -31,7 +31,19 @@
|
|
31 |
<?php
|
32 |
submit_button( __( 'Save Clicky settings', 'clicky' ) );
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
?>
|
36 |
</div>
|
37 |
</form>
|
31 |
<?php
|
32 |
submit_button( __( 'Save Clicky settings', 'clicky' ) );
|
33 |
|
34 |
+
/**
|
35 |
+
* Allow for adding content to the Yoast Clicky admin page footer.
|
36 |
+
*
|
37 |
+
* @deprecated 1.10.0. Use the {@see 'Yoast\WP\Clicky\admin_footer'} action instead.
|
38 |
+
*/
|
39 |
+
do_action_deprecated( 'clicky_admin_footer', [], 'Yoast Clicky 1.10.0', 'Yoast\WP\Clicky\admin_footer' );
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Allow for adding content to the Yoast Clicky admin page footer.
|
43 |
+
*
|
44 |
+
* @since 1.10.0
|
45 |
+
*/
|
46 |
+
do_action( 'Yoast\WP\Clicky\admin_footer' );
|
47 |
?>
|
48 |
</div>
|
49 |
</form>
|
clicky.php
CHANGED
@@ -7,13 +7,15 @@
|
|
7 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 or higher
|
8 |
*
|
9 |
* @wordpress-plugin
|
10 |
-
* Plugin Name:
|
11 |
-
* Version:
|
12 |
-
* Plugin URI:
|
13 |
-
* Description:
|
14 |
-
* Author:
|
15 |
-
*
|
16 |
-
*
|
|
|
|
|
17 |
*/
|
18 |
|
19 |
if ( ! function_exists( 'add_filter' ) ) {
|
@@ -23,14 +25,10 @@ if ( ! function_exists( 'add_filter' ) ) {
|
|
23 |
}
|
24 |
|
25 |
define( 'CLICKY_PLUGIN_FILE', __FILE__ );
|
26 |
-
define( 'CLICKY_PLUGIN_VERSION', '
|
27 |
define( 'CLICKY_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
28 |
define( 'CLICKY_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
|
29 |
|
30 |
-
if ( file_exists( CLICKY_PLUGIN_DIR_PATH . 'vendor/autoload_52.php' ) ) {
|
31 |
-
require CLICKY_PLUGIN_DIR_PATH . 'vendor/autoload_52.php';
|
32 |
-
}
|
33 |
-
|
34 |
/**
|
35 |
* Class Yoast Clicky base class.
|
36 |
*/
|
@@ -40,11 +38,18 @@ class Yoast_Clicky {
|
|
40 |
* Initialize the plugin settings.
|
41 |
*/
|
42 |
public function __construct() {
|
43 |
-
if (
|
|
|
|
|
|
|
44 |
return;
|
45 |
}
|
46 |
|
47 |
-
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -55,14 +60,20 @@ class Yoast_Clicky {
|
|
55 |
|
56 |
if ( is_admin() ) {
|
57 |
new Clicky_Admin();
|
|
|
|
|
58 |
}
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
}
|
64 |
}
|
65 |
}
|
66 |
}
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
7 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 or higher
|
8 |
*
|
9 |
* @wordpress-plugin
|
10 |
+
* Plugin Name: Clicky for WordPress
|
11 |
+
* Version: 2.0
|
12 |
+
* Plugin URI: https://yoast.com/wordpress/plugins/clicky/
|
13 |
+
* Description: The Clicky for WordPress plugin by Yoast makes it easy for you to add your Clicky analytics tracking code to your WordPress install, while also giving you some advanced tracking options.
|
14 |
+
* Author: Team Yoast
|
15 |
+
* Requires PHP: 5.6
|
16 |
+
* Requires at least: 5.9
|
17 |
+
* Author URI: https://yoast.com/
|
18 |
+
* Text Domain: clicky
|
19 |
*/
|
20 |
|
21 |
if ( ! function_exists( 'add_filter' ) ) {
|
25 |
}
|
26 |
|
27 |
define( 'CLICKY_PLUGIN_FILE', __FILE__ );
|
28 |
+
define( 'CLICKY_PLUGIN_VERSION', '2.0' );
|
29 |
define( 'CLICKY_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
30 |
define( 'CLICKY_PLUGIN_DIR_URL', plugin_dir_url( __FILE__ ) );
|
31 |
|
|
|
|
|
|
|
|
|
32 |
/**
|
33 |
* Class Yoast Clicky base class.
|
34 |
*/
|
38 |
* Initialize the plugin settings.
|
39 |
*/
|
40 |
public function __construct() {
|
41 |
+
if (
|
42 |
+
( defined( 'DOING_AJAX' ) && DOING_AJAX ) ||
|
43 |
+
( defined( 'WP_CLI' ) && WP_CLI ) ||
|
44 |
+
( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) {
|
45 |
return;
|
46 |
}
|
47 |
|
48 |
+
if ( file_exists( CLICKY_PLUGIN_DIR_PATH . 'vendor/autoload.php' ) ) {
|
49 |
+
require_once CLICKY_PLUGIN_DIR_PATH . 'vendor/autoload.php';
|
50 |
+
}
|
51 |
+
|
52 |
+
add_action( 'init', [ $this, 'init' ] );
|
53 |
}
|
54 |
|
55 |
/**
|
60 |
|
61 |
if ( is_admin() ) {
|
62 |
new Clicky_Admin();
|
63 |
+
|
64 |
+
return;
|
65 |
}
|
66 |
+
|
67 |
+
new Clicky_Frontend();
|
68 |
+
if ( current_user_can( 'manage_options' ) ) {
|
69 |
+
new Clicky_Visitor_Graph();
|
|
|
70 |
}
|
71 |
}
|
72 |
}
|
73 |
|
74 |
+
add_action(
|
75 |
+
'plugins_loaded',
|
76 |
+
function () {
|
77 |
+
new Yoast_Clicky();
|
78 |
+
}
|
79 |
+
);
|
css/dist/adminbar-rtl.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#wpadminbar .quicklinks li#wp-admin-bar-clickystats{height:28px}#wpadminbar .quicklinks li#wp-admin-bar-clickystats a{height:28px;padding:0}#wpadminbar .quicklinks li#wp-admin-bar-clickystats a img{width:99px;height:20px;padding:4px 5px}
|
css/dist/clicky_admin-rtl.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
#plugin_icon{margin:0 0 0 10px}#yoast_wrapper{float:right;max-width:600px;margin:0 0 0 25px}#yoast_sidebar{float:right;max-width:261px;margin:0 0 0 20px}.nav-tab-wrapper{margin-bottom:0}.yoast_tab{display:none}.yoast_tab.active{display:block;padding:.5em .9em;border:1px solid #ddd;border-radius:3px 0 3px 3px;background-color:#fff}.yoast_tab .select,.yoast_tab .text{width:300px}.yoast_tab li{margin-right:20px;list-style-type:disc}.tabwrapper .yoast_tab{padding:0;border:none;background:none}.tabwrapper .yoast_tab h3{padding:9px 0 4px 15px;font-size:23px;font-weight:400}.yoast_box{margin:0 0 20px;border:1px solid #ccc;background-color:#fff}.yoast_box h3{padding:0 10px 8px 0;border-bottom:1px solid #ccc}.yoast_box .inside{padding:0 10px}.yoast_box .inside ul li{margin-right:20px;line-height:16px;list-style:square}.yoast_box .inside a{text-decoration:none}.yoast_box .inside a:hover{text-decoration:underline}.yoast_box ul li.rss{list-style-image:url(../../images/rss.png)}.yoast_box ul li.twitter{list-style-image:url(../../images/twitter-icon.png)}.yoast_box ul li.facebook{list-style-image:url(../../images/facebook-icon.png)}.yoast_box ul li.email{list-style-image:url(../../images/email_sub.png)}.yoast_box ul li.yoast{list-style:disc}
|
css/dist/index.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Nothing to see here.
|
4 |
+
*/
|
css/index.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Nothing to see here.
|
4 |
+
*/
|
frontend/{class-clicky-frontend.php → frontend.php}
RENAMED
@@ -15,7 +15,7 @@ class Clicky_Frontend {
|
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
-
private $options =
|
19 |
|
20 |
/**
|
21 |
* Class constructor.
|
@@ -27,8 +27,8 @@ class Clicky_Frontend {
|
|
27 |
return;
|
28 |
}
|
29 |
|
30 |
-
add_action( 'wp_head',
|
31 |
-
add_action( 'comment_post',
|
32 |
}
|
33 |
|
34 |
/**
|
@@ -133,17 +133,17 @@ class Clicky_Frontend {
|
|
133 |
$comment = get_comment( $comment_id );
|
134 |
// Only do this for normal comments, not for pingbacks or trackbacks.
|
135 |
if ( $comment->comment_type !== 'pingback' && $comment->comment_type !== 'trackback' ) {
|
136 |
-
$args =
|
137 |
'type' => 'click',
|
138 |
'href' => '/wp-comments-post.php',
|
139 |
'title' => __( 'Posted a comment', 'clicky' ),
|
140 |
'ua' => $comment->comment_agent,
|
141 |
'ip_address' => $comment->comment_author_IP,
|
142 |
-
|
143 |
-
$custom =
|
144 |
'username' => $comment->comment_author,
|
145 |
'email' => $comment->comment_author_email,
|
146 |
-
|
147 |
|
148 |
$this->log_comment( $args, $custom );
|
149 |
}
|
@@ -164,6 +164,7 @@ class Clicky_Frontend {
|
|
164 |
|
165 |
// Custom data, must come in as array of key=>values.
|
166 |
foreach ( $custom as $key => $value ) {
|
|
|
167 |
$file .= '&custom[' . urlencode( $key ) . ']=' . urlencode( $value );
|
168 |
}
|
169 |
|
15 |
*
|
16 |
* @var array
|
17 |
*/
|
18 |
+
private $options = [];
|
19 |
|
20 |
/**
|
21 |
* Class constructor.
|
27 |
return;
|
28 |
}
|
29 |
|
30 |
+
add_action( 'wp_head', [ $this, 'script' ], 90 );
|
31 |
+
add_action( 'comment_post', [ $this, 'track_comment' ], 10, 2 );
|
32 |
}
|
33 |
|
34 |
/**
|
133 |
$comment = get_comment( $comment_id );
|
134 |
// Only do this for normal comments, not for pingbacks or trackbacks.
|
135 |
if ( $comment->comment_type !== 'pingback' && $comment->comment_type !== 'trackback' ) {
|
136 |
+
$args = [
|
137 |
'type' => 'click',
|
138 |
'href' => '/wp-comments-post.php',
|
139 |
'title' => __( 'Posted a comment', 'clicky' ),
|
140 |
'ua' => $comment->comment_agent,
|
141 |
'ip_address' => $comment->comment_author_IP,
|
142 |
+
];
|
143 |
+
$custom = [
|
144 |
'username' => $comment->comment_author,
|
145 |
'email' => $comment->comment_author_email,
|
146 |
+
];
|
147 |
|
148 |
$this->log_comment( $args, $custom );
|
149 |
}
|
164 |
|
165 |
// Custom data, must come in as array of key=>values.
|
166 |
foreach ( $custom as $key => $value ) {
|
167 |
+
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode -- Correct encoding for query vars.
|
168 |
$file .= '&custom[' . urlencode( $key ) . ']=' . urlencode( $value );
|
169 |
}
|
170 |
|
frontend/views/script.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
<?php
|
11 |
if ( ! empty( $clicky_extra ) ) {
|
12 |
echo 'var clicky_custom = clicky_custom || {}; ';
|
13 |
-
//
|
14 |
echo $clicky_extra;
|
15 |
}
|
16 |
?>
|
@@ -19,5 +19,5 @@
|
|
19 |
clicky_site_ids.push(<?php echo wp_json_encode( $this->options['site_id'] ); ?>);
|
20 |
</script>
|
21 |
<?php
|
22 |
-
//
|
23 |
echo '<script async src="//static.getclicky.com/js"></script>';
|
10 |
<?php
|
11 |
if ( ! empty( $clicky_extra ) ) {
|
12 |
echo 'var clicky_custom = clicky_custom || {}; ';
|
13 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
14 |
echo $clicky_extra;
|
15 |
}
|
16 |
?>
|
19 |
clicky_site_ids.push(<?php echo wp_json_encode( $this->options['site_id'] ); ?>);
|
20 |
</script>
|
21 |
<?php
|
22 |
+
// phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
|
23 |
echo '<script async src="//static.getclicky.com/js"></script>';
|
frontend/{class-clicky-visitor-graph.php → visitor-graph.php}
RENAMED
@@ -22,7 +22,7 @@ class Clicky_Visitor_Graph {
|
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
-
private $bar_values =
|
26 |
|
27 |
/**
|
28 |
* Height of the generated image.
|
@@ -64,7 +64,7 @@ class Clicky_Visitor_Graph {
|
|
64 |
*
|
65 |
* @var array
|
66 |
*/
|
67 |
-
private $options =
|
68 |
|
69 |
/**
|
70 |
* The ratio between a value and the overall image height.
|
@@ -95,8 +95,8 @@ class Clicky_Visitor_Graph {
|
|
95 |
return;
|
96 |
}
|
97 |
|
98 |
-
add_action( 'wp_head',
|
99 |
-
add_action( 'admin_bar_menu',
|
100 |
}
|
101 |
|
102 |
/**
|
@@ -105,11 +105,9 @@ class Clicky_Visitor_Graph {
|
|
105 |
* @link https://codex.wordpress.org/Function_Reference/add_action
|
106 |
*/
|
107 |
public function stats_css() {
|
108 |
-
$ext = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.css' : '.min.css';
|
109 |
-
|
110 |
echo "\n";
|
111 |
echo "<style type='text/css'>\n";
|
112 |
-
|
113 |
echo "\n";
|
114 |
echo "</style>\n";
|
115 |
}
|
@@ -117,24 +115,24 @@ class Clicky_Visitor_Graph {
|
|
117 |
/**
|
118 |
* Adds Clicky (graph) to the admin bar of the website.
|
119 |
*
|
120 |
-
* @param object $wp_admin_bar Class that contains all information for the admin bar. Passed by reference.
|
121 |
-
*
|
122 |
* @link https://codex.wordpress.org/Class_Reference/WP_Admin_Bar
|
|
|
|
|
123 |
*/
|
124 |
public function stats_admin_bar_menu( $wp_admin_bar ) {
|
125 |
$img_src = $this->create_graph();
|
126 |
-
if (
|
127 |
return;
|
128 |
}
|
129 |
|
130 |
$url = 'https://secure.getclicky.com/stats/?site_id=' . $this->options['site_id'];
|
131 |
$title = __( 'Visitors over 48 hours. Click for more Clicky Site Stats.', 'clicky' );
|
132 |
|
133 |
-
$menu =
|
134 |
'id' => 'clickystats',
|
135 |
'title' => "<img width='99' height='20' src='" . $img_src . "' alt='" . esc_attr( $title ) . "' title='" . esc_attr( $title ) . "' />",
|
136 |
'href' => $url,
|
137 |
-
|
138 |
|
139 |
$wp_admin_bar->add_menu( $menu );
|
140 |
}
|
@@ -146,7 +144,7 @@ class Clicky_Visitor_Graph {
|
|
146 |
*/
|
147 |
private function create_graph() {
|
148 |
$result = $this->retrieve_clicky_api_details();
|
149 |
-
if (
|
150 |
return false;
|
151 |
}
|
152 |
|
@@ -167,14 +165,14 @@ class Clicky_Visitor_Graph {
|
|
167 |
* @link https://codex.wordpress.org/Function_Reference/wp_remote_get
|
168 |
*/
|
169 |
private function retrieve_clicky_api_details() {
|
170 |
-
$args =
|
171 |
'site_id' => $this->options['site_id'],
|
172 |
'sitekey' => $this->options['site_key'],
|
173 |
'type' => 'visitors',
|
174 |
'hourly' => 1,
|
175 |
'date' => 'last-3-days',
|
176 |
'output' => 'json',
|
177 |
-
|
178 |
$url = 'https://api.getclicky.com/api/stats/4?' . http_build_query( $args );
|
179 |
|
180 |
$resp = wp_remote_get( $url );
|
@@ -212,7 +210,7 @@ class Clicky_Visitor_Graph {
|
|
212 |
}
|
213 |
|
214 |
$hours = 0;
|
215 |
-
$values =
|
216 |
|
217 |
foreach ( $json[0]->dates as $date ) {
|
218 |
foreach ( $date->items as $item ) {
|
@@ -220,7 +218,7 @@ class Clicky_Visitor_Graph {
|
|
220 |
break 2;
|
221 |
}
|
222 |
$values[] = $item->value;
|
223 |
-
|
224 |
}
|
225 |
}
|
226 |
$values = array_reverse( $values );
|
@@ -289,6 +287,7 @@ class Clicky_Visitor_Graph {
|
|
289 |
$image = ob_get_contents();
|
290 |
ob_end_clean();
|
291 |
|
|
|
292 |
$image = 'data:image/png;base64,' . base64_encode( $image );
|
293 |
|
294 |
return $image;
|
22 |
*
|
23 |
* @var array
|
24 |
*/
|
25 |
+
private $bar_values = [];
|
26 |
|
27 |
/**
|
28 |
* Height of the generated image.
|
64 |
*
|
65 |
* @var array
|
66 |
*/
|
67 |
+
private $options = [];
|
68 |
|
69 |
/**
|
70 |
* The ratio between a value and the overall image height.
|
95 |
return;
|
96 |
}
|
97 |
|
98 |
+
add_action( 'wp_head', [ $this, 'stats_css' ] );
|
99 |
+
add_action( 'admin_bar_menu', [ $this, 'stats_admin_bar_menu' ], 100 );
|
100 |
}
|
101 |
|
102 |
/**
|
105 |
* @link https://codex.wordpress.org/Function_Reference/add_action
|
106 |
*/
|
107 |
public function stats_css() {
|
|
|
|
|
108 |
echo "\n";
|
109 |
echo "<style type='text/css'>\n";
|
110 |
+
include CLICKY_PLUGIN_DIR_PATH . 'css/dist/adminbar.css';
|
111 |
echo "\n";
|
112 |
echo "</style>\n";
|
113 |
}
|
115 |
/**
|
116 |
* Adds Clicky (graph) to the admin bar of the website.
|
117 |
*
|
|
|
|
|
118 |
* @link https://codex.wordpress.org/Class_Reference/WP_Admin_Bar
|
119 |
+
*
|
120 |
+
* @param object $wp_admin_bar Class that contains all information for the admin bar. Passed by reference.
|
121 |
*/
|
122 |
public function stats_admin_bar_menu( $wp_admin_bar ) {
|
123 |
$img_src = $this->create_graph();
|
124 |
+
if ( $img_src === false ) {
|
125 |
return;
|
126 |
}
|
127 |
|
128 |
$url = 'https://secure.getclicky.com/stats/?site_id=' . $this->options['site_id'];
|
129 |
$title = __( 'Visitors over 48 hours. Click for more Clicky Site Stats.', 'clicky' );
|
130 |
|
131 |
+
$menu = [
|
132 |
'id' => 'clickystats',
|
133 |
'title' => "<img width='99' height='20' src='" . $img_src . "' alt='" . esc_attr( $title ) . "' title='" . esc_attr( $title ) . "' />",
|
134 |
'href' => $url,
|
135 |
+
];
|
136 |
|
137 |
$wp_admin_bar->add_menu( $menu );
|
138 |
}
|
144 |
*/
|
145 |
private function create_graph() {
|
146 |
$result = $this->retrieve_clicky_api_details();
|
147 |
+
if ( $result === false ) {
|
148 |
return false;
|
149 |
}
|
150 |
|
165 |
* @link https://codex.wordpress.org/Function_Reference/wp_remote_get
|
166 |
*/
|
167 |
private function retrieve_clicky_api_details() {
|
168 |
+
$args = [
|
169 |
'site_id' => $this->options['site_id'],
|
170 |
'sitekey' => $this->options['site_key'],
|
171 |
'type' => 'visitors',
|
172 |
'hourly' => 1,
|
173 |
'date' => 'last-3-days',
|
174 |
'output' => 'json',
|
175 |
+
];
|
176 |
$url = 'https://api.getclicky.com/api/stats/4?' . http_build_query( $args );
|
177 |
|
178 |
$resp = wp_remote_get( $url );
|
210 |
}
|
211 |
|
212 |
$hours = 0;
|
213 |
+
$values = [];
|
214 |
|
215 |
foreach ( $json[0]->dates as $date ) {
|
216 |
foreach ( $date->items as $item ) {
|
218 |
break 2;
|
219 |
}
|
220 |
$values[] = $item->value;
|
221 |
+
++$hours;
|
222 |
}
|
223 |
}
|
224 |
$values = array_reverse( $values );
|
287 |
$image = ob_get_contents();
|
288 |
ob_end_clean();
|
289 |
|
290 |
+
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode -- Valid use of base64_encode.
|
291 |
$image = 'data:image/png;base64,' . base64_encode( $image );
|
292 |
|
293 |
return $image;
|
includes/{class-clicky-options.php → options.php}
RENAMED
@@ -17,7 +17,7 @@ class Clicky_Options {
|
|
17 |
*
|
18 |
* @var array
|
19 |
*/
|
20 |
-
public static $option_defaults =
|
21 |
'site_id' => '', // There is no default site ID as we don't know it...
|
22 |
'site_key' => '', // There is no default site key as we don't know it...
|
23 |
'admin_site_key' => '', // There is no default admin site key as we don't know it...
|
@@ -26,14 +26,14 @@ class Clicky_Options {
|
|
26 |
'track_names' => false, // Tracking the names of commenters makes sense, but might be illegal in some countries, so we default to off.
|
27 |
'cookies_disable' => false, // No need to disable cookies by default as it severely impacts the quality of tracking.
|
28 |
'disable_stats' => false, // The stats on the frontend are often found useful, but some people might want to disable them.
|
29 |
-
|
30 |
|
31 |
/**
|
32 |
* Holds the type of variable that each option is, so we can cast it to that.
|
33 |
*
|
34 |
-
* @var
|
35 |
*/
|
36 |
-
public static $option_var_types =
|
37 |
'site_id' => 'string',
|
38 |
'site_key' => 'string',
|
39 |
'admin_site_key' => 'string',
|
@@ -42,7 +42,7 @@ class Clicky_Options {
|
|
42 |
'track_names' => 'bool',
|
43 |
'cookies_disable' => 'bool',
|
44 |
'disable_stats' => 'bool',
|
45 |
-
|
46 |
|
47 |
/**
|
48 |
* Name of the option we're using.
|
@@ -63,7 +63,7 @@ class Clicky_Options {
|
|
63 |
*
|
64 |
* @var array
|
65 |
*/
|
66 |
-
public $options =
|
67 |
|
68 |
/**
|
69 |
* Class constructor.
|
@@ -106,7 +106,7 @@ class Clicky_Options {
|
|
106 |
/**
|
107 |
* Getting instance of this object. If instance doesn't exists it will be created.
|
108 |
*
|
109 |
-
* @return
|
110 |
*/
|
111 |
public static function instance() {
|
112 |
if ( is_null( self::$instance ) ) {
|
17 |
*
|
18 |
* @var array
|
19 |
*/
|
20 |
+
public static $option_defaults = [
|
21 |
'site_id' => '', // There is no default site ID as we don't know it...
|
22 |
'site_key' => '', // There is no default site key as we don't know it...
|
23 |
'admin_site_key' => '', // There is no default admin site key as we don't know it...
|
26 |
'track_names' => false, // Tracking the names of commenters makes sense, but might be illegal in some countries, so we default to off.
|
27 |
'cookies_disable' => false, // No need to disable cookies by default as it severely impacts the quality of tracking.
|
28 |
'disable_stats' => false, // The stats on the frontend are often found useful, but some people might want to disable them.
|
29 |
+
];
|
30 |
|
31 |
/**
|
32 |
* Holds the type of variable that each option is, so we can cast it to that.
|
33 |
*
|
34 |
+
* @var string[]
|
35 |
*/
|
36 |
+
public static $option_var_types = [
|
37 |
'site_id' => 'string',
|
38 |
'site_key' => 'string',
|
39 |
'admin_site_key' => 'string',
|
42 |
'track_names' => 'bool',
|
43 |
'cookies_disable' => 'bool',
|
44 |
'disable_stats' => 'bool',
|
45 |
+
];
|
46 |
|
47 |
/**
|
48 |
* Name of the option we're using.
|
63 |
*
|
64 |
* @var array
|
65 |
*/
|
66 |
+
public $options = [];
|
67 |
|
68 |
/**
|
69 |
* Class constructor.
|
106 |
/**
|
107 |
* Getting instance of this object. If instance doesn't exists it will be created.
|
108 |
*
|
109 |
+
* @return Clicky_Options
|
110 |
*/
|
111 |
public static function instance() {
|
112 |
if ( is_null( self::$instance ) ) {
|
js/index.php
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Nothing to see here.
|
4 |
+
*/
|
languages/clicky.pot
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the Clicky for WordPress package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Clicky for WordPress
|
6 |
"Report-Msgid-Bugs-To: https://github.com/yoast/clicky/issues\n"
|
7 |
-
"POT-Creation-Date:
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date:
|
12 |
"Last-Translator: Yoast Translate Team <translations@yoast.com>\n"
|
13 |
"Language-Team: Yoast Translate <translations@yoast.com>\n"
|
14 |
"Language: en\n"
|
@@ -24,43 +24,42 @@ msgstr ""
|
|
24 |
"X-Textdomain-Support: yes\n"
|
25 |
"X-Generator: grunt-wp-i18n 1.0.3\n"
|
26 |
|
27 |
-
#: admin/
|
28 |
-
#: admin/class-clicky-options-admin.php:246
|
29 |
#. translators: 1: link open tag to clicky forum website; 2: link close tag.
|
30 |
msgid ""
|
31 |
"If you're in need of support with Clicky and / or this plugin, please visit "
|
32 |
"the %1$sClicky forums%2$s."
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: admin/
|
36 |
msgid "Need Support?"
|
37 |
msgstr ""
|
38 |
|
39 |
-
#: admin/
|
40 |
msgid "No news items, feed might be broken..."
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: admin/
|
44 |
msgid "Subscribe with RSS"
|
45 |
msgstr ""
|
46 |
|
47 |
-
#: admin/
|
48 |
msgid "Latest news from Clicky"
|
49 |
msgstr ""
|
50 |
|
51 |
-
#: admin/
|
52 |
msgid "Like Yoast on Facebook"
|
53 |
msgstr ""
|
54 |
|
55 |
-
#: admin/
|
56 |
msgid "Follow Yoast on Twitter"
|
57 |
msgstr ""
|
58 |
|
59 |
-
#: admin/
|
60 |
msgid "Subscribe by email"
|
61 |
msgstr ""
|
62 |
|
63 |
-
#: admin/
|
64 |
msgid "Latest news from Yoast"
|
65 |
msgstr ""
|
66 |
|
@@ -68,31 +67,31 @@ msgstr ""
|
|
68 |
msgid "Clicky for WordPress"
|
69 |
msgstr ""
|
70 |
|
71 |
-
#: admin/
|
72 |
msgid "Yoast Translate"
|
73 |
msgstr ""
|
74 |
|
75 |
-
#: admin/
|
76 |
msgid "Clicky Goal Tracking"
|
77 |
msgstr ""
|
78 |
|
79 |
-
#: admin/
|
80 |
msgid "Clicky settings"
|
81 |
msgstr ""
|
82 |
|
83 |
-
#: admin/
|
84 |
msgid "Clicky"
|
85 |
msgstr ""
|
86 |
|
87 |
-
#: admin/
|
88 |
msgid "Clicky Stats"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: admin/
|
92 |
msgid "Clicky is almost ready. "
|
93 |
msgstr ""
|
94 |
|
95 |
-
#: admin/
|
96 |
#. translators: 1: link open tag to the plugin settings page; 2: link close
|
97 |
#. tag.
|
98 |
msgid ""
|
@@ -100,84 +99,84 @@ msgid ""
|
|
100 |
"for it to work."
|
101 |
msgstr ""
|
102 |
|
103 |
-
#: admin/
|
104 |
msgid "Settings"
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: admin/
|
108 |
msgid "Basic settings"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: admin/
|
112 |
msgid "Site ID"
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: admin/
|
116 |
msgid "Site Key"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: admin/
|
120 |
msgid "Admin Site Key"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: admin/
|
124 |
msgid "Like this plugin?"
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: admin/
|
128 |
msgid "Need support?"
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: admin/
|
132 |
msgid "Advanced Settings"
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: admin/
|
136 |
msgid "Disable Admin Bar stats"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: admin/
|
140 |
msgid "If you don't want to display the stats in your admin menu, check this box."
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: admin/
|
144 |
msgid "Ignore Admin users"
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: admin/
|
148 |
msgid ""
|
149 |
"If you are using a caching plugin, such as W3 Total Cache or WP-Supercache, "
|
150 |
"please ensure that you have it configured to NOT use the cache for logged "
|
151 |
"in users. Otherwise, admin users <em>will still</em> be tracked."
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: admin/
|
155 |
msgid "Disable cookies"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: admin/
|
159 |
msgid ""
|
160 |
"If you don't want Clicky to use cookies on your site, check this button. By "
|
161 |
"doing so, uniqueness will instead be determined based on their IP address."
|
162 |
msgstr ""
|
163 |
|
164 |
-
#: admin/
|
165 |
msgid "Track names of commenters"
|
166 |
msgstr ""
|
167 |
|
168 |
-
#: admin/
|
169 |
msgid "Outbound Links"
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: admin/
|
173 |
msgid "For instance: <code>/out/,/go/</code>"
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: admin/
|
177 |
msgid "Outbound Link Pattern"
|
178 |
msgstr ""
|
179 |
|
180 |
-
#: admin/
|
181 |
#. translators: 1: link open tag to the clicky user homepage; 2: link close
|
182 |
#. tag.
|
183 |
msgid ""
|
@@ -187,7 +186,7 @@ msgid ""
|
|
187 |
"information."
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: admin/
|
191 |
#. translators: 1: link open tag to the clicky knowledge base article; 2: link
|
192 |
#. close tag.
|
193 |
msgid ""
|
@@ -243,17 +242,17 @@ msgstr ""
|
|
243 |
msgid "Goal Revenue:"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: frontend/
|
247 |
msgid ""
|
248 |
"Clicky tracking not shown because you're an administrator and you've "
|
249 |
"configured Clicky to ignore administrators."
|
250 |
msgstr ""
|
251 |
|
252 |
-
#: frontend/
|
253 |
msgid "Posted a comment"
|
254 |
msgstr ""
|
255 |
|
256 |
-
#: frontend/
|
257 |
msgid "Visitors over 48 hours. Click for more Clicky Site Stats."
|
258 |
msgstr ""
|
259 |
|
1 |
+
# Copyright (C) 2020 Team Yoast
|
2 |
# This file is distributed under the same license as the Clicky for WordPress package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Clicky for WordPress 2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://github.com/yoast/clicky/issues\n"
|
7 |
+
"POT-Creation-Date: 2020-11-12 10:39:42+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: Yoast Translate Team <translations@yoast.com>\n"
|
13 |
"Language-Team: Yoast Translate <translations@yoast.com>\n"
|
14 |
"Language: en\n"
|
24 |
"X-Textdomain-Support: yes\n"
|
25 |
"X-Generator: grunt-wp-i18n 1.0.3\n"
|
26 |
|
27 |
+
#: admin/admin-page.php:73 admin/options-admin.php:246
|
|
|
28 |
#. translators: 1: link open tag to clicky forum website; 2: link close tag.
|
29 |
msgid ""
|
30 |
"If you're in need of support with Clicky and / or this plugin, please visit "
|
31 |
"the %1$sClicky forums%2$s."
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: admin/admin-page.php:74
|
35 |
msgid "Need Support?"
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: admin/admin-page.php:89
|
39 |
msgid "No news items, feed might be broken..."
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: admin/admin-page.php:105
|
43 |
msgid "Subscribe with RSS"
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: admin/admin-page.php:116
|
47 |
msgid "Latest news from Clicky"
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: admin/admin-page.php:123
|
51 |
msgid "Like Yoast on Facebook"
|
52 |
msgstr ""
|
53 |
|
54 |
+
#: admin/admin-page.php:124
|
55 |
msgid "Follow Yoast on Twitter"
|
56 |
msgstr ""
|
57 |
|
58 |
+
#: admin/admin-page.php:125
|
59 |
msgid "Subscribe by email"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: admin/admin-page.php:127
|
63 |
msgid "Latest news from Yoast"
|
64 |
msgstr ""
|
65 |
|
67 |
msgid "Clicky for WordPress"
|
68 |
msgstr ""
|
69 |
|
70 |
+
#: admin/admin-page.php:141
|
71 |
msgid "Yoast Translate"
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: admin/admin.php:52
|
75 |
msgid "Clicky Goal Tracking"
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: admin/admin.php:70
|
79 |
msgid "Clicky settings"
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: admin/admin.php:71
|
83 |
msgid "Clicky"
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: admin/admin.php:78 admin/admin.php:79
|
87 |
msgid "Clicky Stats"
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: admin/admin.php:106
|
91 |
msgid "Clicky is almost ready. "
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: admin/admin.php:110
|
95 |
#. translators: 1: link open tag to the plugin settings page; 2: link close
|
96 |
#. tag.
|
97 |
msgid ""
|
99 |
"for it to work."
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: admin/admin.php:183
|
103 |
msgid "Settings"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: admin/options-admin.php:46 admin/views/admin-page.php:19
|
107 |
msgid "Basic settings"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: admin/options-admin.php:52
|
111 |
msgid "Site ID"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: admin/options-admin.php:53
|
115 |
msgid "Site Key"
|
116 |
msgstr ""
|
117 |
|
118 |
+
#: admin/options-admin.php:54
|
119 |
msgid "Admin Site Key"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: admin/options-admin.php:73
|
123 |
msgid "Like this plugin?"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: admin/options-admin.php:80
|
127 |
msgid "Need support?"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: admin/options-admin.php:90
|
131 |
msgid "Advanced Settings"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: admin/options-admin.php:94
|
135 |
msgid "Disable Admin Bar stats"
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: admin/options-admin.php:95
|
139 |
msgid "If you don't want to display the stats in your admin menu, check this box."
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: admin/options-admin.php:98
|
143 |
msgid "Ignore Admin users"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: admin/options-admin.php:99
|
147 |
msgid ""
|
148 |
"If you are using a caching plugin, such as W3 Total Cache or WP-Supercache, "
|
149 |
"please ensure that you have it configured to NOT use the cache for logged "
|
150 |
"in users. Otherwise, admin users <em>will still</em> be tracked."
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: admin/options-admin.php:102
|
154 |
msgid "Disable cookies"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: admin/options-admin.php:103
|
158 |
msgid ""
|
159 |
"If you don't want Clicky to use cookies on your site, check this button. By "
|
160 |
"doing so, uniqueness will instead be determined based on their IP address."
|
161 |
msgstr ""
|
162 |
|
163 |
+
#: admin/options-admin.php:106
|
164 |
msgid "Track names of commenters"
|
165 |
msgstr ""
|
166 |
|
167 |
+
#: admin/options-admin.php:132
|
168 |
msgid "Outbound Links"
|
169 |
msgstr ""
|
170 |
|
171 |
+
#: admin/options-admin.php:140
|
172 |
msgid "For instance: <code>/out/,/go/</code>"
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: admin/options-admin.php:144
|
176 |
msgid "Outbound Link Pattern"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: admin/options-admin.php:218
|
180 |
#. translators: 1: link open tag to the clicky user homepage; 2: link close
|
181 |
#. tag.
|
182 |
msgid ""
|
186 |
"information."
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: admin/options-admin.php:232
|
190 |
#. translators: 1: link open tag to the clicky knowledge base article; 2: link
|
191 |
#. close tag.
|
192 |
msgid ""
|
242 |
msgid "Goal Revenue:"
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: frontend/frontend.php:46
|
246 |
msgid ""
|
247 |
"Clicky tracking not shown because you're an administrator and you've "
|
248 |
"configured Clicky to ignore administrators."
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: frontend/frontend.php:139
|
252 |
msgid "Posted a comment"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: frontend/visitor-graph.php:129
|
256 |
msgid "Visitors over 48 hours. Click for more Clicky Site Stats."
|
257 |
msgstr ""
|
258 |
|
readme.txt
CHANGED
@@ -3,10 +3,10 @@ Contributors: joostdevalk, yoast
|
|
3 |
Tags: analytics, statistics, clicky, getclicky, affiliate
|
4 |
License: GPLv3
|
5 |
License URI: http://www.gnu.org/licenses/gpl.html
|
6 |
-
Requires at least: 5.
|
7 |
-
Tested up to:
|
8 |
Requires PHP: 5.6.20
|
9 |
-
Stable tag:
|
10 |
|
11 |
Integrates the Clicky web analytics service into your blog and adds features for comment tracking & more.
|
12 |
|
@@ -41,14 +41,29 @@ Read the authors [review of Clicky Analytics](https://yoast.com/clicky-analytics
|
|
41 |
|
42 |
== Changelog ==
|
43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
= 1.9 =
|
45 |
|
|
|
|
|
46 |
* Updated required PHP version to 5.6.
|
47 |
* Lots of code style and escaping improvements.
|
48 |
* Fixes a PHP warning for a file that's not found in some setups, props [Miller Media](https://github.com/Miller-Media).
|
49 |
|
50 |
= 1.8 =
|
51 |
|
|
|
|
|
52 |
* Lots of code style and escaping improvements.
|
53 |
* Removed banner for the Yoast website review service as it's no longer offered.
|
54 |
* Added RTL stylesheets.
|
3 |
Tags: analytics, statistics, clicky, getclicky, affiliate
|
4 |
License: GPLv3
|
5 |
License URI: http://www.gnu.org/licenses/gpl.html
|
6 |
+
Requires at least: 5.9
|
7 |
+
Tested up to: 6.1
|
8 |
Requires PHP: 5.6.20
|
9 |
+
Stable tag: 2.0
|
10 |
|
11 |
Integrates the Clicky web analytics service into your blog and adds features for comment tracking & more.
|
12 |
|
41 |
|
42 |
== Changelog ==
|
43 |
|
44 |
+
= 2.0 =
|
45 |
+
|
46 |
+
Released November 12th, 2020
|
47 |
+
|
48 |
+
* Loads the admin-side scripts on the Clicky settings page only. Props to [erommel](https://github.com/erommel).
|
49 |
+
* Deprecates the `clicky_admin_footer` action hook in favour of the `Yoast\WP\Clicky\admin_footer` hook.
|
50 |
+
* Fixes a frontend CSS bug.
|
51 |
+
* Fixes a bug where the visitor graph in the admin bar would be shown even if the site information was invalid.
|
52 |
+
* Fixes a bug where the Clicky blog feed wasn't retrieved properly.
|
53 |
+
* Stops explicit support for PHP < 5.6 / WP < 5.2.
|
54 |
+
|
55 |
= 1.9 =
|
56 |
|
57 |
+
Released November 25th, 2019
|
58 |
+
|
59 |
* Updated required PHP version to 5.6.
|
60 |
* Lots of code style and escaping improvements.
|
61 |
* Fixes a PHP warning for a file that's not found in some setups, props [Miller Media](https://github.com/Miller-Media).
|
62 |
|
63 |
= 1.8 =
|
64 |
|
65 |
+
Released November 25th, 2019
|
66 |
+
|
67 |
* Lots of code style and escaping improvements.
|
68 |
* Removed banner for the Yoast website review service as it's no longer offered.
|
69 |
* Added RTL stylesheets.
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit5b67105fde0fe0fc68dc2788256e0582::getLoader();
|
vendor/autoload_52.php
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// autoload_52.php generated by xrstf/composer-php52
|
4 |
-
|
5 |
-
require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
|
6 |
-
|
7 |
-
return ComposerAutoloaderInitb9fb574df61967d0b24bb8fdde5c3b97::getLoader();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/composer/ClassLoader.php
CHANGED
@@ -60,7 +60,7 @@ class ClassLoader
|
|
60 |
public function getPrefixes()
|
61 |
{
|
62 |
if (!empty($this->prefixesPsr0)) {
|
63 |
-
return call_user_func_array('array_merge', $this->prefixesPsr0);
|
64 |
}
|
65 |
|
66 |
return array();
|
60 |
public function getPrefixes()
|
61 |
{
|
62 |
if (!empty($this->prefixesPsr0)) {
|
63 |
+
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
64 |
}
|
65 |
|
66 |
return array();
|
vendor/composer/ClassLoader52.php
DELETED
@@ -1,271 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
|
4 |
-
*
|
5 |
-
* This file is released under the terms of the MIT license. You can find the
|
6 |
-
* complete text in the attached LICENSE file or online at:
|
7 |
-
*
|
8 |
-
* http://www.opensource.org/licenses/mit-license.php
|
9 |
-
*
|
10 |
-
* --------------------------------------------------------------------------
|
11 |
-
*
|
12 |
-
* 99% of this is copied as-is from the original Composer source code and is
|
13 |
-
* released under MIT license as well. Copyright goes to:
|
14 |
-
*
|
15 |
-
* - Fabien Potencier <fabien@symfony.com>
|
16 |
-
* - Jordi Boggiano <j.boggiano@seld.be>
|
17 |
-
*/
|
18 |
-
|
19 |
-
class xrstf_Composer52_ClassLoader {
|
20 |
-
private $prefixes = array();
|
21 |
-
private $fallbackDirs = array();
|
22 |
-
private $useIncludePath = false;
|
23 |
-
private $classMap = array();
|
24 |
-
private $classMapAuthoratative = false;
|
25 |
-
private $allowUnderscore = false;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @param boolean $flag true to allow class names with a leading underscore, false to disable
|
29 |
-
*/
|
30 |
-
public function setAllowUnderscore($flag) {
|
31 |
-
$this->allowUnderscore = (boolean) $flag;
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @return array
|
36 |
-
*/
|
37 |
-
public function getPrefixes() {
|
38 |
-
return $this->prefixes;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Turns off searching the prefix and fallback directories for classes
|
43 |
-
* that have not been registered with the class map.
|
44 |
-
*
|
45 |
-
* @param bool $classMapAuthoratative
|
46 |
-
*/
|
47 |
-
public function setClassMapAuthoritative($classMapAuthoratative) {
|
48 |
-
$this->classMapAuthoratative = $classMapAuthoratative;
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Should class lookup fail if not found in the current class map?
|
53 |
-
*
|
54 |
-
* @return bool
|
55 |
-
*/
|
56 |
-
public function getClassMapAuthoratative() {
|
57 |
-
return $this->classMapAuthoratative;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @return array
|
62 |
-
*/
|
63 |
-
public function getFallbackDirs() {
|
64 |
-
return $this->fallbackDirs;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* @return array
|
69 |
-
*/
|
70 |
-
public function getClassMap() {
|
71 |
-
return $this->classMap;
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* @param array $classMap class to filename map
|
76 |
-
*/
|
77 |
-
public function addClassMap(array $classMap) {
|
78 |
-
if ($this->classMap) {
|
79 |
-
$this->classMap = array_merge($this->classMap, $classMap);
|
80 |
-
}
|
81 |
-
else {
|
82 |
-
$this->classMap = $classMap;
|
83 |
-
}
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Registers a set of classes, merging with any others previously set.
|
88 |
-
*
|
89 |
-
* @param string $prefix the classes prefix
|
90 |
-
* @param array|string $paths the location(s) of the classes
|
91 |
-
* @param bool $prepend prepend the location(s)
|
92 |
-
*/
|
93 |
-
public function add($prefix, $paths, $prepend = false) {
|
94 |
-
if (!$prefix) {
|
95 |
-
if ($prepend) {
|
96 |
-
$this->fallbackDirs = array_merge(
|
97 |
-
(array) $paths,
|
98 |
-
$this->fallbackDirs
|
99 |
-
);
|
100 |
-
}
|
101 |
-
else {
|
102 |
-
$this->fallbackDirs = array_merge(
|
103 |
-
$this->fallbackDirs,
|
104 |
-
(array) $paths
|
105 |
-
);
|
106 |
-
}
|
107 |
-
|
108 |
-
return;
|
109 |
-
}
|
110 |
-
|
111 |
-
if (!isset($this->prefixes[$prefix])) {
|
112 |
-
$this->prefixes[$prefix] = (array) $paths;
|
113 |
-
return;
|
114 |
-
}
|
115 |
-
|
116 |
-
if ($prepend) {
|
117 |
-
$this->prefixes[$prefix] = array_merge(
|
118 |
-
(array) $paths,
|
119 |
-
$this->prefixes[$prefix]
|
120 |
-
);
|
121 |
-
}
|
122 |
-
else {
|
123 |
-
$this->prefixes[$prefix] = array_merge(
|
124 |
-
$this->prefixes[$prefix],
|
125 |
-
(array) $paths
|
126 |
-
);
|
127 |
-
}
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Registers a set of classes, replacing any others previously set.
|
132 |
-
*
|
133 |
-
* @param string $prefix the classes prefix
|
134 |
-
* @param array|string $paths the location(s) of the classes
|
135 |
-
*/
|
136 |
-
public function set($prefix, $paths) {
|
137 |
-
if (!$prefix) {
|
138 |
-
$this->fallbackDirs = (array) $paths;
|
139 |
-
return;
|
140 |
-
}
|
141 |
-
|
142 |
-
$this->prefixes[$prefix] = (array) $paths;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Turns on searching the include path for class files.
|
147 |
-
*
|
148 |
-
* @param bool $useIncludePath
|
149 |
-
*/
|
150 |
-
public function setUseIncludePath($useIncludePath) {
|
151 |
-
$this->useIncludePath = $useIncludePath;
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Can be used to check if the autoloader uses the include path to check
|
156 |
-
* for classes.
|
157 |
-
*
|
158 |
-
* @return bool
|
159 |
-
*/
|
160 |
-
public function getUseIncludePath() {
|
161 |
-
return $this->useIncludePath;
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Registers this instance as an autoloader.
|
166 |
-
*/
|
167 |
-
public function register() {
|
168 |
-
spl_autoload_register(array($this, 'loadClass'), true);
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Unregisters this instance as an autoloader.
|
173 |
-
*/
|
174 |
-
public function unregister() {
|
175 |
-
spl_autoload_unregister(array($this, 'loadClass'));
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Loads the given class or interface.
|
180 |
-
*
|
181 |
-
* @param string $class the name of the class
|
182 |
-
* @return bool|null true, if loaded
|
183 |
-
*/
|
184 |
-
public function loadClass($class) {
|
185 |
-
if ($file = $this->findFile($class)) {
|
186 |
-
include $file;
|
187 |
-
return true;
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
/**
|
192 |
-
* Finds the path to the file where the class is defined.
|
193 |
-
*
|
194 |
-
* @param string $class the name of the class
|
195 |
-
* @return string|null the path, if found
|
196 |
-
*/
|
197 |
-
public function findFile($class) {
|
198 |
-
if ('\\' === $class[0]) {
|
199 |
-
$class = substr($class, 1);
|
200 |
-
}
|
201 |
-
|
202 |
-
if (isset($this->classMap[$class])) {
|
203 |
-
return $this->classMap[$class];
|
204 |
-
}
|
205 |
-
elseif ($this->classMapAuthoratative) {
|
206 |
-
return false;
|
207 |
-
}
|
208 |
-
|
209 |
-
$classPath = $this->getClassPath($class);
|
210 |
-
|
211 |
-
foreach ($this->prefixes as $prefix => $dirs) {
|
212 |
-
if (0 === strpos($class, $prefix)) {
|
213 |
-
foreach ($dirs as $dir) {
|
214 |
-
if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
|
215 |
-
return $dir.DIRECTORY_SEPARATOR.$classPath;
|
216 |
-
}
|
217 |
-
}
|
218 |
-
}
|
219 |
-
}
|
220 |
-
|
221 |
-
foreach ($this->fallbackDirs as $dir) {
|
222 |
-
if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
|
223 |
-
return $dir.DIRECTORY_SEPARATOR.$classPath;
|
224 |
-
}
|
225 |
-
}
|
226 |
-
|
227 |
-
if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
|
228 |
-
return $file;
|
229 |
-
}
|
230 |
-
|
231 |
-
return $this->classMap[$class] = false;
|
232 |
-
}
|
233 |
-
|
234 |
-
private function getClassPath($class) {
|
235 |
-
if (false !== $pos = strrpos($class, '\\')) {
|
236 |
-
// namespaced class name
|
237 |
-
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
|
238 |
-
$className = substr($class, $pos + 1);
|
239 |
-
}
|
240 |
-
else {
|
241 |
-
// PEAR-like class name
|
242 |
-
$classPath = null;
|
243 |
-
$className = $class;
|
244 |
-
}
|
245 |
-
|
246 |
-
$className = str_replace('_', DIRECTORY_SEPARATOR, $className);
|
247 |
-
|
248 |
-
// restore the prefix
|
249 |
-
if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
|
250 |
-
$className[0] = '_';
|
251 |
-
}
|
252 |
-
|
253 |
-
$classPath .= $className.'.php';
|
254 |
-
|
255 |
-
return $classPath;
|
256 |
-
}
|
257 |
-
|
258 |
-
public static function resolveIncludePath($classPath) {
|
259 |
-
$paths = explode(PATH_SEPARATOR, get_include_path());
|
260 |
-
|
261 |
-
foreach ($paths as $path) {
|
262 |
-
$path = rtrim($path, '/\\');
|
263 |
-
|
264 |
-
if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
|
265 |
-
return $file;
|
266 |
-
}
|
267 |
-
}
|
268 |
-
|
269 |
-
return false;
|
270 |
-
}
|
271 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -6,12 +6,12 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'Clicky_Admin' => $baseDir . '/admin/
|
10 |
-
'Clicky_Admin_Page' => $baseDir . '/admin/
|
11 |
-
'Clicky_Frontend' => $baseDir . '/frontend/
|
12 |
-
'Clicky_Options' => $baseDir . '/includes/
|
13 |
-
'Clicky_Options_Admin' => $baseDir . '/admin/
|
14 |
-
'Clicky_Visitor_Graph' => $baseDir . '/frontend/
|
15 |
'Composer\\Installers\\AglInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AglInstaller.php',
|
16 |
'Composer\\Installers\\AimeosInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
|
17 |
'Composer\\Installers\\AnnotateCmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
|
@@ -30,6 +30,7 @@ return array(
|
|
30 |
'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
31 |
'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
32 |
'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
|
|
33 |
'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
34 |
'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
35 |
'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
@@ -47,6 +48,7 @@ return array(
|
|
47 |
'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
48 |
'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
49 |
'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
|
|
50 |
'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
51 |
'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
52 |
'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
@@ -81,6 +83,7 @@ return array(
|
|
81 |
'Composer\\Installers\\PxcmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
82 |
'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
83 |
'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
|
|
84 |
'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
85 |
'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
86 |
'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
@@ -91,6 +94,7 @@ return array(
|
|
91 |
'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
92 |
'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
93 |
'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
|
|
94 |
'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
95 |
'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
96 |
'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
@@ -102,7 +106,5 @@ return array(
|
|
102 |
'Composer\\Installers\\YawikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
|
103 |
'Composer\\Installers\\ZendInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
|
104 |
'Composer\\Installers\\ZikulaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
|
105 |
-
'xrstf\\Composer52\\AutoloadGenerator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php',
|
106 |
-
'xrstf\\Composer52\\Generator' => $vendorDir . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php',
|
107 |
'yoast_i18n' => $vendorDir . '/yoast/i18n-module/i18n-module.php',
|
108 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
+
'Clicky_Admin' => $baseDir . '/admin/admin.php',
|
10 |
+
'Clicky_Admin_Page' => $baseDir . '/admin/admin-page.php',
|
11 |
+
'Clicky_Frontend' => $baseDir . '/frontend/frontend.php',
|
12 |
+
'Clicky_Options' => $baseDir . '/includes/options.php',
|
13 |
+
'Clicky_Options_Admin' => $baseDir . '/admin/options-admin.php',
|
14 |
+
'Clicky_Visitor_Graph' => $baseDir . '/frontend/visitor-graph.php',
|
15 |
'Composer\\Installers\\AglInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AglInstaller.php',
|
16 |
'Composer\\Installers\\AimeosInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
|
17 |
'Composer\\Installers\\AnnotateCmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
|
30 |
'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
31 |
'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
32 |
'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
33 |
+
'Composer\\Installers\\DframeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
|
34 |
'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
35 |
'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
36 |
'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
48 |
'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
49 |
'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
50 |
'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
51 |
+
'Composer\\Installers\\KnownInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
|
52 |
'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
53 |
'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
54 |
'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
83 |
'Composer\\Installers\\PxcmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
84 |
'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
85 |
'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
86 |
+
'Composer\\Installers\\Redaxo5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
|
87 |
'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
88 |
'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
89 |
'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
94 |
'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
95 |
'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
96 |
'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
97 |
+
'Composer\\Installers\\TaoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
|
98 |
'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
99 |
'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
100 |
'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
106 |
'Composer\\Installers\\YawikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
|
107 |
'Composer\\Installers\\ZendInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
|
108 |
'Composer\\Installers\\ZikulaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
|
|
|
|
|
109 |
'yoast_i18n' => $vendorDir . '/yoast/i18n-module/i18n-module.php',
|
110 |
);
|
vendor/composer/autoload_namespaces.php
CHANGED
@@ -6,5 +6,4 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
-
'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
|
10 |
);
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
9 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -13,21 +13,24 @@ class ComposerAutoloaderInit3957b09a29f91c5e67cbbd771be5063a
|
|
13 |
}
|
14 |
}
|
15 |
|
|
|
|
|
|
|
16 |
public static function getLoader()
|
17 |
{
|
18 |
if (null !== self::$loader) {
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit5b67105fde0fe0fc68dc2788256e0582
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
13 |
}
|
14 |
}
|
15 |
|
16 |
+
/**
|
17 |
+
* @return \Composer\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
public static function getLoader()
|
20 |
{
|
21 |
if (null !== self::$loader) {
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit5b67105fde0fe0fc68dc2788256e0582', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit5b67105fde0fe0fc68dc2788256e0582', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit5b67105fde0fe0fc68dc2788256e0582::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_real_52.php
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// autoload_real_52.php generated by xrstf/composer-php52
|
4 |
-
|
5 |
-
class ComposerAutoloaderInitb9fb574df61967d0b24bb8fdde5c3b97 {
|
6 |
-
private static $loader;
|
7 |
-
|
8 |
-
public static function loadClassLoader($class) {
|
9 |
-
if ('xrstf_Composer52_ClassLoader' === $class) {
|
10 |
-
require dirname(__FILE__).'/ClassLoader52.php';
|
11 |
-
}
|
12 |
-
}
|
13 |
-
|
14 |
-
/**
|
15 |
-
* @return xrstf_Composer52_ClassLoader
|
16 |
-
*/
|
17 |
-
public static function getLoader() {
|
18 |
-
if (null !== self::$loader) {
|
19 |
-
return self::$loader;
|
20 |
-
}
|
21 |
-
|
22 |
-
spl_autoload_register(array('ComposerAutoloaderInitb9fb574df61967d0b24bb8fdde5c3b97', 'loadClassLoader'), true /*, true */);
|
23 |
-
self::$loader = $loader = new xrstf_Composer52_ClassLoader();
|
24 |
-
spl_autoload_unregister(array('ComposerAutoloaderInitb9fb574df61967d0b24bb8fdde5c3b97', 'loadClassLoader'));
|
25 |
-
|
26 |
-
$vendorDir = dirname(dirname(__FILE__));
|
27 |
-
$baseDir = dirname($vendorDir);
|
28 |
-
$dir = dirname(__FILE__);
|
29 |
-
|
30 |
-
$map = require $dir.'/autoload_namespaces.php';
|
31 |
-
foreach ($map as $namespace => $path) {
|
32 |
-
$loader->add($namespace, $path);
|
33 |
-
}
|
34 |
-
|
35 |
-
$classMap = require $dir.'/autoload_classmap.php';
|
36 |
-
if ($classMap) {
|
37 |
-
$loader->addClassMap($classMap);
|
38 |
-
}
|
39 |
-
|
40 |
-
$loader->register(true);
|
41 |
-
|
42 |
-
return $loader;
|
43 |
-
}
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
@@ -20,23 +20,13 @@ class ComposerStaticInit3957b09a29f91c5e67cbbd771be5063a
|
|
20 |
),
|
21 |
);
|
22 |
|
23 |
-
public static $prefixesPsr0 = array (
|
24 |
-
'x' =>
|
25 |
-
array (
|
26 |
-
'xrstf\\Composer52' =>
|
27 |
-
array (
|
28 |
-
0 => __DIR__ . '/..' . '/xrstf/composer-php52/lib',
|
29 |
-
),
|
30 |
-
),
|
31 |
-
);
|
32 |
-
|
33 |
public static $classMap = array (
|
34 |
-
'Clicky_Admin' => __DIR__ . '/../..' . '/admin/
|
35 |
-
'Clicky_Admin_Page' => __DIR__ . '/../..' . '/admin/
|
36 |
-
'Clicky_Frontend' => __DIR__ . '/../..' . '/frontend/
|
37 |
-
'Clicky_Options' => __DIR__ . '/../..' . '/includes/
|
38 |
-
'Clicky_Options_Admin' => __DIR__ . '/../..' . '/admin/
|
39 |
-
'Clicky_Visitor_Graph' => __DIR__ . '/../..' . '/frontend/
|
40 |
'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php',
|
41 |
'Composer\\Installers\\AimeosInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
|
42 |
'Composer\\Installers\\AnnotateCmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
|
@@ -55,6 +45,7 @@ class ComposerStaticInit3957b09a29f91c5e67cbbd771be5063a
|
|
55 |
'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
56 |
'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
57 |
'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
|
|
58 |
'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
59 |
'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
60 |
'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
@@ -72,6 +63,7 @@ class ComposerStaticInit3957b09a29f91c5e67cbbd771be5063a
|
|
72 |
'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
73 |
'Composer\\Installers\\KanboardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
74 |
'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
|
|
75 |
'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
76 |
'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
77 |
'Composer\\Installers\\LanManagementSystemInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
@@ -106,6 +98,7 @@ class ComposerStaticInit3957b09a29f91c5e67cbbd771be5063a
|
|
106 |
'Composer\\Installers\\PxcmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
107 |
'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
108 |
'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
|
|
109 |
'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
110 |
'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
111 |
'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
@@ -116,6 +109,7 @@ class ComposerStaticInit3957b09a29f91c5e67cbbd771be5063a
|
|
116 |
'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
117 |
'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
118 |
'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
|
|
119 |
'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
120 |
'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
121 |
'Composer\\Installers\\UserFrostingInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
@@ -127,18 +121,15 @@ class ComposerStaticInit3957b09a29f91c5e67cbbd771be5063a
|
|
127 |
'Composer\\Installers\\YawikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
|
128 |
'Composer\\Installers\\ZendInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
|
129 |
'Composer\\Installers\\ZikulaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
|
130 |
-
'xrstf\\Composer52\\AutoloadGenerator' => __DIR__ . '/..' . '/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php',
|
131 |
-
'xrstf\\Composer52\\Generator' => __DIR__ . '/..' . '/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php',
|
132 |
'yoast_i18n' => __DIR__ . '/..' . '/yoast/i18n-module/i18n-module.php',
|
133 |
);
|
134 |
|
135 |
public static function getInitializer(ClassLoader $loader)
|
136 |
{
|
137 |
return \Closure::bind(function () use ($loader) {
|
138 |
-
$loader->prefixLengthsPsr4 =
|
139 |
-
$loader->prefixDirsPsr4 =
|
140 |
-
$loader->
|
141 |
-
$loader->classMap = ComposerStaticInit3957b09a29f91c5e67cbbd771be5063a::$classMap;
|
142 |
|
143 |
}, null, ClassLoader::class);
|
144 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit5b67105fde0fe0fc68dc2788256e0582
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'C' =>
|
20 |
),
|
21 |
);
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
public static $classMap = array (
|
24 |
+
'Clicky_Admin' => __DIR__ . '/../..' . '/admin/admin.php',
|
25 |
+
'Clicky_Admin_Page' => __DIR__ . '/../..' . '/admin/admin-page.php',
|
26 |
+
'Clicky_Frontend' => __DIR__ . '/../..' . '/frontend/frontend.php',
|
27 |
+
'Clicky_Options' => __DIR__ . '/../..' . '/includes/options.php',
|
28 |
+
'Clicky_Options_Admin' => __DIR__ . '/../..' . '/admin/options-admin.php',
|
29 |
+
'Clicky_Visitor_Graph' => __DIR__ . '/../..' . '/frontend/visitor-graph.php',
|
30 |
'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php',
|
31 |
'Composer\\Installers\\AimeosInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
|
32 |
'Composer\\Installers\\AnnotateCmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
|
45 |
'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
|
46 |
'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
|
47 |
'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
|
48 |
+
'Composer\\Installers\\DframeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
|
49 |
'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
|
50 |
'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
|
51 |
'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
|
63 |
'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
|
64 |
'Composer\\Installers\\KanboardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
|
65 |
'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
|
66 |
+
'Composer\\Installers\\KnownInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
|
67 |
'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
|
68 |
'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
|
69 |
'Composer\\Installers\\LanManagementSystemInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
|
98 |
'Composer\\Installers\\PxcmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
|
99 |
'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
|
100 |
'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
|
101 |
+
'Composer\\Installers\\Redaxo5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
|
102 |
'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
|
103 |
'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
|
104 |
'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
|
109 |
'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
|
110 |
'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
|
111 |
'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
|
112 |
+
'Composer\\Installers\\TaoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
|
113 |
'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
|
114 |
'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
|
115 |
'Composer\\Installers\\UserFrostingInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
|
121 |
'Composer\\Installers\\YawikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
|
122 |
'Composer\\Installers\\ZendInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
|
123 |
'Composer\\Installers\\ZikulaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
|
|
|
|
|
124 |
'yoast_i18n' => __DIR__ . '/..' . '/yoast/i18n-module/i18n-module.php',
|
125 |
);
|
126 |
|
127 |
public static function getInitializer(ClassLoader $loader)
|
128 |
{
|
129 |
return \Closure::bind(function () use ($loader) {
|
130 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit5b67105fde0fe0fc68dc2788256e0582::$prefixLengthsPsr4;
|
131 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit5b67105fde0fe0fc68dc2788256e0582::$prefixDirsPsr4;
|
132 |
+
$loader->classMap = ComposerStaticInit5b67105fde0fe0fc68dc2788256e0582::$classMap;
|
|
|
133 |
|
134 |
}, null, ClassLoader::class);
|
135 |
}
|
vendor/xrstf/composer-php52/LICENSE
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
Copyright (c) 2013 Christoph Mewes
|
2 |
-
|
3 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4 |
-
of this software and associated documentation files (the "Software"), to deal
|
5 |
-
in the Software without restriction, including without limitation the rights
|
6 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7 |
-
copies of the Software, and to permit persons to whom the Software is furnished
|
8 |
-
to do so, subject to the following conditions:
|
9 |
-
|
10 |
-
The above copyright notice and this permission notice shall be included in all
|
11 |
-
copies or substantial portions of the Software.
|
12 |
-
|
13 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19 |
-
THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/xrstf/composer-php52/lib/xrstf/Composer52/AutoloadGenerator.php
DELETED
@@ -1,346 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
|
4 |
-
*
|
5 |
-
* This file is released under the terms of the MIT license. You can find the
|
6 |
-
* complete text in the attached LICENSE file or online at:
|
7 |
-
*
|
8 |
-
* http://www.opensource.org/licenses/mit-license.php
|
9 |
-
*
|
10 |
-
* --------------------------------------------------------------------------
|
11 |
-
*
|
12 |
-
* 99% of this is copied as-is from the original Composer source code and is
|
13 |
-
* released under MIT license as well. Copyright goes to:
|
14 |
-
*
|
15 |
-
* - Igor Wiedler <igor@wiedler.ch>
|
16 |
-
* - Jordi Boggiano <j.boggiano@seld.be>
|
17 |
-
*/
|
18 |
-
|
19 |
-
namespace xrstf\Composer52;
|
20 |
-
|
21 |
-
use Composer\Autoload\AutoloadGenerator as BaseGenerator;
|
22 |
-
use Composer\Autoload\ClassMapGenerator;
|
23 |
-
use Composer\Config;
|
24 |
-
use Composer\Installer\InstallationManager;
|
25 |
-
use Composer\Package\AliasPackage;
|
26 |
-
use Composer\Package\PackageInterface;
|
27 |
-
use Composer\Repository\InstalledRepositoryInterface;
|
28 |
-
use Composer\Util\Filesystem;
|
29 |
-
|
30 |
-
class AutoloadGenerator extends BaseGenerator {
|
31 |
-
|
32 |
-
/**
|
33 |
-
* @var bool
|
34 |
-
*/
|
35 |
-
private $classMapAuthoritative = false;
|
36 |
-
|
37 |
-
public function __construct() {
|
38 |
-
// do nothing (but keep this constructor so we can build an instance without the need for an event dispatcher)
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Whether or not generated autoloader considers the class map
|
43 |
-
* authoritative.
|
44 |
-
*
|
45 |
-
* @param bool $classMapAuthoritative
|
46 |
-
*/
|
47 |
-
public function setClassMapAuthoritative($classMapAuthoritative)
|
48 |
-
{
|
49 |
-
$this->classMapAuthoritative = (boolean) $classMapAuthoritative;
|
50 |
-
}
|
51 |
-
|
52 |
-
public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '') {
|
53 |
-
if ($this->classMapAuthoritative) {
|
54 |
-
// Force scanPsr0Packages when classmap is authoritative
|
55 |
-
$scanPsr0Packages = true;
|
56 |
-
}
|
57 |
-
|
58 |
-
$filesystem = new Filesystem();
|
59 |
-
$filesystem->ensureDirectoryExists($config->get('vendor-dir'));
|
60 |
-
|
61 |
-
$cwd = getcwd();
|
62 |
-
$basePath = $filesystem->normalizePath($cwd);
|
63 |
-
$vendorPath = $filesystem->normalizePath(realpath($config->get('vendor-dir')));
|
64 |
-
$targetDir = $vendorPath.'/'.$targetDir;
|
65 |
-
$filesystem->ensureDirectoryExists($targetDir);
|
66 |
-
|
67 |
-
$useGlobalIncludePath = (bool) $config->get('use-include-path');
|
68 |
-
$prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true';
|
69 |
-
$classMapAuthoritative = $config->get('classmap-authoritative');
|
70 |
-
|
71 |
-
$vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
|
72 |
-
$vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true);
|
73 |
-
|
74 |
-
$appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true);
|
75 |
-
$appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode);
|
76 |
-
|
77 |
-
// add 5.2 compat
|
78 |
-
$vendorPathCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathCode);
|
79 |
-
$vendorPathToTargetDirCode = str_replace('__DIR__', 'dirname(__FILE__)', $vendorPathToTargetDirCode);
|
80 |
-
|
81 |
-
$packageMap = $this->buildPackageMap($installationManager, $mainPackage, $localRepo->getCanonicalPackages());
|
82 |
-
$autoloads = $this->parseAutoloads($packageMap, $mainPackage);
|
83 |
-
|
84 |
-
// add custom psr-0 autoloading if the root package has a target dir
|
85 |
-
$targetDirLoader = null;
|
86 |
-
$mainAutoload = $mainPackage->getAutoload();
|
87 |
-
if ($mainPackage->getTargetDir() && !empty($mainAutoload['psr-0'])) {
|
88 |
-
$levels = count(explode('/', $filesystem->normalizePath($mainPackage->getTargetDir())));
|
89 |
-
$prefixes = implode(', ', array_map(function ($prefix) {
|
90 |
-
return var_export($prefix, true);
|
91 |
-
}, array_keys($mainAutoload['psr-0'])));
|
92 |
-
|
93 |
-
$baseDirFromTargetDirCode = $filesystem->findShortestPathCode($targetDir, $basePath, true);
|
94 |
-
|
95 |
-
$targetDirLoader = <<<EOF
|
96 |
-
|
97 |
-
public static function autoload(\$class) {
|
98 |
-
\$dir = $baseDirFromTargetDirCode.'/';
|
99 |
-
\$prefixes = array($prefixes);
|
100 |
-
|
101 |
-
foreach (\$prefixes as \$prefix) {
|
102 |
-
if (0 !== strpos(\$class, \$prefix)) {
|
103 |
-
continue;
|
104 |
-
}
|
105 |
-
|
106 |
-
\$path = explode(DIRECTORY_SEPARATOR, self::getClassPath(\$class));
|
107 |
-
\$path = \$dir.implode('/', array_slice(\$path, $levels));
|
108 |
-
|
109 |
-
if (!\$path = self::resolveIncludePath(\$path)) {
|
110 |
-
return false;
|
111 |
-
}
|
112 |
-
|
113 |
-
require \$path;
|
114 |
-
return true;
|
115 |
-
}
|
116 |
-
}
|
117 |
-
|
118 |
-
EOF;
|
119 |
-
}
|
120 |
-
|
121 |
-
$filesCode = "";
|
122 |
-
$autoloads['files'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['files']));
|
123 |
-
foreach ($autoloads['files'] as $functionFile) {
|
124 |
-
// don't include file if it is using PHP 5.3+ syntax
|
125 |
-
// https://bitbucket.org/xrstf/composer-php52/issue/4
|
126 |
-
if ($this->isPHP53($functionFile)) {
|
127 |
-
$filesCode .= '// require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile)."; // disabled because of PHP 5.3 syntax\n";
|
128 |
-
}
|
129 |
-
else {
|
130 |
-
$filesCode .= ' require '.$this->getPathCode($filesystem, $basePath, $vendorPath, $functionFile).";\n";
|
131 |
-
}
|
132 |
-
}
|
133 |
-
|
134 |
-
if (!$suffix) {
|
135 |
-
$suffix = md5(uniqid('', true));
|
136 |
-
}
|
137 |
-
|
138 |
-
$includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode);
|
139 |
-
|
140 |
-
file_put_contents($vendorPath.'/autoload_52.php', $this->getAutoloadFile($vendorPathToTargetDirCode, $suffix));
|
141 |
-
file_put_contents($targetDir.'/autoload_real_52.php', $this->getAutoloadRealFile(true, (bool) $includePathFile, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader));
|
142 |
-
|
143 |
-
// use stream_copy_to_stream instead of copy
|
144 |
-
// to work around https://bugs.php.net/bug.php?id=64634
|
145 |
-
$sourceLoader = fopen(__DIR__.'/ClassLoader.php', 'r');
|
146 |
-
$targetLoader = fopen($targetDir.'/ClassLoader52.php', 'w+');
|
147 |
-
stream_copy_to_stream($sourceLoader, $targetLoader);
|
148 |
-
fclose($sourceLoader);
|
149 |
-
fclose($targetLoader);
|
150 |
-
unset($sourceLoader, $targetLoader);
|
151 |
-
}
|
152 |
-
|
153 |
-
protected function isPHP53($file) {
|
154 |
-
$tokens = token_get_all(file_get_contents($file));
|
155 |
-
$php53 = array(T_DIR, T_GOTO, T_NAMESPACE, T_NS_C, T_NS_SEPARATOR, T_USE);
|
156 |
-
|
157 |
-
// PHP 5.4+
|
158 |
-
if (defined('T_TRAIT')) {
|
159 |
-
$php53[] = T_TRAIT;
|
160 |
-
$php53[] = T_TRAIT_C;
|
161 |
-
$php53[] = T_TRAIT_C;
|
162 |
-
}
|
163 |
-
|
164 |
-
// PHP 5.5+
|
165 |
-
if (defined('T_FINALLY')) {
|
166 |
-
$php53[] = T_FINALLY;
|
167 |
-
$php53[] = T_YIELD;
|
168 |
-
}
|
169 |
-
|
170 |
-
foreach ($tokens as $token) {
|
171 |
-
if (is_array($token) && in_array($token[0], $php53)) {
|
172 |
-
return true;
|
173 |
-
}
|
174 |
-
}
|
175 |
-
|
176 |
-
return false;
|
177 |
-
}
|
178 |
-
|
179 |
-
protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, $basePath, $vendorPath, $vendorPathCode, $appBaseDirCode) {
|
180 |
-
$includePaths = array();
|
181 |
-
|
182 |
-
foreach ($packageMap as $item) {
|
183 |
-
list($package, $installPath) = $item;
|
184 |
-
|
185 |
-
if (null !== $package->getTargetDir() && strlen($package->getTargetDir()) > 0) {
|
186 |
-
$installPath = substr($installPath, 0, -strlen('/'.$package->getTargetDir()));
|
187 |
-
}
|
188 |
-
|
189 |
-
foreach ($package->getIncludePaths() as $includePath) {
|
190 |
-
$includePath = trim($includePath, '/');
|
191 |
-
$includePaths[] = empty($installPath) ? $includePath : $installPath.'/'.$includePath;
|
192 |
-
}
|
193 |
-
}
|
194 |
-
|
195 |
-
if (!$includePaths) {
|
196 |
-
return;
|
197 |
-
}
|
198 |
-
|
199 |
-
$includePathsFile = <<<EOF
|
200 |
-
<?php
|
201 |
-
|
202 |
-
// include_paths_52.php generated by xrstf/composer-php52
|
203 |
-
|
204 |
-
\$vendorDir = $vendorPathCode;
|
205 |
-
\$baseDir = $appBaseDirCode;
|
206 |
-
|
207 |
-
return array(
|
208 |
-
|
209 |
-
EOF;
|
210 |
-
|
211 |
-
foreach ($includePaths as $path) {
|
212 |
-
$includePathsFile .= "\t" . $this->getPathCode($filesystem, $basePath, $vendorPath, $path) . ",\n";
|
213 |
-
}
|
214 |
-
|
215 |
-
return $includePathsFile . ");\n";
|
216 |
-
}
|
217 |
-
|
218 |
-
protected function getAutoloadFile($vendorPathToTargetDirCode, $suffix) {
|
219 |
-
return <<<AUTOLOAD
|
220 |
-
<?php
|
221 |
-
|
222 |
-
// autoload_52.php generated by xrstf/composer-php52
|
223 |
-
|
224 |
-
require_once $vendorPathToTargetDirCode.'/autoload_real_52.php';
|
225 |
-
|
226 |
-
return ComposerAutoloaderInit$suffix::getLoader();
|
227 |
-
|
228 |
-
AUTOLOAD;
|
229 |
-
}
|
230 |
-
|
231 |
-
protected function getAutoloadRealFile($useClassMap, $useIncludePath, $targetDirLoader, $filesCode, $vendorPathCode, $appBaseDirCode, $suffix, $useGlobalIncludePath, $prependAutoloader, $staticPhpVersion = 70000) {
|
232 |
-
// TODO the class ComposerAutoloaderInit should be revert to a closure
|
233 |
-
// when APC has been fixed:
|
234 |
-
// - https://github.com/composer/composer/issues/959
|
235 |
-
// - https://bugs.php.net/bug.php?id=52144
|
236 |
-
// - https://bugs.php.net/bug.php?id=61576
|
237 |
-
// - https://bugs.php.net/bug.php?id=59298
|
238 |
-
|
239 |
-
if ($filesCode) {
|
240 |
-
$filesCode = "\n\n".rtrim($filesCode);
|
241 |
-
}
|
242 |
-
|
243 |
-
$file = <<<HEADER
|
244 |
-
<?php
|
245 |
-
|
246 |
-
// autoload_real_52.php generated by xrstf/composer-php52
|
247 |
-
|
248 |
-
class ComposerAutoloaderInit$suffix {
|
249 |
-
private static \$loader;
|
250 |
-
|
251 |
-
public static function loadClassLoader(\$class) {
|
252 |
-
if ('xrstf_Composer52_ClassLoader' === \$class) {
|
253 |
-
require dirname(__FILE__).'/ClassLoader52.php';
|
254 |
-
}
|
255 |
-
}
|
256 |
-
|
257 |
-
/**
|
258 |
-
* @return xrstf_Composer52_ClassLoader
|
259 |
-
*/
|
260 |
-
public static function getLoader() {
|
261 |
-
if (null !== self::\$loader) {
|
262 |
-
return self::\$loader;
|
263 |
-
}
|
264 |
-
|
265 |
-
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'), true /*, true */);
|
266 |
-
self::\$loader = \$loader = new xrstf_Composer52_ClassLoader();
|
267 |
-
spl_autoload_unregister(array('ComposerAutoloaderInit$suffix', 'loadClassLoader'));
|
268 |
-
|
269 |
-
\$vendorDir = $vendorPathCode;
|
270 |
-
\$baseDir = $appBaseDirCode;
|
271 |
-
\$dir = dirname(__FILE__);
|
272 |
-
|
273 |
-
|
274 |
-
HEADER;
|
275 |
-
|
276 |
-
if ($useIncludePath) {
|
277 |
-
$file .= <<<'INCLUDE_PATH'
|
278 |
-
$includePaths = require $dir.'/include_paths.php';
|
279 |
-
array_push($includePaths, get_include_path());
|
280 |
-
set_include_path(implode(PATH_SEPARATOR, $includePaths));
|
281 |
-
|
282 |
-
|
283 |
-
INCLUDE_PATH;
|
284 |
-
}
|
285 |
-
|
286 |
-
$file .= <<<'PSR0'
|
287 |
-
$map = require $dir.'/autoload_namespaces.php';
|
288 |
-
foreach ($map as $namespace => $path) {
|
289 |
-
$loader->add($namespace, $path);
|
290 |
-
}
|
291 |
-
|
292 |
-
|
293 |
-
PSR0;
|
294 |
-
|
295 |
-
if ($useClassMap) {
|
296 |
-
$file .= <<<'CLASSMAP'
|
297 |
-
$classMap = require $dir.'/autoload_classmap.php';
|
298 |
-
if ($classMap) {
|
299 |
-
$loader->addClassMap($classMap);
|
300 |
-
}
|
301 |
-
|
302 |
-
|
303 |
-
CLASSMAP;
|
304 |
-
}
|
305 |
-
|
306 |
-
if ($this->classMapAuthoritative) {
|
307 |
-
$file .= <<<'CLASSMAPAUTHORITATIVE'
|
308 |
-
$loader->setClassMapAuthoritative(true);
|
309 |
-
|
310 |
-
CLASSMAPAUTHORITATIVE;
|
311 |
-
}
|
312 |
-
|
313 |
-
if ($useGlobalIncludePath) {
|
314 |
-
$file .= <<<'INCLUDEPATH'
|
315 |
-
$loader->setUseIncludePath(true);
|
316 |
-
|
317 |
-
|
318 |
-
INCLUDEPATH;
|
319 |
-
}
|
320 |
-
|
321 |
-
if ($targetDirLoader) {
|
322 |
-
$file .= <<<REGISTER_AUTOLOAD
|
323 |
-
spl_autoload_register(array('ComposerAutoloaderInit$suffix', 'autoload'), true);
|
324 |
-
|
325 |
-
|
326 |
-
REGISTER_AUTOLOAD;
|
327 |
-
|
328 |
-
}
|
329 |
-
|
330 |
-
$file .= <<<METHOD_FOOTER
|
331 |
-
\$loader->register($prependAutoloader);{$filesCode}
|
332 |
-
|
333 |
-
return \$loader;
|
334 |
-
}
|
335 |
-
|
336 |
-
METHOD_FOOTER;
|
337 |
-
|
338 |
-
$file .= $targetDirLoader;
|
339 |
-
|
340 |
-
return $file . <<<FOOTER
|
341 |
-
}
|
342 |
-
|
343 |
-
FOOTER;
|
344 |
-
|
345 |
-
}
|
346 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/xrstf/composer-php52/lib/xrstf/Composer52/ClassLoader.php
DELETED
@@ -1,271 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
|
4 |
-
*
|
5 |
-
* This file is released under the terms of the MIT license. You can find the
|
6 |
-
* complete text in the attached LICENSE file or online at:
|
7 |
-
*
|
8 |
-
* http://www.opensource.org/licenses/mit-license.php
|
9 |
-
*
|
10 |
-
* --------------------------------------------------------------------------
|
11 |
-
*
|
12 |
-
* 99% of this is copied as-is from the original Composer source code and is
|
13 |
-
* released under MIT license as well. Copyright goes to:
|
14 |
-
*
|
15 |
-
* - Fabien Potencier <fabien@symfony.com>
|
16 |
-
* - Jordi Boggiano <j.boggiano@seld.be>
|
17 |
-
*/
|
18 |
-
|
19 |
-
class xrstf_Composer52_ClassLoader {
|
20 |
-
private $prefixes = array();
|
21 |
-
private $fallbackDirs = array();
|
22 |
-
private $useIncludePath = false;
|
23 |
-
private $classMap = array();
|
24 |
-
private $classMapAuthoratative = false;
|
25 |
-
private $allowUnderscore = false;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* @param boolean $flag true to allow class names with a leading underscore, false to disable
|
29 |
-
*/
|
30 |
-
public function setAllowUnderscore($flag) {
|
31 |
-
$this->allowUnderscore = (boolean) $flag;
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* @return array
|
36 |
-
*/
|
37 |
-
public function getPrefixes() {
|
38 |
-
return $this->prefixes;
|
39 |
-
}
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Turns off searching the prefix and fallback directories for classes
|
43 |
-
* that have not been registered with the class map.
|
44 |
-
*
|
45 |
-
* @param bool $classMapAuthoratative
|
46 |
-
*/
|
47 |
-
public function setClassMapAuthoritative($classMapAuthoratative) {
|
48 |
-
$this->classMapAuthoratative = $classMapAuthoratative;
|
49 |
-
}
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Should class lookup fail if not found in the current class map?
|
53 |
-
*
|
54 |
-
* @return bool
|
55 |
-
*/
|
56 |
-
public function getClassMapAuthoratative() {
|
57 |
-
return $this->classMapAuthoratative;
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* @return array
|
62 |
-
*/
|
63 |
-
public function getFallbackDirs() {
|
64 |
-
return $this->fallbackDirs;
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* @return array
|
69 |
-
*/
|
70 |
-
public function getClassMap() {
|
71 |
-
return $this->classMap;
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* @param array $classMap class to filename map
|
76 |
-
*/
|
77 |
-
public function addClassMap(array $classMap) {
|
78 |
-
if ($this->classMap) {
|
79 |
-
$this->classMap = array_merge($this->classMap, $classMap);
|
80 |
-
}
|
81 |
-
else {
|
82 |
-
$this->classMap = $classMap;
|
83 |
-
}
|
84 |
-
}
|
85 |
-
|
86 |
-
/**
|
87 |
-
* Registers a set of classes, merging with any others previously set.
|
88 |
-
*
|
89 |
-
* @param string $prefix the classes prefix
|
90 |
-
* @param array|string $paths the location(s) of the classes
|
91 |
-
* @param bool $prepend prepend the location(s)
|
92 |
-
*/
|
93 |
-
public function add($prefix, $paths, $prepend = false) {
|
94 |
-
if (!$prefix) {
|
95 |
-
if ($prepend) {
|
96 |
-
$this->fallbackDirs = array_merge(
|
97 |
-
(array) $paths,
|
98 |
-
$this->fallbackDirs
|
99 |
-
);
|
100 |
-
}
|
101 |
-
else {
|
102 |
-
$this->fallbackDirs = array_merge(
|
103 |
-
$this->fallbackDirs,
|
104 |
-
(array) $paths
|
105 |
-
);
|
106 |
-
}
|
107 |
-
|
108 |
-
return;
|
109 |
-
}
|
110 |
-
|
111 |
-
if (!isset($this->prefixes[$prefix])) {
|
112 |
-
$this->prefixes[$prefix] = (array) $paths;
|
113 |
-
return;
|
114 |
-
}
|
115 |
-
|
116 |
-
if ($prepend) {
|
117 |
-
$this->prefixes[$prefix] = array_merge(
|
118 |
-
(array) $paths,
|
119 |
-
$this->prefixes[$prefix]
|
120 |
-
);
|
121 |
-
}
|
122 |
-
else {
|
123 |
-
$this->prefixes[$prefix] = array_merge(
|
124 |
-
$this->prefixes[$prefix],
|
125 |
-
(array) $paths
|
126 |
-
);
|
127 |
-
}
|
128 |
-
}
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Registers a set of classes, replacing any others previously set.
|
132 |
-
*
|
133 |
-
* @param string $prefix the classes prefix
|
134 |
-
* @param array|string $paths the location(s) of the classes
|
135 |
-
*/
|
136 |
-
public function set($prefix, $paths) {
|
137 |
-
if (!$prefix) {
|
138 |
-
$this->fallbackDirs = (array) $paths;
|
139 |
-
return;
|
140 |
-
}
|
141 |
-
|
142 |
-
$this->prefixes[$prefix] = (array) $paths;
|
143 |
-
}
|
144 |
-
|
145 |
-
/**
|
146 |
-
* Turns on searching the include path for class files.
|
147 |
-
*
|
148 |
-
* @param bool $useIncludePath
|
149 |
-
*/
|
150 |
-
public function setUseIncludePath($useIncludePath) {
|
151 |
-
$this->useIncludePath = $useIncludePath;
|
152 |
-
}
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Can be used to check if the autoloader uses the include path to check
|
156 |
-
* for classes.
|
157 |
-
*
|
158 |
-
* @return bool
|
159 |
-
*/
|
160 |
-
public function getUseIncludePath() {
|
161 |
-
return $this->useIncludePath;
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Registers this instance as an autoloader.
|
166 |
-
*/
|
167 |
-
public function register() {
|
168 |
-
spl_autoload_register(array($this, 'loadClass'), true);
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* Unregisters this instance as an autoloader.
|
173 |
-
*/
|
174 |
-
public function unregister() {
|
175 |
-
spl_autoload_unregister(array($this, 'loadClass'));
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Loads the given class or interface.
|
180 |
-
*
|
181 |
-
* @param string $class the name of the class
|
182 |
-
* @return bool|null true, if loaded
|
183 |
-
*/
|
184 |
-
public function loadClass($class) {
|
185 |
-
if ($file = $this->findFile($class)) {
|
186 |
-
include $file;
|
187 |
-
return true;
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
/**
|
192 |
-
* Finds the path to the file where the class is defined.
|
193 |
-
*
|
194 |
-
* @param string $class the name of the class
|
195 |
-
* @return string|null the path, if found
|
196 |
-
*/
|
197 |
-
public function findFile($class) {
|
198 |
-
if ('\\' === $class[0]) {
|
199 |
-
$class = substr($class, 1);
|
200 |
-
}
|
201 |
-
|
202 |
-
if (isset($this->classMap[$class])) {
|
203 |
-
return $this->classMap[$class];
|
204 |
-
}
|
205 |
-
elseif ($this->classMapAuthoratative) {
|
206 |
-
return false;
|
207 |
-
}
|
208 |
-
|
209 |
-
$classPath = $this->getClassPath($class);
|
210 |
-
|
211 |
-
foreach ($this->prefixes as $prefix => $dirs) {
|
212 |
-
if (0 === strpos($class, $prefix)) {
|
213 |
-
foreach ($dirs as $dir) {
|
214 |
-
if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
|
215 |
-
return $dir.DIRECTORY_SEPARATOR.$classPath;
|
216 |
-
}
|
217 |
-
}
|
218 |
-
}
|
219 |
-
}
|
220 |
-
|
221 |
-
foreach ($this->fallbackDirs as $dir) {
|
222 |
-
if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
|
223 |
-
return $dir.DIRECTORY_SEPARATOR.$classPath;
|
224 |
-
}
|
225 |
-
}
|
226 |
-
|
227 |
-
if ($this->useIncludePath && $file = self::resolveIncludePath($classPath)) {
|
228 |
-
return $file;
|
229 |
-
}
|
230 |
-
|
231 |
-
return $this->classMap[$class] = false;
|
232 |
-
}
|
233 |
-
|
234 |
-
private function getClassPath($class) {
|
235 |
-
if (false !== $pos = strrpos($class, '\\')) {
|
236 |
-
// namespaced class name
|
237 |
-
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
|
238 |
-
$className = substr($class, $pos + 1);
|
239 |
-
}
|
240 |
-
else {
|
241 |
-
// PEAR-like class name
|
242 |
-
$classPath = null;
|
243 |
-
$className = $class;
|
244 |
-
}
|
245 |
-
|
246 |
-
$className = str_replace('_', DIRECTORY_SEPARATOR, $className);
|
247 |
-
|
248 |
-
// restore the prefix
|
249 |
-
if ($this->allowUnderscore && DIRECTORY_SEPARATOR === $className[0]) {
|
250 |
-
$className[0] = '_';
|
251 |
-
}
|
252 |
-
|
253 |
-
$classPath .= $className.'.php';
|
254 |
-
|
255 |
-
return $classPath;
|
256 |
-
}
|
257 |
-
|
258 |
-
public static function resolveIncludePath($classPath) {
|
259 |
-
$paths = explode(PATH_SEPARATOR, get_include_path());
|
260 |
-
|
261 |
-
foreach ($paths as $path) {
|
262 |
-
$path = rtrim($path, '/\\');
|
263 |
-
|
264 |
-
if ($file = file_exists($path.DIRECTORY_SEPARATOR.$file)) {
|
265 |
-
return $file;
|
266 |
-
}
|
267 |
-
}
|
268 |
-
|
269 |
-
return false;
|
270 |
-
}
|
271 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/xrstf/composer-php52/lib/xrstf/Composer52/Generator.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Copyright (c) 2013, Christoph Mewes, http://www.xrstf.de
|
4 |
-
*
|
5 |
-
* This file is released under the terms of the MIT license. You can find the
|
6 |
-
* complete text in the attached LICENSE file or online at:
|
7 |
-
*
|
8 |
-
* http://www.opensource.org/licenses/mit-license.php
|
9 |
-
*/
|
10 |
-
|
11 |
-
namespace xrstf\Composer52;
|
12 |
-
|
13 |
-
use Composer\Repository\CompositeRepository;
|
14 |
-
use Composer\Script\Event;
|
15 |
-
|
16 |
-
class Generator {
|
17 |
-
public static function onPostInstallCmd(Event $event) {
|
18 |
-
$composer = $event->getComposer();
|
19 |
-
$installationManager = $composer->getInstallationManager();
|
20 |
-
$repoManager = $composer->getRepositoryManager();
|
21 |
-
$localRepo = $repoManager->getLocalRepository();
|
22 |
-
$package = $composer->getPackage();
|
23 |
-
$config = $composer->getConfig();
|
24 |
-
|
25 |
-
// We can't gain access to the Command's input object, so we have to look
|
26 |
-
// for -o / --optimize-autoloader ourselves. Sadly, neither getopt() works
|
27 |
-
// (always returns an empty array), nor does Symfony's Console Input, as
|
28 |
-
// it expects a full definition of the current command line and we can't
|
29 |
-
// provide that.
|
30 |
-
|
31 |
-
$args = $_SERVER['argv'];
|
32 |
-
$optimize = in_array('-o', $args) || in_array('--optimize-autoloader', $args) || in_array('--optimize', $args);
|
33 |
-
|
34 |
-
$suffix = $config->get('autoloader-suffix');
|
35 |
-
|
36 |
-
$generator = new AutoloadGenerator();
|
37 |
-
$generator->dump($config, $localRepo, $package, $installationManager, 'composer', $optimize, $suffix);
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|