[wp-trac] [WordPress Trac] #22435: Export API
WordPress Trac
noreply at wordpress.org
Mon Jun 17 16:11:02 UTC 2013
#22435: Export API
------------------------------------+------------------------------
Reporter: nbachiyski | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Export | Version:
Severity: normal | Resolution:
Keywords: dev-feedback has-patch |
------------------------------------+------------------------------
Comment (by nbachiyski):
> I don't think wpdb is the best place for the build_IN_condition()
helper.
I can’t imagine a custom `wpdb` implementation, which wouldn’t want to
inherit from `wpdb`. Can you think of any? Currently an implementation
like this would need to define a lot of helper methods like `replace`,
`insert`, `update`, `delete`, `get_var`. All of those probably won’t
change in a custom `wpdb` implementation.
> If I want to log any info while the export is happening, I have to
implement my own WP_Export_Base_Writer child class.
I agree this isn’t cool.
Since logging is a cross-cutting concern, I would implement it via
actions, not via a “skin” class.
Pros:
* We won’t introduce another class dependency.
* In the default implementation we won’t need an empty skin.
* Individual actions could be helpful separately.
* Better forward compatibility – if we add a step, older skins will be
incomplete, but still working.
Cons:
* In cases where one needs to log every step, you will need to hook to a
lot of actions, instead of just writing specific methods in a class.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22435#comment:32>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list