Make WordPress Core

Opened 12 years ago

Last modified 5 years ago

#19864 reopened enhancement

Abstract export_wp() for use by CLI scripts

Reported by: scottconnerly's profile scottconnerly Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Export Keywords:
Focuses: Cc:

Description

Need to be able to execute an export from the PHP CLI for the purpose of running cron / maintenance scripts that write out exports.

This would include writing additional hooks that allow the arguments to be pulled from the cli as well as hooks that allow the output to redirected from the output buffer to a file.

Related ticket: #19863, extra hooks for manipulating content and arguments of an export

Change History (5)

#1 @scribu
12 years ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

There already is a CLI script that can do exports: https://github.com/andreascreten/wp-cli

Type wp help export to see how to use it.

Implementation details: https://github.com/andreascreten/wp-cli/issues/44

Last edited 12 years ago by scribu (previous) (diff)

#2 @nacin
12 years ago

  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened

westi indicated a desire (in IRC) that core should support this. I agree.

#3 @scribu
12 years ago

This would include writing additional hooks that allow the arguments to be pulled from the cli

Isn't this covered by #19863 ?

Last edited 12 years ago by scribu (previous) (diff)

#4 @scribu
12 years ago

This would include writing additional hooks that allow the arguments to be pulled from the cli

I don't understand the assumption behind this. You need some PHP code to load WordPress anyway, so you could parse the CLI arguments directly and then just call export_wp(). No additional hooks needed.

as well as hooks that allow the output to redirected from the output buffer to a file.

I agree that we should decouple the XML generation part from the delivery part.

Also, there are some nested functions in there, which is quite confusing. They should be moved outside or converted into class methods.

#5 @swissspidy
9 years ago

I think we should close this in favour of #22435.

Note: See TracTickets for help on using tickets.