所以我一直在研究symfony2项目,这一切都很好,然后我想在godaddy上托管它,但现在我收到了这个错误.我不明白它也不知道如何解决它.非常感谢.
SQLSTATE [HY000] [1045]访问被拒绝用户'root'@'127.0.0.1'(使用密码:否)
这是我的paramaters.yml文件
# This file is auto-generated during the composer install
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: null
database_name: symfony
database_user: root
database_password:
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: 14bcde878eda1c3f56a59b62b13e820b7f94563d
Run Code Online (Sandbox Code Playgroud)
这是我的config.yml文件
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
#esi: ~
#translator: { fallback: "%locale%" }
translator: ~
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true } …Run Code Online (Sandbox Code Playgroud) 我正在https://developer.mozilla.org/en/docs/Web/CSS/border-radius阅读文档
边界半径属性似乎有第二个半径值,
/* The syntax of the second radius allows one to four values */
/* (first radius values) / radius */
border-radius: 10px 5% / 20px;
/* (first radius values) / top-left-and-bottom-right | top-right-and-bottom-left */
border-radius: 10px 5% / 20px 30px;
/* (first radius values) / top-left | top-right-and-bottom-left | bottom-right */
border-radius: 10px 5px 2em / 20px 25px 30%;
/* (first radius values) / top-left | top-right | bottom-right | bottom-left */
border-radius: 10px 5% / …Run Code Online (Sandbox Code Playgroud) 我在localhost上有一个工作项目,但是当我部署项目时,我收到了这个错误,我不知道是什么导致了这种情况发生.
MappingException: Class 'PremiumPharma\SystemBundle\Entity\User' does not exist
Run Code Online (Sandbox Code Playgroud)
这是堆栈跟踪
in /home/sy2/public_html/temp/symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/MappingException.php line 96
at MappingException::nonExistingClass('PremiumPharma\SystemBundle\Entity\User') in /home/sy2/public_html/temp/symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php line 43
at RuntimeReflectionService->getParentClasses('PremiumPharma\SystemBundle\Entity\User') in /home/sy2/public_html/temp/symfony/vendor/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php line 267
Run Code Online (Sandbox Code Playgroud)
编辑1 我确实注意到探查器中有一些错误,因为它说5个无效实体,并且有一些映射错误,我修复了它们.重新上传后,我仍然有同样的问题.我也尝试清空缓存,但仍然收到相同的错误.
编辑2
这是我的appKernal
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new PremiumPharma\SystemBundle\PremiumPharmaSystemBundle(),
new FOS\UserBundle\FOSUserBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] …Run Code Online (Sandbox Code Playgroud) 根据文件
如果传递给日期过滤器的值为null,则默认情况下将返回当前日期.如果需要空字符串而不是当前日期,请使用三元运算符:
http://twig.sensiolabs.org/doc/2.x/filters/date.html
问题是提供的解决方案需要我们重新访问应用程序中的所有日期并应用三元操作,因为我们永远不想显示今天的日期而不是null.
是否可以覆盖默认日期过滤器?如果是这样,我该如何实现呢.我们正在使用symfony 2.7的树枝