草庐IT

BUNDLE_PATH

全部标签

在 bundle 扩展加载时找不到 PHP Symfony 请求堆栈

我正在尝试创建可重用的日志记录包,它可以为日志消息设置自定义格式化程序。格式化程序在主应用程序的配置文件中设置如下:custom_logger:formatter:AppBundle\Services\MessageFormatter然后在LoggerBundle/DependencyInjection/CustomLoggerExtension.php收到此配置后,我正在尝试获取记录器服务并设置格式化程序classCustomLoggerExtensionextendsConfigurableExtension{publicfunctionloadInternal(array$mer

php - Symfony 3.3 从 3.2 : Compile Error: Cannot declare class Symfony\Bundle\SecurityBundle\Security\FirewallMap

自从我从symfony3.2更新到3.3后我遇到了一些问题,我得到了这个错误CompileError:CannotdeclareclassSymfony\Bundle\SecurityBundle\Security\FirewallMap,becausethenameisalreadyinuseinclasses.php(line1709)inClassCollectionLoader.php(line99)atClassCollectionLoader::load()inKernel.php(line428)atKernel->doLoadClassCache()inKernel.p

php - PHP include_path 主值从何而来?

通过phpinfo,我得到以下include_pathMasterValue。.:/usr/share/pear:/usr/share/php似乎没有在任何地方设置...phpini已将所有include_path(s)注释掉,我的应用程序没有手动设置它,apacheconf/phpconf/其他各种conf/ini没有设置它,没有搜索set_include_path或phpvalue或ini_set等时的结果。还有什么地方可以设置“include_path”吗?我特别询问有关主值的问题。(我在CentOS5.4上) 最佳答案 来自

php - 带有 Symfony2 的购物车 bundle

我正在学习使用Symfony2的方式,同时为一家家族经营的Wine进口商构建一个小型电子商务网站。慢慢地,我开始理解Symfony2的概念,但在继续构建购物车bundle时,我不太确定什么是正确的(至少根据Sf2标准)实现它的方法。我根据session制作了简单的购物车包。我的问题是,当我在购物车中添加产品时,它会一直工作,直到产品ID为0到9,并且产品数量会自动增加,但是在产品ID为10之后,它的数量等于产品ID,而它应该是一个。也是错误的当我们要获取产品信息时,产品信息就来了。我希望这不是一个太广泛的问题。我很清楚,真正强大的购物车实现并非易事。我的代码在这里:CartContro

php - Magento 将带有 'bundle_option' 的捆绑产品添加到购物车?

在Magento中以编程方式将捆绑产品添加到购物车时,我似乎无法在产品选项数组中的任何地方找到“bundle_option”字段的文档。所以我不确定如何正确执行此操作。但这是我的尝试:$json_obj=json_decode($json_string,true);//definecart$cart=Mage::getSingleton('checkout/cart');$bundle=array();$bundle_qty=array();for($i=0;$iload($product_id);#$params=array('product'=>$product_id,'qty'=

php - set_include_path() 不适用于相对 require()

我正在“要求”一个文件,该文件有自己的require()调用。但是调用set_include_path()并不适用于require()中的相对路径。不幸的是,我无法控制所需的代码文件。C:/myapp/index.php-我的代码set_include_path(get_include_path().';C:/app/subfolder');require('C:/app/subfolder/index.php');C:/app/subfolder/index.php-第三方代码(无控制)require('../config.php');//RequirefilelocatedatC:

php - Doctrine 的 Symfony Bundle repo 发生了什么?

我刚刚花了最后2个小时想知道为什么当我对我的项目进行bin/vendors更新时一切都崩溃了。我收到以下错误fatal:github.com/symfony/DoctrineMigrationsBundle.git/info/refsnotfound:didyourungitupdate-server-infoontheserver?fatal:github.com/symfony/DoctrineMongoDBBundle.git/info/refsnotfound:didyourungitupdate-server-infoontheserver?fatal:github.com/

php - fatal error : Class 'Memcached' not found in/my/path

当我尝试时:$mc=newMemcached();我明白了Fatalerror:Class'Memcached'notfoundin/my/pathphpinfo说/etc/php5/apache2/conf.d/20-memcached.ini作为附加的.ini文件加载。这个文件的内容是这个:;uncommentthenextlinetoenablethemoduleextension=memcached.sodpkg--get-选择|grep内存缓存libmemcached6installmemcachedinstallphp5-memcachedinstall库本图Apache2

php - Symfony2,EntityManager::getRepository(命名空间\To\Some\Class::class 或 '**Bundle:Entity')

Symfony2文档说我应该使用别名快捷方式'ByBundle:myEntity'作为实体路径:$em->getRepository('ByBundle:myEntity');但是这个字符串文字没有用——没有重构,没有在IDE中快速自动重命名实体类。我使用魔术方法::class$em->getRepository(\ByBundle\Entity\myEntity::class);问题:我这样做对吗? 最佳答案 事实上,Symfony2核心团队正在使用::class方法来添加表单字段类型,例如:$builder->add('name

php - 如何将多个 url/path 合并到多维数组中?

我有这样的数组:$path=array([0]=>site\projects\terrace_and_balcony\mexico.jpg[1]=>site\projects\terrace_and_balcony\new_york.jpg[2]=>site\projects\terrace_and_balcony\berlin.jpg[3]=>site\projects\terrace_and_balcony\Kentucky.jpg[4]=>site\projects\terrace_and_balcony\Utah.jpg[5]=>site\projects\terrace_an