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


PHP get_api_details函数代码示例

本文整理汇总了PHP中get_api_details函数的典型用法代码示例。如果您正苦于以下问题:PHP get_api_details函数的具体用法?PHP get_api_details怎么用?PHP get_api_details使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: plugin_info_update

/**
 * update plugin_info with additional info from api
 */
function plugin_info_update()
{
    global $plugin_info;
    foreach ($plugin_info as $key => $plugin) {
        $api_data = json_decode(get_api_details('plugin', $key . '.php', getDef('GSNOPLUGINCHECK', true)));
        // on api success
        if (is_object($api_data) && $api_data->status == 'successful') {
            $apiver = $api_data->version;
            $apipath = $api_data->path;
            $apiname = $api_data->name;
            $plugin_info[$key]['name'] = $apiname;
            // $plugin_info[$key]['apiname'] = $apiname;
            $plugin_info[$key]['apipath'] = $apipath;
            $plugin_info[$key]['apiver'] = $apiver;
        }
    }
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:20,代码来源:plugins.php

示例2: getVerCheck

/**
 * retrieve the version check data obj
 * @since  3.4
 * @return obj api json decoded obj on success
 */
function getVerCheck()
{
    # check to see if there is a core update needed
    $data = get_api_details();
    if ($data) {
        return json_decode($data);
    } else {
        return null;
    }
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:15,代码来源:basic.php

示例3: exec_action

	<?php 
# Plugin hook to allow insertion of stuff into the header
if (get_filename_id() != 'index') {
    exec_action('header');
}
?>
	
	<?php 
if (get_filename_id() != 'resetpassword' && get_filename_id() != 'index') {
    ?>
	<script>
		// check to see if core update is needed
		jQuery(document).ready(function() { 
			<?php 
    $data = get_api_details();
    if ($data) {
        $apikey = json_decode($data);
        $verstatus = $apikey->status;
        ?>
				var verstatus = <?php 
        echo $verstatus;
        ?>
;
				if(verstatus != 1) {
					$('a.support').parent('li').append('<span class="warning">!</span>');
					$('a.support').attr('href', 'health-check.php');
				}
			<?php 
    }
    ?>
开发者ID:google-code-backups,项目名称:get-simple-cms,代码行数:30,代码来源:header.php

示例4: subval_sort

$plugin_info_sorted = subval_sort($plugin_info, 'name');
foreach ($plugin_info_sorted as $pluginid => $plugininfo) {
    $setNonce = '&amp;nonce=' . get_nonce("set_" . $pluginid, "plugins.php");
    // @todo disabled plugins have a version of (str) 'disabled', should be 0 or null
    $pluginver = $plugininfo['version'] == 'disabled' ? 0 : $plugininfo['version'];
    if (plugin_active($pluginid)) {
        $cls_Enabled = 'hidden';
        $cls_Disabled = '';
        $trclass = 'enabled';
    } else {
        $cls_Enabled = '';
        $cls_Disabled = 'hidden';
        $trclass = 'disabled';
    }
    // get extend api for this plugin filename
    $api_data = json_decode(get_api_details('plugin', $pluginid));
    $updatelink = '';
    // api success
    if (is_object($api_data) && $api_data->status == 'successful') {
        $apiver = $api_data->version;
        $apipath = $api_data->path;
        $apiname = $api_data->name;
        // show update available link
        if ($pluginver > 0 && version_compare($apiver, $pluginver, '>')) {
            $updatelink = '<br /><a class="updatelink" href="' . $apipath . '" target="_blank">' . i18n_r('UPDATE_AVAILABLE') . ' ' . $apiver . '</a>';
            $needsupdate = true;
        }
        $plugin_title = '<a href="' . $apipath . '" target="_blank">' . $apiname . '</a>';
    } else {
        // api fail , does not exist in extend
        $plugin_title = $plugininfo['name'];
开发者ID:promil23,项目名称:GetSimpleCMS,代码行数:31,代码来源:plugins.php

示例5: nm_update_extend_cache

function nm_update_extend_cache()
{
    if (!is_frontend() && get_filename_id() == 'plugins') {
        include GSADMININCPATH . 'configuration.php';
        $url = $site_link_back_url . 'api/extend/?id=541';
        $tempfile = GSCACHEPATH . md5($url) . '.txt';
        $cachefile = GSCACHEPATH . md5($site_link_back_url . 'api/extend/?file=news_manager.php') . '.txt';
        get_api_details('custom', $url);
        if (file_exists($cachefile)) {
            unlink($cachefile);
        }
        @copy($tempfile, $cachefile);
    }
}
开发者ID:Vin985,项目名称:clqweb,代码行数:14,代码来源:functions.php

示例6: read_pluginsxml

}
read_pluginsxml();
// get the live plugins into $live_plugins array
if (!is_frontend()) {
    create_pluginsxml();
}
// check that plugins have not been removed or added to the directory
// load each of the plugins
foreach ($live_plugins as $file => $en) {
    $pluginsLoaded = true;
    # debugLog("plugin: $file" . " exists: " . file_exists(GSPLUGINPATH . $file) ." enabled: " . $en);
    if ($en == 'true' && file_exists(GSPLUGINPATH . $file)) {
        require_once GSPLUGINPATH . $file;
    } else {
        if (!is_frontend() and get_filename_id() == 'plugins') {
            $apiback = get_api_details('plugin', $file, getDef('GSNOPLUGINCHECK', true));
            $response = json_decode($apiback);
            if ($response and $response->status == 'successful') {
                register_plugin(pathinfo_filename($file), $file, 'disabled', $response->owner, '', i18n_r('PLUGIN_DISABLED'), '', '');
            } else {
                register_plugin(pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
            }
        } else {
            register_plugin(pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
        }
    }
}
/**
 * change_plugin
 * 
 * Enable/Disable a plugin
开发者ID:elephantcode,项目名称:elephantcode,代码行数:31,代码来源:plugin_functions.php

示例7: read_pluginsxml

}
read_pluginsxml();
// get the live plugins into $live_plugins array
if (!is_frontend()) {
    create_pluginsxml();
}
// check that plugins have not been removed or added to the directory
// load each of the plugins
foreach ($live_plugins as $file => $en) {
    $pluginsLoaded = true;
    # debugLog("plugin: $file" . " exists: " . file_exists(GSPLUGINPATH . $file) ." enabled: " . $en);
    if ($en == 'true' && file_exists(GSPLUGINPATH . $file)) {
        require_once GSPLUGINPATH . $file;
    } else {
        if (!is_frontend() and get_filename_id() == 'plugins') {
            $apiback = get_api_details('plugin', $file);
            $response = json_decode($apiback);
            if ($response and $response->status == 'successful') {
                register_plugin(pathinfo_filename($file), $file, 'disabled', $response->owner, '', i18n_r('PLUGIN_DISABLED'), '', '');
            } else {
                register_plugin(pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
            }
        } else {
            register_plugin(pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
        }
    }
}
/**
 * change_plugin
 * 
 * Enable/Disable a plugin
开发者ID:Foltys,项目名称:Masopust,代码行数:31,代码来源:plugin_functions.php

示例8: registerInactivePlugins

/**
 * register the plugins that are not enabled
 * api checks are only done on plugins page
 *
 * @todo disabled plugins have a version of (str) 'disabled', should be 0 or null, leaving alone for now for legacy support
 *
 * @since 3.4.0
 * @uses $live_plugins;
 * @param  bool $apilookup lookup filename in api to get name and desc
 */
function registerInactivePlugins($apilookup = false)
{
    global $live_plugins;
    // load plugins into $plugins_info
    foreach ($live_plugins as $file => $en) {
        # debugLog("plugin: $file" . " exists: " . file_exists(GSPLUGINPATH . $file) ." enabled: " . $en);
        if ($en !== 'true' || !file_exists(GSPLUGINPATH . $file)) {
            if ($apilookup) {
                // check api to get names of inactive plugins etc.
                $apiback = get_api_details('plugin', $file);
                $response = json_decode($apiback);
                if ($response and $response->status == 'successful') {
                    register_plugin(pathinfo_filename($file), $file, 'disabled', $response->owner, '', i18n_r('PLUGIN_DISABLED'), '', '');
                } else {
                    register_plugin(pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
                }
            } else {
                register_plugin(pathinfo_filename($file), $file, 'disabled', 'Unknown', '', i18n_r('PLUGIN_DISABLED'), '', '');
            }
        }
    }
}
开发者ID:promil23,项目名称:GetSimpleCMS,代码行数:32,代码来源:plugin_functions.php

示例9: foreach

$needsupdate = false;
foreach ($pluginfiles as $fi) {
    $pathExt = pathinfo($fi, PATHINFO_EXTENSION);
    $pathName = pathinfo_filename($fi);
    $setNonce = '&amp;nonce=' . get_nonce("set", "plugins.php");
    if ($pathExt == "php") {
        if ($live_plugins[$fi] == 'true') {
            $cls_Enabled = 'hidden';
            $cls_Disabled = '';
            $trclass = 'enabled';
        } else {
            $cls_Enabled = '';
            $cls_Disabled = 'hidden';
            $trclass = 'disabled';
        }
        $api_data = json_decode(get_api_details('plugin', $fi, getDef('GSNOPLUGINCHECK', true)));
        $updatelink = null;
        if (is_object($api_data) && $api_data->status == 'successful') {
            if ($api_data->version > $plugin_info[$pathName]['version']) {
                $updatelink = '<br /><a class="updatelink" href="' . $api_data->path . '" target="_blank">' . i18n_r('UPDATE_AVAILABLE') . ' ' . $api_data->version . '</a>';
                $needsupdate = true;
            }
            $plugin_title = '<a href="' . $api_data->path . '" target="_blank">' . $api_data->name . '</a>';
        } else {
            $plugin_title = $plugin_info[$pathName]['name'];
        }
        $table .= '<tr id="tr-' . $counter . '" class="' . $trclass . '" >';
        $table .= '<td style="width:150px" ><b>' . $plugin_title . '</b></td>';
        $table .= '<td><span>' . $plugin_info[$pathName]['description'];
        if ($plugin_info[$pathName]['version'] != 'disabled') {
            $table .= '<br /><b>' . i18n_r('PLUGIN_VER') . ' ' . $plugin_info[$pathName]['version'] . '</b> &mdash; ' . i18n_r('AUTHOR') . ': <a href="' . $plugin_info[$pathName]['author_url'] . '" target="_blank">' . $plugin_info[$pathName]['author'] . '</a></span>';
开发者ID:hatasu,项目名称:appdroid,代码行数:31,代码来源:plugins.php


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