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


PHP get_version函数代码示例

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


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

示例1: vouchers_init

/**
 * Vouchers plugin initialization functions.
 */
function vouchers_init()
{
    // register a library of helper functions
    elgg_register_library('elgg:vouchers', elgg_get_plugins_path() . 'vouchers/lib/vouchers.php');
    // Register subtype
    run_function_once('vouchers_manager_run_once_subtypes');
    // Register entity_type for search
    elgg_register_entity_type('object', Voucher::SUBTYPE);
    // Site navigation
    $item = new ElggMenuItem('vouchers', elgg_echo('vouchers:menu'), 'vouchers/all');
    elgg_register_menu_item('site', $item);
    // Extend CSS
    elgg_extend_view('css/elgg', 'vouchers/css');
    elgg_register_css('vouchers_tooltip_css', '//code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css');
    // Extend js
    elgg_register_js('vouchersjs', elgg_get_site_url() . 'mod/vouchers/assets/vouchers.js');
    elgg_register_js('vouchers_tooltip_js', '//code.jquery.com/ui/1.11.1/jquery-ui.js');
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('vouchers', 'vouchers_page_handler');
    // Register a URL handler for voucher
    $release = get_version(true);
    // Register a URL handler for agora
    if ($release < 1.9) {
        // version 1.8
        elgg_register_entity_url_handler('object', 'vouchers', 'voucher_url');
    } else {
        // use this since Elgg 1.9
        elgg_register_plugin_hook_handler('entity:url', 'object', 'vouchers_set_url');
    }
    // Register menu item to an ownerblock
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'vouchers_owner_block_menu');
    // Register admin transaction log menu under "Utilities"
    elgg_register_admin_menu_item('administer', 'vouchers_transactions_log', 'administer_utilities');
    // register plugin hooks
    elgg_register_plugin_hook_handler("public_pages", "walled_garden", "vouchers_walled_garden_hook");
    // Register actions
    $action_path = elgg_get_plugins_path() . 'vouchers/actions';
    elgg_register_action("vouchers/addvoucher", "{$action_path}/addvoucher.php");
    elgg_register_action("vouchers/delete", "{$action_path}/delvoucher.php");
    elgg_register_action("vouchers/set_featured", "{$action_path}/vouchers/set_featured.php");
    // set a voucher post as featured
    elgg_register_action("vouchers/unset_featured", "{$action_path}/vouchers/unset_featured.php");
    // unset a voucher post from featured
    elgg_register_action("vouchers/get_with_points", "{$action_path}/vouchers/get_with_points.php");
    // voucher purchase with points only
    elgg_register_action('vouchers/be_interested', "{$action_path}/be_interested.php");
    // send interest
    elgg_register_action("vouchers/usersettings", "{$action_path}/usersettings.php");
    // save user settings
    // extend group main page
    elgg_extend_view('groups/tool_latest', 'vouchers/group_module');
    //elgg_extend_view("print", "printpreview/pageshell/pageshell");
    // add the group vouchers tool option
    add_group_tool_option('vouchers', elgg_echo('vouchers:group:enablevouchers'), true);
    // Add vouchers widgets
    elgg_register_widget_type('vouchers', elgg_echo('vouchers:widget'), elgg_echo('vouchers:widget:description'), 'profile,groups,dashboard');
    // member's voucher posts
    elgg_register_widget_type('vouchers_featured', elgg_echo('vouchers:widget:featured'), elgg_echo('vouchers:widget:featured:description'), 'dashboard');
    // featured vouchers for dashboard
}
开发者ID:nlybe,项目名称:Elgg-Vouchers,代码行数:63,代码来源:start.php

示例2: advanced_notifications_create_annotation_event_handler

/**
 * Handles the sending of notifications when replied on group forum topic
 *
 * @param string         $event      the name of the event
 * @param string         $type       the type of the event
 * @param ElggAnnotation $annotation the supplied ElggAnnotation
 *
 * @return void
 */
function advanced_notifications_create_annotation_event_handler($event, $type, $annotation)
{
    if (!empty($annotation) && $annotation instanceof ElggAnnotation) {
        // is this an annotation on which notifications should be sent
        if (advanced_notifications_is_registered_notification_annotation($annotation)) {
            // check if the entity isn't PRIVATE
            $entity = $annotation->getEntity();
            if (!empty($entity) && $entity->access_id != ACCESS_PRIVATE) {
                // is the entity a registered notification entity
                if (advanced_notifications_is_registered_notification_entity($entity)) {
                    // prepare to call the commandline
                    $commandline_options = array("event" => $event, "type" => $type, "id" => $annotation->id);
                    // in older versions of elgg do this differently
                    if (version_compare(get_version(true), "1.8.6", "<")) {
                        $entity = $annotation->getEntity();
                        unset($commandline_options["id"]);
                        $commandline_options["type"] = $entity->getType();
                        $commandline_options["guid"] = $entity->getGUID();
                        $commandline_options["input"] = "group_topic_post|" . base64_encode($annotation->value);
                    }
                    advanced_notifications_start_commandline($commandline_options);
                }
            }
        }
    }
}
开发者ID:juliendangers,项目名称:advanced_notifications,代码行数:35,代码来源:events.php

