[wp-hackers] Wordpress in Multiple Environments
Gavin Pearce
Gavin.Pearce at 3seven9.com
Fri Jan 21 15:01:29 UTC 2011
> How does that address the URLs saved to the
> database by images uploaded when in the staging environment?
Clarification on that point would be interesting - going to check/test
in a second as am unsure myself.
Still think we need a better "built-in" solution if WordPress is ever to
be taken seriously as a corporate CMS - but I won't open up that can of
worms again.
Gav
-----Original Message-----
From: wp-hackers-bounces at lists.automattic.com
[mailto:wp-hackers-bounces at lists.automattic.com] On Behalf Of Mike
Schinkel
Sent: 17 January 2011 01:30
To: wp-hackers at lists.automattic.com
Subject: Re: [wp-hackers] Wordpress in Multiple Environments
On Jan 16, 2011, at 8:07 PM, Andrew Nacin wrote:
> The simplest solution is to run an output buffer in staging that
rewrites
> any live links. Works extremely well and doesn't put any additional
burden
> onto the production site. It also helps in a number of other areas
outside
> the media library. You might want to conditionally filter the uploads
stuff
> anyway the same way you're filtering home and siteurl.
>
> It could literally be as simple as this in wp-config.php:
>
> ob_start( 'mysite_staging_links' );
> function mysite_staging_links( $content ) {
> return str_replace( 'http://mysite.com/',
'http://staging.mysite.com',
> $content );
> }
How does that address the URLs saved to the database by images uploaded
when in the staging environment?
-Mike
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers
More information about the wp-hackers
mailing list