草庐IT

fnon-call-exceptions

全部标签

PHP 5.6 : ArrayAccess: Function isset calls offsetGet and causes undefined index notice

我编写了实现ArrayAccess接口(interface)的简单PHP类:classMyArrayimplementsArrayAccess{public$value;publicfunction__construct($value=null){$this->value=$value;}publicfunction&offsetGet($offset){var_dump(__METHOD__);if(!isset($this->value[$offset])){thrownewException('Undefinedindex:'.$offset);}return$this->val

php - $serviceUrl : Caught Exception: Missing serviceUrl configuration value

我正在用PHP脚本创建RequestReport。我似乎被$serviceUrl的问题困住了——这给了我很好的时尚"CaughtException:MissingserviceUrlconfigurationvalue.YoumayobtainalistofvalidMWSURLsbyconsultingtheMWSDeveloper'sGuide,orreviewingthesamplecodepublishedalongsidethislibrary.ResponseStatusCode:-1ErrorCode:InvalidServiceUrlErrorType:RequestI

php - 未捕获的异常 'Google_IO_Exception' 消息为“HTTP 错误 : Unable to connect

我有一个任务(查询)运行一些从gmail邮箱检索数据的php代码。它一直运行良好,直到上周五(2015年4月10日),现在我收到此错误日志:E11:58:26.0942015-04-152003.38KB14.2s/code.php0.1.0.2--[15/Apr/2015:07:58:26-0700]"POST/code.phpHTTP/1.1"2003462"https://xxxxxxxxx.appspot.com/start.php?email=test@email.com""AppEngine-Google;(+http://code.google.com/appengine

php - 查找并替换 html(Zend_Dom_Query+createElement()) : Call to a member function createElement() on a non-object

我需要在html代码中查找并替换一些html元素(我遵循了这个答案:GettinganelementfromPHPDOMandchangingitsvalue),为此我检索了内容:$transport=$observer->getTransport();$html=$transport->getHtml();$dom=newZend_Dom_Query($html);$document=$dom->getDocument();这是结果:TitleItems2to2of2totalShow1perpagePage:12Viewas:Grid List SortByPo

php - 错误 : Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR

我尝试将pdf文件转换为图像。我检查这个website,并按照所有步骤说明进行操作。1.obtainanapilicensekey2.downloadtheAPIClass3.Deploythephpfile4.createmypdffile但是当我运行我的文件时发生了这个错误:错误fatalerror:未捕获的SoapFault异常:[WSDL]SOAP-ERROR:解析WSDL:无法从“http://apis.pdfaid.com/pdfaidservices/Service1.svc?wsdl”加载':无法在C:\xampp\htdocs\Web_V2\PdfaidService

php - Laravel 表单请求 : bad method be called

当我使用带有Post方法的表单请求时,响应是“index()”方法响应。但它必须是“store(myRequest$request)”方法。如果我从“store()”中删除myRequest$request方法,它就可以工作。我迷路了。请帮助我。我的Controller:collectionRepository=$collectionRepository;}publicfunctionindex(){return$this->run(function(){return$this->collectionRepository->all()->get();});}publicfunction

php - Symfony2 Monolog 电子邮件只有一些异常(exception)

我在Symfony2项目中使用Monolog,我已经厌倦了看到由于访问被拒绝和其他一些我不感兴趣的情况(有自动请求导致这种情况)而发生的异常电子邮件。有没有办法为Monolog指定一个回调,根据我是否要通过电子邮件发送它返回true/false? 最佳答案 据我所知,您必须覆盖ExceptionListener并控制您的手。在此覆盖过程之后,您可以发送您希望通过电子邮件发送的内容。 关于php-Symfony2Monolog电子邮件只有一些异常(exception),我们在StackOv

php - fatal error : Cannot call constructor in HtmlHelper. php (CakePHP)

我正在为我的应用程序使用cakephp2.1.1。我有一个Controller,我在这个Controller中使用文件缓存。在Controller的操作中,我使用插件NUSOAP调用SOAPService。我有两个Action:1。索引publicfunctionindex(){$items=Cache::read('items','tenMinutes');//tenMinutesistheconfigurationofcacheif($items){$service=newService();$items=$service->callService();Cache::write('

php - 为什么我们使用像 "call_user_func($callback,$param)"而不是 "$callback($param)"这样的代码

这个问题在这里已经有了答案:PHPcall_user_funcvs.justcallingfunction(8个答案)关闭9年前。PHP只是一种脚本语言,所以我们可以简单高效地做很多事情。为什么不使用像“$callback($param)”这样简单易行的方法呢?

php - 更新 Google 日历 - fatal error : Call to undefined function dateTime()

我正在尝试使用PHPAPI更新Google日历。我已成功创建Google日历事件并自动获取事件ID,但是当我尝试更新事件时,出现此错误:PHPFatalerror:CalltoundefinedfunctiondateTime()inpublic_html/googleapi/calendarupdate.phponline45.它指的是行:$event->setStart.dateTime($startdatetime);这是我当前的错误PHP代码:setAssertionCredentials($credentials);if($client->getAuth()->isAcces