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


PHP expose_function函数代码示例

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


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

示例1: ws_pack_thewire_expose_functions

/**
 * Exposes the TheWire functions
 *
 * @return void
 */
function ws_pack_thewire_expose_functions()
{
    expose_function("thewire.post", "my_post_to_wire", array("text" => array("type" => "string", "required" => true), "parent" => array("type" => "int", "required" => false)), 'Post to the wire. 140 characters or less', 'POST', true, true);
    expose_function("thewire.get_wires", "ws_pack_get_wires", array("friends_only" => array("type" => "int", "required" => true)), '', 'GET', true, true);
    expose_function("thewire.get_thread", "ws_pack_get_thread", array("thread_id" => array("type" => "string", "required" => false)), '', 'GET', true, true);
    expose_function("thewire.delete_wire", "ws_pack_delete_wire", array("guid" => array("type" => "int", "required" => true)), '', 'POST', true, true);
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:12,代码来源:thewire.php

示例2: ws_pack_auth_expose_functions

/**
 * Exposes the authentication functions
 * 
 * @return void
 */
function ws_pack_auth_expose_functions()
{
    expose_function("auth.get_api_keys", "ws_pack_auth_get_api_keys", array("application_id" => array("type" => "string", "required" => true), "title" => array("type" => "string", "required" => true), "description" => array("type" => "string", "required" => false, "default" => ""), "icon_url" => array("type" => "string", "required" => false, "default" => ""), "application_info" => array("type" => "array", "required" => false, "default" => array())), elgg_echo("ws_pack:api:auth:get_api_keys"), "GET", false, false);
    // reregister login function to allow login by email
    unexpose_function("auth.gettoken");
    expose_function("auth.gettoken", "ws_pack_auth_gettoken", array("username" => array("type" => "string"), "password" => array("type" => "string")), elgg_echo("auth.gettoken"), "POST", false, false);
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:12,代码来源:auth.php

示例3: elgg_file_viewer_init

function elgg_file_viewer_init()
{
    // Registering a new viewtype for output buffer
    elgg_register_viewtype('ob');
    elgg_register_viewtype_fallback('ob');
    // Exposing a function for remote access to non-public files
    expose_function('efv.download', 'elgg_file_viewer_download', array('guid' => array('type' => 'int', 'required' => true)), 'Access a non-public file from a remote location', 'GET', false, true);
    // Projekktor for Video/Audio support
    elgg_register_js('projekktor', '/mod/elgg_file_viewer/vendors/projekktor-1.2.38r332/projekktor-1.2.38r332.min.js');
    elgg_register_simplecache_view('js/elgg_file_viewer/projekktor');
    elgg_register_js('elgg.projekktor', elgg_get_simplecache_url('js', 'elgg_file_viewer/projekktor'), 'footer');
    elgg_register_css('projekktor', '/mod/elgg_file_viewer/vendors/projekktor-1.2.38r332/theme/maccaco/projekktor.style.css');
    // Syntax highlighter / text support
    elgg_register_js('syntaxhighlighter', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shCore.js', 'footer');
    elgg_register_js('syntaxhighlighter.css', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushCss.js', 'footer');
    elgg_register_js('syntaxhighlighter.xml', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushXml.js', 'footer');
    elgg_register_js('syntaxhighlighter.plain', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushPlain.js', 'footer');
    elgg_register_js('syntaxhighlighter.js', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushJScript.js', 'footer');
    elgg_register_js('syntaxhighlighter.php', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/scripts/shBrushPhp.js', 'footer');
    elgg_register_simplecache_view('js/elgg_file_viewer/syntaxhighlighter');
    elgg_register_js('elgg.syntaxhighlighter', elgg_get_simplecache_url('js', 'elgg_file_viewer/syntaxhighlighter'), 'footer');
    elgg_register_css('syntaxhighlighter.core', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/styles/shCore.css');
    elgg_register_css('syntaxhighlighter.theme', '/mod/elgg_file_viewer/vendors/syntaxhighlighter_3.0.83/styles/shThemeDefault.css');
    // FFmpeg class
    elgg_register_class('FFmpeg', elgg_get_plugins_path() . 'elgg_file_viewer/vendors/ffmpeg/src/ffmpeg.class.php');
    elgg_register_page_handler('projekktor', 'elgg_file_viewer_projekktor_video');
}
开发者ID:socialweb,项目名称:PiGo,代码行数:27,代码来源:start.php

示例4: ws_pack_groups_expose_functions

/**
 * Exposes the groups functions
 *
 * @return void
 */
function ws_pack_groups_expose_functions()
{
    // get (all) groups
    /*
    expose_function(
    	"groups.get",
    	"ws_pack_groups_get",
    	array(
    		"filter" => array(
    			"type" => "string",
    			"required" => true
    		),
    		"offset" => array(
    			"type" => "int",
    			"required" => false,
    			"default" => 0
    		),
    		"limit" => array(
    			"type" => "int",
    			"required" => false,
    			"default" => 10
    		)
    	),
    	elgg_echo("ws_pack:api:groups:get"),
    	"GET",
    	true,
    	false
    );
    */
    // get groups user_guid is a member of
    expose_function("groups.member_of", "ws_pack_groups_member_of", array("user_guid" => array("type" => "int", "required" => false, "default" => 0), "offset" => array("type" => "int", "required" => false, "default" => 0), "limit" => array("type" => "int", "required" => false, "default" => 10)), elgg_echo("ws_pack:api:groups:member_of"), "GET", true, true);
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:37,代码来源:groups.php

示例5: ws_pack_discussions_expose_functions

/**
 * Exposes the discussions functions
 *
 * @return void
 */
function ws_pack_discussions_expose_functions()
{
    expose_function("discussions.post", "post_discussion", array("title" => array("type" => "string", "required" => false), "content" => array("type" => "string", "required" => true), "group_guid" => array("type" => "int", "required" => true), "tags" => array("type" => "string", "required" => false), "access" => array("type" => "int", "required" => false)), 'Post to discussion', 'POST', true, true);
    expose_function("discussions.post_reply", "post_reply", array("content" => array("type" => "string", "required" => true), "parent_guid" => array("type" => "int", "required" => true)), 'Post reply', 'POST', true, true);
    expose_function("discussions.get_discussions", "ws_pack_get_discussions", array("group_guid" => array("type" => "int", "required" => true)), '', 'GET', true, true);
    expose_function("discussions.get_discussion", "ws_pack_get_discussion", array("guid" => array("type" => "int", "required" => true)), '', 'GET', true, true);
    expose_function("discussions.delete_discussion", "ws_pack_delete_discussion", array("guid" => array("type" => "int", "required" => true)), '', 'POST', true, true);
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:13,代码来源:discussions.php

示例6: ws_pack_messages_expose_functions

/**
 * Exposes the messages functions
 *
 * @return void
 */
function ws_pack_messages_expose_functions()
{
    expose_function("messages.send_message", "ws_pack_send_message", array("subject" => array("type" => "string", "required" => true), "message" => array("type" => "string", "required" => true), "recipient" => array("type" => "int", "required" => true)), '', 'POST', true, true);
    expose_function("messages.get_messages", "ws_pack_get_messages", array(), '', 'GET', true, true);
    expose_function("messages.get_conversation", "ws_pack_get_conversation", array("user_guid" => array("type" => "int", "required" => false), "fromto_guid" => array("type" => "int", "required" => false), "relationship" => array("type" => "string", "required" => true)), '', 'GET', true, true);
    expose_function("messages.get_last_conversations", "ws_pack_get_last_conversations", array("user_guid" => array("type" => "int", "required" => false)), '', 'GET', true, true);
    expose_function("messages.delete_message", "ws_pack_delete_message", array("guid" => array("type" => "int", "required" => true)), '', 'POST', true, true);
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:13,代码来源:messages.php

示例7: zhaohu_expose_restapi

function zhaohu_expose_restapi()
{
    expose_function("test.echo", "my_echo", array("string" => array('type' => 'string')), 'A testing method which echos back a string', 'GET', false, false);
    expose_function("event.get", "ws_get_event", array("guid" => array('type' => 'int', required => true)), 'API that gets one event', 'GET', false, false);
    expose_function("photo.get", "ws_get_photo", array("guid" => array('type' => 'int', required => true)), 'API that gets one photo', 'GET', false, false);
    expose_function("event.search", "ws_search_events", array("state" => array('type' => 'string', 'default' => 'WA'), "keyword" => array('type' => 'string', 'default' => 'All'), "past" => array('type' => 'string', 'default' => 'n'), "featured" => array('type' => 'string', 'default' => 'n'), "offset" => array('type' => 'int', 'default' => '0')), 'API that searches events', 'GET', false, false);
    expose_function("album.list", "ws_list_albums", array("offset" => array('type' => 'int', 'default' => '0')), 'API that lists albums', 'GET', false, false);
    expose_function("photo.list", "ws_list_photos", array("album_guid" => array('type' => 'int', required => true), "offset" => array('type' => 'int', 'default' => '0'), "batch_size" => array('type' => 'int', 'default' => ZHAOHU_MANAGER_SEARCH_LIST_LIMIT)), 'API that lists albums', 'GET', false, false);
}
开发者ID:pingwangcs,项目名称:51zhaohu,代码行数:9,代码来源:restapi.php

示例8: pleio_api_expose_functions

function pleio_api_expose_functions()
{
    foreach (pleio_api_methods() as $method => $info) {
        $info["params"] = isset($info["params"]) ? $info["params"] : array();
        $info["description"] = isset($info["description"]) ? $info["description"] : "Pleio API method " . $method;
        $info["method"] = isset($info["method"]) ? $info["method"] : "GET";
        $info["login_required"] = isset($info["login_required"]) ? $info["login_required"] : true;
        $public_method = isset($info["public_method"]) ? $info["public_method"] : "pleio." . $method;
        $private_function = isset($info["private_function"]) ? $info["private_function"] : "pleio_api_" . $method;
        expose_function($public_method, $private_function, $info["params"], $info["description"], $info["method"], true, $info["login_required"]);
    }
}
开发者ID:appstaat,项目名称:pleio_api,代码行数:12,代码来源:helpers.php

示例9: engape_init

function engape_init()
{
    elgg_register_page_handler('face_upload', 'engap_faceupload_page_handler');
    expose_function("reg.user", "eg_reg_user", array("email" => array('type' => 'string'), "password" => array('type' => 'string')), 'Register a new Users', 'GET', false, false);
    expose_function("list.river", "eg_list_river", array("refid" => array('type' => 'string'), "type" => array('type' => 'string'), "extra" => array('type' => 'string'), "optr" => array('type' => 'string'), "limit" => array('type' => 'string')), 'Provide List of activity', 'GET', false, true);
    expose_function("list.entity", "eg_list_entity", array("type" => array('type' => 'string'), "subtype" => array('type' => 'string'), "refguid" => array('type' => 'string'), "limit" => array('type' => 'string'), "extra" => array('type' => 'string'), "optr" => array('type' => 'string')), 'provide list of entity', 'GET', false, true);
    expose_function("get.entity", "eg_get_entity", array("guid" => array('type' => 'string')), 'Get the properties of an Entity', 'GET', false, false);
    expose_function("refresh.icons", "eg_refresh_entity_icons", array("refreshlist" => array('type' => 'string')), 'returns icontimes for given  set of icons', 'GET', false, true);
    expose_function("sync.entities", "eg_sync_entities", array("guids" => array('type' => 'string'), "iconguids" => array('type' => 'string')), 'returns icontimes for given  set of icons', 'GET', false, true);
    expose_function("wire.post", "eg_wire_post", array("wire_post" => array('type' => 'string')), 'Wire Post', 'POST', false, true);
    expose_function("engap.gettoken", "engap_gettoken", array('username' => array('type' => 'string'), 'password' => array('type' => 'string')), elgg_echo('engap.gettoken'), 'POST', false, false);
    expose_function("engap.refreshtoken", "engap_refreshtoken", array(), elgg_echo('engap.refreshtoken'), 'GET', false, true);
    expose_function("chat.post", "eg_chat_post", array("cp_guid" => array('type' => 'string'), "chat_post" => array('type' => 'string')), 'Chat Post', 'POST', false, true);
    expose_function("chat.get", "eg_chat_get", array("cp_guid" => array('type' => 'string'), "refid" => array('type' => 'string'), "optr" => array('type' => 'string')), 'Chat Get', 'GET', false, true);
    expose_function("submit.form", "eg_submit_form", array("formname" => array('type' => 'string'), "formdata" => array('type' => 'string')), 'html form', 'POST', false, true);
    elgg_register_page_handler('engap', 'engap_page_handler');
    elgg_register_plugin_hook_handler('rest', 'init', 'engape_rest_init');
}
开发者ID:enraiser,项目名称:engap,代码行数:18,代码来源:start.php

示例10: oauth_init

/**
 * Elgg oauth client and server
 * 
 * @author Justin Richer
 * @copyright The MITRE Corporation
 * @link http://mitre.org/
 */
function oauth_init()
{
    // Get config
    global $CONFIG;
    // include the OAuth library
    if (!class_exists('OAuthConsumer')) {
        include $CONFIG->pluginspath . 'oauth/lib/OAuth.php';
    }
    // set up the data store
    include $CONFIG->pluginspath . 'oauth/lib/ElggOAuthDataStore.php';
    // set up our actions and hooks
    // mechanisms to register and unregister consumers
    elgg_register_action('oauth/register', $CONFIG->pluginspath . 'oauth/actions/register.php');
    elgg_register_action('oauth/unregister', $CONFIG->pluginspath . 'oauth/actions/unregister.php');
    elgg_register_action('oauth/editconsumer', $CONFIG->pluginspath . 'oauth/actions/editconsumer.php');
    // mechanisms to let the user authorize and revoke their tokens
    elgg_register_action('oauth/authorize', $CONFIG->pluginspath . 'oauth/actions/authorize.php');
    elgg_register_action('oauth/revoke', $CONFIG->pluginspath . 'oauth/actions/revoke.php');
    // mechanisms to allow consumers of remote sites to request tokens
    elgg_register_action('oauth/gettoken', $CONFIG->pluginspath . 'oauth/actions/gettoken.php');
    // page handler
    elgg_register_page_handler('oauth', 'oauth_page_handler');
    // plugins hooks (for permissions on OAuth token and consumer objects)
    elgg_register_plugin_hook_handler('permissions_check', 'object', 'oauth_permissions_check');
    // cron to clean up old nonces and tokens
    elgg_register_plugin_hook_handler('cron', 'hourly', 'oauth_cron_cleanup');
    // add our menu pieces
    elgg_register_menu_item('site', array('name' => elgg_echo('oauth:menu'), 'text' => elgg_echo('oauth:menu'), 'href' => $CONFIG->wwwroot . 'oauth/authorize'));
    // hook for the PAM permissions system
    register_pam_handler('oauth_pam_handler', 'sufficient', 'user');
    register_pam_handler('oauth_pam_handler', 'sufficient', 'api');
    // API Test function
    expose_function('oauth.echo', 'oauth_echo', array('string' => array('type' => 'string')), 'A testing method for OAuth authentication', 'GET', true, true);
    // run our set up and upgrade functions
    run_function_once('oauth_run_once');
    run_function_once('oauth_upgrade_201004');
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:44,代码来源:start.php

示例11: wire_delete

 * @return bool
 */
function wire_delete($username, $wireid)
{
    $user = get_user_by_username($username);
    if (!$user) {
        throw new InvalidParameterException('registration:usernamenotvalid');
    }
    $thewire = get_entity($wireid);
    $return['success'] = false;
    if ($thewire->getSubtype() == "thewire" && $thewire->canEdit($user->guid)) {
        $children = elgg_get_entities_from_relationship(array('relationship' => 'parent', 'relationship_guid' => $wireid, 'inverse_relationship' => true));
        if ($children) {
            foreach ($children as $child) {
                $child->reply = false;
            }
        }
        $rowsaffected = $thewire->delete();
        if ($rowsaffected > 0) {
            $return['success'] = true;
            $return['message'] = elgg_echo("thewire:deleted");
        } else {
            $return['message'] = elgg_echo("thewire:notdeleted");
        }
    } else {
        $return['message'] = elgg_echo("thewire:notdeleted");
    }
    return $return;
}
expose_function('wire.delete_posts', "wire_delete", array('username' => array('type' => 'string'), 'wireid' => array('type' => 'int')), "Delete a wire post", 'POST', true, false);
开发者ID:digecon,项目名称:elgg_web_services,代码行数:30,代码来源:wire.php

示例12: expose_function

}
expose_function('user.friend.get_friends', "user_get_friends", array('username' => array('type' => 'string', 'required' => true), 'limit' => array('type' => 'int', 'required' => false), 'offset' => array('type' => 'int', 'required' => false)), "Register user", 'GET', false, false);
/**
 * Web service to obtains the people who have made a given user a friend
 *
 * @param string $username Username
 * @param string $limit    Number of users to return
 * @param string $offset   Indexing offset, if any
 *
 * @return array
 */
function user_get_friends_of($username, $limit = 10, $offset = 0)
{
    $user = get_user_by_username($username);
    if (!$user) {
        throw new InvalidParameterException(elgg_echo('registration:usernamenotvalid'));
    }
    $friends = get_user_friends_of($user->guid, '', $limit, $offset);
    $success = false;
    foreach ($friends as $friend) {
        $return[$friend->guid]['username'] = $friend->username;
        $return[$friend->guid]['name'] = $friend->name;
        $success = true;
    }
    if (!$success) {
        $return['error']['message'] = elgg_echo('friends:none');
    }
    return $return;
}
expose_function('user.friend.get_friends_of', "user_get_friends_of", array('username' => array('type' => 'string', 'required' => true), 'limit' => array('type' => 'int', 'required' => false), 'offset' => array('type' => 'int', 'required' => false)), "Register user", 'GET', false, false);
开发者ID:digecon,项目名称:elgg_web_services,代码行数:30,代码来源:user.php

示例13: ws_pack_users_expose_functions

/**
 * Exposes the users functions
 *
 * @return void
 */
function ws_pack_users_expose_functions()
{
    expose_function("users.get_logged_in_user", "ws_pack_users_get_logged_in_user", array(), elgg_echo("ws_pack:api:users:get_logged_in_user"), "GET", true, true);
    expose_function("users.register_for_push_notifications", "ws_pack_users_register_for_push_notifications", array("service_name" => array("type" => "string", "required" => true), "settings" => array("type" => "array", "required" => true)), elgg_echo("ws_pack:api:users:register_for_push_notifications"), "POST", true, true);
    expose_function("users.unregister_from_push_notifications", "ws_pack_users_unregister_from_push_notifications", array("service_name" => array("type" => "string", "required" => true)), elgg_echo("ws_pack:api:users:unregister_from_push_notifications"), "POST", true, true);
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:11,代码来源:users.php

示例14: ws_pack_river_expose_functions

/**
 * Exposes the river functions
 *
 * @return void
 */
function ws_pack_river_expose_functions()
{
    expose_function("river.get", "ws_pack_river_get", array("filter" => array("type" => "string", "required" => true), "guids" => array("type" => "array", "required" => false, "default" => array()), "offset" => array("type" => "int", "required" => false, "default" => 0), "limit" => array("type" => "int", "required" => false, "default" => 25), "posted_time_lower" => array("type" => "int", "required" => false, "default" => 0)), elgg_echo("ws_pack:api:river:get"), "GET", true, true);
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:9,代码来源:river.php

示例15: ws_pack_search_expose_functions

function ws_pack_search_expose_functions()
{
    expose_function("search.query", "ws_pack_search", array("query" => array("type" => "string", "required" => true), "offset" => array("type" => "integer", "required" => false), "limit" => array("type" => "integer", "required" => false)), elgg_echo("ws_pack:api:system:api:register_push_notification_service"), "GET", true, false);
}
开发者ID:pleio,项目名称:ws_pack,代码行数:4,代码来源:search.php


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