草庐IT

In-memory

全部标签

php - fatal error : Class not found in AppKernel. PHP

我已经按照Symfony文档生成了一个新的Bundle(ImgBundle),但是当在浏览器中重新加载应用程序时,它无法识别bundle的主类。这是我的ImgBundle.php:应用内核.php:getEnvironment(),['dev','test'],true)){$bundles[]=newSymfony\Bundle\DebugBundle\DebugBundle();$bundles[]=newSymfony\Bundle\WebProfilerBundle\WebProfilerBundle();$bundles[]=newSensio\Bundle\Distribu

php - 文件()[函数.文件] : php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

从文件("http://www.otherdomain.com")获取内容时出现以下错误。file()[function.file]:php_network_getaddresses:getaddrinfofailed:Temporaryfailureinnameresolution域服务器是linux。如何解决这个问题? 最佳答案 引用:Ifyou'rehavingproblemswithfopen("url...")butyoucanrun'hosturl'inashellwindowandgetthecorrectlookup

php - Symfony2 : "Fatal error: Class service..." while trying to include a class as an service in config. yml (TCPPDF)

我正在尝试在Symfony2(2.1.4-DEV)中使用服务容器包含类TCPDF的扩展。为此,我编辑了symfony/app/config/config.yml:services:extend_pdf:class:Acme\VSBundle\extend_pdf在文件symfony/src/Acme/VSBundle/extend_pdf.php中,我有一个像这样的虚拟类:我将其加载到Controller中,例如:functiontestAction(){$extendpdf=$this->get('extend_pdf');returnnewResponse('success');}

php - Facebook 登录无法连接到 graph.facebook.com :443; Operation now in progress

我正在尝试实现facebook登录,我有以下代码。$helper=newFacebook\FacebookRedirectLoginHelper(URL('facebook/login'),$apiVersion=NULL);try{$session=$helper->getSessionFromRedirect();}catch(Facebook\FacebookRequestException$ex){//WhenFacebookreturnsanerrorreturnRedirect::to('login')->with('error-message','Facebookcoul

php - 在 Symfony 文件对象中加载 'php://temp' 或 'php://memory' 文件

我的数据库中有一个blob资源。我想暂时将这个文件包装到SymfonyFile对象中,因为我想使用特定的方法,如扩展猜测器,并应用symfony文件验证器。我想将这个临时文件存储到内存中,因为blob是小文件,我不想在每个请求中都在磁盘中创建一个文件。我试过这样做:$file=newFile('php://temp');但是symfony抛出一个错误,提示“文件“php://temp”不存在”。查看文件源,错误是由构造函数中进行的“is_file($path)”检查引起的,我可以使第二个参数中的false无效。但是,如果我这样做:$file=newFile('php://temp',f

php - 交响乐 : multiple applications in one test

我正在为我的项目的后端应用程序模块编写功能测试。为了测试某些功能,我需要从前端应用程序模拟用户操作。所以,我创建了2sfTestFunctionalinstances:$frontendBrowser=newfrontendTestFunctional();$backendBrowser=newbackendTestFunctional();这些类基本上都继承自sfTestFunctional。现在,正如我们所知,symfony中的每个应用程序都有自己的上下文实例,所以我们必须先切换到它:sfContext::switchTo('frontend');//thisworksfine$f

php - 如何为 Apache/PHP 中的特定脚本设置更高的 memory_limit、post_max_size?

我有一个Web应用程序,它将对虚拟主机的所有请求重定向到Controller,然后Controller根据URL决定要包含和运行哪些文件。有一个Web服务可以通过POST接受大型XML文件。我需要应用程序的memory_limit和post_max_为~32M,接受XML的服务除外,这需要它们的限制接近1024M。ini_set('memory_limit','1024M')在脚本中有效,但不适用于post_max_size。我似乎不知道该怎么做。我正在尝试类似的东西:ServerNametest.comDocumentRoot/var/www/test.com/htmlphp_adm

php - 如何在 Doctrine2 中使用带有数组 IN 参数的 native 查询

我有这个用doctrine写的原生SQLSELECTCOUNT(DISTINCTt.int_task_type_id)asa_countFROMtbl_xref_people_tasktWHEREt.bit_completed=trueANDt.int_people_id=:peopleIdANDt.int_task_type_idIN(:taskType)我必须用原生SQL编写它,因为int_task_type_id是分层模型类中的鉴别器列。问题是我无法执行以下操作:$query->setParameter(':taskType',implode(',',$taskType));或者

php - Doctrine 迁移 : There are no commands defined in the "" namespace

我正在尝试将DoctrineMigrations设置为独立程序,但遇到了一些麻烦。我在同一文件夹中有doctrine-migrations.phar和migrations.yml。migrations.yml包含以下内容:name:DoctrineSandboxMigrationsmigrations_namespace:DoctrineMigrationstable_name:doctrine_migration_versionsmigrations_directory:/home/myusername/myproject/Database/Update在/home/myuserna

php - 第 332 行的 fatal error : Call to a member function getId() on a non-object in C:\wamp\www\magentno\lib\Varien\Data\Tree\Dbp. php

我正在使用Magento1.8.0.0,我通过本地主机在WAMP服务器上安装了一个测试版本,当我想添加类别时,出现下一个错误:fatalerror:在C:\wamp\www\magentno\lib\Varien\Data\Tree\Dbp.php中的非对象上调用成员函数getId()第332行我还没有开店,因为我需要那个类别。我已经在出现错误的行中添加了tryandcatch代码。这是给出错误的代码:publicfunctionloadEnsuredNodes($category,$rootNode){$pathIds=$category->getPathIds();$rootNod