当前位置: 首页>>代码示例>>PHP>>正文


PHP PucFactory::getLatestClassVersion方法代码示例

本文整理汇总了PHP中PucFactory::getLatestClassVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP PucFactory::getLatestClassVersion方法的具体用法?PHP PucFactory::getLatestClassVersion怎么用?PHP PucFactory::getLatestClassVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PucFactory的用法示例。


在下文中一共展示了PucFactory::getLatestClassVersion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: set_up_auto_updater

function set_up_auto_updater()
{
    $forceUpdate = get_option('force-jetpack-update');
    if ($forceUpdate != get_current_jetpack_version()) {
        update_option('force-jetpack-update', 'just-updated');
    }
    $beta_type = get_option('jp_beta_type');
    if ($beta_type == 'rc_only') {
        $json_url = 'http://betadownload.jetpack.me/rc/rc.json';
    } else {
        $json_url = 'http://betadownload.jetpack.me/jetpack-bleeding-edge.json';
    }
    do_action('add_debug_info', $json_url, 'json_url');
    require 'plugin-updates/plugin-update-checker.php';
    $JetpackBeta = PucFactory::buildUpdateChecker($json_url, WP_PLUGIN_DIR . '/jetpack/jetpack.php', 'jetpack', '0.01');
    // Allows us to update the Jetpack Beta tool by updating GitHub
    $className = PucFactory::getLatestClassVersion('PucGitHubChecker');
    $myUpdateChecker = new $className('https://github.com/Automattic/jetpack-beta/', __FILE__, 'master');
    $jp_beta_autoupdate = get_option('jp_beta_autoupdate');
    if ($jp_beta_autoupdate != 'no') {
        function auto_update_jetpack_beta($update, $item)
        {
            // Array of plugin slugs to always auto-update
            $plugins = array('jetpack');
            if (in_array($item->slug, $plugins)) {
                return true;
                // Always update plugins in this array
            } else {
                return $update;
                // Else, use the normal API response to decide whether to update or not
            }
        }
        add_filter('auto_update_plugin', 'auto_update_jetpack_beta', 10, 2);
    }
}
开发者ID:Ramoonus,项目名称:jetpack-beta,代码行数:35,代码来源:jetpack-beta.php

示例2: includes

 private function includes()
 {
     global $klikbayi_settings, $klikbayi_sanitize;
     require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-sanitize.php';
     require_once KLIKBAYI_PATH_LIB . 'inc/settings.php';
     $klikbayi_sanitize = klikbayi_sanitize();
     $klikbayi_settings = klikbayi_settings();
     require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-load.php';
     require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-widget.php';
     if (is_admin()) {
         require_once ABSPATH . 'wp-includes/pluggable.php';
         if (current_user_can('manage_options')) {
             require KLIKBAYI_PATH_LIB . 'inc/updates/plugin-update-checker/plugin-update-checker.php';
             $className = PucFactory::getLatestClassVersion('PucGitHubChecker');
             $myUpdateChecker = new $className('https://github.com/Jevuska/klikbayi/', KLIKBAYI_PLUGIN_FILE, 'master');
             require_once KLIKBAYI_PATH_LIB . 'inc/admin-function.php';
             require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-admin.php';
             require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-setup.php';
             do_action('load-klikbayi-admin-page');
         }
     } else {
     }
     require_once KLIKBAYI_PATH_LIB . 'install.php';
 }
开发者ID:extremelyanca,项目名称:klikbayi,代码行数:24,代码来源:klikbayi.php

示例3: wpprss_activation_rewrite_permalinks

