Closed (fixed)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Sep 2010 at 17:54 UTC
Updated:
5 Oct 2012 at 06:49 UTC
Jump to comment: Most recent file
Comments
Comment #1
alex_b commented> A reference accessor to each item individually along with an iterator.
My gut is telling me that this is what we should go for. Passing each item by reference will save us an array copy - this will save us some resources when iterating through items for processing them.
Comment #2
kvvnn commentedEDIT: see http://drupal.org/node/663860#comment-3462046
Comment #3
alex_b commentedFYI: http://php.net/manual/en/class.iterator.php
Comment #4
twistor commentedThis is no longer possible as the iterator class doesn't allow passing items by reference. So we should just make items public.
Comment #5
twistor commentedComment #6
infojunkieWorks for me!
Comment #7
infojunkie...but it seems patch in #4 was not made against the latest 6.x-1.x-dev. Please re-roll.
Comment #8
twistor commentedHere you go.
Comment #9
alex_b commented#8 - great.
If we do so, we should go and make all protected items on FeedsImportBatch public and deprecate set/add/get methods.
Comment #10
twistor commentedAs you requested. The only thing I'm not sure of is $current_item and its associated shiftItem() and currentItem(). While it's pretty much the same to do:
That doesn't set current_item in the process. So what I'm thinking is leave FeedsImportBatch::shiftItem() but deprecate FeedsImportBatch::currentItem() and make current_item public. Also, the logic in currentItem() doesn't accomplish anything since array_shift will return NULL on an empty array.
Comment #11
twistor commentedThis patch is currently broken because of the getRaw() methods on FeedsFileBatch and FeedsHTTPBatch. Those actually perform the reading when called. Will post another patch soon with the getRaw() method moved back.
Comment #12
twistor commentedAll tests pass if #946822: FeedsSitemapParser broken: Serialization of 'SimpleXMLElement' is not allowed is included.
Comment #13
stevetweeddale commentedSubscribing
Comment #14
alex_b commentedThis is looking good, removed @deprecated from feedNode(). Running tests now.
Comment #15
alex_b commentedOn further inspection: FeedsBatch::feedNode() should be deprecated. I never liked this weirdo anyways.
Committed to 6.x. Thank you
http://drupal.org/cvs?commit=441446
Needs port to 7.x 2.x.
Comment #16
alex_b commentedComment #17
alex_b commentedDeleting a lot of code. Running tests, if good, will commit asap.
Comment #18
alex_b commentedCommitted, thank you.
http://drupal.org/cvs?commit=441512
Comment #20
awm commentedsubscribe
Comment #21
twistor commented