Code Monkey home page Code Monkey logo

Comments (7)

havvg avatar havvg commented on July 28, 2024

I'm on cloudControl, too. That was the main reason, why I added schema inheritance support in the first place, to be able to alter that exact database attribute (by now there are way more changes to the user model).

Imho, it's solved and it's handled in a nice way.
You can alter the database package attribute as I mentioned. Then you got your generated files in place and committed into git.

from propelbundle.

Elexy avatar Elexy commented on July 28, 2024

Ok, I'll try again.

from propelbundle.

Elexy avatar Elexy commented on July 28, 2024

It works mostly, but I still have a little snag:

Fatal error: Cannot redeclare class FOS\UserBundle\Propel\User in .../src/FOS/UserBundle/Propel/User.php on line 22

The FOSUserbundle has these classes also.

from propelbundle.

havvg avatar havvg commented on July 28, 2024

My guess would be, you got your autoloader configured the wrong way. Make sure the src/.. directory is listed before the vendor/.. one related to the FOS namespace.

You also should apply the changes from the bundle to the generated classes, like implemented interfaces (e.g. Group).

from propelbundle.

Elexy avatar Elexy commented on July 28, 2024

Thanks, I modified the autoload.php like you said
My autoloader now has this:

'Propel'           => __DIR__.'/../vendor/bundles',
'FOS'              => array(__DIR__.'/../src/', __DIR__.'/../vendor/bundles'),```

The error is still there.
The strange thing is that I only see the error when I run my unit test WITH code coverage:
phpunit -c app --log-junit "../reports/testresult.xml" --coverage-clover "../reports/coverage.xml

Just navigating the website gives no error....

from propelbundle.

havvg avatar havvg commented on July 28, 2024

No, that's not what I meant. I mean something like:

<?php

use Symfony\Component\ClassLoader\UniversalClassLoader;

$loader = new UniversalClassLoader();
$loader->registerNamespaces(array(
    'FOS\UserBundle\Propel' => __DIR__.'/../src/',
    'FOS' => __DIR__.'/../vendor/bundles',
));

from propelbundle.

Elexy avatar Elexy commented on July 28, 2024

EDIT: Just hit enter when you we're typing I guess. Strange that it works with how I setup the autoload. However I changed it to what you said, that makes more sense. Thanks again

I found my mistake!

I had made a FOSUserBundle, didn't read it right. I changed it to:

namespace FOS\UserBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;
use FOS\UserBundle\FOSUserBundle;

class UserBundle extends FOSUserBundle
{
}

Now It's all working fine

Just one thing: putting the schema.yml in my bundle didn't override the one from the FOS bundle. I put it in app/Resources like it states in the FOS manual and then it overrides correctly and I get my classes in my 'UserBundle'.

from propelbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.