/*
Plugin Name: WordPress Popular Posts Feedmaker
Plugin URI: http://wpdevelopers.com
Description: Creates a popular feed at /feed/popular, which uses WordPress Popular Posts
Version: 1.7.4
Author: Ted Slater & Tyler Johnson
Author URI: http://libertyalliance.com
Author Email: tyler@libertyalliance.com
Text Domain: wordpress-popular-posts-feedmaker
Copyright 2016 WP Developers & Liberty Alliance
*/
/**********
Check for Plugin Updates
**********/
require 'plugin-update-checker-3.0/plugin-update-checker.php';
$wpdevClassName = PucFactory::getLatestClassVersion('PucGitHubChecker');
$wpdevUpdateChecker = new $wpdevClassName('https://github.com/LibertyAllianceGit/wordpress-popular-posts-feedmaker', __FILE__, 'master');
$wpdevUpdateChecker->setAccessToken('4921ce230f2bd252dd1fafc7afeac812ddf091de');
/**********
Refresh Permalinks on Plugin Activation
**********/
register_activation_hook(__FILE__, 'wpprss_activation_rewrite_permalinks');
function wpprss_activation_rewrite_permalinks()
{
    //Ensure the $wp_rewrite global is loaded
    global $wp_rewrite;
    //Call flush_rules() as a method of the $wp_rewrite object, so that permalinks are flushed
    $wp_rewrite->flush_rules(false);
}
/**********
Add Image Sizes for Patriot Times & Email Newsletters
开发者ID:LibertyAllianceGit,项目名称:wordpress-popular-posts-feedmaker,代码行数:31,代码来源:wordpress-popular-posts-feedmaker.php

示例4: auto_update_wa_fronted

	Plugin Name: WA-Fronted
	Plugin URI: http://github.com/jesperbjerke/wa-fronted
	Description: Edit content directly from fronted in the contents actual place
	Version: 1.2.1
	Text Domain: wa-fronted
	Domain Path: /languages
	Author: Jesper Bjerke
	Author URI: http://www.westart.se
	Network: True
	License: GPLv2
*/
/**
 * Plugin updater curtesy of @link https://github.com/YahnisElsts
 */
require_once 'plugin-update-checker/plugin-update-checker.php';
$Plugin_Updater = PucFactory::getLatestClassVersion('PucGitHubChecker');
$WA_Fronted_Updater = new $Plugin_Updater('https://github.com/jesperbjerke/wa-fronted/', __FILE__, 'master');
/**
 * Enable automatic background updates for this plugin
 */
function auto_update_wa_fronted($update, $item)
{
    // Array of plugin slugs to always auto-update
    $plugins = array('wa-fronted');
    if (in_array($item->slug, $plugins)) {
        return true;
        // Always update plugins in this array
    } else {
        return $update;
        // Else, use the normal API response to decide whether to update or not
    }
开发者ID:r-a-y,项目名称:wa-fronted,代码行数:31,代码来源:wa-fronted.php

示例5: initGithubUpdater

 public function initGithubUpdater()
 {
     // Add some translations
     add_filter('puc_manual_check_link-buzz-seo', function () {
         return '';
     }, 10, 0);
     add_filter('puc_manual_check_message-buzz-seo', function ($message, $status) {
         if ($status == 'no_update') {
             return __('Buzz SEO plugin is up to date.', 'buzz-seo');
         } else {
             if ($status == 'update_available') {
                 return __('A new version of the Buzz SEO plugin is available.', 'buzz-seo');
             } else {
                 return sprintf(__('Unknown update checker status `%s`.', 'buzz-seo'), htmlentities($status));
             }
         }
     }, 10, 2);
     // Require file since it doesn't have an autoloader
     require_once BUZZSEO_DIR . 'vendor/yahnis-elsts/plugin-update-checker/plugin-update-checker.php';
     $className = \PucFactory::getLatestClassVersion('PucGitHubChecker');
     /* @var $updateChecker \PucGitHubChecker_2_2 */
     $updateChecker = new $className('https://github.com/nextbuzz/buzz-seo/', BUZZSEO_FILE, 'master');
 }
开发者ID:nextbuzz,项目名称:buzz-seo,代码行数:23,代码来源:Admin.php


注:本文中的PucFactory::getLatestClassVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。