草庐IT

new-style-class

全部标签

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 - fatal error : Class 'SELF' not found

我有以下相关代码:try{self::$db=newPDO($dsn,self::USER,SELF::PASS);//Connecttothedatabase,andstorethepdoobject.self::$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);}catch(PDOException$e){thrownewException("Therehavebeenanerrorintheconnection:".$e->getMessage());}执行此代码所在的静态函数时,出现以下错误:Fatalerr

php - Laravel 4 迁移 : class not found exception

很明显,当我想迁移我的数据库时,我得到了这个奇怪的错误{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class''notfound","file":"C:\\xampp\\htdocs\\l4crm\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Migrations\\Migrator.php","line":301}}[Finishedin1.3s]过去当然一切正常,我尝试迁移哪些文件并不重

php - 向类(class) Moodle 添加自定义字段

关闭。这个问题需要更多focused.它目前不接受答案。想改进这个问题吗?更新问题,使其只关注一个问题editingthispost.关闭2年前。Improvethisquestion我是moodle的新手。我需要您的建议来创建插件,该插件将在添加/编辑类(class)页面上添加自定义字段,并将输入值存储在mdl_course表中。

php - New Relic for Heroku 应用程序中显示的 Composer\Autoload\includeFile 速度极慢

在NewRelic中,我可以看到托管在Heroku上的PHP5.6应用程序的事务跟踪。该交易执行时间为21,600毫秒,其中87%是Composer\Autoload\includeFile。根据我的理解,Composer\Autoload\includeFile只是由include$file;组成,所以我很茫然。这个问题并不经常发生,大多数这种类型的交易看起来都很好。什么会花这么长时间? 最佳答案 我用Composer得到了相同的结果。Composer管理库真的很容易,但是默认加载速度很慢。您应该使用“--optimize-aut

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 - Opcache 导致 PHP fatal error : Class '\xa0L\xdaor\x7f' not found

我们网站上的图像大小调整脚本有时会失败并出现以下错误:PHPFatalerror:Class'\xa0L\xdaor\x7f'notfound...online4有问题的脚本的实际第4行是:$photo=newPhoto($photo_id);我不知道错误日志中的十六进制代码\xa0L\xdaor\x7f来自哪里。该脚本将运行良好,并且相对频繁地运行一两天,然后每次都开始失败,并出现该错误。如果我运行opcache_reset(),错误就会停止。有人知道是什么导致了这个问题吗?更新:我没有得到任何回应-所以我只是使用opcache.blacklist_filename从操作码缓存中排除

php - Symfony - NelmioApiDocBundle : Show parameter description imported from class

我正在使用NelmioApiDocBundle连同用于RESTAPI的PHP框架Symfony3。我想在/api/doc页面中显示我的参数的描述。如果不手动添加参数,这可能吗?我想从输入/输出类中导入它。这是我的文档的样子:这是生成文档的Controller操作(/api/user/login)的@ApiDoc:*@ApiDoc(*section="user",*resource=true,*description="Checkstheusercredentialsandreturnsanauthentication&refreshtokeniftheyarecorrect",*inp

php - 什么是 PHP 和 SQLSRV 驱动程序中的 "New transaction is not allowed"错误?

我正在开发一个用PHP编写并使用SQLServer2008的Web应用程序。为了连接到数据库,我使用了Microsoft的SQLSRV驱动程序。在此应用程序的一部分中,我必须使用SQL事务。正如微软建议的那样,我完全是根据这篇文章做的。我的代码中的主要流程遵循以下步骤:1-启动sql事务2-通过jQuery向PHP文件发送信息并查看JSON发送的结果3-如果结果为假则回滚,如果为真则转到下一个查询。4-如果没有错误发生并且所有结果都正常,则提交事务。//Thisismypseudocodeif(sqlsrv_begin_transaction($sqlsrv->sqlsrvLink)=

php - 使用原则 2 选择从一个父类(super class)扩展的多个子类的实体

鉴于我的Doctrine2实体的设置:App\Bundle\LorumBundle\Entity\Node:type:entitytable:nodefields:id:id:truetype:integerunsigned:falsenullable:falsegenerator:strategy:IDENTITYcreated:type:datetimeinheritanceType:SINGLE_TABLEdiscriminatorColumn:name:typetype:stringlength:255discriminatorMap:a:ab:bc:cApp\Bundle\L