示例3: polls_init

function polls_init()
{
    elgg_register_library('elgg:polls', elgg_get_plugins_path() . 'polls/models/model.php');
    // Set up menu for logged in users
    if (elgg_is_logged_in()) {
        $item = new ElggMenuItem('polls', elgg_echo('polls'), 'polls/owner/' . elgg_get_logged_in_user_entity()->username);
    } else {
        $item = new ElggMenuItem('polls', elgg_echo('poll'), 'polls/all');
    }
    elgg_register_menu_item('site', $item);
    // Extend system CSS with our own styles, which are defined in the polls/css view
    elgg_extend_view('css/elgg', 'polls/css');
    // Extend hover-over menu
    elgg_extend_view('profile/menu/links', 'polls/menu');
    // Register a page handler, so we can have nice URLs
    elgg_register_page_handler('polls', 'polls_page_handler');
    // Register a URL handler for poll posts
    elgg_register_entity_url_handler('object', 'poll', 'polls_url');
    // notifications
    $elgg_version = explode('.', get_version(true));
    if ($elgg_version[1] > 8) {
        $send_notification = elgg_get_plugin_setting('send_notification', 'polls');
        if (!$send_notification || $send_notification != 'no') {
            elgg_register_notification_event('object', 'poll');
            elgg_register_plugin_hook_handler('prepare', 'notification:create:object:poll', 'polls_prepare_notification');
        }
    }
    // add link to owner block
    elgg_register_plugin_hook_handler('register', 'menu:owner_block', 'polls_owner_block_menu');
    elgg_register_plugin_hook_handler('widget_url', 'widget_manager', 'polls_widget_url_handler');
    // Register entity type
    elgg_register_entity_type('object', 'poll');
    // register the JavaScript
    $js = elgg_get_simplecache_url('js', 'polls/js');
    elgg_register_simplecache_view('js/polls/js');
    elgg_register_js('elgg.polls', $js);
    // add group widget
    $group_polls = elgg_get_plugin_setting('group_polls', 'polls');
    if (!$group_polls || $group_polls != 'no') {
        elgg_extend_view('groups/tool_latest', 'polls/group_module');
    }
    if (!$group_polls || $group_polls == 'yes_default') {
        add_group_tool_option('polls', elgg_echo('polls:enable_polls'), TRUE);
    } else {
        if ($group_polls == 'yes_not_default') {
            add_group_tool_option('polls', elgg_echo('polls:enable_polls'), FALSE);
        }
    }
    //add widgets
    elgg_register_widget_type('poll', elgg_echo('polls:my_widget_title'), elgg_echo('polls:my_widget_description'), "profile,groups");
    elgg_register_widget_type('latestPolls', elgg_echo('polls:latest_widget_title'), elgg_echo('polls:latest_widget_description'), "index,profile,dashboard,groups");
    elgg_register_widget_type('poll_individual', elgg_echo('polls:individual'), elgg_echo('poll_individual_group:widget:description'), "index,profile,dashboard,groups");
    // Register actions
    $action_path = elgg_get_plugins_path() . 'polls/actions/polls';
    elgg_register_action("polls/add", "{$action_path}/add.php");
    elgg_register_action("polls/edit", "{$action_path}/edit.php");
    elgg_register_action("polls/delete", "{$action_path}/delete.php");
    elgg_register_action("polls/vote", "{$action_path}/vote.php");
}
开发者ID:socialweb,项目名称:PiGo,代码行数:59,代码来源:start.php

示例4: diagnostics_basic_hook

/**
 * Generate a basic report.
 *
 * @return string
 */
function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params)
{
    // Get version information
    $version = get_version();
    $release = get_version(true);
    $returnvalue .= elgg_echo('diagnostics:report:basic', array($release, $version));
    return $returnvalue;
}
开发者ID:duanhv,项目名称:mdg-social,代码行数:13,代码来源:start.php

示例5: diagnostics_basic_hook

/**
 * Generate a basic report.
 *
 * @param unknown_type $hook
 * @param unknown_type $entity_type
 * @param unknown_type $returnvalue
 * @param unknown_type $params
 */
