Since it is changing to 777, I fear that you are using an old version of
doctrine that may be affected by a security issue (
http://www.doctrine-project.org/2015/08/31/security_misconfiguration_vulnerability_in_various_doctrine_projects.html
)

You may want to check https://github.com/doctrine/common/pull/711 to see
how this sort of functionality works (and how it is tested): this may help
you writing a test for your particular scenario.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 20 January 2016 at 17:01, Hendrik <[email protected]> wrote:

> Hi Marco,
>
> I tested with hardcoded values and everything worked. So it encouraged me
> to test with the real function and right now it looks like it works.
>
> The one unique thing I did between when it didn't work and now, was to
> change the Proxy Dir permissions, previously they were 775 and now they are
> 777. Also the owner of the file was changed.
>
> So something in the Doctrine wants to write in the Proxy Folder. I thought
> it only needs to read from the Proxy folder when I manually generate the
> Proxy files, isn't it suppose to be so?
>
> It was rather long time ago when I first created proxy files, until now,
> when I changed the Entities, that I do not know why it has worked at the
> beginning. Probably because the permissions and ownership were setup
> correctly at the beginning and doctrine was able to do every change it
> needed, before the folder permissions got corrupted.
>
> Thanks for help.
> Hendrik
>
> On Wednesday, 20 January 2016 15:06:54 UTC+1, Marco Pivetta wrote:
>>
>> Hi Hendrik,
>>
>> Can you run this with hardcoded values (to make sure there's nothing that
>> comes from the few IFs and flags that you are passing around)?
>>
>> Did you also try debugging method calls that go through the proxy factory
>> <https://github.com/doctrine/common/blob/773c56e51fc26ae07a47146fae31b320dd6cada3/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php#L115>
>> ?
>>
>> Marco Pivetta
>>
>> http://twitter.com/Ocramius
>>
>> http://ocramius.github.com/
>>
>> On 20 January 2016 at 15:02, Hendrik <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I have already asked the question at stack overflow.
>>>
>>> But I think I get faster and better answers here.
>>>
>>>
>>> I have now run out of ideas and Google is not helping either. I believe
>>> the issue is rather simple to solve, but currently I am not seeing why it
>>> happens. Everything works fine on my testing environment with dev mode.
>>>
>>> But doesn't work on production where the dev mode is off and proxy files
>>> need to be generated manually.
>>>
>>> The first time I generated proxy files on the production environment,
>>> everything worked fine. Now I needed to improve some of the entities and
>>> when I use the "doctrine orm:generate-proxies" command again, then all the
>>> proxy files get generated and when I look at the new entity proxy files,
>>> then I can see that the new column are mapped.
>>>
>>> But when I try to save or load new object, then nothing gets saved or
>>> load to the new columns. It is as if doctrine 2 doesn't understand, that
>>> there are new proxy files that it should use. Instead, it keeps on using
>>> some other hidden old proxy files, cached away in some dark end.
>>>
>>> Any idea why doctrine 2 doesn't use the newly generated proxy files?
>>>
>>> For extra clarity, this the the Doctrine Initialisation code.
>>>
>>>     $paths = array(__DIR__ . '/../ORM/Definition/Doctrine2/Entity');
>>>
>>>             $isDevMode = false;
>>>             $autoGenerateProxyClasses =
>>> AbstractProxyFactory::AUTOGENERATE_NEVER;
>>>
>>>             if ($this->serverDevelopment()) {
>>>                 $isDevMode = true;
>>>                 $autoGenerateProxyClasses =
>>> AbstractProxyFactory::AUTOGENERATE_ALWAYS;
>>>             }
>>>
>>>             $dbParams = array(
>>>                 'driver' => 'pdo_mysql',
>>>                 'user' => 'REMOVE',
>>>                 'password' => 'REMOVE',
>>>                 'dbname' => 'REMOVE',
>>>                 'host' => 'REMOVE'
>>>             );
>>>
>>>             $config =
>>> Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
>>>             $config->setProxyDir(__DIR__ .
>>> '/../ORM/Definition/Doctrine2/Entity/Proxy');
>>>
>>> $config->setProxyNamespace('Database\ORM\Definition\Doctrine2\Entity\Proxy');
>>>
>>> $config->setAutoGenerateProxyClasses($autoGenerateProxyClasses);
>>>
>>>             $this->entityManager = EntityManager::create($dbParams,
>>> $config);
>>>
>>> Any help would be appreciated.
>>>
>>> Thanks,
>>> Hendrik
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "doctrine-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/doctrine-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "doctrine-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to