[wp-trac] [WordPress Trac] #37220: Improvement symlinks on wp-config.php

WordPress Trac noreply at wordpress.org
Thu Aug 25 21:53:34 UTC 2016


#37220: Improvement symlinks on wp-config.php
----------------------------+------------------------------
 Reporter:  grazianognoll   |       Owner:
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Bootstrap/Load  |     Version:  4.5.3
 Severity:  normal          |  Resolution:  worksforme
 Keywords:                  |     Focuses:
----------------------------+------------------------------
Changes (by iamfriendly):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 Hi @grazianognoll,

 Thanks for the report! I've found great success in using `is_link()`
 http://php.net/manual/en/function.is-link.php and `readlink()`
 http://php.net/manual/en/function.readlink.php.

 i.e. some variation of the following;


 {{{
 $local_url       = 'http://mywebsite.dev';
 $root_path = dirname( dirname( __FILE__ ) );
 $wp_content_dir = readlink( $root_path . '/current' ) . '/content';

 define( 'WP_HOME', $local_url );
 define( 'WP_SITEURL', $local_url );

 define( 'PLUGINDIR', 'content/plugins' );

 define( 'CONTENT_DIR', '/content' );
 define( 'WP_CONTENT_DIR', $wp_content_dir );
 define( 'WP_CONTENT_URL', $local_url . '/content' );
 }}}

 Also, if you're into using symlinks with a custom deploy strategy, I
 highly recommend giving https://github.com/roots/bedrock a look. They push
 the boundaries a little so require you to have PHP 5.6.

 There's definitely ways of making this work, so I'm going to close this as
 'worksforme' but if you think that's not true in your case, please feel
 free to reply.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37220#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list