草庐IT

working_dir

全部标签

php - PHP 中 Python 的 dir 函数的等价物

有没有Python的dir()的等价方法在PHP中?如果我能看到哪些方法与特定数据类型或类相关联,那就太好了。 最佳答案 AfaikPHP没有仅等同于dir的功能,但您可以使用get_class_methods等函数获取此类信息:http://php.net/manual/en/ref.classobj.php 关于php-PHP中Python的dir函数的等价物,我们在StackOverflow上找到一个类似的问题: https://stackoverflo

php - artisan 队列:work and artisan horizon:work?有什么区别

我在Horizo​​n中使用Laravel队列和Redis。Supervisor正在运行artisanhorizo​​n,它会生成进程/usr/bin/php7.2artisanhorizo​​n:workredis是否需要运行queue:work或者Horizo​​n是否已经可以自行处理队列? 最佳答案 安装Horizo​​n后,Artisanqueue:work和horizon:work命令执行相同的任务,除了horizon:work接受它用来与Horizo​​n主管协调的参数。当运行Horizo​​n主管进程时(通过artis

PHP fatal error : Call to a member function find() on a non-object however my function work

我在代码的第71行收到此错误,但是该行的功能已正确执行,并且按照我的预期执行。但是,我注意到我的错误日志中充满了这些行:[09-Dec-201314:54:02UTC]PHPFatalerror:Calltoamemberfunctionfind()onanon-objectin/home/sportve/public_html/open_event_common.phponline71我检查的内容:simple_html_dom_parser已包含在内,第71行打算执行的此功能正在运行。这是我的代码的第71行:$content->find('a.openevent',0)->inne

php - 在 PHP : (*UTF8) Works on Windows but not Linux 中使用 preg_match 匹配 UTF 字符

我有一个简单的正则表达式来检查用户名:preg_match('/(*UTF8)^[[:alnum:]]([[:alnum:]]|[_.-])+$/i',$username);在本地测试中(使用WAMP的Windows7),这将允许用户名使用UTF字符(例如é或ñ)。但是,当我在实际托管网站的服务器上进行测试时,我收到以下警告:Warning:preg_match()[function.preg-match]:Compilationfailed:(*VERB)notrecognizedatoffset5in/home/sites/vgmusic.com/test/Core/Impl/Fo

php - Magento : getAttributeText doesn't work

我有一个名为“Housing”的下拉属性(属性代码“housing”)。我想获取产品所选选项的文本,但“getAttributeText”函数不返回任何内容。我的代码:$product_object=Mage::getModel('catalog/product')->load($productId);$housing=$product_object->getHousing();echo$housing;echo"";$housing=$product_object->getAttributeText('housing');echo$housing;echo"";$housing=$p

php - fsockopen() : unable to connect not work with PHP (Connection timed out)

我有这个代码:$domain='massag.com';$hosts=array();$mxweights=array();getmxrr($domain,$hosts,$mxweights);var_dump($hosts);var_dump($mxweights);$host=gethostbynamel($hosts[0])[0];var_dump($host);$f=@fsockopen($host,25,$errno,$errstr,10);if(!$f){var_dump('NOTCONNECTED');}它没有连接到smtp服务器但是当我使用命令时smtp:217.196

php - 基于 Laravel session 的身份验证 :api middleware not working

我尝试使用Laravel5.3的AuthScaffolding,包括api路由。我想为api守卫使用session驱动程序,但显然这没有任何影响。在我使用有效用户登录应用程序后(所以我从/login到/home)我尝试输入路径/api/user,但它总是将我重定向到/home。RedirectIfAuthenticated中间件重定向用户。以下是我的尝试以及测试应用程序的快速概览://In"app\Http\Middleware\RedirectIfAuthenticated.php"if(Auth::guard($guard)->check()){returnredirect('/h

php - 警告 : open dir: not implemented

我是PHP新手,正在尝试构建脚本。当我加载脚本时,出现以下错误:警告:opendir(http://www.hetweerinboskamp.nl/voorpagina/movies)[function.opendir]:打开目录失败:未实现4){$rawd=parsename($file);$hal.='newDate('.substr($rawd,0,4).','.substr($rawd,4,2).'-1,'.substr($rawd,6,2).'),';//$hal.=$rawd.',';}closedir($handle);} 最佳答案

php - Wamp 服务器 : Multiple Virtual Hosts are not working on Windows

我在Windows上有两个虚拟主机(例如:test1.dev和test2.dev)。但它总是为两个虚拟主机加载test1.dev的内容。以下是我的文件:主持人:127.0.0.1localhost127.0.0.1test1.dev127.0.0.1test2.devhttpd.conf:SSLRandomSeedstartupbuiltinSSLRandomSeedconnectbuiltinInclude"c:/wamp/alias/*"ServerNametest1.devDocumentRoot"C:\wamp\www\test1\public"ServerNametest2.

php - Facebook 图谱 API 更改 : Picture type (size) no longer working?

根据Facebook的GraphAPI文档(here),您可以通过以下URL访问用户个人资料图片的各种尺寸:https://graph.facebook.com/(userid)/picture?type=smallhttps://graph.facebook.com/(userid)/picture?type=large您会注意到,第一个解析为以_t.jpg(小缩略图)结尾的url,第二个以_n.jpg(大图像)结尾。到目前为止,一切都很好。同样,我们应该能够像这样查询这些图像:https://graph.facebook.com/(userid)?fields=picture&ty