草庐IT

rows_to_zero

全部标签

php - 部署者 - fatal error : Call to undefined function server()

Deployerversion4.1.0运行depdeploytest时报如下错误:PHPFatalerror:Calltoundefinedfunctionserver()服务器ftn在配置文件中定义如下://Configureserversserver('test','test.server.com')->user('user')->identityFile('~/.ssh/id.pub','~/.ssh/user','password')->stage("test")->env('deploy_path','/var/www/project.com');这几乎是Deployers

php - 供应商更新破坏了 FOS 用户包 "Call to a member function has() on a non-object"

我为Symfony2.8项目更新了我的供应商,突然登录页面没有加载——相反我得到了这个:Error:Calltoamemberfunctionhas()onanon-objectinvendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.phpatline184"name":"hazardlog","license":"proprietary","type":"project","autoload":{"psr-4":{"":"src/"},"classmap":["app/AppK

php - Facebook FQL 用户表 `sex` 字段 : how to return male/female even the user is using different locale?

情况:我的facebook应用程序(http://apps.facebook.com/mymagicmirror/)需要检测用户的性别,然后查询异性或男性或女性FQL:SELECTuid,name,pic,sexFROMuserWHEREuidIN(SELECTuid2FROMfriendWHEREuid1='.$user_id.')andsex='male'问题:当facebook用户使用其他语言环境时,“性别”字段不再匹配“男性”和“女性”。相反,用中文来说,性别将变为男性/女性,而sex='male'的FQL将返回零结果。有什么解决方案可以查询所有男性/女性friend,即使fa

PHP int to date 问题

看看下面的代码:$t=77;date("H:i:s",$t);返回21:01:17当然,正确的结果应该是00:01:17之类的。$t值确实是由YouTubeGData返回的以秒为单位的值API,trought($videoEntry->getVideoDuration())。如何解决这个问题? 最佳答案 日期是特定于时区的。您需要将其设置为GMT以获得您想要的结果。date_default_timezone_set('GMT');$t=77;echodate("H:i:s",$t); 关

php - "Unable to find xref table"与 Dompdf0.6a + FPDI

我正在尝试使用dompdf0.6a从html生成一个pdf文件并且工作正常,但随后我需要对其进行加密以进行保护,但出现错误FPDFerror:Unabletofindxreftable-MaybeaProblemwith'auto_detect_line_endings'但是,如果我使用旧的dompdf版本,它工作正常。我猜它会生成fpdi不支持的更新的pdf版本。顺便说一句。我将其追踪到FPDI/pdf_parser.php:208(内部方法pdf_read_xref()) 最佳答案 我能够通过使用Adob​​eAcrobatPr

php - 如何处理 "Call to a member function on a non object"

你如何确保你不会收到致命的“调用非对象上的成员函数”?Foxexample,我的模板中经常有这样的东西:(我觉得非常方便和可读):getRelatedObject()->getProperty()->formatProperty()?>但是,只有当每个方法都返回一个正确类的对象时,这才有效。但情况并非总是如此。相关对象可能不存在于数据库中,因此它返回null并且您将面临fatalerror。然后你去手动检查返回值:getRelatedObject())&&is_object($object->getRelatedObject()->getProperty())):getRelatedO

php - Google Maps V3 Zoom to Show all markers 不工作

我正在使用GoogleMapsV3API,在map上创建多个标记后,我很难让map缩小以显示所有标记。现在下面的代码只显示标记而不调整缩放。你能找到那里的错误吗?谢谢!functioninitialize(){varlatlng=newgoogle.maps.LatLng(1.289566,103.847267);varoptions={zoom:15,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:false};varmap=newgoogle.maps.Map(document.getElement

php - SMTP 错误 : Could not connect to SMTP host

我有这段代码,在我的本地服务器上一切正常。电子邮件发送没有任何问题。但是现在我将内容传递给网络服务器,我得到了这个错误...SMTPError:CouldnotconnecttoSMTPhost.服务器启用了SSL..正确吗?那么,问题是什么?$mail=newPHPMailer();$mail->IsSMTP();$mail->SMTPAuth=true;//enableSMTPauthentication$mail->SMTPSecure="ssl";//setstheprefixtotheservier$mail->Host="smtp.gmail.com";//setsGMAI

PHP XML Expat 解析器 : how to read only part of the XML document?

我有一个具有以下结构的XML文档:helloclienttimehelloclienthowcanIhelp?operatortimegoodmorningclienttimegoodmorninghowcanIhelp?operatortime我能够创建解析器并打印出整个文档,但问题是我只想打印(用户)节点和具有特定属性(id)的子节点。我的PHP代码是:if(!empty($_GET['id'])){$id=$_GET['id'];$parser=xml_parser_create();functionstart($parser,$element_name,$element_att

php - Google API 联系人 v.3,PHP : add a contact to the group

我成功地使用cURL创建了一个新的联系人,但是当我想为这个联系人添加组成员时,我收到400错误。我读过thisdocs并提出了同样的要求,但没有奏效。我究竟做错了什么?感谢您的任何想法!这就是我创建带有组信息的XML的方式:$doc=newDOMDocument('1.0','UTF-8');$doc->formatOutput=true;$entry=$doc->createElement('entry');$entry->setAttribute('gd:etag',$etag);$doc->appendChild($entry);$category=$doc->createEle