Skip to content

Remove requirement of doctrine #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
woodspire opened this issue Aug 22, 2014 · 3 comments
Closed

Remove requirement of doctrine #10

woodspire opened this issue Aug 22, 2014 · 3 comments

Comments

@woodspire
Copy link

src/Wrep/Daemonizable/Command/EndlessContainerAwareCommand.php

line: 43
$doctrine = $this->getContainer()->get('doctrine');

This throw an exception if doctrine is not installed (I use propel)

add an IF case around it:

if ($this->getContainer()->has('doctrine')) {
-- current code
}

@mac-cain13
Copy link
Owner

Good suggestion, would be indeed better to check if doctrine is available. Will apply this fix so it works for you, but I'm wondering if Propel needs some kind of cache clearing. Since this command keeps running forever, we must assure Propel/Doctrine doesn't return outdated results from their cache.

Is there a way and/or need to clear the Propel cache?

@woodspire
Copy link
Author

I don't think there is an entity manager in propel so I don't see a place where we could get all entity and clear|reset them.

For example, for each entity, there is a *Query class to fetch them from the database. There is a clear method in each query object. But I think once the reference to the object is done (when quitting from the execute() function, I think the object is ready to be garbage collected. If someone wants to keep the object persistent between each loop, I think they would have to manually call the clear() method in finishIteration().

@mac-cain13
Copy link
Owner

Allright! Then the new version 1.2.4 should do the job for propel users.

On Mon, Aug 25, 2014 at 4:14 PM, woodspire notifications@github.com
wrote:

I don't think there is an entity manager in propel so I don't see a place where we could get all entity and clear|reset them.

For example, for each entity, there is a *Query class to fetch them from the database. There is a clear method in each query object. But I think once the reference to the object is done (when quitting from the execute() function, I think the object is ready to be garbage collected. If someone wants to keep the object persistent between each loop, I think they would have to manually call the clear() method in finishIteration().

Reply to this email directly or view it on GitHub:
#10 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants