forked from wearerequired/traduttore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
traduttore.php
71 lines (61 loc) · 2.39 KB
/
traduttore.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* Plugin Name: Traduttore
* Plugin URI: https://github.com/wearerequired/traduttore/
* Description: Add WordPress.org-style language pack API to your GlotPress installation for your WordPress projects hosted on GitHub.
* Version: 3.2.0-alpha
* Author: required
* Author URI: https://required.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: traduttore
* Domain Path: /languages
*
* Copyright (c) 2017-2020 required (email: [email protected])
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2 or, at
* your discretion, any later version, as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
namespace Required\Traduttore;
use WP_CLI;
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
}
if ( ! class_exists( __NAMESPACE__ . '\Plugin' ) ) {
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
trigger_error( sprintf( '%s does not exist. Check Composer\'s autoloader.', __NAMESPACE__ . '\Plugin' ), E_USER_WARNING );
return;
}
const VERSION = '3.2.0-alpha';
const PLUGIN_FILE = __FILE__;
register_deactivation_hook( __FILE__, [ Plugin::class, 'on_plugin_deactivation' ] );
/**
* Initializes the plugin.
*
* @since 1.0.0
*/
function init() {
$plugin = new Plugin();
$plugin->init();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\init', 1 );
if ( class_exists( '\WP_CLI' ) ) {
if ( class_exists( '\WP_CLI\Dispatcher\CommandNamespace' ) ) {
WP_CLI::add_command( 'traduttore', CLI\CommandNamespace::class );
}
WP_CLI::add_command( 'traduttore info', CLI\InfoCommand::class );
WP_CLI::add_command( 'traduttore project', CLI\ProjectCommand::class );
WP_CLI::add_command( 'traduttore project cache', CLI\CacheCommand::class );
WP_CLI::add_command( 'traduttore language-pack', CLI\LanguagePackCommand::class );
}