草庐IT

token_name

全部标签

php - Firebase FCM 错误 JSON_PARSING_ERROR : Unexpected token END OF FILE at position

我正在尝试使用php通过firebase的fcm服务发送通知。这是我到目前为止得到的:$ch=curl_init();$payload=['to'=>'/topics/'.ANDROID_TOPIC,'notification'=>['message'=>1]];$headers=['Content-Type:application/json','Content-length:'.sizeof(json_encode($payload)),'Authorization:key='.FIREBASE_KEY];curl_setopt($ch,CURLOPT_URL,'https://fc

php - Firebase 云消息传递 HTTP V1 API : How to Get the Auth 2. 0 访问 token 与 REST 调用?

为了在PHP中使用HTTPV1API(不是遗留API),必须使用REST接口(interface)。https://firebase.google.com/docs/cloud-messaging/send-message#top_of_page我想知道如何获得Auth2.0访问token?https://firebase.google.com/docs/cloud-messaging/auth-server由于没有适用于PHP的GoogleAPI客户端库(请参阅上面链接中的示例),如何通过REST调用接收Auth2.0token(无需显示PHP代码)?相关问题:一旦收到这个短命tok

php - OAuth2 token ,消息 : '{ "error": "access_denied" }' returned when I try to update Google Calendar using OAuth (Service Account)

我正在使用适用于PHP的Google标准库来使用日历服务,并且我已经通过GoogleAPI控制台为OAuth2.0身份验证设置了一个服务帐户类型。我的主要目标是通过批量更新用户的谷歌日历(例如:user@organisationname.com)(当用户不在线时)。例如。更新用户日历中的事件。当用户登录应用程序(使用OAuth2.0)时,他/她将为应用程序提供“管理您的日历”、“查看您的日历”和“在我不使用应用”以下代码用于使用OAuth2.0登录setApplicationName("GoogleCalendarPHPStarterApplication");$client->set

php - laravel 5 csrf_token 值为空

为什么laravel5csrf_token值总是空的?我如何获得该token值?我试过了,{!!csrf_token!!},{{csrf_token}}and{{Form::open()}}....{{Form::close()}}我的输出 最佳答案 这是因为您没有使用web组中间件。Laravel足够聪明,知道如果您不使用该组,则不需要token。尝试在Route::group(['middleware'=>'web']...中移动你的路线并告诉我们它:)来源:不久前我犯了同样的错误。

PhpStorm:获取 "Methods with the same name as their class will not be constructors"的代码检查警告

好吧,我终于切换到PHP7。我的代码有点旧,会被翻新。一些问题是:classMagicClassfunctionMagicClass(){//etc}在执行过程中给出弃用警告:Deprecated:MethodswiththesamenameastheirclasswillnotbeconstructorsinafutureversionofPHP;MagicClasshasadeprecatedconstructorin这很好:classMagicClassfunction__construct(){//etc}如何让PhpStorm代码检查来警告我当前代码库中的此类错误?

php - Nginx 为静态文件代理不正确的 fastcgi_script_name

server{listenloc.app:80;root/app/frontend/web;indexindex.php;location/{try_files$uri$uri//index.php$is_args$args;}location~^/admin{proxy_passhttp://127.0.0.1:81;}location~*\.php${#phpconf}}server{listen127.0.0.1:81;root/app/backend/web;indexindex.php;location/{try_files$uri$uri//index.php$is_arg

javascript - 如何将 codeigniter 的 CSRF token 传递给 Paypal Express Checkout?

我正在将PaypalExpressCheckout与服务器端REST集成到我的codeigniter网站中。根据Paypal文档,我将以下内容添加到我的结帐页面:varCREATE_PAYMENT_URL='https://#######/paypal/create';varEXECUTE_PAYMENT_URL='https://######/paypal/execute';paypal.Button.render({env:'production',//Or'sandbox'commit:true,//Showa'PayNow'buttonpayment:function(){re

php - 创建 Google 联系人 --> 为什么只有 "NAME"没有插入新联系人?

这是我提出的要求:-//createnewentry$doc=newDOMDocument();$doc->formatOutput=true;$entry=$doc->createElement('atom:entry');$entry->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:atom','http://www.w3.org/2005/Atom');$entry->setAttributeNS('http://www.w3.org/2000/xmlns/','xmlns:gd','http://schemas.go

php - Drupal - 如何使用 taxonomy_get_term_by_name 从名称中获取术语 ID

我尝试使用以下代码从术语中获取termId:$term=taxonomy_get_term_by_name($address_string);$termId=$term[0]->tid;有1个结果,但它显示为term[30]-所以上面的代码不起作用。我以为我可以通过查看第一个元素来访问术语数组-例如$term[0]我做错了什么?这是var_dump($term)的结果:array(size=1)30=>object(stdClass)[270]public'tid'=>string'30'(length=2)public'vid'=>string'4'(length=1)public'

php - Laravel - JWT Auth 无法从请求中解析 token

我在我的中间件中添加了以下代码,用于使用JWTAuth进行用户身份验证,它适用于中间件处理的所有路由。publicfunctionhandle($request,Closure$next){if($request->has('token')){try{$this->auth=JWTAuth::parseToken()->authenticate();return$next($request);}catch(JWTException$e){returnredirect()->guest('user/login');}}}但是对于使用PostMethod的一条路线,其中token已正确传递