草庐IT

facebook-test-users

全部标签

php - ' fatal error : Class 'CURLFile' not found' error in Facebook PHP Application for 'upload photo to user' s timeline'

我刚刚尝试使用FacebookPHPSDK开发一个Facebook应用程序。Facebook开发者网站中给出的示例代码如下。'YOUR_APP_ID','secret'=>'YOUR_APP_SECRET','fileUpload'=>true,'allowSignedRequest'=>false//optionalbutshouldbesettofalsefornon-canvasapps);$facebook=newFacebook($config);$user_id=$facebook->getUser();$photo='./mypic.png';//Pathtothepho

php - 数据库更改自动通知 :similar with facebook friend request

我想开发一个基于phpmysql的社交网站。注册用户可以选择将其他用户添加为friend,就像在Facebook中所做的那样。如果用户A单击用户B个人资料上的“添加好友”链接,好友请求记录将相应地保存在A和B的数据库中。当B访问正在等待的friend请求显示页面(例如个人资料页面)时,请求将显示为查询B的数据库。我认为这很简单。但是当B在线时,C可以向B发出好友请求。我想通知BC已经发出这样的请求,即使B没有刷新他/她的个人资料页面(或任何页面显示等待中的好友请求的选项)。至于通知的类型,它可以是一个显示好友请求等待总数的框。单击该框将显示详细信息。或者它可以是任何其他形式。我的兴趣点

php - 如何在单元测试(PHPUnit)中的 trigger_error(..., E_USER_WARNING) 之后执行代码?

我有这样的代码:classToBeTested{functionsimpleMethod($param){if(0===$param){trigger_error("Paramis0!",E_USER_WARNING);returnfalse;}returntrue;}}并测试这段代码:classSimpleTestextendsPHPUnit_Framework_TestCase{functiontestSimpleMethod(){$toBeTestedObject=newToBeTested();$this->assertFalse($toBeTestedObject->simp

php - 这个解决方案有什么问题? (Perm-Missing-Elem codility test)

我已经开始玩codility并遇到了这个问题:Azero-indexedarrayAconsistingofNdifferentintegersisgiven.Thearraycontainsintegersintherange[1..(N+1)],whichmeansthatexactlyoneelementismissing.Yourgoalistofindthatmissingelement.Writeafunction:intsolution(intA[],intN);that,givenazero-indexedarrayA,returnsthevalueofthemissi

php - Laravel 5.2 -> 5.3 Auth::user() 返回 null

我已经从5.2升级到5.3,Auth::user()返回null。路线Route::group(['middleware'=>['auth']],function(){Route::get('/test','MyController@showMain');}Controller构造函数调用Auth::check()返回nullpublic$user;publicfunction__construct(){$this->user=Auth::user();}publicfunctionshowMain(){return$this->user;}ControllershowMain调用Au

php - 如何使用 php graph Api 保存 facebook 个人资料图片

我正在使用这个curl类来保存文件-->classCurlHelper{/***Downloadsafilefromaurlandreturnsthetemporaryfilepath.*@paramstring$url*@returnstringThefilepath*/publicstaticfunctiondownloadFile($url,$options=array()){if(!is_array($options))$options=array();$options=array_merge(array('connectionTimeout'=>5,//seconds'tim

php - 如何检测用户在 iframe 或直接 url 中打开我的 Facebook 应用程序

假设我的Facebook应用程序url是http://fb.domain.com/应用程序url是http://apps.facebook.com/demoapp/现在我希望用户不能直接打开应用程序url,而必须在Facebook的iframe中。如果用户直接打开链接,我如何检测并重定向到http://apps.facebook.com/demoapp/的链接?让我知道key。 最佳答案 如果您只是想检测用户是否在iframe中打开了您的URL,启用javascript,您可以这样做:if(window!=window.top){/

php - 通过 API 创建和配置 Facebook 应用程序

我正在寻找通过FacebookAPI创建和配置Facebook应用程序的解决方案。它的图形API/FQL或RESTAPI无关紧要,但我找不到任何方法来做到这一点。 最佳答案 你没有找到,因为这是不可能的。Facebook决定不支持使用API管理和创建应用程序,以避免由机器人创建或编辑应用程序。使用API只能执行一些操作:迁移(比如迁移到OAuth2,...)限制条件(地域、年龄...)用户封禁(添加/删除)测试用户创建/编辑/删除参见http://developers.facebook.com/docs/reference/api/

php - laravel 护照 : Request user() returning null outside auth:api middleware, 和内部返回用户对象

当我尝试使用auth:api中间件获取登录用户的详细信息时,它会在我的Controller函数中返回包含详细信息的用户对象。api.php(withauth:apimiddlewarereturnsUserobject)Route::group(['middleware'=>'auth:api'],function(){Route::get('users/mentor_details/{uuid}','UserController@getMentorProfileDetails');});但是当我试图在这个auth:api中间件之外获取登录用户详细信息时,它返回null。api.php

php - 区别 <?php echo '$test' ; ?> 和 <?=$test?>

有什么区别和? 最佳答案 假设您的意思是,两者实际上是同一件事。问题是,你想要多便携。几乎所有支持PHP的地方都支持,但是很多管理员禁用语法。 关于php-区别和,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/3623458/