Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7922647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:02:18+00:00 2026-06-03T17:02:18+00:00

In Symfony2, when I run the command bin/vendors install I get the following message:

  • 0

In Symfony2, when I run the command bin/vendors install I get the following message:

?? src/Symfony/Component/Validator/Constraints/Alphanumeric.php
?? src/Symfony/Component/Validator/Constraints/AlphanumericValidator.php
?? src/Symfony/Component/Validator/Constraints/GreaterThan.php
?? src/Symfony/Component/Validator/Constraints/GreaterThanValidator.php
"symfony" has local modifications. Please revert or commit/push them before running this command again.

The files listed, are custom constraint validators created by me following the cookbook entry here.

Is there a way to update the deps files ignoring the changes I made? My goal is to install a new bundle while keeping the constraint validator files created by me.

UPDATE: Peter solution was right, the only thing left is to “use” the correct namespace inside the entity like this:

(The code has words in Spanish and I will assume again that I’m in the DemoBundle just for consistency)

namespace Acme\DemoBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Acme\DemoBundle\Component\Validator\Constraints as CustomAssert;

/**
 * @ORM\Entity
 */
class Employee
{
    //...

    /**
     * @ORM\Column(type="string", length=20)
     * @Assert\NotBlank()
     * @CustomAssert\Alphanumeric()
     */
    protected $alfanum;

    //...
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T17:02:21+00:00Added an answer on June 3, 2026 at 5:02 pm

    No, don’t do this. Custom validators (or custom anything) you write should be a part of your namespace, not Symfony’s. And they certainly shouldn’t be vendors directory at all (unless you write your own vendor). This is the whole point of namespacing and vendor management – to avoid collisions!

    So, you need to move your custom validators to your application’s source. Using the AcmeDemoBundle as an example…

    Create directories for the following path

    src/Acme/DemoBundle/Component/Validator/Constraints
    

    And then move your custom validators into this folder. Then update the namespace for each validator class accordingly

    namespace Acme\DemoBundle\Component\Validator\Constraints
    

    Cheers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded the latest symfony2 (2.0.10) and tried to run bin/vendors install but it
Trying to install symfony2 and I get the following message You need to enable
i am following the tutorial: http://jasonswett.net/blog/how-to-write-a-symfony-plugin/ and when i run: ./symfony plugin:install simplePropelFeedPlugin.tgz i
After a fresh symfony2 install i can run phpunit -c app/ and phpunit tests
I'm trying to get Assetic to run within Symfony 2.0.11 in order to use
What is the full rsync command run by Symfony when deploying a project with...
Symfony2 returns No route found for GET / when I try to run http://localhost/app_dev.php
I am trying to install vendors for the following project connect on osx lion.
I'm trying to install a new Symfony project without vendors preinstalled. I'm running Windows
I write a functional test for my symfony software and run it from command

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.