Initial commit
This commit is contained in:
420
wp-content/plugins/gitium/functions.php
Normal file
420
wp-content/plugins/gitium/functions.php
Normal file
@ -0,0 +1,420 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
function gitium_error_log( $message ) {
|
||||
if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) { return; }
|
||||
error_log( "gitium_error_log: $message" );
|
||||
}
|
||||
|
||||
function wp_content_is_versioned() {
|
||||
return file_exists( WP_CONTENT_DIR . '/.git' );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'gitium_enable_maintenance_mode' ) ) :
|
||||
function gitium_enable_maintenance_mode() {
|
||||
$file = ABSPATH . '/.maintenance';
|
||||
|
||||
if ( false === file_put_contents( $file, '<?php $upgrading = ' . time() .';' ) ) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'gitium_disable_maintenance_mode' ) ) :
|
||||
function gitium_disable_maintenance_mode() {
|
||||
return unlink( ABSPATH . '/.maintenance' );
|
||||
}
|
||||
endif;
|
||||
|
||||
function gitium_get_versions() {
|
||||
$versions = get_transient( 'gitium_versions' );
|
||||
if ( empty( $versions ) ) {
|
||||
$versions = gitium_update_versions();
|
||||
}
|
||||
return $versions;
|
||||
}
|
||||
|
||||
function _gitium_commit_changes( $message, $dir = '.' ) {
|
||||
global $git;
|
||||
|
||||
list( , $git_private_key ) = gitium_get_keypair();
|
||||
if (!$git_private_key)
|
||||
return false;
|
||||
$git->set_key( $git_private_key );
|
||||
|
||||
$git->add( $dir );
|
||||
gitium_update_versions();
|
||||
$current_user = wp_get_current_user();
|
||||
return $git->commit( $message, $current_user->display_name, $current_user->user_email );
|
||||
}
|
||||
|
||||
function _gitium_format_message( $name, $version = false, $prefix = '' ) {
|
||||
$commit_message = "`$name`";
|
||||
if ( $version ) {
|
||||
$commit_message .= " version $version";
|
||||
}
|
||||
if ( $prefix ) {
|
||||
$commit_message = "$prefix $commit_message";
|
||||
}
|
||||
return $commit_message;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function return the basic info about a path.
|
||||
*
|
||||
* base_path - means the path after wp-content dir (themes/plugins)
|
||||
* type - can be file/theme/plugin
|
||||
* name - the file name of the path, if it is a file, or the theme/plugin name
|
||||
* version - the theme/plugin version, othewise null
|
||||
*/
|
||||
/* Some examples:
|
||||
|
||||
with 'wp-content/themes/twentyten/style.css' will return:
|
||||
array(
|
||||
'base_path' => 'wp-content/themes/twentyten'
|
||||
'type' => 'theme'
|
||||
'name' => 'TwentyTen'
|
||||
'version' => '1.12'
|
||||
)
|
||||
|
||||
with 'wp-content/themes/twentyten/img/foo.png' will return:
|
||||
array(
|
||||
'base_path' => 'wp-content/themes/twentyten'
|
||||
'type' => 'theme'
|
||||
'name' => 'TwentyTen'
|
||||
'version' => '1.12'
|
||||
)
|
||||
|
||||
with 'wp-content/plugins/foo.php' will return:
|
||||
array(
|
||||
'base_path' => 'wp-content/plugins/foo.php'
|
||||
'type' => 'plugin'
|
||||
'name' => 'Foo'
|
||||
'varsion' => '2.0'
|
||||
)
|
||||
|
||||
with 'wp-content/plugins/autover/autover.php' will return:
|
||||
array(
|
||||
'base_path' => 'wp-content/plugins/autover'
|
||||
'type' => 'plugin'
|
||||
'name' => 'autover'
|
||||
'version' => '3.12'
|
||||
)
|
||||
|
||||
with 'wp-content/plugins/autover/' will return:
|
||||
array(
|
||||
'base_path' => 'wp-content/plugins/autover'
|
||||
'type' => 'plugin'
|
||||
'name' => 'autover'
|
||||
'version' => '3.12'
|
||||
)
|
||||
*/
|
||||
function _gitium_module_by_path( $path ) {
|
||||
$versions = gitium_get_versions();
|
||||
|
||||
// default values
|
||||
$module = array(
|
||||
'base_path' => $path,
|
||||
'type' => 'file',
|
||||
'name' => basename( $path ),
|
||||
'version' => null,
|
||||
);
|
||||
|
||||
// find the base_path
|
||||
$split_path = explode( '/', $path );
|
||||
if ( 2 < count( $split_path ) ) {
|
||||
$module['base_path'] = "{$split_path[0]}/{$split_path[1]}/{$split_path[2]}";
|
||||
}
|
||||
|
||||
// find other data for theme
|
||||
if ( array_key_exists( 'themes', $versions ) && 0 === strpos( $path, 'wp-content/themes/' ) ) {
|
||||
$module['type'] = 'theme';
|
||||
foreach ( $versions['themes'] as $theme => $data ) {
|
||||
if ( 0 === strpos( $path, "wp-content/themes/$theme" ) ) {
|
||||
$module['name'] = $data['name'];
|
||||
$module['version'] = $data['version'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// find other data for plugin
|
||||
if ( array_key_exists( 'plugins', $versions ) && 0 === strpos( $path, 'wp-content/plugins/' ) ) {
|
||||
$module['type'] = 'plugin';
|
||||
foreach ( $versions['plugins'] as $plugin => $data ) {
|
||||
if ( '.' === dirname( $plugin ) ) { // single file plugin
|
||||
if ( "wp-content/plugins/$plugin" === $path ) {
|
||||
$module['base_path'] = $path;
|
||||
$module['name'] = $data['name'];
|
||||
$module['version'] = $data['version'];
|
||||
break;
|
||||
}
|
||||
} else if ( 'wp-content/plugins/' . dirname( $plugin ) === $module['base_path'] ) {
|
||||
$module['name'] = $data['name'];
|
||||
$module['version'] = $data['version'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $module;
|
||||
}
|
||||
|
||||
function gitium_group_commit_modified_plugins_and_themes( $msg_append = '' ) {
|
||||
global $git;
|
||||
|
||||
$uncommited_changes = $git->get_local_changes();
|
||||
$commit_groups = array();
|
||||
$commits = array();
|
||||
|
||||
if ( ! empty( $msg_append ) ) {
|
||||
$msg_append = "($msg_append)";
|
||||
}
|
||||
foreach ( $uncommited_changes as $path => $action ) {
|
||||
$change = _gitium_module_by_path( $path );
|
||||
$change['action'] = $action;
|
||||
$commit_groups[ $change['base_path'] ] = $change;
|
||||
}
|
||||
|
||||
foreach ( $commit_groups as $base_path => $change ) {
|
||||
$commit_message = _gitium_format_message( $change['name'], $change['version'], "${change['action']} ${change['type']}" );
|
||||
$commit = _gitium_commit_changes( "$commit_message $msg_append", $base_path, false );
|
||||
if ( $commit ) {
|
||||
$commits[] = $commit;
|
||||
}
|
||||
}
|
||||
|
||||
return $commits;
|
||||
}
|
||||
|
||||
function gitium_commit_and_push_gitignore_file( $path = '' ) {
|
||||
global $git;
|
||||
|
||||
$current_user = wp_get_current_user();
|
||||
if ( ! empty( $path ) ) { $git->rm_cached( $path ); }
|
||||
$git->add( '.gitignore' );
|
||||
$commit = $git->commit( 'Update the `.gitignore` file', $current_user->display_name, $current_user->user_email );
|
||||
gitium_merge_and_push( $commit );
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'gitium_acquire_merge_lock' ) ) :
|
||||
function gitium_acquire_merge_lock() {
|
||||
$gitium_lock_path = apply_filters( 'gitium_lock_path', '/tmp/.gitium-lock' );
|
||||
$gitium_lock_handle = fopen( $gitium_lock_path, 'w+' );
|
||||
|
||||
$lock_timeout = intval( ini_get( 'max_execution_time' ) ) > 10 ? intval( ini_get( 'max_execution_time' ) ) - 5 : 10;
|
||||
$lock_timeout_ms = 10;
|
||||
$lock_retries = 0;
|
||||
while ( ! flock( $gitium_lock_handle, LOCK_EX | LOCK_NB ) ) {
|
||||
usleep( $lock_timeout_ms * 1000 );
|
||||
$lock_retries++;
|
||||
if ( $lock_retries * $lock_timeout_ms > $lock_timeout * 1000 ) {
|
||||
return false; // timeout
|
||||
}
|
||||
}
|
||||
gitium_error_log( __FUNCTION__ );
|
||||
return array( $gitium_lock_path, $gitium_lock_handle );
|
||||
}
|
||||
endif;
|
||||
|
||||
if ( ! function_exists( 'gitium_release_merge_lock' ) ) :
|
||||
function gitium_release_merge_lock( $lock ) {
|
||||
list( $gitium_lock_path, $gitium_lock_handle ) = $lock;
|
||||
gitium_error_log( __FUNCTION__ );
|
||||
flock( $gitium_lock_handle, LOCK_UN );
|
||||
fclose( $gitium_lock_handle );
|
||||
}
|
||||
endif;
|
||||
|
||||
// Merges the commits with remote and pushes them back
|
||||
function gitium_merge_and_push( $commits ) {
|
||||
global $git;
|
||||
|
||||
$lock = gitium_acquire_merge_lock()
|
||||
or trigger_error( 'Timeout when gitium lock was acquired', E_USER_WARNING );
|
||||
|
||||
if ( ! $git->fetch_ref() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$merge_status = $git->merge_with_accept_mine( $commits );
|
||||
|
||||
gitium_release_merge_lock( $lock );
|
||||
|
||||
return $git->push() && $merge_status;
|
||||
}
|
||||
|
||||
function gitium_check_after_event( $plugin, $event = 'activation' ) {
|
||||
global $git;
|
||||
|
||||
if ( 'gitium/gitium.php' == $plugin ) { return; } // do not hook on activation of this plugin
|
||||
|
||||
if ( $git->is_dirty() ) {
|
||||
$versions = gitium_update_versions();
|
||||
if ( isset( $versions['plugins'][ $plugin ] ) ) {
|
||||
$name = $versions['plugins'][ $plugin ]['name'];
|
||||
$version = $versions['plugins'][ $plugin ]['version'];
|
||||
} else {
|
||||
$name = $plugin;
|
||||
}
|
||||
gitium_auto_push( _gitium_format_message( $name, $version, "after $event of" ) );
|
||||
}
|
||||
}
|
||||
|
||||
function gitium_update_remote_tracking_branch() {
|
||||
global $git;
|
||||
$remote_branch = $git->get_remote_tracking_branch();
|
||||
set_transient( 'gitium_remote_tracking_branch', $remote_branch );
|
||||
|
||||
return $remote_branch;
|
||||
}
|
||||
|
||||
function _gitium_get_remote_tracking_branch( $update_transient = false ) {
|
||||
if ( ! $update_transient && ( false !== ( $remote_branch = get_transient( 'gitium_remote_tracking_branch' ) ) ) ) {
|
||||
return $remote_branch;
|
||||
} else {
|
||||
return gitium_update_remote_tracking_branch();
|
||||
}
|
||||
}
|
||||
|
||||
function gitium_update_is_status_working() {
|
||||
global $git;
|
||||
$is_status_working = $git->is_status_working();
|
||||
set_transient( 'gitium_is_status_working', $is_status_working );
|
||||
return $is_status_working;
|
||||
}
|
||||
|
||||
function _gitium_is_status_working( $update_transient = false ) {
|
||||
if ( ! $update_transient && ( false !== ( $is_status_working = get_transient( 'gitium_is_status_working' ) ) ) ) {
|
||||
return $is_status_working;
|
||||
} else {
|
||||
return gitium_update_is_status_working();
|
||||
}
|
||||
}
|
||||
|
||||
function _gitium_status( $update_transient = false ) {
|
||||
global $git;
|
||||
|
||||
if ( ! $update_transient && ( false !== ( $changes = get_transient( 'gitium_uncommited_changes' ) ) ) ) {
|
||||
return $changes;
|
||||
}
|
||||
|
||||
$git_version = get_transient( 'gitium_git_version' );
|
||||
if ( false === $git_version ) {
|
||||
set_transient( 'gitium_git_version', $git->get_version() );
|
||||
}
|
||||
|
||||
if ( $git->is_status_working() && $git->get_remote_tracking_branch() ) {
|
||||
if ( ! $git->fetch_ref() ) {
|
||||
set_transient( 'gitium_remote_disconnected', $git->get_last_error() );
|
||||
} else {
|
||||
delete_transient( 'gitium_remote_disconnected' );
|
||||
}
|
||||
$changes = $git->status();
|
||||
} else {
|
||||
delete_transient( 'gitium_remote_disconnected' );
|
||||
$changes = array();
|
||||
}
|
||||
|
||||
set_transient( 'gitium_uncommited_changes', $changes, 12 * 60 * 60 ); // cache changes for half-a-day
|
||||
return $changes;
|
||||
}
|
||||
|
||||
function _gitium_ssh_encode_buffer( $buffer ) {
|
||||
$len = strlen( $buffer );
|
||||
if ( ord( $buffer[0] ) & 0x80 ) {
|
||||
$len++;
|
||||
$buffer = "\x00" . $buffer;
|
||||
}
|
||||
return pack( 'Na*', $len, $buffer );
|
||||
}
|
||||
|
||||
function _gitium_generate_keypair() {
|
||||
$rsa_key = openssl_pkey_new(
|
||||
array(
|
||||
'private_key_bits' => 2048,
|
||||
'private_key_type' => OPENSSL_KEYTYPE_RSA,
|
||||
)
|
||||
);
|
||||
|
||||
try {
|
||||
$private_key = openssl_pkey_get_private( $rsa_key );
|
||||
$try = openssl_pkey_export( $private_key, $pem ); //Private Key
|
||||
if (!$try)
|
||||
return false;
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$key_info = openssl_pkey_get_details( $rsa_key );
|
||||
$buffer = pack( 'N', 7 ) . 'ssh-rsa' .
|
||||
_gitium_ssh_encode_buffer( $key_info['rsa']['e'] ) .
|
||||
_gitium_ssh_encode_buffer( $key_info['rsa']['n'] );
|
||||
$public_key = 'ssh-rsa ' . base64_encode( $buffer ) . ' gitium@' . parse_url( get_home_url(), PHP_URL_HOST );
|
||||
|
||||
return array( $public_key, $pem );
|
||||
}
|
||||
|
||||
function gitium_get_keypair( $generate_new_keypair = false ) {
|
||||
if ( $generate_new_keypair ) {
|
||||
$keypair = _gitium_generate_keypair();
|
||||
delete_option( 'gitium_keypair' );
|
||||
add_option( 'gitium_keypair', $keypair, '', false );
|
||||
}
|
||||
if ( false === ( $keypair = get_option( 'gitium_keypair', false ) ) ) {
|
||||
$keypair = _gitium_generate_keypair();
|
||||
add_option( 'gitium_keypair', $keypair, '', false );
|
||||
}
|
||||
return $keypair;
|
||||
}
|
||||
|
||||
function _gitium_generate_webhook_key() {
|
||||
return md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.()[]{}-_=+!@#%^&*~<>:;' ) );
|
||||
}
|
||||
|
||||
function gitium_get_webhook_key( $generate_new_webhook_key = false ) {
|
||||
if ( $generate_new_webhook_key ) {
|
||||
$key = _gitium_generate_webhook_key();
|
||||
delete_option( 'gitium_webhook_key' );
|
||||
add_option( 'gitium_webhook_key', $key, '', false );
|
||||
return $key;
|
||||
}
|
||||
if ( false === ( $key = get_option( 'gitium_webhook_key', false ) ) ) {
|
||||
$key = _gitium_generate_webhook_key();
|
||||
add_option( 'gitium_webhook_key', $key, '', false );
|
||||
}
|
||||
return $key;
|
||||
}
|
||||
|
||||
function gitium_get_webhook() {
|
||||
if ( defined( 'GIT_WEBHOOK_URL' ) && GIT_WEBHOOK_URL ) { return GIT_WEBHOOK_URL; }
|
||||
$key = gitium_get_webhook_key();
|
||||
$url = add_query_arg( 'key', $key, plugins_url( 'gitium-webhook.php', __FILE__ ) );
|
||||
return apply_filters( 'gitium_webhook_url', $url, $key );
|
||||
}
|
||||
|
||||
function gitium_admin_init() {
|
||||
global $git;
|
||||
|
||||
$git_version = get_transient( 'gitium_git_version' );
|
||||
if ( false === $git_version ) {
|
||||
set_transient( 'gitium_git_version', $git->get_version() );
|
||||
}
|
||||
}
|
||||
add_action( 'admin_init', 'gitium_admin_init' );
|
49
wp-content/plugins/gitium/gitium-webhook.php
Normal file
49
wp-content/plugins/gitium/gitium-webhook.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
header( 'Content-Type: text/html' );
|
||||
define( 'SHORTINIT', true );
|
||||
//$wordpress_loader = $_SERVER['DOCUMENT_ROOT'] . '/wp-load.php';
|
||||
$wordpress_loader = filter_input(INPUT_SERVER, 'DOCUMENT_ROOT', FILTER_SANITIZE_STRING) . '/wp-load.php';
|
||||
|
||||
require_once $wordpress_loader;
|
||||
require_once __DIR__ . '/functions.php';
|
||||
require_once __DIR__ . '/inc/class-git-wrapper.php';
|
||||
|
||||
$webhook_key = get_option( 'gitium_webhook_key', '' );
|
||||
$get_key = filter_input(INPUT_GET, 'key', FILTER_SANITIZE_STRING);
|
||||
if ( ! empty ( $webhook_key ) && isset( $get_key ) && $webhook_key == $get_key ) :
|
||||
( '1.7' <= substr( $git->get_version(), 0, 3 ) ) or wp_die( 'Gitium plugin require minimum `git version 1.7`!' );
|
||||
|
||||
list( $git_public_key, $git_private_key ) = gitium_get_keypair();
|
||||
if ( ! $git_public_key || ! $git_private_key )
|
||||
wp_die('Not ready.', 'Not ready.', array( 'response' => 403 ));
|
||||
else
|
||||
$git->set_key( $git_private_key );
|
||||
|
||||
$commits = array();
|
||||
$commitmsg = sprintf( 'Merged changes from %s on %s', $_SERVER['SERVER_NAME'], date( 'm.d.Y' ) );
|
||||
|
||||
if ( $git->is_dirty() && $git->add() > 0 ) {
|
||||
$commits[] = $git->commit( $commitmsg ) or trigger_error( 'Could not commit local changes!', E_USER_ERROR );
|
||||
}
|
||||
gitium_merge_and_push( $commits ) or trigger_error( 'Failed merge & push: ' . serialize( $git->get_last_error() ), E_USER_ERROR );
|
||||
|
||||
wp_die( $commitmsg , 'Pull done!', array( 'response' => 200 ) );
|
||||
else :
|
||||
wp_die( 'Cheating uh?', 'Cheating uh?', array( 'response' => 403 ) );
|
||||
endif;
|
374
wp-content/plugins/gitium/gitium.php
Normal file
374
wp-content/plugins/gitium/gitium.php
Normal file
@ -0,0 +1,374 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Gitium
|
||||
* Version: 1.0.3
|
||||
* Author: Presslabs
|
||||
* Author URI: https://www.presslabs.com
|
||||
* License: GPL2
|
||||
* Description: Keep all your code on git version control system.
|
||||
* Text Domain: gitium
|
||||
* Domain Path: /languages/
|
||||
*/
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
define( 'GITIUM_LAST_COMMITS', 20 );
|
||||
define( 'GITIUM_MIN_GIT_VER', '1.7' );
|
||||
define( 'GITIUM_MIN_PHP_VER', '5.6' );
|
||||
|
||||
if ( is_multisite() ) {
|
||||
define( 'GITIUM_ADMIN_MENU_ACTION', 'network_admin_menu' );
|
||||
define( 'GITIUM_ADMIN_NOTICES_ACTION', 'network_admin_notices' );
|
||||
define( 'GITIUM_MANAGE_OPTIONS_CAPABILITY', 'manage_network_options' );
|
||||
} else {
|
||||
define( 'GITIUM_ADMIN_MENU_ACTION', 'admin_menu' );
|
||||
define( 'GITIUM_ADMIN_NOTICES_ACTION', 'admin_notices' );
|
||||
define( 'GITIUM_MANAGE_OPTIONS_CAPABILITY', 'manage_options' );
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/functions.php';
|
||||
require_once __DIR__ . '/inc/class-git-wrapper.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-requirements.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-admin.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-help.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-menu.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-menu-bubble.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-submenu-configure.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-submenu-status.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-submenu-commits.php';
|
||||
require_once __DIR__ . '/inc/class-gitium-submenu-settings.php';
|
||||
|
||||
function gitium_load_textdomain() {
|
||||
load_plugin_textdomain( 'gitium', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
||||
}
|
||||
add_action( 'plugins_loaded', 'gitium_load_textdomain' );
|
||||
|
||||
function _gitium_make_ssh_git_file_exe() {
|
||||
$ssh_wrapper = dirname( __FILE__ ) . '/inc/ssh-git';
|
||||
$process = proc_open(
|
||||
"chmod -f +x $ssh_wrapper",
|
||||
array(
|
||||
0 => array( 'pipe', 'r' ), // stdin
|
||||
1 => array( 'pipe', 'w' ), // stdout
|
||||
),
|
||||
$pipes
|
||||
);
|
||||
if ( is_resource( $process ) ) {
|
||||
fclose( $pipes[0] );
|
||||
proc_close( $process );
|
||||
}
|
||||
}
|
||||
register_activation_hook( __FILE__, '_gitium_make_ssh_git_file_exe' );
|
||||
|
||||
function gitium_deactivation() {
|
||||
delete_transient( 'gitium_git_version' );
|
||||
}
|
||||
register_deactivation_hook( __FILE__, 'gitium_deactivation' );
|
||||
|
||||
function gitium_uninstall_hook() {
|
||||
delete_transient( 'gitium_remote_tracking_branch' );
|
||||
delete_transient( 'gitium_remote_disconnected' );
|
||||
delete_transient( 'gitium_uncommited_changes' );
|
||||
delete_transient( 'gitium_git_version' );
|
||||
delete_transient( 'gitium_versions' );
|
||||
delete_transient( 'gitium_menu_bubble' );
|
||||
delete_transient( 'gitium_is_status_working' );
|
||||
|
||||
delete_option( 'gitium_keypair' );
|
||||
delete_option( 'gitium_webhook_key' );
|
||||
}
|
||||
register_uninstall_hook( __FILE__, 'gitium_uninstall_hook' );
|
||||
|
||||
/* Array
|
||||
(
|
||||
[themes] => Array
|
||||
(
|
||||
[twentytwelve] => `Twenty Twelve` version 1.3
|
||||
)
|
||||
[plugins] => Array
|
||||
(
|
||||
[cron-view/cron-gui.php] => `Cron GUI` version 1.03
|
||||
[hello-dolly/hello.php] => `Hello Dolly` version 1.6
|
||||
)
|
||||
|
||||
) */
|
||||
function gitium_update_versions() {
|
||||
$new_versions = [];
|
||||
|
||||
// get all themes from WP
|
||||
$all_themes = wp_get_themes( array( 'allowed' => true ) );
|
||||
foreach ( $all_themes as $theme_name => $theme ) :
|
||||
$theme_versions[ $theme_name ] = array(
|
||||
'name' => $theme->Name,
|
||||
'version' => null,
|
||||
'msg' => '',
|
||||
);
|
||||
$theme_versions[ $theme_name ]['msg'] = '`' . $theme->Name . '`';
|
||||
$version = $theme->Version;
|
||||
if ( ! empty( $version ) ) {
|
||||
$theme_versions[ $theme_name ]['msg'] .= " version $version";
|
||||
$theme_versions[ $theme_name ]['version'] .= $version;
|
||||
}
|
||||
endforeach;
|
||||
|
||||
if ( ! empty( $theme_versions ) ) {
|
||||
$new_versions['themes'] = $theme_versions;
|
||||
}
|
||||
// get all plugins from WP
|
||||
if ( ! function_exists( 'get_plugins' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
}
|
||||
$all_plugins = get_plugins();
|
||||
foreach ( $all_plugins as $name => $data ) :
|
||||
$plugin_versions[ $name ] = array(
|
||||
'name' => $data['Name'],
|
||||
'version' => null,
|
||||
'msg' => '',
|
||||
);
|
||||
$plugin_versions[ $name ]['msg'] = "`{$data['Name']}`";
|
||||
if ( ! empty( $data['Version'] ) ) {
|
||||
$plugin_versions[ $name ]['msg'] .= ' version ' . $data['Version'];
|
||||
$plugin_versions[ $name ]['version'] .= $data['Version'];
|
||||
}
|
||||
endforeach;
|
||||
|
||||
if ( ! empty( $plugin_versions ) ) {
|
||||
$new_versions['plugins'] = $plugin_versions;
|
||||
}
|
||||
|
||||
set_transient( 'gitium_versions', $new_versions );
|
||||
|
||||
return $new_versions;
|
||||
}
|
||||
add_action( 'load-plugins.php', 'gitium_update_versions', 999 );
|
||||
|
||||
function gitium_upgrader_post_install( $res, $hook_extra, $result ) {
|
||||
_gitium_make_ssh_git_file_exe();
|
||||
|
||||
$action = null;
|
||||
$type = null;
|
||||
|
||||
// install logic
|
||||
if ( isset( $hook_extra['type'] ) && ( 'plugin' === $hook_extra['type'] ) ) {
|
||||
$action = 'installed';
|
||||
$type = 'plugin';
|
||||
} else if ( isset( $hook_extra['type'] ) && ( 'theme' === $hook_extra['type'] ) ) {
|
||||
$action = 'installed';
|
||||
$type = 'theme';
|
||||
}
|
||||
|
||||
// update/upgrade logic
|
||||
if ( isset( $hook_extra['plugin'] ) ) {
|
||||
$action = 'updated';
|
||||
$type = 'plugin';
|
||||
} else if ( isset( $hook_extra['theme'] ) ) {
|
||||
$action = 'updated';
|
||||
$type = 'theme';
|
||||
}
|
||||
|
||||
// get action if missed above
|
||||
if ( isset( $hook_extra['action'] ) ) {
|
||||
$action = $hook_extra['action'];
|
||||
if ( 'install' === $action ) {
|
||||
$action = 'installed';
|
||||
}
|
||||
if ( 'update' === $action ) {
|
||||
$action = 'updated';
|
||||
}
|
||||
}
|
||||
|
||||
if ( WP_DEBUG ) {
|
||||
error_log( __FUNCTION__ . ':hook_extra:' . serialize( $hook_extra ) );
|
||||
error_log( __FUNCTION__ . ':action:type:' . $action . ':' . $type );
|
||||
}
|
||||
|
||||
$git_dir = $result['destination'];
|
||||
$version = '';
|
||||
|
||||
if ( ABSPATH == substr( $git_dir, 0, strlen( ABSPATH ) ) ) {
|
||||
$git_dir = substr( $git_dir, strlen( ABSPATH ) );
|
||||
}
|
||||
switch ( $type ) {
|
||||
case 'theme':
|
||||
wp_clean_themes_cache();
|
||||
$theme_data = wp_get_theme( $result['destination_name'] );
|
||||
$name = $theme_data->get( 'Name' );
|
||||
$version = $theme_data->get( 'Version' );
|
||||
break;
|
||||
case 'plugin':
|
||||
foreach ( $result['source_files'] as $file ) :
|
||||
if ( '.php' != substr( $file, -4 ) ) { continue; }
|
||||
// every .php file is a possible plugin so we check if it's a plugin
|
||||
$filepath = trailingslashit( $result['destination'] ) . $file;
|
||||
$plugin_data = get_plugin_data( $filepath );
|
||||
if ( $plugin_data['Name'] ) :
|
||||
$name = $plugin_data['Name'];
|
||||
$version = $plugin_data['Version'];
|
||||
// We get info from the first plugin in the package
|
||||
break;
|
||||
endif;
|
||||
endforeach;
|
||||
break;
|
||||
}
|
||||
if ( empty( $name ) ) {
|
||||
$name = $result['destination_name'];
|
||||
}
|
||||
$commit_message = _gitium_format_message( $name,$version,"$action $type" );
|
||||
$commit = _gitium_commit_changes( $commit_message, $git_dir, false );
|
||||
gitium_merge_and_push( $commit );
|
||||
|
||||
return $res;
|
||||
}
|
||||
add_filter( 'upgrader_post_install', 'gitium_upgrader_post_install', 10, 3 );
|
||||
|
||||
// Checks for local changes, tries to group them by plugin/theme and pushes the changes
|
||||
function gitium_auto_push( $msg_prepend = '' ) {
|
||||
global $git;
|
||||
list( , $git_private_key ) = gitium_get_keypair();
|
||||
if ( ! $git_private_key )
|
||||
return;
|
||||
$git->set_key( $git_private_key );
|
||||
|
||||
$commits = gitium_group_commit_modified_plugins_and_themes( $msg_prepend );
|
||||
gitium_merge_and_push( $commits );
|
||||
gitium_update_versions();
|
||||
}
|
||||
add_action( 'upgrader_process_complete', 'gitium_auto_push', 11, 0 );
|
||||
|
||||
function gitium_check_after_activate_modifications( $plugin ) {
|
||||
gitium_check_after_event( $plugin );
|
||||
}
|
||||
add_action( 'activated_plugin', 'gitium_check_after_activate_modifications', 999 );
|
||||
|
||||
function gitium_check_after_deactivate_modifications( $plugin ) {
|
||||
gitium_check_after_event( $plugin, 'deactivation' );
|
||||
}
|
||||
add_action( 'deactivated_plugin', 'gitium_check_after_deactivate_modifications', 999 );
|
||||
|
||||
function gitium_check_for_plugin_deletions() { // Handle plugin deletion
|
||||
// $_GET['deleted'] used to resemble if a plugin has been deleted (true)
|
||||
// ...meanwhile commit b28dd45f3dad19f0e06c546fdc89ed5b24bacd72 in github.com/WordPress/WordPress...
|
||||
// Now it resembles the number of deleted plugins (a number). Thanks WP
|
||||
if ( isset( $_GET['deleted'] ) && ( 1 <= (int) $_GET['deleted'] || 'true' == $_GET['deleted'] ) ) {
|
||||
gitium_auto_push();
|
||||
}
|
||||
}
|
||||
add_action( 'load-plugins.php', 'gitium_check_for_plugin_deletions' );
|
||||
|
||||
add_action( 'wp_ajax_wp-plugin-delete-success', 'gitium_auto_push' );
|
||||
add_action( 'wp_ajax_wp-theme-delete-success', 'gitium_auto_push' );
|
||||
|
||||
function gitium_wp_plugin_delete_success() {
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
jQuery(document).ready(function() {
|
||||
jQuery(document).on( 'wp-plugin-delete-success', function() {
|
||||
jQuery.post(ajaxurl, data={'action': 'wp-plugin-delete-success'});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
add_action( 'admin_head', 'gitium_wp_plugin_delete_success' );
|
||||
|
||||
function gitium_wp_theme_delete_success() {
|
||||
?>
|
||||
<script type='text/javascript'>
|
||||
jQuery(document).ready(function() {
|
||||
jQuery(document).on( 'wp-theme-delete-success', function() {
|
||||
jQuery.post(ajaxurl, data={'action': 'wp-theme-delete-success'});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
add_action( 'admin_head', 'gitium_wp_theme_delete_success' );
|
||||
|
||||
function gitium_check_for_themes_deletions() { // Handle theme deletion
|
||||
if ( isset( $_GET['deleted'] ) && 'true' == $_GET['deleted'] ) {
|
||||
gitium_auto_push();
|
||||
}
|
||||
}
|
||||
add_action( 'load-themes.php', 'gitium_check_for_themes_deletions' );
|
||||
|
||||
// Deprecated function - backward compatibility
|
||||
function gitium_hook_plugin_and_theme_editor_page( $hook )
|
||||
{
|
||||
switch ($hook) {
|
||||
case 'plugin-editor.php':
|
||||
if (isset($_GET['a']) && 'te' == $_GET['a']) {
|
||||
gitium_auto_push();
|
||||
}
|
||||
break;
|
||||
|
||||
case 'theme-editor.php':
|
||||
if (isset($_GET['updated']) && 'true' == $_GET['updated']) {
|
||||
gitium_auto_push();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* We execute the "gitium_auto_push" on "wp_die_ajax_handler" filter to make sure we are
|
||||
* at the end of our request and the latest file is saved on disk.
|
||||
*/
|
||||
function gitium_check_ajax_success_call($callback)
|
||||
{
|
||||
gitium_auto_push();
|
||||
|
||||
return $callback;
|
||||
}
|
||||
|
||||
/*
|
||||
* We add this filer on "wp_die_ajax_handler" since our action executes before the actual file is saved on disk
|
||||
* which results in a race condition that would commit only the previously saved data not the
|
||||
* currently saved one.
|
||||
*/
|
||||
function add_filter_for_ajax_save()
|
||||
{
|
||||
add_filter('wp_die_ajax_handler', 'gitium_check_ajax_success_call', 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* We need to apply different filters while checking for WP version to maintain
|
||||
* backworks compatibility since the Code Editor has changed drastically
|
||||
* with the 4.9 WP update.
|
||||
*/
|
||||
if ( version_compare( $GLOBALS['wp_version'], '4.9', '>=' ) )
|
||||
add_action( 'wp_ajax_edit-theme-plugin-file', 'add_filter_for_ajax_save', 1, 0 );
|
||||
else
|
||||
add_action( 'admin_enqueue_scripts', 'gitium_hook_plugin_and_theme_editor_page' );
|
||||
|
||||
function gitium_options_page_check() {
|
||||
global $git;
|
||||
if ( ! $git->can_exec_git() ) { wp_die( 'Cannot exec git' ); }
|
||||
return true;
|
||||
}
|
||||
|
||||
function gitium_remote_disconnected_notice() {
|
||||
if ( current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) && $message = get_transient( 'gitium_remote_disconnected' ) ) : ?>
|
||||
<div class="error-nag error">
|
||||
<p>
|
||||
Could not connect to remote repository.
|
||||
<pre><?php echo esc_html( $message ); ?></pre>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif;
|
||||
}
|
||||
add_action( 'admin_notices', 'gitium_remote_disconnected_notice' );
|
BIN
wp-content/plugins/gitium/img/gitium.png
Normal file
BIN
wp-content/plugins/gitium/img/gitium.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 540 B |
26
wp-content/plugins/gitium/img/gitium.svg
Normal file
26
wp-content/plugins/gitium/img/gitium.svg
Normal file
@ -0,0 +1,26 @@
|
||||
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In -->
|
||||
<svg version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
|
||||
x="0px" y="0px" width="233.9px" height="204.1px" viewBox="0 0 233.9 204.1" enable-background="new 0 0 233.9 204.1"
|
||||
xml:space="preserve">
|
||||
<defs>
|
||||
</defs>
|
||||
<path fill="#496567" d="M233.9,0v172.3c0,16.8-14.7,31.8-30,31.8H39c-25.4,0-39-13.2-39-45.4V35.1h37.9V0H233.9L233.9,0z"/>
|
||||
<path fill="#FFFFFF" d="M37.9,46.8H12.4v113.8c0,17.5,6.5,25.8,12.6,25.8c7.4,0,12.8-8.2,12.8-25.8V46.8z M219.4,14H51.5v149.2
|
||||
c0,12.1-2.2,20.8-5.6,27.6h156.9c6.7,0,17.7-9,16.5-22.1V14z"/>
|
||||
<path fill="#496567" d="M192.4,46.4H79.5c-3.4,0-6.1-2.7-6.1-6.1c0-3.4,2.7-6.1,6.1-6.1h112.9c3.4,0,6.1,2.7,6.1,6.1
|
||||
C198.5,43.7,195.8,46.4,192.4,46.4z M149.7,118.3c-1-1.4-2.2-2.3-3.8-2.7s-3.5-0.6-5.8-0.6h-18.5c-2.2,0-4,0.6-5.3,1.8
|
||||
c-1.3,1.2-2,2.7-2,4.5c0,2.2,0.8,3.8,2.3,4.7s3.9,1.4,6.9,1.4h12.6v13.1c-3.4,1.8-6.8,3.2-10.1,4.2c-3.3,1-6.9,1.5-10.6,1.5
|
||||
c-7.8,0-13.8-2.5-18.2-7.6c-4.3-5.1-6.5-12.4-6.5-21.8c0-4.4,0.6-8.3,1.7-11.9s2.7-6.6,4.8-9.1c2.1-2.5,4.6-4.4,7.6-5.7
|
||||
c3-1.3,6.3-2,10.1-2c3.7,0,6.7,0.5,9,1.6s4.2,2.5,5.6,4.1s3.1,4,5.1,7.1c0.7,1,1.6,1.8,2.7,2.3s2.2,0.8,3.4,0.8
|
||||
c2.1,0,3.9-0.7,5.5-2.2c1.5-1.4,2.3-3.2,2.3-5.3c0-1.9-0.7-4.1-2-6.5c-1.3-2.5-3.3-4.8-5.9-7c-2.6-2.2-6-4-10.2-5.5
|
||||
c-4.2-1.4-9-2.2-14.4-2.2c-6.6,0-12.5,1-17.7,2.9c-5.2,1.9-9.6,4.7-13.3,8.3s-6.4,8-8.2,13.3s-2.8,10.9-2.8,17.2
|
||||
c0,6.4,1,12.2,2.9,17.3c1.9,5.2,4.7,9.6,8.3,13.2s7.9,6.4,13,8.3c5.1,1.9,10.7,2.9,16.9,2.9c5.3,0,10.2-0.6,14.7-1.8
|
||||
c4.5-1.2,9.2-3.1,14.1-5.8c1.7-0.9,3.1-1.9,4.2-2.9s1.8-2.1,2.2-3.3c0.4-1.2,0.6-2.9,0.6-4.9v-15.5
|
||||
C151.1,121.8,150.7,119.7,149.7,118.3z M161.3,100.5c-1.2,1-1.8,2.3-1.8,3.9c0,1.6,0.6,2.9,1.7,3.9s2.8,1.5,4.9,1.5h2v28.8
|
||||
c0,4.7,0.4,8.4,1.1,11.2s2.3,5,4.8,6.5c2.4,1.6,6,2.4,10.7,2.4c4.9,0,8.7-0.6,11.4-1.9c2.6-1.3,4-3.1,4-5.6c0-1.4-0.5-2.6-1.5-3.6
|
||||
c-1-1-2.1-1.5-3.3-1.5c-0.8,0-2,0.2-3.5,0.5c-1.5,0.3-2.7,0.5-3.6,0.5c-1.6,0-2.8-0.4-3.5-1.2c-0.7-0.8-1.2-1.8-1.3-3.1
|
||||
c-0.2-1.3-0.2-3.1-0.2-5.4v-27.6h2.8c3,0,5.3-0.4,6.8-1.2c1.6-0.8,2.4-2.2,2.4-4.2c0-1.6-0.6-2.9-1.7-3.9c-1.1-1-2.7-1.5-4.9-1.5
|
||||
h-5.5V88.8c0-2.5-0.1-4.5-0.4-5.9c-0.3-1.4-0.9-2.5-2-3.5c-1.5-1.4-3.3-2.1-5.2-2.1c-1.4,0-2.6,0.3-3.7,1c-1.1,0.6-1.9,1.5-2.5,2.5
|
||||
c-0.6,1-0.9,2.2-1.1,3.5c-0.1,1.4-0.2,3.3-0.2,5.7v9h-1.6C164.2,99,162.5,99.5,161.3,100.5z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.4 KiB |
667
wp-content/plugins/gitium/inc/class-git-wrapper.php
Normal file
667
wp-content/plugins/gitium/inc/class-git-wrapper.php
Normal file
@ -0,0 +1,667 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
define('GITIGNORE', <<<EOF
|
||||
*.log
|
||||
*.swp
|
||||
*.back
|
||||
*.bak
|
||||
*.sql
|
||||
*.sql.gz
|
||||
~*
|
||||
|
||||
.htaccess
|
||||
.maintenance
|
||||
|
||||
wp-config.php
|
||||
sitemap.xml
|
||||
sitemap.xml.gz
|
||||
wp-content/uploads/
|
||||
wp-content/blogs.dir/
|
||||
wp-content/upgrade/
|
||||
wp-content/backup-db/
|
||||
wp-content/cache/
|
||||
wp-content/backups/
|
||||
|
||||
wp-content/advanced-cache.php
|
||||
wp-content/object-cache.php
|
||||
wp-content/wp-cache-config.php
|
||||
wp-content/db.php
|
||||
|
||||
wp-admin/
|
||||
wp-includes/
|
||||
/index.php
|
||||
/license.txt
|
||||
/readme.html
|
||||
|
||||
# de_DE
|
||||
/liesmich.html
|
||||
|
||||
# it_IT
|
||||
/LEGGIMI.txt
|
||||
/licenza.html
|
||||
|
||||
# da_DK
|
||||
/licens.html
|
||||
|
||||
# es_ES, es_PE
|
||||
/licencia.txt
|
||||
|
||||
# hu_HU
|
||||
/licenc.txt
|
||||
/olvasdel.html
|
||||
|
||||
# sk_SK
|
||||
/licencia-sk_SK.txt
|
||||
|
||||
# sv_SE
|
||||
/licens-sv_SE.txt
|
||||
|
||||
/wp-activate.php
|
||||
/wp-blog-header.php
|
||||
/wp-comments-post.php
|
||||
/wp-config-sample.php
|
||||
/wp-cron.php
|
||||
/wp-links-opml.php
|
||||
/wp-load.php
|
||||
/wp-login.php
|
||||
/wp-mail.php
|
||||
/wp-settings.php
|
||||
/wp-signup.php
|
||||
/wp-trackback.php
|
||||
/xmlrpc.php
|
||||
EOF
|
||||
);
|
||||
|
||||
|
||||
class Git_Wrapper {
|
||||
|
||||
private $last_error = '';
|
||||
private $gitignore = GITIGNORE;
|
||||
|
||||
function __construct( $repo_dir ) {
|
||||
$this->repo_dir = $repo_dir;
|
||||
$this->private_key = '';
|
||||
}
|
||||
|
||||
function _rrmdir( $dir ) {
|
||||
if ( empty( $dir ) || ! is_dir( $dir ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$files = array_diff( scandir( $dir ), array( '.', '..' ) );
|
||||
foreach ( $files as $file ) {
|
||||
$filepath = realpath("$dir/$file");
|
||||
( is_dir( $filepath ) ) ? $this->_rrmdir( $filepath ) : unlink( $filepath );
|
||||
}
|
||||
return rmdir( $dir );
|
||||
}
|
||||
|
||||
function _log(...$args) {
|
||||
if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) { return; }
|
||||
|
||||
$output = '';
|
||||
if (isset($args) && $args) foreach ( $args as $arg ) {
|
||||
$output .= var_export($arg, true).'/n/n';
|
||||
}
|
||||
|
||||
if ($output) error_log($output);
|
||||
}
|
||||
|
||||
function _git_temp_key_file() {
|
||||
$key_file = tempnam( sys_get_temp_dir(), 'ssh-git' );
|
||||
return $key_file;
|
||||
}
|
||||
|
||||
function set_key( $private_key ) {
|
||||
$this->private_key = $private_key;
|
||||
}
|
||||
|
||||
private function get_env() {
|
||||
$env = array();
|
||||
$key_file = null;
|
||||
|
||||
if ( defined( 'GIT_SSH' ) && GIT_SSH ) {
|
||||
$env['GIT_SSH'] = GIT_SSH;
|
||||
} else {
|
||||
$env['GIT_SSH'] = dirname( __FILE__ ) . '/ssh-git';
|
||||
}
|
||||
|
||||
if ( defined( 'GIT_KEY_FILE' ) && GIT_KEY_FILE ) {
|
||||
$env['GIT_KEY_FILE'] = GIT_KEY_FILE;
|
||||
} elseif ( $this->private_key ) {
|
||||
$key_file = $this->_git_temp_key_file();
|
||||
chmod( $key_file, 0600 );
|
||||
file_put_contents( $key_file, $this->private_key );
|
||||
$env['GIT_KEY_FILE'] = $key_file;
|
||||
}
|
||||
|
||||
return $env;
|
||||
}
|
||||
|
||||
protected function _call(...$args) {
|
||||
$args = join( ' ', array_map( 'escapeshellarg', $args ) );
|
||||
$cmd = "git $args 2>&1";
|
||||
$return = -1;
|
||||
$response = array();
|
||||
$env = $this->get_env();
|
||||
|
||||
$proc = proc_open(
|
||||
$cmd,
|
||||
array(
|
||||
0 => array( 'pipe', 'r' ), // stdin
|
||||
1 => array( 'pipe', 'w' ), // stdout
|
||||
),
|
||||
$pipes,
|
||||
$this->repo_dir,
|
||||
$env
|
||||
);
|
||||
if ( is_resource( $proc ) ) {
|
||||
fclose( $pipes[0] );
|
||||
while ( $line = fgets( $pipes[1] ) ) {
|
||||
$response[] = rtrim( $line, "\n\r" );
|
||||
}
|
||||
$return = (int)proc_close( $proc );
|
||||
}
|
||||
$this->_log( "$return $cmd", join( "\n", $response ) );
|
||||
if ( ! defined( 'GIT_KEY_FILE' ) && isset( $env['GIT_KEY_FILE'] ) ) {
|
||||
unlink( $env['GIT_KEY_FILE'] );
|
||||
}
|
||||
if ( 0 != $return ) {
|
||||
$this->last_error = join( "\n", $response );
|
||||
} else {
|
||||
$this->last_error = null;
|
||||
}
|
||||
return array( $return, $response );
|
||||
}
|
||||
|
||||
function get_last_error() {
|
||||
return $this->last_error;
|
||||
}
|
||||
|
||||
function can_exec_git() {
|
||||
list( $return, ) = $this->_call( 'version' );
|
||||
return ( 0 == $return );
|
||||
}
|
||||
|
||||
function is_status_working() {
|
||||
list( $return, ) = $this->_call( 'status', '-s' );
|
||||
return ( 0 == $return );
|
||||
}
|
||||
|
||||
function get_version() {
|
||||
list( $return, $version ) = $this->_call( 'version' );
|
||||
if ( 0 != $return ) { return ''; }
|
||||
if ( ! empty( $version[0] ) ) {
|
||||
return substr( $version[0], 12 );
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
// git rev-list @{u}..
|
||||
function get_ahead_commits() {
|
||||
list( , $commits ) = $this->_call( 'rev-list', '@{u}..' );
|
||||
return $commits;
|
||||
}
|
||||
|
||||
// git rev-list ..@{u}
|
||||
function get_behind_commits() {
|
||||
list( , $commits ) = $this->_call( 'rev-list', '..@{u}' );
|
||||
return $commits;
|
||||
}
|
||||
|
||||
function init() {
|
||||
file_put_contents( "$this->repo_dir/.gitignore", $this->gitignore );
|
||||
list( $return, ) = $this->_call( 'init' );
|
||||
$this->_call( 'config', 'user.email', 'gitium@presslabs.com' );
|
||||
$this->_call( 'config', 'user.name', 'Gitium' );
|
||||
$this->_call( 'config', 'push.default', 'matching' );
|
||||
return ( 0 == $return );
|
||||
}
|
||||
|
||||
function is_dot_git_dir( $dir ) {
|
||||
$realpath = realpath( $dir );
|
||||
$git_config = realpath( $realpath . '/config' );
|
||||
$git_index = realpath( $realpath . '/index' );
|
||||
if ( ! empty( $realpath ) && is_dir( $realpath ) && file_exists( $git_config ) && file_exists( $git_index ) ) {
|
||||
return True;
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
$dot_git_dir = realpath( $this->repo_dir . '/.git' );
|
||||
if ( $this->is_dot_git_dir( $dot_git_dir ) && $this->_rrmdir( $dot_git_dir ) ) {
|
||||
if ( WP_DEBUG ) {
|
||||
error_log( "Gitium cleanup successfull. Removed '$dot_git_dir'." );
|
||||
}
|
||||
return True;
|
||||
}
|
||||
if ( WP_DEBUG ) {
|
||||
error_log( "Gitium cleanup failed. '$dot_git_dir' is not a .git dir." );
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
function add_remote_url( $url ) {
|
||||
list( $return, ) = $this->_call( 'remote', 'add', 'origin', $url );
|
||||
return ( 0 == $return );
|
||||
}
|
||||
|
||||
function get_remote_url() {
|
||||
list( , $response ) = $this->_call( 'config', '--get', 'remote.origin.url' );
|
||||
if ( isset( $response[0] ) ) {
|
||||
return $response[0];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function remove_remote() {
|
||||
list( $return, ) = $this->_call( 'remote', 'rm', 'origin');
|
||||
return ( 0 == $return );
|
||||
}
|
||||
|
||||
function get_remote_tracking_branch() {
|
||||
list( $return, $response ) = $this->_call( 'rev-parse', '--abbrev-ref', '--symbolic-full-name', '@{u}' );
|
||||
if ( 0 == $return ) {
|
||||
return $response[0];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function get_local_branch() {
|
||||
list( $return, $response ) = $this->_call( 'rev-parse', '--abbrev-ref', 'HEAD' );
|
||||
if ( 0 == $return ) {
|
||||
return $response[0];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function fetch_ref() {
|
||||
list( $return, ) = $this->_call( 'fetch', 'origin' );
|
||||
return ( 0 == $return );
|
||||
}
|
||||
|
||||
protected function _resolve_merge_conflicts( $message ) {
|
||||
list( , $changes ) = $this->status( true );
|
||||
$this->_log( $changes );
|
||||
foreach ( $changes as $path => $change ) {
|
||||
if ( in_array( $change, array( 'UD', 'DD' ) ) ) {
|
||||
$this->_call( 'rm', $path );
|
||||
$message .= "\n\tConflict: $path [removed]";
|
||||
} elseif ( 'DU' == $change ) {
|
||||
$this->_call( 'add', $path );
|
||||
$message .= "\n\tConflict: $path [added]";
|
||||
} elseif ( in_array( $change, array( 'AA', 'UU', 'AU', 'UA' ) ) ) {
|
||||
$this->_call( 'checkout', '--theirs', $path );
|
||||
$this->_call( 'add', '--all', $path );
|
||||
$message .= "\n\tConflict: $path [local version]";
|
||||
}
|
||||
}
|
||||
$this->commit( $message );
|
||||
}
|
||||
|
||||
function get_commit_message( $commit ) {
|
||||
list( $return, $response ) = $this->_call( 'log', '--format=%B', '-n', '1', $commit );
|
||||
return ( $return !== 0 ? false : join( "\n", $response ) );
|
||||
}
|
||||
|
||||
private function strpos_haystack_array( $haystack, $needle, $offset=0 ) {
|
||||
if ( ! is_array( $haystack ) ) { $haystack = array( $haystack ); }
|
||||
|
||||
foreach ( $haystack as $query ) {
|
||||
if ( strpos( $query, $needle, $offset) !== false ) { return true; }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function cherry_pick( $commits ) {
|
||||
foreach ( $commits as $commit ) {
|
||||
if ( empty( $commit ) ) { return false; }
|
||||
|
||||
list( $return, $response ) = $this->_call( 'cherry-pick', $commit );
|
||||
|
||||
// abort the cherry-pick if the changes are already pushed
|
||||
if ( false !== $this->strpos_haystack_array( $response, 'previous cherry-pick is now empty' ) ) {
|
||||
$this->_call( 'cherry-pick', '--abort' );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( $return != 0 ) {
|
||||
$this->_resolve_merge_conflicts( $this->get_commit_message( $commit ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function merge_with_accept_mine(...$commits) {
|
||||
do_action( 'gitium_before_merge_with_accept_mine' );
|
||||
|
||||
if ( 1 == count($commits) && is_array( $commits[0] ) ) {
|
||||
$commits = $commits[0];
|
||||
}
|
||||
|
||||
// get ahead commits
|
||||
$ahead_commits = $this->get_ahead_commits();
|
||||
|
||||
// combine all commits with the ahead commits
|
||||
$commits = array_unique( array_merge( array_reverse( $commits ), $ahead_commits ) );
|
||||
$commits = array_reverse( $commits );
|
||||
|
||||
// get the remote branch
|
||||
$remote_branch = $this->get_remote_tracking_branch();
|
||||
|
||||
// get the local branch
|
||||
$local_branch = $this->get_local_branch();
|
||||
|
||||
// rename the local branch to 'merge_local'
|
||||
$this->_call( 'branch', '-m', 'merge_local' );
|
||||
|
||||
// local branch set up to track remote branch
|
||||
$this->_call( 'branch', $local_branch, $remote_branch );
|
||||
|
||||
// checkout to the $local_branch
|
||||
list( $return, ) = $this->_call( 'checkout', $local_branch );
|
||||
if ( $return != 0 ) {
|
||||
$this->_call( 'branch', '-M', $local_branch );
|
||||
return false;
|
||||
}
|
||||
|
||||
// don't cherry pick if there are no commits
|
||||
if ( count( $commits ) > 0 ) {
|
||||
$this->cherry_pick( $commits );
|
||||
}
|
||||
|
||||
if ( $this->successfully_merged() ) { // git status without states: AA, DD, UA, AU ...
|
||||
// delete the 'merge_local' branch
|
||||
$this->_call( 'branch', '-D', 'merge_local' );
|
||||
return true;
|
||||
} else {
|
||||
$this->_call( 'cherry-pick', '--abort' );
|
||||
$this->_call( 'checkout', '-b', 'merge_local' );
|
||||
$this->_call( 'branch', '-M', $local_branch );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function successfully_merged() {
|
||||
list( , $response ) = $this->status( true );
|
||||
$changes = array_values( $response );
|
||||
return ( 0 == count( array_intersect( $changes, array( 'DD', 'AU', 'UD', 'UA', 'DU', 'AA', 'UU' ) ) ) );
|
||||
}
|
||||
|
||||
function merge_initial_commit( $commit, $branch ) {
|
||||
list( $return, ) = $this->_call( 'branch', '-m', 'initial' );
|
||||
if ( 0 != $return ) {
|
||||
return false;
|
||||
}
|
||||
list( $return, ) = $this->_call( 'checkout', $branch );
|
||||
if ( 0 != $return ) {
|
||||
return false;
|
||||
}
|
||||
list( $return, ) = $this->_call(
|
||||
'cherry-pick', '--strategy', 'recursive', '--strategy-option', 'theirs', $commit
|
||||
);
|
||||
if ( $return != 0 ) {
|
||||
$this->_resolve_merge_conflicts( $this->get_commit_message( $commit ) );
|
||||
if ( ! $this->successfully_merged() ) {
|
||||
$this->_call( 'cherry-pick', '--abort' );
|
||||
$this->_call( 'checkout', 'initial' );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->_call( 'branch', '-D', 'initial' );
|
||||
return true;
|
||||
}
|
||||
|
||||
function get_remote_branches() {
|
||||
list( , $response ) = $this->_call( 'branch', '-r' );
|
||||
$response = array_map( 'trim', $response );
|
||||
$response = array_map( create_function( '$b', 'return str_replace("origin/","",$b);' ), $response );
|
||||
return $response;
|
||||
}
|
||||
|
||||
function add(...$args) {
|
||||
if ( 1 == count($args) && is_array( $args[0] ) ) {
|
||||
$args = $args[0];
|
||||
}
|
||||
$params = array_merge( array( 'add', '-n', '--all' ), $args );
|
||||
list ( , $response ) = call_user_func_array( array( $this, '_call' ), $params );
|
||||
$count = count( $response );
|
||||
|
||||
$params = array_merge( array( 'add', '--all' ), $args );
|
||||
list ( , $response ) = call_user_func_array( array( $this, '_call' ), $params );
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
function commit( $message, $author_name = '', $author_email = '' ) {
|
||||
$author = '';
|
||||
if ( $author_email ) {
|
||||
if ( empty( $author_name ) ) {
|
||||
$author_name = $author_email;
|
||||
}
|
||||
$author = "$author_name <$author_email>";
|
||||
}
|
||||
|
||||
if ( ! empty( $author ) ) {
|
||||
list( $return, $response ) = $this->_call( 'commit', '-m', $message, '--author', $author );
|
||||
} else {
|
||||
list( $return, $response ) = $this->_call( 'commit', '-m', $message );
|
||||
}
|
||||
if ( $return !== 0 ) { return false; }
|
||||
|
||||
list( $return, $response ) = $this->_call( 'rev-parse', 'HEAD' );
|
||||
|
||||
return ( $return === 0 ) ? $response[0] : false;
|
||||
}
|
||||
|
||||
function push( $branch = '' ) {
|
||||
if ( ! empty( $branch ) ) {
|
||||
list( $return, ) = $this->_call( 'push', '--porcelain', '-u', 'origin', $branch );
|
||||
} else {
|
||||
list( $return, ) = $this->_call( 'push', '--porcelain', '-u', 'origin', 'HEAD' );
|
||||
}
|
||||
return ( $return == 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Get uncommited changes with status porcelain
|
||||
* git status --porcelain
|
||||
* It returns an array like this:
|
||||
array(
|
||||
file => deleted|modified
|
||||
...
|
||||
)
|
||||
*/
|
||||
function get_local_changes() {
|
||||
list( $return, $response ) = $this->_call( 'status', '--porcelain' );
|
||||
|
||||
if ( 0 !== $return ) {
|
||||
return array();
|
||||
}
|
||||
$new_response = array();
|
||||
if ( ! empty( $response ) ) {
|
||||
foreach ( $response as $line ) :
|
||||
$work_tree_status = substr( $line, 1, 1 );
|
||||
$path = substr( $line, 3 );
|
||||
|
||||
if ( ( '"' == $path[0] ) && ('"' == $path[strlen( $path ) - 1] ) ) {
|
||||
// git status --porcelain will put quotes around paths with whitespaces
|
||||
// we don't want the quotes, let's get rid of them
|
||||
$path = substr( $path, 1, strlen( $path ) - 2 );
|
||||
}
|
||||
|
||||
if ( 'D' == $work_tree_status ) {
|
||||
$action = 'deleted';
|
||||
} else {
|
||||
$action = 'modified';
|
||||
}
|
||||
$new_response[ $path ] = $action;
|
||||
endforeach;
|
||||
}
|
||||
return $new_response;
|
||||
}
|
||||
|
||||
function get_uncommited_changes() {
|
||||
list( , $changes ) = $this->status();
|
||||
return $changes;
|
||||
}
|
||||
|
||||
function local_status() {
|
||||
list( $return, $response ) = $this->_call( 'status', '-s', '-b', '-u' );
|
||||
if ( 0 !== $return ) {
|
||||
return array( '', array() );
|
||||
}
|
||||
|
||||
$new_response = array();
|
||||
if ( ! empty( $response ) ) {
|
||||
$branch_status = array_shift( $response );
|
||||
foreach ( $response as $idx => $line ) :
|
||||
unset( $index_status, $work_tree_status, $path, $new_path, $old_path );
|
||||
|
||||
if ( empty( $line ) ) { continue; } // ignore empty lines like the last item
|
||||
if ( '#' == $line[0] ) { continue; } // ignore branch status
|
||||
|
||||
$index_status = substr( $line, 0, 1 );
|
||||
$work_tree_status = substr( $line, 1, 1 );
|
||||
$path = substr( $line, 3 );
|
||||
|
||||
$old_path = '';
|
||||
$new_path = explode( '->', $path );
|
||||
if ( ( 'R' === $index_status ) && ( ! empty( $new_path[1] ) ) ) {
|
||||
$old_path = trim( $new_path[0] );
|
||||
$path = trim( $new_path[1] );
|
||||
}
|
||||
$new_response[ $path ] = trim( $index_status . $work_tree_status . ' ' . $old_path );
|
||||
endforeach;
|
||||
}
|
||||
|
||||
return array( $branch_status, $new_response );
|
||||
}
|
||||
|
||||
function status( $local_only = false ) {
|
||||
list( $branch_status, $new_response ) = $this->local_status();
|
||||
|
||||
if ( $local_only ) { return array( $branch_status, $new_response ); }
|
||||
|
||||
$behind_count = 0;
|
||||
$ahead_count = 0;
|
||||
if ( preg_match( '/## ([^.]+)\.+([^ ]+)/', $branch_status, $matches ) ) {
|
||||
$local_branch = $matches[1];
|
||||
$remote_branch = $matches[2];
|
||||
|
||||
list( , $response ) = $this->_call( 'rev-list', "$local_branch..$remote_branch", '--count' );
|
||||
$behind_count = (int)$response[0];
|
||||
|
||||
list( , $response ) = $this->_call( 'rev-list', "$remote_branch..$local_branch", '--count' );
|
||||
$ahead_count = (int)$response[0];
|
||||
}
|
||||
|
||||
if ( $behind_count ) {
|
||||
list( , $response ) = $this->_call( 'diff', '-z', '--name-status', "$local_branch~$ahead_count", $remote_branch );
|
||||
$response = explode( chr( 0 ), $response[0] );
|
||||
array_pop( $response );
|
||||
for ( $idx = 0 ; $idx < count( $response ) / 2 ; $idx++ ) {
|
||||
$file = $response[ $idx * 2 + 1 ];
|
||||
$change = $response[ $idx * 2 ];
|
||||
if ( ! isset( $new_response[ $file ] ) ) {
|
||||
$new_response[ $file ] = "r$change";
|
||||
}
|
||||
}
|
||||
}
|
||||
return array( $branch_status, $new_response );
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks if repo has uncommited changes
|
||||
* git status --porcelain
|
||||
*/
|
||||
function is_dirty() {
|
||||
$changes = $this->get_uncommited_changes();
|
||||
return ! empty( $changes );
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the last n commits
|
||||
*/
|
||||
function get_last_commits( $n = 20 ) {
|
||||
list( $return, $message ) = $this->_call( 'log', '-n', $n, '--pretty=format:%s' );
|
||||
if ( 0 !== $return ) { return false; }
|
||||
|
||||
list( $return, $response ) = $this->_call( 'log', '-n', $n, '--pretty=format:%h|%an|%ae|%ad|%cn|%ce|%cd' );
|
||||
if ( 0 !== $return ) { return false; }
|
||||
|
||||
foreach ( $response as $index => $value ) {
|
||||
$commit_info = explode( '|', $value );
|
||||
$commits[ $commit_info[0] ] = array(
|
||||
'subject' => $message[ $index ],
|
||||
'author_name' => $commit_info[1],
|
||||
'author_email' => $commit_info[2],
|
||||
'author_date' => $commit_info[3],
|
||||
);
|
||||
if ( $commit_info[1] != $commit_info[4] && $commit_info[2] != $commit_info[5] ) {
|
||||
$commits[ $commit_info[0] ]['committer_name'] = $commit_info[4];
|
||||
$commits[ $commit_info[0] ]['committer_email'] = $commit_info[5];
|
||||
$commits[ $commit_info[0] ]['committer_date'] = $commit_info[6];
|
||||
}
|
||||
}
|
||||
return $commits;
|
||||
}
|
||||
|
||||
public function set_gitignore( $content ) {
|
||||
file_put_contents( $this->repo_dir . '/.gitignore', $content );
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_gitignore() {
|
||||
return file_get_contents( $this->repo_dir . '/.gitignore' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove files in .gitignore from version control
|
||||
*/
|
||||
function rm_cached( $path ) {
|
||||
list( $return, ) = $this->_call( 'rm', '--cached', $path );
|
||||
return ( $return == 0 );
|
||||
}
|
||||
|
||||
function remove_wp_content_from_version_control() {
|
||||
$process = proc_open(
|
||||
'rm -rf ' . ABSPATH . '/wp-content/.git',
|
||||
array(
|
||||
0 => array( 'pipe', 'r' ), // stdin
|
||||
1 => array( 'pipe', 'w' ), // stdout
|
||||
),
|
||||
$pipes
|
||||
);
|
||||
if ( is_resource( $process ) ) {
|
||||
fclose( $pipes[0] );
|
||||
proc_close( $process );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! defined( 'GIT_DIR' ) ) {
|
||||
define( 'GIT_DIR', dirname( WP_CONTENT_DIR ) );
|
||||
}
|
||||
|
||||
# global is needed here for wp-cli as it includes/exec files inside a function scope
|
||||
# this forces the context to really be global :\.
|
||||
global $git;
|
||||
$git = new Git_Wrapper( GIT_DIR );
|
53
wp-content/plugins/gitium/inc/class-gitium-admin.php
Normal file
53
wp-content/plugins/gitium/inc/class-gitium-admin.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Admin {
|
||||
|
||||
public function __construct() {
|
||||
global $git;
|
||||
|
||||
list( , $git_private_key ) = gitium_get_keypair();
|
||||
$git->set_key( $git_private_key );
|
||||
|
||||
if ( current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {
|
||||
$req = new Gitium_Requirements();
|
||||
if ( ! $req->get_status() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( $this->has_configuration() ) {
|
||||
new Gitium_Submenu_Status();
|
||||
new Gitium_Submenu_Commits();
|
||||
new Gitium_Submenu_Settings();
|
||||
new Gitium_Menu_Bubble();
|
||||
} else {
|
||||
new Gitium_Submenu_Configure();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function has_configuration() {
|
||||
return _gitium_is_status_working() && _gitium_get_remote_tracking_branch();
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( is_admin() && ! is_multisite() ) || ( is_network_admin() && is_multisite() ) ) {
|
||||
add_action( 'init', 'gitium_admin_page' );
|
||||
function gitium_admin_page() {
|
||||
new Gitium_Admin();
|
||||
}
|
||||
}
|
107
wp-content/plugins/gitium/inc/class-gitium-help.php
Normal file
107
wp-content/plugins/gitium/inc/class-gitium-help.php
Normal file
@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Help {
|
||||
|
||||
public function __construct( $hook, $help = 'gitium' ) {
|
||||
add_action( "load-{$hook}", array( $this, $help ), 20 );
|
||||
}
|
||||
|
||||
private function general() {
|
||||
$screen = get_current_screen();
|
||||
$screen->add_help_tab( array( 'id' => 'gitium', 'title' => __( 'Gitium', 'gitium' ), 'callback' => array( $this, 'gitium' ) ) );
|
||||
$screen->add_help_tab( array( 'id' => 'faq', 'title' => __( 'F.A.Q.', 'gitium' ), 'callback' => array( $this, 'faq' ) ) );
|
||||
$screen->add_help_tab( array( 'id' => 'requirements', 'title' => __( 'Requirements', 'gitium' ), 'callback' => array( $this, 'requirements_callback' ) ) );
|
||||
$screen->set_help_sidebar( '<div style="width:auto; height:auto; float:right; padding-right:28px; padding-top:15px"><img src="' . plugins_url( 'img/gitium.svg', dirname( __FILE__ ) ) . '" width="96"></div>' );
|
||||
}
|
||||
|
||||
public function gitium() {
|
||||
echo '<p>' . __( 'Gitium enables continuous deployment for WordPress integrating with tools such as Github, Bitbucket or Travis-CI. Plugin and theme updates, installs and removals are automatically versioned.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'Ninja code edits from the WordPress editor are also tracked into version control. Gitium is designed for sane development environments.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'Staging and production can follow different branches of the same repository. You can deploy code simply trough git push.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'Gitium requires <code>git</code> command line tool minimum version 1.7 installed on the server and <code>proc_open</code> PHP function enabled.', 'gitium' ) . '</p>';
|
||||
}
|
||||
|
||||
public function faq() {
|
||||
echo '<p><strong>' . __( 'Could not connect to remote repository?', 'gitium' ) . '</strong><br />'. __( 'If you encounter this kind of error you can try to fix it by setting the proper username of the .git directory.', 'gitium' ) . '<br />' . __( 'Example', 'gitium' ) .': <code>chown -R www-data:www-data .git</code></p>';
|
||||
echo '<p><strong>' . __( 'Is this plugin considered stable?', 'gitium' ) . '</strong><br />'. __( 'Right now this plugin is considered alpha quality and should be used in production environments only by adventurous kinds.', 'gitium' ) . '</p>';
|
||||
echo '<p><strong>' . __( 'What happens in case of conflicts?', 'gitium' ) . '</strong><br />'. __( 'The behavior in case of conflicts is to overwrite the changes on the origin repository with the local changes (ie. local modifications take precedence over remote ones).', 'gitium' ) . '</p>';
|
||||
echo '<p><strong>' . __( 'How to deploy automatically after a push?', 'gitium' ) . '</strong><br />'. __( 'You can ping the webhook url after a push to automatically deploy the new code. The webhook url can be found under Code menu. This url plays well with Github or Bitbucket webhooks.', 'gitium' ) . '</p>';
|
||||
echo '<p><strong>' . __( 'Does it works on multi site setups?', 'gitium' ) . '</strong><br />'. __( 'Gitium is not supporting multisite setups at the moment.', 'gitium' ) . '</p>';
|
||||
echo '<p><strong>' . __( 'How does gitium handle submodules?', 'gitium' ) . '</strong><br />'. __( 'Currently submodules are not supported.', 'gitium' ) . '</p>';
|
||||
}
|
||||
|
||||
public function requirements_callback() {
|
||||
echo '<p>' . __( 'Gitium requires:', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'the function proc_open available', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'can exec the file inc/ssh-git', 'gitium' ) . '</p>';
|
||||
|
||||
printf( '<p>' . __( 'git version >= %s', 'gitium' ) . '</p>', GITIUM_MIN_GIT_VER );
|
||||
printf( '<p>' . __( 'PHP version >= %s', 'gitium' ) . '</p>', GITIUM_MIN_PHP_VER );
|
||||
}
|
||||
|
||||
public function configuration() {
|
||||
$screen = get_current_screen();
|
||||
$screen->add_help_tab( array( 'id' => 'configuration', 'title' => __( 'Configuration', 'gitium' ), 'callback' => array( $this, 'configuration_callback' ) ) );
|
||||
$this->general();
|
||||
}
|
||||
|
||||
public function configuration_callback() {
|
||||
echo '<p><strong>' . __( 'Configuration step 1', 'gitium' ) . '</strong><br />' . __( 'In this step you must specify the <code>Remote URL</code>. This URL represents the link between the git sistem and your site.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'You can get this URL from your Git repository and it looks like this:', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'github.com -> git@github.com:user/example.git', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'To go to the next step, fill the <code>Remote URL</code> and then press the <code>Fetch</code> button.', 'gitium' ) . '</p>';
|
||||
echo '<p><strong>' . __( 'Configuration step 2', 'gitium' ) . '</strong><br />' . __( 'In this step you must select the <code>branch</code> you want to follow.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'Only this branch will have all of your code modifications.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'When you push the button <code>Merge & Push</code>, all code(plugins & themes) will be pushed on the git repository.', 'gitium' ) . '</p>';
|
||||
}
|
||||
|
||||
public function status() {
|
||||
$screen = get_current_screen();
|
||||
$screen->add_help_tab( array( 'id' => 'status', 'title' => __( 'Status', 'gitium' ), 'callback' => array( $this, 'status_callback' ) ) );
|
||||
$this->general();
|
||||
}
|
||||
|
||||
public function status_callback() {
|
||||
echo '<p>' . __( 'On status page you can see what files are modified, and you can commit the changes to git.', 'gitium' ) . '</p>';
|
||||
}
|
||||
|
||||
public function commits() {
|
||||
$screen = get_current_screen();
|
||||
$screen->add_help_tab( array( 'id' => 'commits', 'title' => __( 'Commits', 'gitium' ), 'callback' => array( $this, 'commits_callback' ) ) );
|
||||
$this->general();
|
||||
}
|
||||
|
||||
public function commits_callback() {
|
||||
echo '<p>' . __( 'You may be wondering what is the difference between author and committer.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'The <code>author</code> is the person who originally wrote the patch, whereas the <code>committer</code> is the person who last applied the patch.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'So, if you send in a patch to a project and one of the core members applies the patch, both of you get credit — you as the author and the core member as the committer.', 'gitium' ) . '</p>';
|
||||
}
|
||||
|
||||
public function settings() {
|
||||
$screen = get_current_screen();
|
||||
$screen->add_help_tab( array( 'id' => 'settings', 'title' => __( 'Settings', 'gitium' ), 'callback' => array( $this, 'settings_callback' ) ) );
|
||||
$this->general();
|
||||
}
|
||||
|
||||
public function settings_callback() {
|
||||
echo '<p>' . __( 'Each line from the gitignore file specifies a pattern.', 'gitium' ) . '</p>';
|
||||
echo '<p>' . __( 'When deciding whether to ignore a path, Git normally checks gitignore patterns from multiple sources, with the following order of precedence, from highest to lowest (within one level of precedence, the last matching pattern decides the outcome)', 'gitium' ) . '</p>';
|
||||
echo '<p>' . sprintf( __( 'Read more on %s', 'gitium' ), '<a href="http://git-scm.com/docs/gitignore" target="_blank">git documentation</a>' ) . '</p>';
|
||||
}
|
||||
}
|
55
wp-content/plugins/gitium/inc/class-gitium-menu-bubble.php
Normal file
55
wp-content/plugins/gitium/inc/class-gitium-menu-bubble.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Menu_Bubble extends Gitium_Menu {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct( $this->gitium_menu_slug, $this->gitium_menu_slug );
|
||||
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'add_menu_bubble' ) );
|
||||
}
|
||||
|
||||
public function add_menu_bubble() {
|
||||
global $menu;
|
||||
|
||||
if ( ! _gitium_is_status_working() ) {
|
||||
foreach ( $menu as $key => $value ) {
|
||||
if ( $this->menu_slug == $menu[ $key ][2] ) {
|
||||
$menu_bubble = get_transient( 'gitium_menu_bubble' );
|
||||
if ( false === $menu_bubble ) { $menu_bubble = ''; }
|
||||
$menu[ $key ][0] = str_replace( $menu_bubble, '', $menu[ $key ][0] );
|
||||
delete_transient( 'gitium_menu_bubble' );
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
list( , $changes ) = _gitium_status();
|
||||
|
||||
if ( ! empty( $changes ) ) :
|
||||
$bubble_count = count( $changes );
|
||||
foreach ( $menu as $key => $value ) {
|
||||
if ( $this->menu_slug == $menu[ $key ][2] ) {
|
||||
$menu_bubble = " <span class='update-plugins count-$bubble_count'><span class='plugin-count'>"
|
||||
. $bubble_count . '</span></span>';
|
||||
$menu[ $key ][0] .= $menu_bubble;
|
||||
set_transient( 'gitium_menu_bubble', $menu_bubble );
|
||||
return;
|
||||
}
|
||||
}
|
||||
endif;
|
||||
}
|
||||
}
|
97
wp-content/plugins/gitium/inc/class-gitium-menu.php
Normal file
97
wp-content/plugins/gitium/inc/class-gitium-menu.php
Normal file
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Menu {
|
||||
|
||||
public $gitium_menu_slug = 'gitium/gitium.php';
|
||||
public $commits_menu_slug = 'gitium/gitium-commits.php';
|
||||
public $settings_menu_slug = 'gitium/gitium-settings.php';
|
||||
|
||||
public $git = null;
|
||||
|
||||
public $menu_slug;
|
||||
public $submenu_slug;
|
||||
|
||||
public function __construct( $menu_slug, $submenu_slug ) {
|
||||
global $git;
|
||||
$this->git = $git;
|
||||
|
||||
$this->menu_slug = $menu_slug;
|
||||
$this->submenu_slug = $submenu_slug;
|
||||
}
|
||||
|
||||
public function redirect( $message = '', $success = false, $menu_slug = '' ) {
|
||||
$message_id = substr(
|
||||
md5( str_shuffle( 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' ) . time() ), 0, 8
|
||||
);
|
||||
if ( $message ) {
|
||||
set_transient( 'message_' . $message_id, $message, 900 );
|
||||
}
|
||||
if ( '' === $menu_slug ) { $menu_slug = $this->menu_slug; }
|
||||
$url = network_admin_url( 'admin.php?page=' . $menu_slug );
|
||||
$url = esc_url_raw( add_query_arg(
|
||||
array(
|
||||
'message' => $message_id,
|
||||
'success' => $success,
|
||||
),
|
||||
$url
|
||||
) );
|
||||
wp_safe_redirect( $url );
|
||||
exit;
|
||||
}
|
||||
|
||||
public function success_redirect( $message = '', $menu_slug = '' ) {
|
||||
$this->redirect( $message, true, $menu_slug );
|
||||
}
|
||||
|
||||
public function disconnect_repository() {
|
||||
$gitium_disconnect_repo = filter_input(INPUT_POST, 'GitiumSubmitDisconnectRepository', FILTER_SANITIZE_STRING);
|
||||
|
||||
if ( ! isset( $gitium_disconnect_repo ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-admin' );
|
||||
gitium_uninstall_hook();
|
||||
if ( ! $this->git->remove_remote() ) {
|
||||
$this->redirect( __('Could not remove remote.', 'gitium') );
|
||||
}
|
||||
$this->success_redirect( __('You are now disconnected from the repository. New key pair generated.', 'gitium') );
|
||||
}
|
||||
|
||||
public function show_message() {
|
||||
$get_message = filter_input(INPUT_GET, 'message', FILTER_SANITIZE_STRING);
|
||||
$get_success = filter_input(INPUT_GET, 'success', FILTER_SANITIZE_STRING);
|
||||
if ( isset( $get_message ) && $get_message ) {
|
||||
$type = ( isset( $get_success ) && $get_success == 1 ) ? 'updated' : 'error';
|
||||
$message = get_transient( 'message_'. $get_message );
|
||||
if ( $message ) : ?>
|
||||
<div class="<?php echo esc_attr( $type ); ?>"><p><?php echo esc_html( $message ); ?></p></div>
|
||||
<?php endif;
|
||||
}
|
||||
}
|
||||
|
||||
protected function show_disconnect_repository_button() {
|
||||
?>
|
||||
<form name="gitium_form_disconnect" id="gitium_form_disconnect" action="" method="POST">
|
||||
<?php
|
||||
wp_nonce_field( 'gitium-admin' );
|
||||
?>
|
||||
<input type="submit" name="GitiumSubmitDisconnectRepository" value='<?php _e( 'Disconnect from repo', 'gitium' ); ?>' class="button secondary" onclick="return confirm('<?php _e( 'Are you sure you want to disconnect from the remote repository?', 'gitium' ); ?>')"/>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
}
|
117
wp-content/plugins/gitium/inc/class-gitium-requirements.php
Normal file
117
wp-content/plugins/gitium/inc/class-gitium-requirements.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Requirements {
|
||||
|
||||
private $req = array();
|
||||
private $msg = array();
|
||||
|
||||
/**
|
||||
* Gitium requires:
|
||||
* git min version
|
||||
* the function proc_open available
|
||||
* PHP min version
|
||||
* can exec the file inc/ssh-git
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->_check_req();
|
||||
add_action( GITIUM_ADMIN_NOTICES_ACTION, array( $this, 'admin_notices' ) );
|
||||
}
|
||||
|
||||
private function _check_req() {
|
||||
list($this->req['is_git_version'], $this->msg['is_git_version'] ) = $this->is_git_version();
|
||||
list($this->req['is_proc_open'], $this->msg['is_proc_open'] ) = $this->is_proc_open();
|
||||
list($this->req['is_php_verion'], $this->msg['is_php_verion'] ) = $this->is_php_version();
|
||||
list($this->req['can_exec_ssh_git_file'],$this->msg['can_exec_ssh_git_file']) = $this->can_exec_ssh_git_file();
|
||||
|
||||
return $this->req;
|
||||
}
|
||||
|
||||
public function admin_notices() {
|
||||
if ( ! current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ( $this->req as $key => $value ) {
|
||||
if ( false === $value ) {
|
||||
echo "<div class='error-nag error'><p>Gitium Requirement: {$this->msg[$key]}</p></div>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get_status() {
|
||||
$requirements = $this->req;
|
||||
|
||||
foreach ( $requirements as $req ) :
|
||||
if ( false === $req ) :
|
||||
return false;
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function is_git_version() {
|
||||
$git_version = get_transient( 'gitium_git_version' );
|
||||
|
||||
if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
|
||||
global $git;
|
||||
$git_version = $git->get_version();
|
||||
set_transient( 'gitium_git_version', $git_version );
|
||||
if ( empty( $git_version ) ) {
|
||||
return array( false, 'There is no git installed on this server.' );
|
||||
} else if ( GITIUM_MIN_GIT_VER > substr( $git_version, 0, 3 ) ) {
|
||||
return array( false, "The git version is `$git_version` and must be greater than `" . GITIUM_MIN_GIT_VER . "`!" );
|
||||
}
|
||||
}
|
||||
|
||||
return array( true, "The git version is `$git_version`." );
|
||||
}
|
||||
|
||||
private function is_proc_open() {
|
||||
if ( ! function_exists( 'proc_open' ) ) {
|
||||
return array( false, 'The function `proc_open` is disabled!' );
|
||||
} else {
|
||||
return array( true, 'The function `proc_open` is enabled!' );
|
||||
}
|
||||
}
|
||||
|
||||
private function is_php_version() {
|
||||
if ( ! function_exists( 'phpversion' ) ) {
|
||||
return array( false, 'The function `phpversion` is disabled!' );
|
||||
} else {
|
||||
$php_version = phpversion();
|
||||
if ( GITIUM_MIN_PHP_VER <= substr( $php_version, 0, 3 ) ) {
|
||||
return array( true, "The PHP version is `$php_version`." );
|
||||
} else {
|
||||
return array( false, "The PHP version is `$php_version` and is not greater or equal to " . GITIUM_MIN_PHP_VER );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function can_exec_ssh_git_file() {
|
||||
$filepath = dirname( __FILE__ ) . '/ssh-git';
|
||||
|
||||
if ( ! function_exists( 'is_executable' ) ) {
|
||||
return array( false, 'The function `is_executable` is disabled!' );
|
||||
} else if ( is_executable( $filepath ) ) {
|
||||
return array( true, "The `$filepath` file can be executed!" );
|
||||
} else {
|
||||
return array( false, "The `$filepath` file is not executable" );
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Submenu_Commits extends Gitium_Menu {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct( $this->gitium_menu_slug, $this->commits_menu_slug );
|
||||
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) );
|
||||
}
|
||||
|
||||
public function admin_menu() {
|
||||
$submenu_hook = add_submenu_page(
|
||||
$this->menu_slug,
|
||||
__( 'Git Commits', 'gitium' ),
|
||||
__( 'Commits', 'gitium' ),
|
||||
GITIUM_MANAGE_OPTIONS_CAPABILITY,
|
||||
$this->submenu_slug,
|
||||
array( $this, 'page' )
|
||||
);
|
||||
new Gitium_Help( $submenu_hook, 'commits' );
|
||||
}
|
||||
|
||||
public function table_head() {
|
||||
?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?php _e( 'Commits', 'gitium' ); ?></th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function table_end_row() {
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
public function table_start_row() {
|
||||
static $counter = 0;
|
||||
$counter++;
|
||||
echo ( 0 != $counter % 2 ) ? '<tr class="active">' : '<tr class="inactive">';
|
||||
}
|
||||
|
||||
public function page() {
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2><?php printf( __( 'Last %s commits', 'gitium' ), GITIUM_LAST_COMMITS ); ?></h2>
|
||||
<table class="wp-list-table widefat plugins">
|
||||
<?php $this->table_head(); ?>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ( $this->git->get_last_commits( GITIUM_LAST_COMMITS ) as $commit_id => $data ) {
|
||||
unset( $committer_name );
|
||||
extract( $data );
|
||||
if ( isset( $committer_name ) ) {
|
||||
$committer = "<span title='$committer_email'> -> $committer_name " . sprintf( __( 'committed %s ago', 'gitium' ), human_time_diff( strtotime( $committer_date ) ) ) . '</span>';
|
||||
$committers_avatar = '<div style="position:absolute; left:30px; border: 1px solid white; background:white; height:17px; top:30px; border-radius:2px">' . get_avatar( $committer_email, 16 ) . '</div>';
|
||||
} else {
|
||||
$committer = '';
|
||||
$committers_avatar = '';
|
||||
}
|
||||
$this->table_start_row();
|
||||
?>
|
||||
<td style="position:relative">
|
||||
<div style="float:left; width:auto; height:auto; padding-left:2px; padding-right:5px; padding-top:2px; margin-right:5px; border-radius:2px"><?php echo get_avatar( $author_email, 32 ); ?></div>
|
||||
<?php echo $committers_avatar; ?>
|
||||
<div style="float:left; width:auto; height:auto;"><strong><?php echo esc_html( $subject ); ?></strong><br />
|
||||
<span title="<?php echo esc_attr( $author_email ); ?>"><?php echo esc_html( $author_name ) . ' ' . sprintf( __( 'authored %s ago', 'gitium' ), human_time_diff( strtotime( $author_date ) ) ); ?></span><?php echo $committer; ?></div>
|
||||
</td>
|
||||
<td><p style="padding-top:8px"><?php echo $commit_id; ?></p></td>
|
||||
<?php
|
||||
$this->table_end_row();
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
253
wp-content/plugins/gitium/inc/class-gitium-submenu-configure.php
Normal file
253
wp-content/plugins/gitium/inc/class-gitium-submenu-configure.php
Normal file
@ -0,0 +1,253 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Submenu_Configure extends Gitium_Menu {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct( $this->gitium_menu_slug, $this->gitium_menu_slug );
|
||||
|
||||
if ( current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {
|
||||
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) );
|
||||
add_action( 'admin_init', array( $this, 'regenerate_keypair' ) );
|
||||
add_action( 'admin_init', array( $this, 'gitium_warning' ) );
|
||||
add_action( 'admin_init', array( $this, 'init_repo' ) );
|
||||
add_action( 'admin_init', array( $this, 'choose_branch' ) );
|
||||
add_action( 'admin_init', array( $this, 'disconnect_repository' ) );
|
||||
}
|
||||
}
|
||||
|
||||
public function admin_menu() {
|
||||
add_menu_page(
|
||||
__( 'Git Configuration', 'gitium' ),
|
||||
'Gitium',
|
||||
GITIUM_MANAGE_OPTIONS_CAPABILITY,
|
||||
$this->menu_slug,
|
||||
array( $this, 'page' ),
|
||||
plugins_url( 'img/gitium.png', dirname( __FILE__ ) )
|
||||
);
|
||||
|
||||
$submenu_hook = add_submenu_page(
|
||||
$this->menu_slug,
|
||||
__( 'Git Configuration', 'gitium' ),
|
||||
__( 'Configuration', 'gitium' ),
|
||||
GITIUM_MANAGE_OPTIONS_CAPABILITY,
|
||||
$this->menu_slug,
|
||||
array( $this, 'page' )
|
||||
);
|
||||
new Gitium_Help( $submenu_hook, 'configuration' );
|
||||
}
|
||||
|
||||
public function regenerate_keypair() {
|
||||
$submit_keypair = filter_input(INPUT_POST, 'GitiumSubmitRegenerateKeypair', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $submit_keypair ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-admin' );
|
||||
gitium_get_keypair( true );
|
||||
$this->success_redirect( __( 'Keypair successfully regenerated.', 'gitium' ) );
|
||||
}
|
||||
|
||||
public function gitium_warning() {
|
||||
$submit_warning = filter_input(INPUT_POST, 'GitiumSubmitWarning', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $submit_warning ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-admin' );
|
||||
$this->git->remove_wp_content_from_version_control();
|
||||
}
|
||||
|
||||
public function init_process( $remote_url ) {
|
||||
$git = $this->git;
|
||||
$git->init();
|
||||
$git->add_remote_url( $remote_url );
|
||||
$git->fetch_ref();
|
||||
if ( count( $git->get_remote_branches() ) == 0 ) {
|
||||
$git->add( 'wp-content', '.gitignore' );
|
||||
$current_user = wp_get_current_user();
|
||||
$git->commit( __( 'Initial commit', 'gitium' ), $current_user->display_name, $current_user->user_email );
|
||||
if ( ! $git->push( 'master' ) ) {
|
||||
$git->cleanup();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function init_repo() {
|
||||
$remote_url = filter_input(INPUT_POST, 'remote_url', FILTER_SANITIZE_STRING);
|
||||
$gitium_submit_fetch = filter_input(INPUT_POST, 'GitiumSubmitFetch', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $gitium_submit_fetch ) || ! isset( $remote_url ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-admin' );
|
||||
|
||||
if ( empty( $remote_url ) ) {
|
||||
$this->redirect( __( 'Please specify a valid repo.', 'gitium' ) );
|
||||
}
|
||||
if ( $this->init_process( $remote_url ) ) {
|
||||
$this->success_redirect( __( 'Repository initialized successfully.', 'gitium' ) );
|
||||
} else {
|
||||
global $git;
|
||||
$this->redirect( __( 'Could not push to remote: ', 'gitium' ) . $remote_url . ' ERROR: ' . serialize( $git->get_last_error() ) );
|
||||
}
|
||||
}
|
||||
|
||||
public function choose_branch() {
|
||||
$gitium_submit_merge_push = filter_input(INPUT_POST, 'GitiumSubmitMergeAndPush', FILTER_SANITIZE_STRING);
|
||||
$tracking_branch = filter_input(INPUT_POST, 'tracking_branch', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $gitium_submit_merge_push ) || ! isset( $tracking_branch ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-admin' );
|
||||
$this->git->add();
|
||||
|
||||
$branch = $tracking_branch;
|
||||
set_transient( 'gitium_remote_tracking_branch', $branch );
|
||||
$current_user = wp_get_current_user();
|
||||
|
||||
$commit = $this->git->commit( __( 'Merged existing code from ', 'gitium' ) . get_home_url(), $current_user->display_name, $current_user->user_email );
|
||||
if ( ! $commit ) {
|
||||
$this->git->cleanup();
|
||||
$this->redirect( __( 'Could not create initial commit -> ', 'gitium' ) . $this->git->get_last_error() );
|
||||
}
|
||||
if ( ! $this->git->merge_initial_commit( $commit, $branch ) ) {
|
||||
$this->git->cleanup();
|
||||
$this->redirect( __( 'Could not merge the initial commit -> ', 'gitium' ) . $this->git->get_last_error() );
|
||||
}
|
||||
$this->git->push( $branch );
|
||||
$this->success_redirect( __( 'Branch selected successfully.', 'gitium' ) );
|
||||
}
|
||||
|
||||
private function setup_step_1_remote_url() {
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><label for="remote_url"><?php _e( 'Remote URL', 'gitium' ); ?></label></th>
|
||||
<td>
|
||||
<input type="text" class="regular-text" name="remote_url" id="remote_url" placeholder="git@github.com:user/example.git" value="">
|
||||
<p class="description"><?php _e( 'This URL provide access to a Git repository via SSH, HTTPS, or Subversion.', 'gitium' ); ?><br />
|
||||
<?php _e( 'If you need to authenticate over "https://" instead of SSH use: <code>https://user:pass@github.com/user/example.git</code>', 'gitium' ); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function setup_step_1_key_pair() {
|
||||
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) :
|
||||
list( $git_public_key, ) = gitium_get_keypair(); ?>
|
||||
<tr>
|
||||
<th scope="row"><label for="key_pair"><?php _e( 'Key pair', 'gitium' ); ?></label></th>
|
||||
<td>
|
||||
<p>
|
||||
<input type="text" class="regular-text" name="key_pair" id="key_pair" value="<?php echo esc_attr( $git_public_key ); ?>" readonly="readonly">
|
||||
<input type="submit" name="GitiumSubmitRegenerateKeypair" class="button" value="<?php _e( 'Regenerate Key', 'gitium' ); ?>" />
|
||||
</p>
|
||||
<p class="description"><?php _e( 'If your code use ssh keybased authentication for git you need to allow write access to your repository using this key.', 'gitium' ); ?><br />
|
||||
<?php _e( 'Checkout instructions for <a href="https://help.github.com/articles/generating-ssh-keys#step-3-add-your-ssh-key-to-github" target="_blank">github</a> or <a href="https://confluence.atlassian.com/display/BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-HowtoaddakeyusingSSHforOSXorLinux" target="_blank">bitbucket</a>.', 'gitium' ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;
|
||||
}
|
||||
|
||||
private function setup_warning() {
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2><?php _e( 'Warning!', 'gitium' ); ?></h2>
|
||||
<form name="gitium_form_warning" id="gitium_form_warning" action="" method="POST">
|
||||
<?php wp_nonce_field( 'gitium-admin' ); ?>
|
||||
<p><code>wp-content</code> is already under version control. You <a onclick="document.getElementById('gitium_form_warning').submit();" style="color:red;" href="#">must remove it from version control</a> in order to continue.</p>
|
||||
<p><strong>NOTE</strong> by doing this you WILL LOSE commit history, but NOT the actual files.</p>
|
||||
<input type="hidden" name="GitiumSubmitWarning" class="button-primary" value="1" />
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function setup_step_1() {
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2><?php _e( 'Configuration step 1', 'gitium' ); ?></h2>
|
||||
<p><?php _e( 'If you need help to set this up, please click on the "Help" button from the top right corner of this screen.' ); ?></p>
|
||||
<form action="" method="POST">
|
||||
<?php wp_nonce_field( 'gitium-admin' ); ?>
|
||||
<table class="form-table">
|
||||
<?php $this->setup_step_1_remote_url(); ?>
|
||||
<?php $this->setup_step_1_key_pair(); ?>
|
||||
</table>
|
||||
<p class="submit">
|
||||
<input type="submit" name="GitiumSubmitFetch" class="button-primary" value="<?php _e( 'Fetch', 'gitium' ); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function setup_step_2() {
|
||||
$git = $this->git; ?>
|
||||
<div class="wrap">
|
||||
<h2><?php _e( 'Configuration step 2', 'gitium' ); ?></h2>
|
||||
<p><?php _e( 'If you need help to set this up, please click on the "Help" button from the top right corner of this screen.' ); ?></p>
|
||||
|
||||
|
||||
<form action="" method="POST">
|
||||
<?php wp_nonce_field( 'gitium-admin' ); ?>
|
||||
|
||||
<table class="form-table">
|
||||
<tr>
|
||||
<th scope="row"><label for="tracking_branch"><?php _e( 'Choose tracking branch', 'gitium' ); ?></label></th>
|
||||
<td>
|
||||
<select name="tracking_branch" id="tracking_branch">
|
||||
<?php foreach ( $git->get_remote_branches() as $branch ) : ?>
|
||||
<option value="<?php echo esc_attr( $branch ); ?>"><?php echo esc_html( $branch ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<p class="description"><?php _e( 'Your code origin is set to', 'gitium' ); ?> <code><?php echo esc_html( $git->get_remote_url() ); ?></code></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p class="submit">
|
||||
<input type="submit" name="GitiumSubmitMergeAndPush" class="button-primary" value="<?php _e( 'Merge & Push', 'gitium' ); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
<?php
|
||||
$this->show_disconnect_repository_button();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function page() {
|
||||
$this->show_message();
|
||||
|
||||
if ( wp_content_is_versioned() ) {
|
||||
return $this->setup_warning();
|
||||
}
|
||||
|
||||
if ( ! $this->git->is_status_working() || ! $this->git->get_remote_url() ) {
|
||||
return $this->setup_step_1();
|
||||
}
|
||||
|
||||
if ( ! $this->git->get_remote_tracking_branch() ) {
|
||||
return $this->setup_step_2();
|
||||
}
|
||||
|
||||
_gitium_status( true );
|
||||
gitium_update_is_status_working();
|
||||
gitium_update_remote_tracking_branch();
|
||||
}
|
||||
}
|
139
wp-content/plugins/gitium/inc/class-gitium-submenu-settings.php
Normal file
139
wp-content/plugins/gitium/inc/class-gitium-submenu-settings.php
Normal file
@ -0,0 +1,139 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Submenu_Settings extends Gitium_Menu {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct( $this->gitium_menu_slug, $this->settings_menu_slug );
|
||||
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) );
|
||||
add_action( 'admin_init', array( $this, 'save' ) );
|
||||
add_action( 'admin_init', array( $this, 'regenerate_webhook' ) );
|
||||
add_action( 'admin_init', array( $this, 'regenerate_public_key' ) );
|
||||
}
|
||||
|
||||
public function admin_menu() {
|
||||
$submenu_hook = add_submenu_page(
|
||||
$this->menu_slug,
|
||||
'Settings',
|
||||
__( 'Settings' ),
|
||||
GITIUM_MANAGE_OPTIONS_CAPABILITY,
|
||||
$this->submenu_slug,
|
||||
array( $this, 'page' )
|
||||
);
|
||||
new Gitium_Help( $submenu_hook, 'settings' );
|
||||
}
|
||||
|
||||
public function regenerate_webhook() {
|
||||
$gitium_regen_webhook = filter_input(INPUT_POST, 'GitiumSubmitRegenerateWebhook', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $gitium_regen_webhook ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-settings' );
|
||||
gitium_get_webhook_key( true );
|
||||
$this->success_redirect( __( 'Webhook URL regenerates. Please make sure you update any external references.', 'gitium' ), $this->settings_menu_slug );
|
||||
}
|
||||
|
||||
public function regenerate_public_key() {
|
||||
$submit_regenerate_pub_key = filter_input(INPUT_POST, 'GitiumSubmitRegeneratePublicKey', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $submit_regenerate_pub_key ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-settings' );
|
||||
gitium_get_keypair( true );
|
||||
$this->success_redirect( __( 'Public key successfully regenerated.', 'gitium' ), $this->settings_menu_slug );
|
||||
}
|
||||
|
||||
private function show_webhook_table_webhook_url() {
|
||||
?>
|
||||
<tr>
|
||||
<th><label for="webhook-url"><?php _e( 'Webhook URL', 'gitium' ); ?>:</label></th>
|
||||
<td>
|
||||
<p><code id="webhook-url"><?php echo esc_url( gitium_get_webhook() ); ?></code>
|
||||
<?php if ( ! defined( 'GIT_WEBHOOK_URL' ) || GIT_WEBHOOK_URL == '' ) : ?>
|
||||
<input type="submit" name="GitiumSubmitRegenerateWebhook" class="button" value="<?php _e( 'Regenerate Webhook', 'gitium' ); ?>" />
|
||||
<a class="button" href="<?php echo esc_url( gitium_get_webhook() ); ?>" target="_blank">Merge changes</a></p>
|
||||
<?php endif; ?>
|
||||
<p class="description"><?php _e( 'Pinging this URL triggers an update from remote repository.', 'gitium' ); ?></p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function show_webhook_table_public_key() {
|
||||
list( $git_public_key, ) = gitium_get_keypair();
|
||||
if ( ! defined( 'GIT_KEY_FILE' ) || GIT_KEY_FILE == '' ) : ?>
|
||||
<tr>
|
||||
<th><label for="public-key"><?php _e( 'Public Key', 'gitium' ); ?>:</label></th>
|
||||
<td>
|
||||
<p><input type="text" class="regular-text" name="public_key" id="public-key" value="<?php echo esc_attr( $git_public_key ); ?>" readonly="readonly">
|
||||
<input type="submit" name="GitiumSubmitRegeneratePublicKey" class="button" value="<?php _e( 'Regenerate Key', 'gitium' ); ?>" /></p>
|
||||
<p class="description"><?php _e( 'If your code use ssh keybased authentication for git you need to allow write access to your repository using this key.', 'gitium' ); ?><br />
|
||||
<?php _e( 'Checkout instructions for <a href="https://help.github.com/articles/generating-ssh-keys#step-3-add-your-ssh-key-to-github" target="_blank">github</a> or <a href="https://confluence.atlassian.com/display/BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-HowtoaddakeyusingSSHforOSXorLinux" target="_blank">bitbucket</a>.', 'gitium' ); ?>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif;
|
||||
}
|
||||
|
||||
public function show_webhook_table() {
|
||||
?>
|
||||
<table class="form-table">
|
||||
<?php $this->show_webhook_table_webhook_url() ?>
|
||||
<?php $this->show_webhook_table_public_key(); ?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function save() {
|
||||
$submit_save = filter_input(INPUT_POST, 'GitiumSubmitSave', FILTER_SANITIZE_STRING);
|
||||
$gitignore_content = filter_input(INPUT_POST, 'gitignore_content', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $submit_save ) || ! isset( $gitignore_content ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-settings' );
|
||||
|
||||
if ( $this->git->set_gitignore( $gitignore_content ) ) {
|
||||
gitium_commit_and_push_gitignore_file();
|
||||
$this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->settings_menu_slug );
|
||||
} else {
|
||||
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->settings_menu_slug );
|
||||
}
|
||||
}
|
||||
|
||||
public function page() {
|
||||
$this->show_message();
|
||||
?>
|
||||
<div class="wrap">
|
||||
<h2><?php _e( 'Gitium Settings', 'gitium' ); ?></h2>
|
||||
|
||||
<form action="" method="POST">
|
||||
<?php wp_nonce_field( 'gitium-settings' ) ?>
|
||||
|
||||
<p><span style="color:red;"><?php _e( 'Be careful when you modify this list!', 'gitium' ); ?></span></p>
|
||||
<textarea name="gitignore_content" rows="20" cols="140"><?php echo esc_html( $this->git->get_gitignore() ); ?></textarea>
|
||||
|
||||
<?php $this->show_webhook_table(); ?>
|
||||
<p class="submit">
|
||||
<input type="submit" name="GitiumSubmitSave" class="button-primary" value="<?php _e( 'Save', 'gitium' ); ?>" />
|
||||
</p>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
236
wp-content/plugins/gitium/inc/class-gitium-submenu-status.php
Normal file
236
wp-content/plugins/gitium/inc/class-gitium-submenu-status.php
Normal file
@ -0,0 +1,236 @@
|
||||
<?php
|
||||
/* Copyright 2014-2016 Presslabs SRL <ping@presslabs.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License, version 2, 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
|
||||
*/
|
||||
|
||||
class Gitium_Submenu_Status extends Gitium_Menu {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct( $this->gitium_menu_slug, $this->gitium_menu_slug );
|
||||
|
||||
if ( current_user_can( GITIUM_MANAGE_OPTIONS_CAPABILITY ) ) {
|
||||
add_action( GITIUM_ADMIN_MENU_ACTION, array( $this, 'admin_menu' ) );
|
||||
add_action( 'admin_init', array( $this, 'save_changes' ) );
|
||||
add_action( 'admin_init', array( $this, 'save_ignorelist' ) );
|
||||
add_action( 'admin_init', array( $this, 'disconnect_repository' ) );
|
||||
}
|
||||
}
|
||||
|
||||
public function admin_menu() {
|
||||
add_menu_page(
|
||||
__( 'Git Status', 'gitium' ),
|
||||
'Gitium',
|
||||
GITIUM_MANAGE_OPTIONS_CAPABILITY,
|
||||
$this->menu_slug,
|
||||
array( $this, 'page' ),
|
||||
plugins_url( 'img/gitium.png', dirname( __FILE__ ) )
|
||||
);
|
||||
|
||||
$submenu_hook = add_submenu_page(
|
||||
$this->menu_slug,
|
||||
__( 'Git Status', 'gitium' ),
|
||||
__( 'Status', 'gitium' ),
|
||||
GITIUM_MANAGE_OPTIONS_CAPABILITY,
|
||||
$this->menu_slug,
|
||||
array( $this, 'page' )
|
||||
);
|
||||
new Gitium_Help( $submenu_hook, 'status' );
|
||||
}
|
||||
|
||||
private function get_change_meanings() {
|
||||
return array(
|
||||
'??' => __( 'untracked', 'gitium' ),
|
||||
'rM' => __( 'modified on remote', 'gitium' ),
|
||||
'rA' => __( 'added to remote', 'gitium' ),
|
||||
'rD' => __( 'deleted from remote', 'gitium' ),
|
||||
'D' => __( 'deleted from work tree', 'gitium' ),
|
||||
'M' => __( 'updated in work tree', 'gitium' ),
|
||||
'A' => __( 'added to work tree', 'gitium' ),
|
||||
'AM' => __( 'added to work tree', 'gitium' ),
|
||||
'R' => __( 'deleted from work tree', 'gitium' ),
|
||||
);
|
||||
}
|
||||
|
||||
public function humanized_change( $change ) {
|
||||
$meaning = $this->get_change_meanings();
|
||||
|
||||
if ( isset( $meaning[ $change ] ) ) {
|
||||
return $meaning[ $change ];
|
||||
}
|
||||
if ( 0 === strpos( $change, 'R ' ) ) {
|
||||
$old_filename = substr( $change, 2 );
|
||||
$change = sprintf( __( 'renamed from `%s`', 'gitium' ), $old_filename );
|
||||
}
|
||||
return $change;
|
||||
}
|
||||
|
||||
public function save_ignorelist() {
|
||||
$gitium_ignore_path = filter_input(INPUT_POST, 'GitiumIgnorePath', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $gitium_ignore_path ) ) {
|
||||
return;
|
||||
} else {
|
||||
$path = $gitium_ignore_path;
|
||||
}
|
||||
check_admin_referer( 'gitium-admin' );
|
||||
|
||||
if ( $this->git->set_gitignore( join( "\n", array_unique( array_merge( explode( "\n", $this->git->get_gitignore() ), array( $path ) ) ) ) ) ) {
|
||||
gitium_commit_and_push_gitignore_file( $path );
|
||||
$this->success_redirect( __( 'The file `.gitignore` is saved!', 'gitium' ), $this->gitium_menu_slug );
|
||||
} else {
|
||||
$this->redirect( __( 'The file `.gitignore` could not be saved!', 'gitium' ), false, $this->gitium_menu_slug );
|
||||
}
|
||||
}
|
||||
|
||||
public function save_changes() {
|
||||
$gitium_save_changes = filter_input(INPUT_POST, 'GitiumSubmitSaveChanges', FILTER_SANITIZE_STRING);
|
||||
$gitium_commit_msg = filter_input(INPUT_POST, 'commitmsg', FILTER_SANITIZE_STRING);
|
||||
if ( ! isset( $gitium_save_changes ) ) {
|
||||
return;
|
||||
}
|
||||
check_admin_referer( 'gitium-admin' );
|
||||
|
||||
gitium_enable_maintenance_mode() or wp_die( __( 'Could not enable the maintenance mode!', 'gitium' ) );
|
||||
$this->git->add();
|
||||
$commitmsg = sprintf( __( 'Merged changes from %s on %s', 'gitium' ), get_site_url(), date( 'm.d.Y' ) );
|
||||
if ( isset( $gitium_commit_msg ) && ! empty( $gitium_commit_msg ) ) {
|
||||
$commitmsg = $gitium_commit_msg;
|
||||
}
|
||||
$current_user = wp_get_current_user();
|
||||
$commit = $this->git->commit( $commitmsg, $current_user->display_name, $current_user->user_email );
|
||||
if ( ! $commit ) {
|
||||
$this->redirect( __( 'Could not commit!', 'gitium' ) );
|
||||
}
|
||||
$merge_success = gitium_merge_and_push( $commit );
|
||||
gitium_disable_maintenance_mode();
|
||||
if ( ! $merge_success ) {
|
||||
$this->redirect( __( 'Merge failed: ', 'gitium' ) . $this->git->get_last_error() );
|
||||
}
|
||||
$this->success_redirect( sprintf( __( 'Pushed commit: `%s`', 'gitium' ), $commitmsg ) );
|
||||
}
|
||||
|
||||
private function show_ahead_and_behind_info( $changes = '' ) {
|
||||
$branch = $this->git->get_remote_tracking_branch();
|
||||
$ahead = count( $this->git->get_ahead_commits() );
|
||||
$behind = count( $this->git->get_behind_commits() );
|
||||
?>
|
||||
<p>
|
||||
<?php printf( __( 'Following remote branch <code>%s</code>.', 'gitium' ), $branch );
|
||||
?> <?php
|
||||
if ( ! $ahead && ! $behind && empty( $changes ) ) {
|
||||
_e( 'Everything is up to date', 'gitium' );
|
||||
}
|
||||
if ( $ahead && $behind ) {
|
||||
printf( __( 'You are %s commits ahead and %s behind remote.', 'gitium' ), $ahead, $behind );
|
||||
} elseif ( $ahead ) {
|
||||
printf( __( 'You are %s commits ahead remote.', 'gitium' ), $ahead );
|
||||
} elseif ( $behind ) {
|
||||
printf( __( 'You are %s commits behind remote.', 'gitium' ), $behind );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function show_git_changes_table_rows( $changes = '' ) {
|
||||
?>
|
||||
<script type="application/javascript">
|
||||
function add_path_and_submit( elem ) {
|
||||
var container = document.getElementById( 'form_status' );
|
||||
var input = document.createElement( 'input' );
|
||||
input.type = 'hidden';
|
||||
input.name = 'GitiumIgnorePath';
|
||||
input.value = elem;
|
||||
container.appendChild( input );
|
||||
container.submit();
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
$counter = 0;
|
||||
foreach ( $changes as $path => $type ) :
|
||||
$counter++;
|
||||
echo ( 0 != $counter % 2 ) ? '<tr class="alternate">' : '<tr>';
|
||||
echo '<td><strong>' . esc_html( $path ) . '</strong>';
|
||||
echo '<div class="row-actions"><span class="edit"><a href="#" onclick="add_path_and_submit(\'' . $path . '\');">' . __( 'Add this file to the `.gitignore` list.', 'gitium' ) . '</a></span></div></td>';
|
||||
echo '<td>';
|
||||
if ( is_dir( ABSPATH . '/' . $path ) && is_dir( ABSPATH . '/' . trailingslashit( $path ) . '.git' ) ) { // test if is submodule
|
||||
_e( 'Submodules are not supported in this version.', 'gitium' );
|
||||
} else {
|
||||
echo '<span title="' . esc_html( $type ) .'">' . esc_html( $this->humanized_change( $type ) ) . '</span>';
|
||||
}
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
endforeach;
|
||||
}
|
||||
|
||||
private function show_git_changes_table( $changes = '' ) {
|
||||
?>
|
||||
<table class="widefat" id="git-changes-table">
|
||||
<thead><tr><th scope="col" class="manage-column"><?php _e( 'Path', 'gitium' ); ?></th><th scope="col" class="manage-column"><?php _e( 'Change', 'gitium' ); ?></th></tr></thead>
|
||||
<tfoot><tr><th scope="col" class="manage-column"><?php _e( 'Path', 'gitium' ); ?></th><th scope="col" class="manage-column"><?php _e( 'Change', 'gitium' ); ?></th></tr></tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
if ( empty( $changes ) ) :
|
||||
echo '<tr><td><p>';
|
||||
_e( 'Nothing to commit, working directory clean.', 'gitium' );
|
||||
echo '</p></td></tr>';
|
||||
else :
|
||||
$this->show_git_changes_table_rows( $changes );
|
||||
endif;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
|
||||
private function show_git_changes_table_submit_buttons( $changes ) {
|
||||
if ( ! empty( $changes ) ) : ?>
|
||||
<p>
|
||||
<label for="save-changes"><?php _e( 'Commit message', 'gitium' ); ?>:</label>
|
||||
<input type="text" name="commitmsg" id="save-changes" class="widefat" value="" placeholder="<?php printf( __( 'Merged changes from %s on %s', 'gitium' ), get_site_url(), date( 'm.d.Y' ) ); ?>" />
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" name="GitiumSubmitSaveChanges" class="button-primary button" value="<?php _e( 'Save changes', 'gitium' ); ?>" <?php if ( get_transient( 'gitium_remote_disconnected' ) ) { echo 'disabled="disabled" '; } ?>/>
|
||||
</p>
|
||||
<?php endif;
|
||||
}
|
||||
|
||||
private function changes_page() {
|
||||
list( , $changes ) = _gitium_status();
|
||||
?>
|
||||
<div class="wrap">
|
||||
<div id="icon-options-general" class="icon32"> </div>
|
||||
<h2><?php _e( 'Status', 'gitium' ); ?> <code class="small" style="background-color:forestgreen; color:whitesmoke;"><?php _e( 'connected to', 'gitium' ); ?> <strong><?php echo esc_html( $this->git->get_remote_url() ); ?></strong></code></h2>
|
||||
|
||||
<form name="form_status" id="form_status" action="" method="POST">
|
||||
<?php
|
||||
wp_nonce_field( 'gitium-admin' );
|
||||
$this->show_ahead_and_behind_info( $changes );
|
||||
$this->show_git_changes_table( $changes );
|
||||
$this->show_git_changes_table_submit_buttons( $changes );
|
||||
?>
|
||||
</form>
|
||||
<?php
|
||||
$this->show_disconnect_repository_button();
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
public function page() {
|
||||
$this->show_message();
|
||||
_gitium_status( true );
|
||||
$this->changes_page();
|
||||
}
|
||||
}
|
8
wp-content/plugins/gitium/inc/ssh-git
Executable file
8
wp-content/plugins/gitium/inc/ssh-git
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
SSH_AUTH_SOCK=''
|
||||
SSH="ssh -q -F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
|
||||
if [ -z "$GIT_KEY_FILE" ] ; then
|
||||
exec $SSH "$@"
|
||||
else
|
||||
exec $SSH -i "$GIT_KEY_FILE" "$@"
|
||||
fi
|
BIN
wp-content/plugins/gitium/languages/gitium-es_ES.mo
Normal file
BIN
wp-content/plugins/gitium/languages/gitium-es_ES.mo
Normal file
Binary file not shown.
546
wp-content/plugins/gitium/languages/gitium-es_ES.po
Normal file
546
wp-content/plugins/gitium/languages/gitium-es_ES.po
Normal file
@ -0,0 +1,546 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gitium\n"
|
||||
"POT-Creation-Date: 2014-10-20 19:06+0200\n"
|
||||
"PO-Revision-Date: 2014-11-13 11:20+0200\n"
|
||||
"Last-Translator: Presslabs <ping@presslabs.com>\n"
|
||||
"Language-Team: Presslabs <ping@presslabs.com>\n"
|
||||
"Language: English\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
"X-Poedit-KeywordsList: __;_e\n"
|
||||
"X-Poedit-Basepath: .\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-SearchPath-0: ..\n"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:34
|
||||
#: ../inc/class-gitium-submenu-configure.php:44
|
||||
msgid "Git Configuration"
|
||||
msgstr "Configuración Git"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:45
|
||||
msgid "Configuration"
|
||||
msgstr "Configuración"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:59
|
||||
msgid "Keypair successfully regenerated."
|
||||
msgstr "Par de claves regenerado con éxito."
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:78
|
||||
msgid "Initial commit"
|
||||
msgstr "Commit Inicial"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:94
|
||||
msgid "Please specify a valid repo."
|
||||
msgstr "Por favor, especifique un repo válido"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:99
|
||||
msgid "Could not push to remote"
|
||||
msgstr "No se pudo empujar al remoto"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:113
|
||||
msgid "Merged existing code from "
|
||||
msgstr "Código existente fusionado de"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:116
|
||||
msgid "Could not create initial commit -> "
|
||||
msgstr "No se pudo crear Commit inicial ->"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:120
|
||||
msgid "Could not merge the initial commit -> "
|
||||
msgstr "No se pudo fusionar el Commit inicial ->"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:129
|
||||
msgid "Remote URL"
|
||||
msgstr "URL remoto"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:132
|
||||
msgid ""
|
||||
"This URL provide access to a Git repository via SSH, HTTPS, or Subversion."
|
||||
msgstr ""
|
||||
"Este URL proporciona acceso a un repositorio Git vía SSH, HTTPS o Subversión."
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:133
|
||||
msgid ""
|
||||
"If you need to authenticate over \"https://\" instead of SSH use: "
|
||||
"<code>https://user:pass@github.com/user/example.git</code>"
|
||||
msgstr ""
|
||||
"Si necesita autenticar sobre \"https:// en lugar del uso de SSH: <code> "
|
||||
"https://user:pass@github.com/user/example.git </code>"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:143
|
||||
msgid "Key pair"
|
||||
msgstr "Par de claves"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:147
|
||||
#: ../inc/class-gitium-submenu-settings.php:80
|
||||
msgid "Regenerate Key"
|
||||
msgstr "Regenerar clave"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:149
|
||||
#: ../inc/class-gitium-submenu-settings.php:81
|
||||
msgid ""
|
||||
"If your code use ssh keybased authentication for git you need to allow write "
|
||||
"access to your repository using this key."
|
||||
msgstr ""
|
||||
"Si su código usa autenticación ssh keybased para git, usted necesita "
|
||||
"permitir el acceso de escritura a su repositorio utilizando esta clave."
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:150
|
||||
#: ../inc/class-gitium-submenu-settings.php:82
|
||||
msgid ""
|
||||
"Checkout instructions for <a href=\"https://help.github.com/articles/"
|
||||
"generating-ssh-keys#step-3-add-your-ssh-key-to-github\" target=\"_blank"
|
||||
"\">github</a> or <a href=\"https://confluence.atlassian.com/display/"
|
||||
"BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-"
|
||||
"HowtoaddakeyusingSSHforOSXorLinux\" target=\"_blank\">bitbucket</a>."
|
||||
msgstr ""
|
||||
"Instrucciones de Pedido para <a href=\"https://help.github.com/articles/"
|
||||
"generating-ssh-keys#step-3-add-your-ssh-key-to-github\" target=\"_blank"
|
||||
"\">github</a> or <a href=\"https://confluence.atlassian.com/display/"
|
||||
"BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-"
|
||||
"HowtoaddakeyusingSSHforOSXorLinux\"."
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:160
|
||||
msgid "Warning!"
|
||||
msgstr "¡Advertencia!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:174
|
||||
#: ../inc/class-gitium-help.php:47
|
||||
msgid "Configuration step 1"
|
||||
msgstr "Paso de configuración 1"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:175
|
||||
#: ../inc/class-gitium-submenu-configure.php:194
|
||||
msgid ""
|
||||
"If you need help to set this up, please click on the \"Help\" button from "
|
||||
"the top right corner of this screen."
|
||||
msgstr ""
|
||||
"Si necesita ayuda para configurar esto, por favor haga clic en el botón "
|
||||
"\"Ayuda\" de la esquina superior derecha de esta pantalla."
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:183
|
||||
msgid "Fetch"
|
||||
msgstr "Buscar"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:193
|
||||
#: ../inc/class-gitium-help.php:52
|
||||
msgid "Configuration step 2"
|
||||
msgstr "Paso de configuración 2"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:202
|
||||
msgid "Choose tracking branch"
|
||||
msgstr "Elija la rama de seguimiento"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:215
|
||||
msgid "Merge & Push"
|
||||
msgstr "Una & Empuje"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:32
|
||||
#: ../inc/class-gitium-submenu-status.php:42
|
||||
msgid "Git Status"
|
||||
msgstr "Estado Git"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:43
|
||||
#: ../inc/class-gitium-submenu-status.php:209 ../inc/class-gitium-help.php:59
|
||||
msgid "Status"
|
||||
msgstr "Estado"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:53
|
||||
msgid "untracked"
|
||||
msgstr "sin seguimiento"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:54
|
||||
msgid "modified on remote"
|
||||
msgstr "modificación en el remoto"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:55
|
||||
msgid "added to remote"
|
||||
msgstr "Agregado a remoto"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:56
|
||||
msgid "deleted from remote"
|
||||
msgstr "Borrado de remoto"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:57
|
||||
#: ../inc/class-gitium-submenu-status.php:61
|
||||
msgid "deleted from work tree"
|
||||
msgstr "Borrado del árbol de trabajo"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:58
|
||||
msgid "updated in work tree"
|
||||
msgstr "actualizado en el árbol de trabajo"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:59
|
||||
#: ../inc/class-gitium-submenu-status.php:60
|
||||
msgid "added to work tree"
|
||||
msgstr "añadido a árbol de trabajo"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:73
|
||||
#, php-format
|
||||
msgid "renamed from `%s`"
|
||||
msgstr "renombrado de `%s`"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:88
|
||||
#: ../inc/class-gitium-submenu-settings.php:106
|
||||
msgid "The file `.gitignore` is saved!"
|
||||
msgstr "¡El archivo` .gitignore` se guardó!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:90
|
||||
#: ../inc/class-gitium-submenu-settings.php:108
|
||||
msgid "The file `.gitignore` could not be saved!"
|
||||
msgstr "¡El archivo ` .gitignore` no pudo guardarse!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:100
|
||||
msgid "Could not enable the maintenance mode!"
|
||||
msgstr "No se pudo activar el modo de mantenimiento"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:102
|
||||
#: ../inc/class-gitium-submenu-status.php:196
|
||||
#, php-format
|
||||
msgid "Merged changes from %s on %s"
|
||||
msgstr "Cambios fusionados de %s en %s"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:109
|
||||
msgid "Could not commit!"
|
||||
msgstr "¡No pudo comprometerse!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:114
|
||||
msgid "Merge failed: "
|
||||
msgstr "Combinar falló:"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:116
|
||||
#, php-format
|
||||
msgid "Pushed commit: `%s`"
|
||||
msgstr "Empujado comprometer: `%s`"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:125
|
||||
#, php-format
|
||||
msgid "Following remote branch <code>%s</code>."
|
||||
msgstr "Siguiendo sucursal remota <code>%s</code>."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:127
|
||||
msgid "Everything is up to date"
|
||||
msgstr "Todo está actualizado"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:130
|
||||
#, php-format
|
||||
msgid "You are %s commits ahead and %s behind remote."
|
||||
msgstr "Usted está %s Commits por delante y %s por detrás del remoto."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:132
|
||||
#, php-format
|
||||
msgid "You are %s commits ahead remote."
|
||||
msgstr "Usted está %s Commits delante del remoto."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:134
|
||||
#, php-format
|
||||
msgid "You are %s commits behind remote."
|
||||
msgstr "Usted está %s Commits detrás del remoto."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:160
|
||||
msgid "Add this file to the `.gitignore` list."
|
||||
msgstr "Añadir este archivo a la lista `.gitignore`."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:163
|
||||
msgid "Submodules are not supported in this version."
|
||||
msgstr "Sub-módulos no son compatibles con esta versión."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:175
|
||||
#: ../inc/class-gitium-submenu-status.php:176
|
||||
msgid "Path"
|
||||
msgstr "Ruta"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:175
|
||||
#: ../inc/class-gitium-submenu-status.php:176
|
||||
msgid "Change"
|
||||
msgstr "Cambiar"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:181
|
||||
msgid "Nothing to commit, working directory clean."
|
||||
msgstr "Nada que comprometer, directorio de trabajo limpio."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:195
|
||||
msgid "Commit message"
|
||||
msgstr "Comprometer mensaje"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:199
|
||||
msgid "Save changes"
|
||||
msgstr "Guardar cambios"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:209
|
||||
msgid "connected to"
|
||||
msgstr "conectados a"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:32 ../inc/class-gitium-help.php:81
|
||||
msgid "Settings"
|
||||
msgstr "Ajustes"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:46
|
||||
msgid ""
|
||||
"Webhook URL regenerates. Please make sure you update any external references."
|
||||
msgstr ""
|
||||
"Webhook URL se regenera. Por favor, asegúrese de actualizar todas las "
|
||||
"referencias externas."
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:55
|
||||
msgid "Public key successfully regenerated."
|
||||
msgstr "Clave pública regenera con éxito."
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:61
|
||||
msgid "Webhook URL"
|
||||
msgstr "URL Webhook"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:65
|
||||
msgid "Regenerate Webhook"
|
||||
msgstr "Regenerar Webhook"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:67
|
||||
msgid "Pinging this URL triggers an update from remote repository."
|
||||
msgstr ""
|
||||
"Hacer ping en esta URL desencadena una actualización del repositorio remoto."
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:77
|
||||
msgid "Public Key"
|
||||
msgstr "Clave Pública"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:116
|
||||
msgid "Gitium Settings"
|
||||
msgstr "Ajustes Gitium"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:121
|
||||
msgid "Be careful when you modify this list!"
|
||||
msgstr "¡Tenga cuidado al modificar esta lista!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:126
|
||||
msgid "Save"
|
||||
msgstr "Guardar"
|
||||
|
||||
#: ../inc/class-gitium-help.php:26
|
||||
msgid "Gitium"
|
||||
msgstr "Gitium"
|
||||
|
||||
#: ../inc/class-gitium-help.php:27
|
||||
msgid "F.A.Q."
|
||||
msgstr "PF"
|
||||
|
||||
#: ../inc/class-gitium-help.php:32
|
||||
msgid ""
|
||||
"Gitium enables continuous deployment for WordPress integrating with tools "
|
||||
"such as Github, Bitbucket or Travis-CI. Plugin and theme updates, installs "
|
||||
"and removals are automatically versioned."
|
||||
msgstr ""
|
||||
"Gitium permite el despliegue continuo para integración de WordPress con "
|
||||
"herramientas como Github, Bitbucket o Travis-CI. El plugin y las "
|
||||
"actualizaciones de temas, instalaciones y eliminaciones están versionadas "
|
||||
"automáticamente."
|
||||
|
||||
#: ../inc/class-gitium-help.php:33
|
||||
msgid ""
|
||||
"Ninja code edits from the WordPress editor are also tracked into version "
|
||||
"control. Gitium is designed for sane development environments."
|
||||
msgstr ""
|
||||
"Las ediciones Código Ninja desde el editor de WordPress también son "
|
||||
"rastreadas en el control de versiones. Gitium está diseñado para entornos de "
|
||||
"desarrollo sanos."
|
||||
|
||||
#: ../inc/class-gitium-help.php:34
|
||||
msgid ""
|
||||
"Staging and production can follow different branches of the same repository. "
|
||||
"You can deploy code simply trough git push."
|
||||
msgstr ""
|
||||
"Puesta en escena y producción pueden seguir diferentes ramas del mismo "
|
||||
"repositorio. Puede implementar código simplemente a través git push."
|
||||
|
||||
#: ../inc/class-gitium-help.php:35
|
||||
msgid ""
|
||||
"Gitium requires <code>git</code> command line tool minimum version 1.7 "
|
||||
"installed on the server and <code>proc_open</code> PHP function enabled."
|
||||
msgstr ""
|
||||
"Gitium requiere la herramienta de línea de comandos<code> git </code>, "
|
||||
"mínimo la versión 1.7 instalada en el servidor y <code> proc_open </code> la "
|
||||
"función PHP habilitada."
|
||||
|
||||
#: ../inc/class-gitium-help.php:39
|
||||
msgid "Is this plugin considered stable?"
|
||||
msgstr "¿Es este plugin considerado estable?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:39
|
||||
msgid ""
|
||||
"Right now this plugin is considered alpha quality and should be used in "
|
||||
"production environments only by adventurous kinds."
|
||||
msgstr ""
|
||||
"Ahora mismo este plugin se considera de calidad alfa y debe utilizarse en "
|
||||
"entornos de producción sólo por tipos aventureros."
|
||||
|
||||
#: ../inc/class-gitium-help.php:40
|
||||
msgid "What happens in case of conflicts?"
|
||||
msgstr "¿Qué sucede en caso de conflictos?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:40
|
||||
msgid ""
|
||||
"The behavior in case of conflicts is to overwrite the changes on the origin "
|
||||
"repository with the local changes (ie. local modifications take precedence "
|
||||
"over remote ones)."
|
||||
msgstr ""
|
||||
"El comportamiento en caso de conflictos es sobrescribir los cambios en el "
|
||||
"repositorio de origen con los cambios locales (p.ej. las modificaciones "
|
||||
"locales toman precedencia sobre las remotas)."
|
||||
|
||||
#: ../inc/class-gitium-help.php:41
|
||||
msgid "How to deploy automatically after a push?"
|
||||
msgstr "¿Cómo implementar automáticamente después de un empujón?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:41
|
||||
msgid ""
|
||||
"You can ping the webhook url after a push to automatically deploy the new "
|
||||
"code. The webhook url can be found under Code menu. This url plays well with "
|
||||
"Github or Bitbucket webhooks."
|
||||
msgstr ""
|
||||
"Puede hacer ping en la url webhook después de un empujón para distribuir "
|
||||
"automáticamente el nuevo código. La url webhook se puede encontrar en el "
|
||||
"menú Código. Esta url juega bien con Github o BitBucket WebHooks."
|
||||
|
||||
#: ../inc/class-gitium-help.php:42
|
||||
msgid "Does it works on multi site setups?"
|
||||
msgstr "¿Trabaja en múltiples configuraciones de sitio?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:42
|
||||
msgid "Gitium is not supporting multisite setups at the moment."
|
||||
msgstr ""
|
||||
"Gitium no soporta a las configuraciones de múltiples sitios en este momento."
|
||||
|
||||
#: ../inc/class-gitium-help.php:43
|
||||
msgid "How does gitium handle submodules?"
|
||||
msgstr "¿Cómo manejar gitium los submódulos?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:43
|
||||
msgid "Currently submodules are not supported."
|
||||
msgstr "Actualmente los submódulos no son compatibles."
|
||||
|
||||
#: ../inc/class-gitium-help.php:47
|
||||
msgid ""
|
||||
"In this step you must specify the <code>Remote URL</code>. This URL "
|
||||
"represents the link between the git sistem and your site."
|
||||
msgstr ""
|
||||
"En esta etapa, se debe especificar el <code> URL remoto </code>. Esta URL "
|
||||
"representa el enlace entre el sistema git y su sitio."
|
||||
|
||||
#: ../inc/class-gitium-help.php:48
|
||||
msgid "You can get this URL from your Git repository and it looks like this:"
|
||||
msgstr ""
|
||||
"Usted puede obtener esta dirección URL de su repositorio Git y se ve así:"
|
||||
|
||||
#: ../inc/class-gitium-help.php:49
|
||||
msgid "github.com -> git@github.com:user/example.git"
|
||||
msgstr "github.com -> git@github.com:user/example.git"
|
||||
|
||||
#: ../inc/class-gitium-help.php:50
|
||||
msgid "bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git"
|
||||
msgstr "bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git"
|
||||
|
||||
#: ../inc/class-gitium-help.php:51
|
||||
msgid ""
|
||||
"To go to the next step, fill the <code>Remote URL</code> and then press the "
|
||||
"<code>Fetch</code> button."
|
||||
msgstr ""
|
||||
"Para ir al siguiente paso, llene la <code> URL remota </code> y pulse el "
|
||||
"botón <code> Buscar </code>."
|
||||
|
||||
#: ../inc/class-gitium-help.php:52
|
||||
msgid ""
|
||||
"In this step you must select the <code>branch</code> you want to follow."
|
||||
msgstr ""
|
||||
"En este paso deberá seleccionar la <code> rama </code> que desea seguir."
|
||||
|
||||
#: ../inc/class-gitium-help.php:53
|
||||
msgid "Only this branch will have all of your code modifications."
|
||||
msgstr "Sólo esta rama tendrá todas sus modificaciones de código."
|
||||
|
||||
#: ../inc/class-gitium-help.php:54
|
||||
msgid ""
|
||||
"When you push the button <code>Merge & Push</code>, all code(plugins & "
|
||||
"themes) will be pushed on the git repository."
|
||||
msgstr ""
|
||||
"Cuando se presiona el botón <code> Combinar y Empujar </code>, todo el "
|
||||
"código (plugins y temas) serán empujados en el repositorio git."
|
||||
|
||||
#: ../inc/class-gitium-help.php:64
|
||||
msgid ""
|
||||
"On status page you can see what files are modified, and you can commit the "
|
||||
"changes to git."
|
||||
msgstr ""
|
||||
"En la página de estado se puede ver qué archivos son modificados, y usted "
|
||||
"puede confirmar los cambios a Git."
|
||||
|
||||
#: ../inc/class-gitium-help.php:69 ../inc/class-gitium-submenu-commits.php:29
|
||||
#: ../inc/class-gitium-submenu-commits.php:41
|
||||
msgid "Commits"
|
||||
msgstr "Commits"
|
||||
|
||||
#: ../inc/class-gitium-help.php:74
|
||||
msgid ""
|
||||
"You may be wondering what is the difference between author and committer."
|
||||
msgstr ""
|
||||
"Usted puede preguntarse cuál es la diferencia entre el autor y el comitter."
|
||||
|
||||
#: ../inc/class-gitium-help.php:75
|
||||
msgid ""
|
||||
"The <code>author</code> is the person who originally wrote the patch, "
|
||||
"whereas the <code>committer</code> is the person who last applied the patch."
|
||||
msgstr ""
|
||||
"El <code> autor </code> es la persona que originalmente escribió el parche, "
|
||||
"mientras que el <code> committer </code> es la persona que aplicó el parche "
|
||||
"al final."
|
||||
|
||||
#: ../inc/class-gitium-help.php:76
|
||||
msgid ""
|
||||
"So, if you send in a patch to a project and one of the core members applies "
|
||||
"the patch, both of you get credit — you as the author and the core member as "
|
||||
"the committer."
|
||||
msgstr ""
|
||||
"Por lo tanto, si usted envía en un parche para un proyecto y uno de los "
|
||||
"principales miembros aplica el parche, ambos consiguen crédito - usted como "
|
||||
"el autor y el miembro de núcleo como el commiter."
|
||||
|
||||
#: ../inc/class-gitium-help.php:86
|
||||
msgid "Each line from the gitignore file specifies a pattern."
|
||||
msgstr "Cada línea del archivo gitignore especifica un patrón."
|
||||
|
||||
#: ../inc/class-gitium-help.php:87
|
||||
msgid ""
|
||||
"When deciding whether to ignore a path, Git normally checks gitignore "
|
||||
"patterns from multiple sources, with the following order of precedence, from "
|
||||
"highest to lowest (within one level of precedence, the last matching pattern "
|
||||
"decides the outcome)"
|
||||
msgstr ""
|
||||
"A la hora de decidir si se debe pasar por alto una ruta, Git normalmente "
|
||||
"comprueba patrones gitignore de múltiples fuentes, con el siguiente orden, "
|
||||
"de de mayor a menor (dentro de un nivel de prioridad, la última "
|
||||
"coincidencia de patrones decide el resultado)"
|
||||
|
||||
#: ../inc/class-gitium-help.php:88
|
||||
#, php-format
|
||||
msgid "Read more on %s"
|
||||
msgstr "Leer más en %s"
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:28
|
||||
msgid "Git Commits"
|
||||
msgstr "Commits Git"
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:61
|
||||
#, php-format
|
||||
msgid "Last %s commits"
|
||||
msgstr "Últimos commits %s"
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:70
|
||||
#, php-format
|
||||
msgid "committed %s ago"
|
||||
msgstr "cometido hace %s"
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:82
|
||||
#, php-format
|
||||
msgid "authored %s ago"
|
||||
msgstr "Creado hace %s"
|
BIN
wp-content/plugins/gitium/languages/gitium-sr_RS.mo
Normal file
BIN
wp-content/plugins/gitium/languages/gitium-sr_RS.mo
Normal file
Binary file not shown.
538
wp-content/plugins/gitium/languages/gitium-sr_RS.po
Normal file
538
wp-content/plugins/gitium/languages/gitium-sr_RS.po
Normal file
@ -0,0 +1,538 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gitium\n"
|
||||
"POT-Creation-Date: 2014-10-20 19:06+0200\n"
|
||||
"PO-Revision-Date: 2014-10-24 12:51+0200\n"
|
||||
"Last-Translator: Presslabs <ping@presslabs.com>\n"
|
||||
"Language-Team: Presslabs <ping@presslabs.com>\n"
|
||||
"Language: English\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
"X-Poedit-KeywordsList: __;_e\n"
|
||||
"X-Poedit-Basepath: .\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-SearchPath-0: ..\n"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:34
|
||||
#: ../inc/class-gitium-submenu-configure.php:44
|
||||
msgid "Git Configuration"
|
||||
msgstr "Git konfiguracija"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:45
|
||||
msgid "Configuration"
|
||||
msgstr "Konfiguracija"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:59
|
||||
msgid "Keypair successfully regenerated."
|
||||
msgstr "Par ključeva uspešno regenerisan"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:78
|
||||
msgid "Initial commit"
|
||||
msgstr "Početna uputstva"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:94
|
||||
msgid "Please specify a valid repo."
|
||||
msgstr "Odaberite važeće spremište"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:99
|
||||
msgid "Could not push to remote"
|
||||
msgstr "Neuspelo potiskivanje u udaljeno spremište"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:113
|
||||
msgid "Merged existing code from "
|
||||
msgstr "Postojeći kod spojen sa"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:116
|
||||
msgid "Could not create initial commit -> "
|
||||
msgstr "Neuspelo kreiranje početnog uputstva ->"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:120
|
||||
msgid "Could not merge the initial commit -> "
|
||||
msgstr "Neuspelo spajanje početnog uputstva ->"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:129
|
||||
msgid "Remote URL"
|
||||
msgstr "URL udaljenog spremišta"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:132
|
||||
msgid ""
|
||||
"This URL provide access to a Git repository via SSH, HTTPS, or Subversion."
|
||||
msgstr ""
|
||||
"Ovaj URL obezbeđuje pristup Git skladištu putem SSH-a, HTTPS-a ili "
|
||||
"Subverzije."
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:133
|
||||
msgid ""
|
||||
"If you need to authenticate over \"https://\" instead of SSH use: "
|
||||
"<code>https://user:pass@github.com/user/example.git</code>"
|
||||
msgstr ""
|
||||
"Ako treba da proverite preko \"https://\" umesto SSH, koristite: "
|
||||
"<code>https://user:pass@github.com/user/example.git</code>"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:143
|
||||
msgid "Key pair"
|
||||
msgstr "Par ključeva"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:147
|
||||
#: ../inc/class-gitium-submenu-settings.php:80
|
||||
msgid "Regenerate Key"
|
||||
msgstr "Ključ za regenerisanje"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:149
|
||||
#: ../inc/class-gitium-submenu-settings.php:81
|
||||
msgid ""
|
||||
"If your code use ssh keybased authentication for git you need to allow write "
|
||||
"access to your repository using this key."
|
||||
msgstr ""
|
||||
"Ako vaš kod koristi git autentifikaciju na osnovu ssh ključa, morate pismeno "
|
||||
"dozvoliti pristup svom spremištu uz pomoć ovog ključa. "
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:150
|
||||
#: ../inc/class-gitium-submenu-settings.php:82
|
||||
msgid ""
|
||||
"Checkout instructions for <a href=\"https://help.github.com/articles/"
|
||||
"generating-ssh-keys#step-3-add-your-ssh-key-to-github\" target=\"_blank"
|
||||
"\">github</a> or <a href=\"https://confluence.atlassian.com/display/"
|
||||
"BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-"
|
||||
"HowtoaddakeyusingSSHforOSXorLinux\" target=\"_blank\">bitbucket</a>."
|
||||
msgstr ""
|
||||
"Pogledajte uputstva na <a href=\"https://help.github.com/articles/generating-"
|
||||
"ssh-keys#step-3-add-your-ssh-key-to-github\" target=\"_blank\">github</a> "
|
||||
"ili <a href=\"https://confluence.atlassian.com/display/BITBUCKET/Add+an+SSH"
|
||||
"+key+to+an+account#AddanSSHkeytoanaccount-HowtoaddakeyusingSSHforOSXorLinux"
|
||||
"\" target=\"_blank\">bitbucket</a>."
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:160
|
||||
msgid "Warning!"
|
||||
msgstr "Upozorenje!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:174
|
||||
#: ../inc/class-gitium-help.php:47
|
||||
msgid "Configuration step 1"
|
||||
msgstr "Konfiguracija, korak 1"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:175
|
||||
#: ../inc/class-gitium-submenu-configure.php:194
|
||||
msgid ""
|
||||
"If you need help to set this up, please click on the \"Help\" button from "
|
||||
"the top right corner of this screen."
|
||||
msgstr ""
|
||||
"Ako vam treba pomoć za ovo podešavanje, kliknite na taster \"Pomoć\" u "
|
||||
"gornjem desnom uglu ekrana."
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:183
|
||||
msgid "Fetch"
|
||||
msgstr "Uzmi"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:193
|
||||
#: ../inc/class-gitium-help.php:52
|
||||
msgid "Configuration step 2"
|
||||
msgstr "Konfiguracija, korak 2"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:202
|
||||
msgid "Choose tracking branch"
|
||||
msgstr "Odaberite ogranak za praćenje"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:215
|
||||
msgid "Merge & Push"
|
||||
msgstr "Spoji & Potisni"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:32
|
||||
#: ../inc/class-gitium-submenu-status.php:42
|
||||
msgid "Git Status"
|
||||
msgstr "Git Status"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:43
|
||||
#: ../inc/class-gitium-submenu-status.php:209 ../inc/class-gitium-help.php:59
|
||||
msgid "Status"
|
||||
msgstr "Status"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:53
|
||||
msgid "untracked"
|
||||
msgstr "nepraćen"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:54
|
||||
msgid "modified on remote"
|
||||
msgstr "modifikovan na udaljenom skladištu"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:55
|
||||
msgid "added to remote"
|
||||
msgstr "dodat udaljenom skladištu"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:56
|
||||
msgid "deleted from remote"
|
||||
msgstr "obrisan sa udaljenog skladišta"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:57
|
||||
#: ../inc/class-gitium-submenu-status.php:61
|
||||
msgid "deleted from work tree"
|
||||
msgstr "obrisan sa radnog drveta"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:58
|
||||
msgid "updated in work tree"
|
||||
msgstr "ažuriran u radnom drvetu"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:59
|
||||
#: ../inc/class-gitium-submenu-status.php:60
|
||||
msgid "added to work tree"
|
||||
msgstr "dodat radnom drvetu"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:73
|
||||
#, php-format
|
||||
msgid "renamed from `%s`"
|
||||
msgstr "ime `%s` promenjeno"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:88
|
||||
#: ../inc/class-gitium-submenu-settings.php:106
|
||||
msgid "The file `.gitignore` is saved!"
|
||||
msgstr "Datoteka `.gitignore` je sačuvana!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:90
|
||||
#: ../inc/class-gitium-submenu-settings.php:108
|
||||
msgid "The file `.gitignore` could not be saved!"
|
||||
msgstr "Datoteka `.gitignore` ne može biti sačuvana!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:100
|
||||
msgid "Could not enable the maintenance mode!"
|
||||
msgstr "Režim održavanja nije mogao biti aktiviran!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:102
|
||||
#: ../inc/class-gitium-submenu-status.php:196
|
||||
#, php-format
|
||||
msgid "Merged changes from %s on %s"
|
||||
msgstr "Promene sa %s na %s spojene!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:109
|
||||
msgid "Could not commit!"
|
||||
msgstr "Neuspelo izvršenje!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:114
|
||||
msgid "Merge failed: "
|
||||
msgstr "Neuspelo spajanje:"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:116
|
||||
#, php-format
|
||||
msgid "Pushed commit: `%s`"
|
||||
msgstr "Preneto izvršenje: `%s`"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:125
|
||||
#, php-format
|
||||
msgid "Following remote branch <code>%s</code>."
|
||||
msgstr "Praćenje udaljenog ogranka<kod>%s</kod>."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:127
|
||||
msgid "Everything is up to date"
|
||||
msgstr "Sve je ažurirano"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:130
|
||||
#, php-format
|
||||
msgid "You are %s commits ahead and %s behind remote."
|
||||
msgstr "Vi ste %s izvršenja ispred i %s iza udaljenog spremišta."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:132
|
||||
#, php-format
|
||||
msgid "You are %s commits ahead remote."
|
||||
msgstr "Vi ste %s izvršenja ispred udaljenog spremišta."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:134
|
||||
#, php-format
|
||||
msgid "You are %s commits behind remote."
|
||||
msgstr "Vi ste %s izvršenja iza udaljenog spremišta."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:160
|
||||
msgid "Add this file to the `.gitignore` list."
|
||||
msgstr "Dodajte ovu datoteku `.gitignore` listi."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:163
|
||||
msgid "Submodules are not supported in this version."
|
||||
msgstr "U ovoj verziji nisu podržani submoduli."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:175
|
||||
#: ../inc/class-gitium-submenu-status.php:176
|
||||
msgid "Path"
|
||||
msgstr "Putanja"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:175
|
||||
#: ../inc/class-gitium-submenu-status.php:176
|
||||
msgid "Change"
|
||||
msgstr "Izmeni"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:181
|
||||
msgid "Nothing to commit, working directory clean."
|
||||
msgstr "Nema ničega za izvršenje, radni direktorijum je čist."
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:195
|
||||
msgid "Commit message"
|
||||
msgstr "Poruka o izvršenju"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:199
|
||||
msgid "Save changes"
|
||||
msgstr "Sačuvaj izmene"
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:209
|
||||
msgid "connected to"
|
||||
msgstr "povezan sa"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:32 ../inc/class-gitium-help.php:81
|
||||
msgid "Settings"
|
||||
msgstr "Podešavanja"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:46
|
||||
msgid ""
|
||||
"Webhook URL regenerates. Please make sure you update any external references."
|
||||
msgstr ""
|
||||
"Webhook URL se regeneriše. Proverite da li ste ažurirali eksterne reference."
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:55
|
||||
msgid "Public key successfully regenerated."
|
||||
msgstr "Javni ključ uspešno regenerisan."
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:61
|
||||
msgid "Webhook URL"
|
||||
msgstr "Webhook URL"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:65
|
||||
msgid "Regenerate Webhook"
|
||||
msgstr "Regeneriši webhook"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:67
|
||||
msgid "Pinging this URL triggers an update from remote repository."
|
||||
msgstr "Pingovanje ovog URL-a povlači ažuriranje iz udaljenog skladišta."
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:77
|
||||
msgid "Public Key"
|
||||
msgstr "Javni ključ"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:116
|
||||
msgid "Gitium Settings"
|
||||
msgstr "Gitium podešavanja"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:121
|
||||
msgid "Be careful when you modify this list!"
|
||||
msgstr "Oprezno menjajte ovu listu!"
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:126
|
||||
msgid "Save"
|
||||
msgstr "Sačuvaj"
|
||||
|
||||
#: ../inc/class-gitium-help.php:26
|
||||
msgid "Gitium"
|
||||
msgstr "Gitium"
|
||||
|
||||
#: ../inc/class-gitium-help.php:27
|
||||
msgid "F.A.Q."
|
||||
msgstr "Često postavljana pitanja"
|
||||
|
||||
#: ../inc/class-gitium-help.php:32
|
||||
msgid ""
|
||||
"Gitium enables continuous deployment for WordPress integrating with tools "
|
||||
"such as Github, Bitbucket or Travis-CI. Plugin and theme updates, installs "
|
||||
"and removals are automatically versioned."
|
||||
msgstr ""
|
||||
"Gitium omogućava kontinuiranu primenu WordPress integrisanja alatima, kao "
|
||||
"što su: Github, Bitbucket ili Travis-CI. Ažuriranja plugin-a i teme, "
|
||||
"instalacije i uklanjanja automatski su verzionirani."
|
||||
|
||||
#: ../inc/class-gitium-help.php:33
|
||||
msgid ""
|
||||
"Ninja code edits from the WordPress editor are also tracked into version "
|
||||
"control. Gitium is designed for sane development environments."
|
||||
msgstr ""
|
||||
"Nindža kod, koji uređuje iz WordPress uređivača, takođe se prati u kontroli "
|
||||
"verzije. Gitium je dizajniran za razumna razvojna okruženja."
|
||||
|
||||
#: ../inc/class-gitium-help.php:34
|
||||
msgid ""
|
||||
"Staging and production can follow different branches of the same repository. "
|
||||
"You can deploy code simply trough git push."
|
||||
msgstr ""
|
||||
"Postavljanje i proizvodnja mogu da prate različite grane istog spremišta. "
|
||||
"Možete da primenite kod jednostavno kroz git push."
|
||||
|
||||
#: ../inc/class-gitium-help.php:35
|
||||
msgid ""
|
||||
"Gitium requires <code>git</code> command line tool minimum version 1.7 "
|
||||
"installed on the server and <code>proc_open</code> PHP function enabled."
|
||||
msgstr ""
|
||||
"Gitium zahteva da na serveru bude instaliran <code>git</code> alat komandne "
|
||||
"linije, najmanje verzije 1.7 i <code>proc_open</code> aktiviranu PHP "
|
||||
"funkciju."
|
||||
|
||||
#: ../inc/class-gitium-help.php:39
|
||||
msgid "Is this plugin considered stable?"
|
||||
msgstr "Da li se ovaj plugin smatra stabilnim?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:39
|
||||
msgid ""
|
||||
"Right now this plugin is considered alpha quality and should be used in "
|
||||
"production environments only by adventurous kinds."
|
||||
msgstr ""
|
||||
"Trenutno se smatra da ovaj plugin ima alfa kvalitet i treba ga koristiti u "
|
||||
"okruženjima produkcije isključivo avanturističkog karaktera."
|
||||
|
||||
#: ../inc/class-gitium-help.php:40
|
||||
msgid "What happens in case of conflicts?"
|
||||
msgstr "Šta se dešava u slučaju konflikta?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:40
|
||||
msgid ""
|
||||
"The behavior in case of conflicts is to overwrite the changes on the origin "
|
||||
"repository with the local changes (ie. local modifications take precedence "
|
||||
"over remote ones)."
|
||||
msgstr ""
|
||||
"U slučaju konflikta treba poništiti izmene u prvobitnom spremištu, zajedno "
|
||||
"sa lokalnim izmenama (tj. Lokalne izmene imaju prednost u odnosu na "
|
||||
"udaljene)."
|
||||
|
||||
#: ../inc/class-gitium-help.php:41
|
||||
msgid "How to deploy automatically after a push?"
|
||||
msgstr "Kako izvršiti automatsko razmeštanje posle pritiska?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:41
|
||||
msgid ""
|
||||
"You can ping the webhook url after a push to automatically deploy the new "
|
||||
"code. The webhook url can be found under Code menu. This url plays well with "
|
||||
"Github or Bitbucket webhooks."
|
||||
msgstr ""
|
||||
"Možete pingovati url za webhook nakon pritiska za automatsko razmeštanje "
|
||||
"novog koda. URL za webhook možete naći u meniju koda. Ovaj url dobro radi uz "
|
||||
"Github ili Bitbucket webhooks."
|
||||
|
||||
#: ../inc/class-gitium-help.php:42
|
||||
msgid "Does it works on multi site setups?"
|
||||
msgstr "Da li radi na podešavanjima višestrukih site-ova?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:42
|
||||
msgid "Gitium is not supporting multisite setups at the moment."
|
||||
msgstr "Gitium trenutno ne podržava podešavanje višestrukih site-ova."
|
||||
|
||||
#: ../inc/class-gitium-help.php:43
|
||||
msgid "How does gitium handle submodules?"
|
||||
msgstr "Kako gitium upravlja submodulima?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:43
|
||||
msgid "Currently submodules are not supported."
|
||||
msgstr "Trenutno, submoduli nisu podržani."
|
||||
|
||||
#: ../inc/class-gitium-help.php:47
|
||||
msgid ""
|
||||
"In this step you must specify the <code>Remote URL</code>. This URL "
|
||||
"represents the link between the git sistem and your site."
|
||||
msgstr ""
|
||||
"U ovom koraku morate odrediti <code>Udaljeni URL</code>. Ovaj URL "
|
||||
"predstavlja vezu između git sistema i vašeg site-a."
|
||||
|
||||
#: ../inc/class-gitium-help.php:48
|
||||
msgid "You can get this URL from your Git repository and it looks like this:"
|
||||
msgstr "Ovaj URL možete dobiti iz svog Git spremišta i on izgleda ovako:"
|
||||
|
||||
#: ../inc/class-gitium-help.php:49
|
||||
msgid "github.com -> git@github.com:user/example.git"
|
||||
msgstr "github.com -> git@github.com:user/example.git"
|
||||
|
||||
#: ../inc/class-gitium-help.php:50
|
||||
msgid "bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git"
|
||||
msgstr "bitbucket.org -> git@bitbucket.org:user/glowing-happines.git"
|
||||
|
||||
#: ../inc/class-gitium-help.php:51
|
||||
msgid ""
|
||||
"To go to the next step, fill the <code>Remote URL</code> and then press the "
|
||||
"<code>Fetch</code> button."
|
||||
msgstr ""
|
||||
"Da biste prešli na sledeći korak, popunite <code>Udaljeni URL</code> i "
|
||||
"pritisnite <code>Dobavi</code> taster."
|
||||
|
||||
#: ../inc/class-gitium-help.php:52
|
||||
msgid ""
|
||||
"In this step you must select the <code>branch</code> you want to follow."
|
||||
msgstr ""
|
||||
"U ovom koraku morate odabrati <code>ogranak</code> koji želite da pratite. "
|
||||
|
||||
#: ../inc/class-gitium-help.php:53
|
||||
msgid "Only this branch will have all of your code modifications."
|
||||
msgstr "Samo će ovaj ogranak imati sve vaše modifikacije koda."
|
||||
|
||||
#: ../inc/class-gitium-help.php:54
|
||||
msgid ""
|
||||
"When you push the button <code>Merge & Push</code>, all code(plugins & "
|
||||
"themes) will be pushed on the git repository."
|
||||
msgstr ""
|
||||
"Kad kliknete na taster <code>Spoji & Potisni</code> svi (plugin-ovi i teme) "
|
||||
"koda biće potisnuti u git spremište."
|
||||
|
||||
#: ../inc/class-gitium-help.php:64
|
||||
msgid ""
|
||||
"On status page you can see what files are modified, and you can commit the "
|
||||
"changes to git."
|
||||
msgstr ""
|
||||
"Na stranici statusa možete videti koje su datoteke izmenjene i možete uneti "
|
||||
"izmene u git."
|
||||
|
||||
#: ../inc/class-gitium-help.php:69 ../inc/class-gitium-submenu-commits.php:29
|
||||
#: ../inc/class-gitium-submenu-commits.php:41
|
||||
msgid "Commits"
|
||||
msgstr "Izvršenja"
|
||||
|
||||
#: ../inc/class-gitium-help.php:74
|
||||
msgid ""
|
||||
"You may be wondering what is the difference between author and committer."
|
||||
msgstr "Možda se pitate u čemu je razlika između autora i izvršioca?"
|
||||
|
||||
#: ../inc/class-gitium-help.php:75
|
||||
msgid ""
|
||||
"The <code>author</code> is the person who originally wrote the patch, "
|
||||
"whereas the <code>committer</code> is the person who last applied the patch."
|
||||
msgstr ""
|
||||
"<code>Autor</code> je osoba koja je originalno napisala zakrpu, dok je "
|
||||
"<code>izvršilac</code> osoba koja je poslednja primenila zakrpu."
|
||||
|
||||
#: ../inc/class-gitium-help.php:76
|
||||
msgid ""
|
||||
"So, if you send in a patch to a project and one of the core members applies "
|
||||
"the patch, both of you get credit — you as the author and the core member as "
|
||||
"the committer."
|
||||
msgstr ""
|
||||
"Dakle, ako pošaljete zakrpu projektu i jedan od ključnih članova je primeni "
|
||||
"- oboje dobijate zasluge - vi kao autor, a ključni član kao izvršilac."
|
||||
|
||||
#: ../inc/class-gitium-help.php:86
|
||||
msgid "Each line from the gitignore file specifies a pattern."
|
||||
msgstr "Svaka linija iz gitignore datoteke označava šablon."
|
||||
|
||||
#: ../inc/class-gitium-help.php:87
|
||||
msgid ""
|
||||
"When deciding whether to ignore a path, Git normally checks gitignore "
|
||||
"patterns from multiple sources, with the following order of precedence, from "
|
||||
"highest to lowest (within one level of precedence, the last matching pattern "
|
||||
"decides the outcome)"
|
||||
msgstr ""
|
||||
"Kad odlučujete o tome da li ćete ignorisati putanju, Git obično proverava "
|
||||
"gitignore šablone iz višestrukih izvora, sa sledećim redosledom - od "
|
||||
"najvišeg do najnižeg (u okviru jednog nivoa prednosti, poslednji šablon koji "
|
||||
"se poklapa odlučuje o ishodu)."
|
||||
|
||||
#: ../inc/class-gitium-help.php:88
|
||||
#, php-format
|
||||
msgid "Read more on %s"
|
||||
msgstr "Pročitajte više o %s"
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:28
|
||||
msgid "Git Commits"
|
||||
msgstr "Git izvršenja"
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:61
|
||||
#, php-format
|
||||
msgid "Last %s commits"
|
||||
msgstr "Poslednja %s izvršenja"
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:70
|
||||
#, php-format
|
||||
msgid "committed %s ago"
|
||||
msgstr "izvršena pre %s"
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:82
|
||||
#, php-format
|
||||
msgid "authored %s ago"
|
||||
msgstr "autorizovana pre %s"
|
489
wp-content/plugins/gitium/languages/gitium.pot
Normal file
489
wp-content/plugins/gitium/languages/gitium.pot
Normal file
@ -0,0 +1,489 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Gitium\n"
|
||||
"POT-Creation-Date: 2014-10-20 19:06+0200\n"
|
||||
"PO-Revision-Date: 2014-10-20 19:06+0200\n"
|
||||
"Last-Translator: Presslabs <ping@presslabs.com>\n"
|
||||
"Language-Team: Presslabs <ping@presslabs.com>\n"
|
||||
"Language: English\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
"X-Poedit-KeywordsList: __;_e\n"
|
||||
"X-Poedit-Basepath: .\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-SearchPath-0: ..\n"
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:34
|
||||
#: ../inc/class-gitium-submenu-configure.php:44
|
||||
msgid "Git Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:45
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:59
|
||||
msgid "Keypair successfully regenerated."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:78
|
||||
msgid "Initial commit"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:94
|
||||
msgid "Please specify a valid repo."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:99
|
||||
msgid "Could not push to remote"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:113
|
||||
msgid "Merged existing code from "
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:116
|
||||
msgid "Could not create initial commit -> "
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:120
|
||||
msgid "Could not merge the initial commit -> "
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:129
|
||||
msgid "Remote URL"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:132
|
||||
msgid ""
|
||||
"This URL provide access to a Git repository via SSH, HTTPS, or Subversion."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:133
|
||||
msgid ""
|
||||
"If you need to authenticate over \"https://\" instead of SSH use: "
|
||||
"<code>https://user:pass@github.com/user/example.git</code>"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:143
|
||||
msgid "Key pair"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:147
|
||||
#: ../inc/class-gitium-submenu-settings.php:80
|
||||
msgid "Regenerate Key"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:149
|
||||
#: ../inc/class-gitium-submenu-settings.php:81
|
||||
msgid ""
|
||||
"If your code use ssh keybased authentication for git you need to allow write "
|
||||
"access to your repository using this key."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:150
|
||||
#: ../inc/class-gitium-submenu-settings.php:82
|
||||
msgid ""
|
||||
"Checkout instructions for <a href=\"https://help.github.com/articles/"
|
||||
"generating-ssh-keys#step-3-add-your-ssh-key-to-github\" target=\"_blank"
|
||||
"\">github</a> or <a href=\"https://confluence.atlassian.com/display/"
|
||||
"BITBUCKET/Add+an+SSH+key+to+an+account#AddanSSHkeytoanaccount-"
|
||||
"HowtoaddakeyusingSSHforOSXorLinux\" target=\"_blank\">bitbucket</a>."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:160
|
||||
msgid "Warning!"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:174
|
||||
#: ../inc/class-gitium-help.php:47
|
||||
msgid "Configuration step 1"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:175
|
||||
#: ../inc/class-gitium-submenu-configure.php:194
|
||||
msgid ""
|
||||
"If you need help to set this up, please click on the \"Help\" button from "
|
||||
"the top right corner of this screen."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:183
|
||||
msgid "Fetch"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:193
|
||||
#: ../inc/class-gitium-help.php:52
|
||||
msgid "Configuration step 2"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:202
|
||||
msgid "Choose tracking branch"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-configure.php:215
|
||||
msgid "Merge & Push"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:32
|
||||
#: ../inc/class-gitium-submenu-status.php:42
|
||||
msgid "Git Status"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:43
|
||||
#: ../inc/class-gitium-submenu-status.php:209 ../inc/class-gitium-help.php:59
|
||||
msgid "Status"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:53
|
||||
msgid "untracked"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:54
|
||||
msgid "modified on remote"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:55
|
||||
msgid "added to remote"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:56
|
||||
msgid "deleted from remote"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:57
|
||||
#: ../inc/class-gitium-submenu-status.php:61
|
||||
msgid "deleted from work tree"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:58
|
||||
msgid "updated in work tree"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:59
|
||||
#: ../inc/class-gitium-submenu-status.php:60
|
||||
msgid "added to work tree"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:73
|
||||
#, php-format
|
||||
msgid "renamed from `%s`"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:88
|
||||
#: ../inc/class-gitium-submenu-settings.php:106
|
||||
msgid "The file `.gitignore` is saved!"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:90
|
||||
#: ../inc/class-gitium-submenu-settings.php:108
|
||||
msgid "The file `.gitignore` could not be saved!"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:100
|
||||
msgid "Could not enable the maintenance mode!"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:102
|
||||
#: ../inc/class-gitium-submenu-status.php:196
|
||||
#, php-format
|
||||
msgid "Merged changes from %s on %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:109
|
||||
msgid "Could not commit!"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:114
|
||||
msgid "Merge failed: "
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:116
|
||||
#, php-format
|
||||
msgid "Pushed commit: `%s`"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:125
|
||||
#, php-format
|
||||
msgid "Following remote branch <code>%s</code>."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:127
|
||||
msgid "Everything is up to date"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:130
|
||||
#, php-format
|
||||
msgid "You are %s commits ahead and %s behind remote."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:132
|
||||
#, php-format
|
||||
msgid "You are %s commits ahead remote."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:134
|
||||
#, php-format
|
||||
msgid "You are %s commits behind remote."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:160
|
||||
msgid "Add this file to the `.gitignore` list."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:163
|
||||
msgid "Submodules are not supported in this version."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:175
|
||||
#: ../inc/class-gitium-submenu-status.php:176
|
||||
msgid "Path"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:175
|
||||
#: ../inc/class-gitium-submenu-status.php:176
|
||||
msgid "Change"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:181
|
||||
msgid "Nothing to commit, working directory clean."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:195
|
||||
msgid "Commit message"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:199
|
||||
msgid "Save changes"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-status.php:209
|
||||
msgid "connected to"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:32 ../inc/class-gitium-help.php:81
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:46
|
||||
msgid ""
|
||||
"Webhook URL regenerates. Please make sure you update any external references."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:55
|
||||
msgid "Public key successfully regenerated."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:61
|
||||
msgid "Webhook URL"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:65
|
||||
msgid "Regenerate Webhook"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:67
|
||||
msgid "Pinging this URL triggers an update from remote repository."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:77
|
||||
msgid "Public Key"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:116
|
||||
msgid "Gitium Settings"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:121
|
||||
msgid "Be careful when you modify this list!"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-settings.php:126
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:26
|
||||
msgid "Gitium"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:27
|
||||
msgid "F.A.Q."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:32
|
||||
msgid ""
|
||||
"Gitium enables continuous deployment for WordPress integrating with tools "
|
||||
"such as Github, Bitbucket or Travis-CI. Plugin and theme updates, installs "
|
||||
"and removals are automatically versioned."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:33
|
||||
msgid ""
|
||||
"Ninja code edits from the WordPress editor are also tracked into version "
|
||||
"control. Gitium is designed for sane development environments."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:34
|
||||
msgid ""
|
||||
"Staging and production can follow different branches of the same repository. "
|
||||
"You can deploy code simply trough git push."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:35
|
||||
msgid ""
|
||||
"Gitium requires <code>git</code> command line tool minimum version 1.7 "
|
||||
"installed on the server and <code>proc_open</code> PHP function enabled."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:39
|
||||
msgid "Is this plugin considered stable?"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:39
|
||||
msgid ""
|
||||
"Right now this plugin is considered alpha quality and should be used in "
|
||||
"production environments only by adventurous kinds."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:40
|
||||
msgid "What happens in case of conflicts?"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:40
|
||||
msgid ""
|
||||
"The behavior in case of conflicts is to overwrite the changes on the origin "
|
||||
"repository with the local changes (ie. local modifications take precedence "
|
||||
"over remote ones)."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:41
|
||||
msgid "How to deploy automatically after a push?"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:41
|
||||
msgid ""
|
||||
"You can ping the webhook url after a push to automatically deploy the new "
|
||||
"code. The webhook url can be found under Code menu. This url plays well with "
|
||||
"Github or Bitbucket webhooks."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:42
|
||||
msgid "Does it works on multi site setups?"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:42
|
||||
msgid "Gitium is not supporting multisite setups at the moment."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:43
|
||||
msgid "How does gitium handle submodules?"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:43
|
||||
msgid "Currently submodules are not supported."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:47
|
||||
msgid ""
|
||||
"In this step you must specify the <code>Remote URL</code>. This URL "
|
||||
"represents the link between the git sistem and your site."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:48
|
||||
msgid "You can get this URL from your Git repository and it looks like this:"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:49
|
||||
msgid "github.com -> git@github.com:user/example.git"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:50
|
||||
msgid "bitbucket.org -> git@bitbucket.org:user/glowing-happiness.git"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:51
|
||||
msgid ""
|
||||
"To go to the next step, fill the <code>Remote URL</code> and then press the "
|
||||
"<code>Fetch</code> button."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:52
|
||||
msgid ""
|
||||
"In this step you must select the <code>branch</code> you want to follow."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:53
|
||||
msgid "Only this branch will have all of your code modifications."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:54
|
||||
msgid ""
|
||||
"When you push the button <code>Merge & Push</code>, all code(plugins & "
|
||||
"themes) will be pushed on the git repository."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:64
|
||||
msgid ""
|
||||
"On status page you can see what files are modified, and you can commit the "
|
||||
"changes to git."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:69 ../inc/class-gitium-submenu-commits.php:29
|
||||
#: ../inc/class-gitium-submenu-commits.php:41
|
||||
msgid "Commits"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:74
|
||||
msgid ""
|
||||
"You may be wondering what is the difference between author and committer."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:75
|
||||
msgid ""
|
||||
"The <code>author</code> is the person who originally wrote the patch, "
|
||||
"whereas the <code>committer</code> is the person who last applied the patch."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:76
|
||||
msgid ""
|
||||
"So, if you send in a patch to a project and one of the core members applies "
|
||||
"the patch, both of you get credit — you as the author and the core member as "
|
||||
"the committer."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:86
|
||||
msgid "Each line from the gitignore file specifies a pattern."
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:87
|
||||
msgid ""
|
||||
"When deciding whether to ignore a path, Git normally checks gitignore "
|
||||
"patterns from multiple sources, with the following order of precedence, from "
|
||||
"highest to lowest (within one level of precedence, the last matching pattern "
|
||||
"decides the outcome)"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-help.php:88
|
||||
#, php-format
|
||||
msgid "Read more on %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:28
|
||||
msgid "Git Commits"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:61
|
||||
#, php-format
|
||||
msgid "Last %s commits"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:70
|
||||
#, php-format
|
||||
msgid "committed %s ago"
|
||||
msgstr ""
|
||||
|
||||
#: ../inc/class-gitium-submenu-commits.php:82
|
||||
#, php-format
|
||||
msgid "authored %s ago"
|
||||
msgstr ""
|
239
wp-content/plugins/gitium/readme.txt
Normal file
239
wp-content/plugins/gitium/readme.txt
Normal file
@ -0,0 +1,239 @@
|
||||
=== Gitium ===
|
||||
|
||||
Contributors: PressLabs
|
||||
Donate link: https://www.presslabs.com/gitium/
|
||||
Tags: git, version, versioning, deployment, version-control, github, bitbucket, travis, code, revision, testing, development, branch, production, staging, debug, plugin, gitium, presslabs, simple
|
||||
Requires at least: 3.9
|
||||
Tested up to: 5.2.2
|
||||
Requires PHP: 5.6
|
||||
License: GPLv2
|
||||
Stable tag: 1.0.3
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Automatic git version control and deployment for your plugins and themes integrated into wp-admin.
|
||||
|
||||
|
||||
== Description ==
|
||||
|
||||
Gitium enables continuous deployment for WordPress, integrating with tools such as Github, Bitbucket or Travis-CI. Theme or plugin updates, installs and removals are all automatically versioned. Ninja code edits from the WordPress editor are also tracked by the version control system.
|
||||
|
||||
Gitium is designed with sane development environments in mind, allowing staging and production to follow different branches of the same repository. You can also deploy code by simply using `git push`.
|
||||
|
||||
Gitium requires `git` command line tool with a minimum version of 1.7 installed on the server and the `proc_open` PHP function enabled.
|
||||
|
||||
You can find more documentation on [Presslabs](https://www.presslabs.com/help/gitium/general).
|
||||
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. Setup step 1: Get SSH Key
|
||||
2. Setup step 2: Set SSH Key (Github)
|
||||
3. Setup step 3: Add remote repository
|
||||
4. Setup step 4: Choose following branch
|
||||
5. Commit local changes
|
||||
|
||||
|
||||
== Installation ==
|
||||
|
||||
= Manual Installation =
|
||||
1. Upload `gitium.zip` to the `/wp-content/plugins/` directory;
|
||||
2. Extract the `gitium.zip` archive into the `/wp-content/plugins/` directory;
|
||||
3. Activate the plugin through the 'Plugins' menu in WordPress.
|
||||
|
||||
Alternatively, go into your WordPress dashboard and click on Plugins -> Add Plugin and search for `Gitium`. Then, click on Install and, after that, on Activate Now.
|
||||
|
||||
|
||||
= Usage =
|
||||
|
||||
Activate the plugin and follow the on-screen instructions under the `Gitium` menu.
|
||||
|
||||
_IMPORTANT_: Gitium does its best not to version your WordPress core, neither your `/wp-content/uploads` folder.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= Could not connect to remote repository? =
|
||||
|
||||
If you encounter this kind of error you can try to fix it by setting the proper username of the .git directory.
|
||||
|
||||
Example: chown -R www-data:www-data .git
|
||||
|
||||
= Is this plugin considered stable? =
|
||||
|
||||
Yes, we consider the plugin stable after extensive usage in production environments at Presslabs, with hundreds of users and powering sites with hundreds of millions of pageviews per month.
|
||||
|
||||
= What will happen in case of conflicts? =
|
||||
|
||||
The behavior in case of conflicts is to overwrite the changes on the `origin` repository with the local changes (ie. local modifications take precedence over remote ones).
|
||||
|
||||
= How to deploy automatically after a push? =
|
||||
|
||||
You can ping the webhook url after a push to automatically deploy the new code. The webhook url can be found under `Gitium` menu, `Settings` section. This url also plays well with Github or Bitbucket webhooks.
|
||||
|
||||
= Does it works on multi site setups? =
|
||||
|
||||
Gitium does not support multisite setups at the moment.
|
||||
|
||||
= How does gitium handle submodules? =
|
||||
|
||||
Submodules are currently not supported.
|
||||
|
||||
== Upgrade Notice ==
|
||||
= 1.0.3 =
|
||||
Fixed wrong redirection for multisite installations during initial setup
|
||||
|
||||
== Changelog ==
|
||||
= 1.0.3 =
|
||||
* Fixed wrong redirection for multisite installations during initial setup
|
||||
|
||||
= 1.0.2 =
|
||||
* Full PHP 7+ compatibility
|
||||
* Hotfix - Fixed the blank pages being displayed instead of success of failure messages;
|
||||
* Hotfix - Fixed the push process when other remote branches had changes;
|
||||
* Hotfix - Fixed the missing ssh / key handling with fatal errors during activation;
|
||||
* Added - More success messages in certain cases.
|
||||
|
||||
= 1.0.1 =
|
||||
* Hotfix - Fix race condition on Code Editor Save
|
||||
|
||||
= 1.0 =
|
||||
* Fixed WP 4.9 Compatibility
|
||||
|
||||
= 1.0-rc12 =
|
||||
* Bumped plugin version
|
||||
|
||||
= 1.0-rc11 =
|
||||
* Hotfixed an error that prevented gitium to error_log properly.
|
||||
|
||||
= 1.0-rc10 =
|
||||
* Bumped wordpress tested version
|
||||
|
||||
= 1.0-rc9 =
|
||||
* PHP7 compat and wp-cli
|
||||
|
||||
= 1.0-rc8 =
|
||||
* Fix some indents
|
||||
* Add some more tests
|
||||
* Fix the submenu configure logic
|
||||
|
||||
= 1.0-rc7 =
|
||||
* Test remote url from git wrapper
|
||||
* Remove the phpmd package from test environment
|
||||
* Set WP_DEBUG to false on tests
|
||||
* Refactoring
|
||||
* Abort the cherry-pick - changes are already there
|
||||
* Fix the race condition
|
||||
* Add acquire and release logs for gitium lock
|
||||
* Add explanations to merge with accept mine logic
|
||||
|
||||
= 1.0-rc6 =
|
||||
* Delete all transients and options on uninstall hook
|
||||
* Add transients to is_versions and get_remote_tracking_branch functions
|
||||
* Update the composer
|
||||
* Check requirements before show the admin menu
|
||||
* Put the logs off by default(on test env)
|
||||
* Fix redirect issue and display errors
|
||||
* Create wordpress docker env command
|
||||
* PHP Warning: unlink #114
|
||||
|
||||
= 1.0-rc5 =
|
||||
* Fix delete plugin/theme bug on 4.6
|
||||
* Update the readme file
|
||||
|
||||
= 1.0-rc4 =
|
||||
* Fix merge with accept mine behind commits bug
|
||||
|
||||
= 1.0-rc3 =
|
||||
* Add support for multisite
|
||||
* Fix PHP error on merge & push
|
||||
|
||||
= 1.0-rc2 =
|
||||
* Change the default lockfile location
|
||||
* Fix a PHP Warning
|
||||
|
||||
= 1.0-rc1 =
|
||||
* Update the logic of merge and push
|
||||
* Add lock mechanism for fetch and merge
|
||||
* Fix repo stuck on merge_local branch
|
||||
* Tested up to 4.5.3
|
||||
|
||||
= 0.5.8-beta =
|
||||
* Add documentation for 'Could not connect to remote repository?'
|
||||
* Fix the update theme from Dashboard commit message & the install plugin commit message
|
||||
* Fix install/delete plugin/theme commit message
|
||||
* Add a test and rewrite the tests
|
||||
* Tested up to 4.5.2
|
||||
|
||||
= 0.5.7-beta =
|
||||
* Fix bug deleting plugins/themes causes wrong commit message
|
||||
* Fix bug wrong commit message
|
||||
* Fix bug updated function to stop maintenance mode hang
|
||||
* Fix bug undefined variable 'new_versions'
|
||||
* Add 'Merge changes' button for gitium webhook
|
||||
* Add gitium documentation for docker
|
||||
* Add more tests
|
||||
|
||||
= 0.5.6-beta =
|
||||
* Fix compatibility issues with wp-cli
|
||||
|
||||
= 0.5.5-beta =
|
||||
* Fix bug plugin deletion from plugins page did not trigger commit
|
||||
|
||||
= 0.5.4-beta =
|
||||
* Fix bug missing changes on similarly named plugins
|
||||
* Add requirements notices
|
||||
* Add requirements help section
|
||||
|
||||
= 0.5.3-beta =
|
||||
* Fix paths with spaces bug
|
||||
* Add a Disconnect from repo button
|
||||
* Fix POST var `path` conflicts
|
||||
* Fix travis tests
|
||||
|
||||
= 0.5.2-beta =
|
||||
* Add Contextual Help to Configuration page
|
||||
* Make the icon path relative
|
||||
* The key file is deleted properly
|
||||
* Update serbian translation
|
||||
* Make the resource type more specific
|
||||
* Fix Menu Bubble
|
||||
* Remove useless param for get_transient
|
||||
* Add Spanish Translation
|
||||
* Rename `gitium_version` transient
|
||||
* Fix git version notice
|
||||
* Delete .vimrc
|
||||
* Update .gitignore
|
||||
* Fix syntax error
|
||||
* Add better git version check
|
||||
* Fix add_query_arg vulnerability
|
||||
|
||||
= 0.5.1-beta =
|
||||
* Update Serbian Translation (by [Ogi Djuraskovic](http://firstsiteguide.com/))
|
||||
* Fix Menu Bubble
|
||||
|
||||
= 0.5-beta =
|
||||
* Add `Last 20 Commits` menu page
|
||||
* Add WordPress Contextual Help menu
|
||||
* Add `Settings` menu page
|
||||
* Move `Webhook URL` and `Public Key` fields to `Settings` page
|
||||
* Add menu icon
|
||||
* The `.gitignore` file can be edited
|
||||
* Fix commit message on theme/plugin update event
|
||||
* Refactoring
|
||||
|
||||
= 0.4-beta =
|
||||
* Add `Bitbucket` documentation link
|
||||
* Add the action `gitium_before_merge_with_accept_mine`
|
||||
* Moved to `travis-ci.org`
|
||||
* Add new tests
|
||||
* Added code climate coverage reporting
|
||||
* Refactoring
|
||||
|
||||
= 0.3.2-alpha =
|
||||
* Fix plugin activation issues
|
||||
|
||||
= 0.3.1-alpha =
|
||||
* Fix issues with ssh repositories
|
||||
* Fix maintemance mode when webhook fails
|
||||
|
||||
= 0.3-alpha =
|
||||
* First alpha release
|
Reference in New Issue
Block a user