草庐IT

get_declared_classes

全部标签

php - 使用 Guzzle 通过 Symfony 将 HTTP GET 发送到外部 API

我是Symfony开发的新手,如果这是一个愚蠢的问题,请原谅。我正在尝试从外部API获取JSON数据。我尝试通过Postman运行GET请求并返回JSON格式的正确数据,因此我知道我的URL是正确的。我编写了以下代码以使用Guzzle从我的外部APIHTTP获取一组JSON数据:'http://my.api.url/']);//Sendarequesttohttp://my.api.url/site/67/module/1449/item$response=$client->request('GET','site/67/module/1449/item');dump($response

php - get_meta_tags 不适用于同一域或来源

我正在尝试使用get_meta_tags函数来获取url的元信息。它无法给我来自相同来源或域的url的元信息。就像我在Controller上做的一样http://example.com/fetch$tags=get_meta_tags("http://example.com/blog/my-awesome-blog-post");print_r($tags);试图获取我网站上某个页面的元信息http://example.com/blog/my-awesome-blog-post.分享两张截图:开发实例错误:本地实例:出现类似无法打开流的错误:已达到重定向限制,中止。这是我遇到的错误。我

php - file_get_contents() 作用于 facebook api

file_get_contents()[function.file-get-contents]:SSL:Connectionresetbypeerin上file_get_contents("https://api.facebook.com/method/events.invite?eid=".$eid."&uids=".json_encode($uids)."&access_token=".$facebook->getAccessToken())它邀请他们选择的用户friend参加事件,但是我在这篇文章的顶部遇到了错误。用cURL测试,同样的错误。已测试我回去用cURL测试了一些东西$

php - 如何在 CodeIgniter 的不同函数中将后方法表单提交到相同的 get-url?

我发现CodeIgniter表单验证通过load->view方法显示错误消息,如果使用“redirect”将丢失字段错误消息。目前我使用一个函数显示表单页面,另一个函数处理表单帖子。classUsersextendsCI_Controller{function__construct(){parent::__construct();}publicfunctionsign_up(){$this->load->view('users/sign_up');}publicfunctiondo_sign_up(){$this->form_validation->set_rules('user_lo

php - Not a valid entity or mapped super class 错误来自 Doctrine

我正在尝试设置Doctrine(2.2.1)以与我的网站一起使用,并且我遵循了入门指南,但我收到以下错误:Fatalerror:Uncaughtexception'Doctrine\ORM\Mapping\MappingException'withmessage'ClassDocumentFieldisnotavalidentityormappedsuperclass.'inC:\inetpub\sites\hd\Doctrine\ORM\Mapping\MappingException.php:147Stacktrace:#0C:\inetpub\sites\hd\Doctrine\

当 allow_url_fopen 打开时,php file_get_contents 返回 null

我收到警告消息:file_get_contents未能打开流权限被拒绝我已经在php.ini文件中将all_url_open设置为on。我的php文件在我的apache服务器中,它试图从同一台机器上的tomcat服务器访问一个url(返回JSON)。php文件中的代码如下所示:$srcURL='http://samemachine:8080/returnjson/';$results=file_get_contents($srcURL);我也尝试过curl,但它什么也没返回,也没有访问tomcat服务器:functioncurl($url){$ch=curl_init();curl_s

PHP Xpath : Get all href's that contain "letter"

假设我有一个已加载的html文件,我运行此查询:$url='http://www.fangraphs.com/players.aspx';$html=file_get_contents($url);$myDom=newDOMDocument;$myDom->formatOutput=true;@$myDom->loadHTML($html);$anchor=$xpath->query('//a[contains(@href,"letter")]');这给了我这些anchor的列表,如下所示:Aa但我需要一种方法来只获取“players.aspx?letter=Aa”。我想我可以试试:$

ssl - file_get_contents() 无法在 youtube 上正常工作

我想从youtube获取数据,我正在使用file_get_contents()方法。有时它工作正常但有时它不工作并显示以下错误file_get_contents()[function.file-get-contents]:SSL:cryptoenablingtimeoutfile_get_contents()[function.file-get-contents]:Failedtoenablecryptofile_get_contents(https://gdata.youtube.com/feeds/api/users/default?access_token=token&v=2&a

php - 两个捆绑关系中的 Symfony2 "class not found in the chain"

在尝试跨束定义一对多关系时,会发生以下情况:Theclass'Mana\ClientBundle\Entity\Member'wasnotfoundinthechainconfigurednamespacesMana\SplitBundle\Entity更新3:我现在已经看到关于这种关系可以和不能完成的相互矛盾的答案。假设它可以(因为stackoverflow的其他人似乎已经做到了),除了在AppKernel.php中注册bundle并在实体中输入注释之外,还需要什么配置?resolve_target_entity_listener似乎没有什么不同。更新2:好吧,我知道我在这里超出了我

php - 为什么我在验证 reCAPTCHA 时收到此 "SSL certificate problems: unable to get local issuer certificate"错误?

我在PHP和Laravel方面都是新手,我遇到了以下奇怪的问题。我开发了一个包含GooglereCAPTCHA字段的注册表单,如下所示:.............................................................................................................................................................................................Captcha{!!app('captcha')->display();!!}