Tôi đang sử dụng symfony 2.3 khuôn khổ và autoloader tuyên bố đã tìm thấy các tập tin nhưng không có lớp:Autoloader dự kiến lớp Symfony2
RuntimeException: The autoloader expected class "Sensio\Bundle\
FrameworkExtraBundle\Request\ParamConverter\DateTimeParamConverter"
to be defined in file "/home/na/auth/vendor/sensio/framework-extra-bundle/
Sensio/Bundle/FrameworkExtraBundle/Request/ParamConverter/
DateTimeParamConverter.php". The file was found but the class was not in it,
the class name or namespace probably has a typo.
Các tập tin này được đề cập đến được hiển thị dưới đây:
<?php
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use DateTime;
/**
* Convert DateTime instances from request attribute variable.
*
* @author Benjamin Eberlei <[email protected]>
*/
class DateTimeParamConverter implements ParamConverterInterface
{
/**
* @{inheritdoc}
*
* @throws NotFoundHttpException When invalid date given
*/
public function apply(Request $request, ConfigurationInterface $configuration)
{
$param = $configuration->getName();
if (!$request->attributes->has($param)) {
return false;
}
$options = $configuration->getOptions();
$value = $request->attributes->get($param);
$date = isset($options['format'])
? DateTime::createFromFormat($options['format'], $value)
: new DateTime($value);
if (!$date) {
throw new NotFoundHttpException('Invalid date given.');
}
$request->attributes->set($param, $date);
return true;
}
/**
* @{inheritdoc}
*/
public function supports(ConfigurationInterface $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
return "DateTime" === $configuration->getClass();
}
}
Dù sao, một số chi tiết có thể giúp là tôi vừa mới cài đặt Giáo Lý và chạy các lệnh ...
2028 php app/console doctrine:schema:create
2029 php app/console doctrine:generate:entities Auth
Sau những lệnh này, symfony ngừng hoạt động. Tôi không biết đây có phải là một lỗi lạ hay gì đó không. Nếu bạn cần thêm thông tin, tôi có thể đăng bài. Cảm ơn vì bất kì sự giúp đỡ.
Cố gắng chạy 'php composer.phar install' để đảm bảo rằng tất cả các phụ thuộc được cài đặt và tạo lại tệp tự động tải. –
Đáng buồn thay, điều đó không hiệu quả. –