草庐IT

channel_name

全部标签

php - Laravel Echo - 允许访客连接到状态 channel

我正在使用laravel-echo-server来运行LaravelEcho来广播事件。我有一个用户计数器channel,它显示应用程序上的所有用户。为此,我正在使用存在channel。这对于已登录的用户来说效果很好,但guest永远无法连接。我在BroadcastServiceProvider中设置了以下内容:Broadcast::channel('global',function(){return['name'=>'guest'];});据我所知,应该允许每个人都以“客人”身份进入。我猜有一些中间件或身份验证在此之前正在检查,我需要为此channel禁用。如果能帮助所有客户加入此在

php - 使用 Youtube API v3 从 Youtube channel 获取视频列表(没有烦人的身份验证弹出窗口)

我有一个youtubechannel,我正在使用YoutubeAPIv3提取在该channel中上传的视频列表(使用php库)。以下是我正在使用的代码片段:require_once'google-api-php-client/src/Google_Client.php';require_once'google-api-php-client/src/contrib/Google_YouTubeService.php';session_start();$OAUTH2_CLIENT_ID='xxxxxxxxx';$OAUTH2_CLIENT_SECRET='xxxxxxxxx';$clien

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

php - 使用 ImageMagick (php) 将 RGB channel 合并回单个图像

所以我遇到了ImageMagick和php的情况,我需要分别处理每个RGBchannel,然后将它们合并回最终图像。所以在我下面的代码中,$red、$green和$blue是channel(作为灰度图像)。以下代码是我尝试过的代码(以及一些变体),但每次我最终得到的图像只有青色、洋红色或黄色显示出来。在本例中,生成的图像为青色。$im->removeImage();$im->addImage($red);$im->addImage($green);$im->addImage($blue);$img=$im->combineImages(self::CHANNEL_ALL);$im->r

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 广播 channel - 检查连接

我在文档或搜索中找不到这个,也许有人有一些提示。我正在尝试检查后端的存在channel上有多少连接。我可以像这样使用Echo在前端检查是否正常:Echo.join('chat').here((users)=>{//users.lengthisthepropercountofconnections})但有没有一种方法可以获得相同数量的连接,但在Laravel某处的后端代码中? 最佳答案 如果您使用的是Pusher,后端只需执行以下操作:$response=$pusher->get('/channels/presence-channel

PHP - $request->getPost ('first_name' )

publicfunctionprocess(Zend_Controller_Request_Abstract$request){$this->first_name=$this->sanitize($request->getPost('first_name'));....}我的问题是$request是类zend_controller_request_abstract的一个实例,但是getpost是类zend_controller_request_http中定义的一个函数,它扩展了zend_controller_request_abstract,那为什么$request直接调用getPos

php - 在 PHP 中使用 session_name() - 无法访问数据

当我使用时:session_name('fObj');session_start();$_SESSION['foo']='bar';随后加载页面并运行:session_start();print_r($_SESSION);不返回session数据。如果我删除session_name();它工作正常。有谁知道如何使用具有不同session名称的session?更新:如果我运行上面的代码,作为两个页面加载,然后更改为:session_name('fObj');session_start();print_r($_SESSION);我可以访问数据。但是,如果它只在我第一次加载没有行的页面时才有