예제 #1
0
 function test_auto_push()
 {
     global $git;
     $this->assertEmpty($git->get_uncommited_changes());
     $this->_add_changes_locally();
     $this->assertCount(1, $git->get_uncommited_changes());
     gitium_auto_push();
     $this->assertEmpty($git->get_uncommited_changes());
 }
예제 #2
0
파일: gitium.php 프로젝트: leshuis/testwp
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;
}
예제 #3
0
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"));
    }
}