function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params)
{
    global $CONFIG;
    // Get version information
    $version = get_version();
    $release = get_version(true);
    $returnvalue .= sprintf(elgg_echo('diagnostics:report:basic'), $release, $version);
    return $returnvalue;
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:17,代码来源:start.php

示例6: ping_home

/**
 * Run once and only once.
 * 
 * @param ElggSite $site The site who's information to use
 */
function ping_home(ElggSite $site)
{
    global $NOTIFICATION_SERVER, $CONFIG;
    // Get version information
    $version = get_version();
    $release = get_version(true);
    // Get export
    $export = export($site->guid);
    return send_api_post_call($NOTIFICATION_SERVER, array('method' => 'elgg.system.ping', 'url' => $site->url, 'version' => $version, 'release' => $release), array(), $export, 'text/xml');
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:15,代码来源:ping.php

示例7: is_elgg18

/**
 * Determine if we're running elgg 1.8 or newer
 * @return boolean
 */
function is_elgg18()
{
    static $is_elgg18;
    if ($is_elgg18 !== null) {
        return $is_elgg18;
    }
    if (is_callable('elgg_get_version')) {
        return false;
        // this is newer than 1.8
    }
    $is_elgg18 = strpos(get_version(true), '1.8') === 0;
    return $is_elgg18;
}
开发者ID:arckinteractive,项目名称:elgg_stormpath,代码行数:17,代码来源:functions.php

示例8: transfer_plugins_export

/**
 * Exports plugins and their configuration
 */
function transfer_plugins_export()
{
    // metadata
    $info = array('elgg_version' => get_version(true), 'elgg_release' => get_version(false), 'transfer_plugins_format' => TRANSFER_PLUGINS_FORMAT);
    $info['plugins'] = array();
    $plugins = elgg_get_plugins('all');
    foreach ($plugins as $plugin) {
        if (is_object($plugin) && is_object($plugin->getManifest())) {
            $plugin_info = array('id' => $plugin->getID(), 'version' => $plugin->getManifest()->getVersion(), 'active' => (bool) $plugin->isActive(), 'settings' => $plugin->getAllSettings(), 'priority' => $plugin->getPriority());
        }
        $plugin_order[$plugin->getPriority() * 10] = $plugin->getID();
        $info['plugins'][] = $plugin_info;
    }
    $info['17_pluginorder'] = serialize($plugin_order);
    return serialize($info);
}
开发者ID:socialweb,项目名称:PiGo,代码行数:19,代码来源:start.php

示例9: get_version_number

function get_version_number()
{
    $r = 'v';
    $v = get_version();
    $pos = strpos($v, ' ', 0);
    if ($pos === false) {
        my_die('Wrong version: ' . $v);
    }
    $vn = preg_split("/[.]/", substr($v, 0, $pos));
    if (count($vn) < 3) {
        my_die('Wrong version: ' . $v);
    }
    for ($i = 0; $i < 3; $i++) {
        $r .= substr('000' . $vn[$i], -3);
    }
    return $r;
    // 'vxxxyyyzzz' wenn version = x.y.z
}
开发者ID:shoehn,项目名称:learningwithtext,代码行数:18,代码来源:utilities.inc.php

示例10: header

header("Content-Type: text/plain");
?>
#!/bin/sh

BASEURL="<?php 
echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . conf('subdirectory');
?>
"
TPL_BASE="${BASEURL}/assets/client_installer/"
MUNKIPATH="/usr/local/munki/" # TODO read munkipath from munki config
PREFPATH="/Library/Preferences/MunkiReport"
CURL="/usr/bin/curl --insecure --fail --silent  --show-error"
# Exit status
ERR=0
VERSION="<?php 
echo get_version();
?>
"

echo "BaseURL is ${BASEURL}"

echo "Retrieving munkireport scripts"

cd ${MUNKIPATH}
$CURL "${TPL_BASE}{preflight,postflight,report_broken_client}" --remote-name --remote-name --remote-name \
	&& $CURL "${TPL_BASE}reportcommon" -o "${MUNKIPATH}munkilib/reportcommon.py" \
	&& $CURL "${TPL_BASE}phpserialize" -o "${MUNKIPATH}munkilib/phpserialize.py"

if [ "${?}" != 0 ]
then
	echo "Failed to download all required components!"
开发者ID:BillTheBest,项目名称:munkireport,代码行数:31,代码来源:install_script.php

示例11: define

<?php

define('VERSION_STATIC', '1.14');
function get_version()
{
    date_default_timezone_set('UTC');
    $root_dir = dirname(dirname(__FILE__));
    if (is_dir("{$root_dir}/.git") && file_exists("{$root_dir}/.git/refs/heads/master")) {
        $suffix = substr(trim(file_get_contents("{$root_dir}/.git/refs/heads/master")), 0, 7);
        return VERSION_STATIC . ".{$suffix}";
    }
    return VERSION_STATIC;
}
define('VERSION', get_version());
开发者ID:adrianpietka,项目名称:bfrss,代码行数:14,代码来源:version.php

示例12: version_upgrade

/**
 * Upgrades Elgg
 *
 */
function version_upgrade()
{
    $dbversion = (int) datalist_get('version');
    // No version number? Oh snap...this is an upgrade from a clean installation < 1.7.
    // Run all upgrades without error reporting and hope for the best.
    // See http://trac.elgg.org/elgg/ticket/1432 for more.
    $quiet = !$dbversion;
    // Upgrade database
    if (db_upgrade($dbversion, '', $quiet)) {
        system_message(elgg_echo('upgrade:db'));
    }
    // Upgrade core
    if (upgrade_code($dbversion, $quiet)) {
        system_message(elgg_echo('upgrade:core'));
    }
    // Now we trigger an event to give the option for plugins to do something
    $upgrade_details = new stdClass();
    $upgrade_details->from = $dbversion;
    $upgrade_details->to = get_version();
    trigger_elgg_event('upgrade', 'upgrade', $upgrade_details);
    // Update the version
    datalist_set('version', get_version());
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:27,代码来源:version.php

示例13: elseif

    if (isset($site_mods[$mod])) {
        if (file_exists(NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_INTERFACE . ".php")) {
            include NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_INTERFACE . ".php";
        } elseif (file_exists(NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_DATA . ".php")) {
            include NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_DATA . ".php";
        } elseif (file_exists(NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_en.php")) {
            include NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_en.php";
        }
    }
    return $lang_module;
}
$info = array();
if (defined('NV_IS_GODADMIN')) {
    $field = array();
    $field[] = array('key' => $lang_module['version_user'], 'value' => $global_config['version']);
    $new_version = get_version(28800);
    //kem tra lai sau 8 tieng
    if ($new_version != false) {
        if (nv_version_compare($global_config['version'], $new_version->version) < 0) {
            $field[] = array('key' => $lang_module['version_news'], 'value' => (string) $new_version->version);
        }
    }
    $caption = "<a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=settings&amp;" . NV_OP_VARIABLE . "=checkupdate\">" . $lang_module['checkversion'] . "</a>";
    $info[] = array('caption' => $caption, 'field' => $field);
}
foreach ($site_mods as $mod => $value) {
    if (file_exists(NV_ROOTDIR . "/modules/" . $value['module_file'] . "/siteinfo.php")) {
        $siteinfo = array();
        $mod_data = $value['module_data'];
        include NV_ROOTDIR . "/modules/" . $value['module_file'] . "/siteinfo.php";
        if (!empty($siteinfo)) {
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:main.php

示例14: die

<?php

// Disallow direct access to this file for security reasons
if (!defined("IN_MYBB")) {
    die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$page->add_breadcrumb_item("CloudFlare Manager", "index.php?module=cloudflare");
$page->add_breadcrumb_item("Change Log", "index.php?module=cloudflare-change_log");
$page->output_header("CloudFlare Manager - Change Log For Version " . get_version());
$version = str_replace(" ", "", get_version());
$changelog = @file_get_contents("http://cf.mybbsecurity.net/changelog/" . $version);
if ($changelog) {
    echo nl2br($changelog);
} else {
    echo "Error: Cannot find change log for version " . get_version() . ".";
}
$page->output_footer();
开发者ID:EspialWires,项目名称:MyBB-CloudFlare-Manager,代码行数:17,代码来源:cloudflare_change_log.php

示例15: foreach

/**
 * iZAP izap_videos
 *
 * @package Elgg videotizer, by iZAP Web Solutions.
 * @license GNU Public License version 3
 * @Contact iZAP Team "<support@izap.in>"
 * @Founder Tarun Jangra "<tarun@izap.in>"
 * @link http://www.izap.in/
 * 
 */
$limit = $vars['entity']->num_display;
$limit = $limit ? $limit : 5;
$options['type'] = 'object';
$options['subtype'] = 'izap_videos';
$options['limit'] = $limit;
if ((double) get_version(true) <= 1.6) {
    $videos = get_entities($options['type'], $options['subtype'], 0, '', $options['subtype']);
} else {
    $videos = elgg_get_entities($options);
}
if ($videos) {
    foreach ($videos as $video) {
        echo elgg_view('izap_videos/widgetListing', array('entity' => $video));
    }
}
if (is_old_elgg()) {
    ?>
<script type="text/javascript">
  $(document).ready(function() {
    $(".izap_ajaxed_thumb").click(function() {
      $("#load_video_" + this.rel).attr('style', '');
开发者ID:rimpy,项目名称:izap_videos,代码行数:31,代码来源:view.php


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