[wp-trac] [WordPress Trac] #51507: Ability to use as a framework

WordPress Trac noreply at wordpress.org
Tue Oct 13 09:44:27 UTC 2020


#51507: Ability to use as a framework
--------------------------+------------------------------
 Reporter:  ttodua        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by ttodua):

 To test simply:

 {{{
 $x= microtime(true);
 define('SHORTINIT_WITHOUT_DB', true);  //as opposed to define('SHORTINIT',
 true);
 require(__DIR__."/src/wp-load.php");
 var_dump(  microtime(true)- $x );
 }}}
 However, this above approach requires a dummy `wp-config.php` file to
 exist. So there might be also need to make a check in `wp-config.php` so
 as when `SHORTINIT_WITHOUT_DB` is set, it should not for check `wp-config`
 existence..

 However, in the meanwhile to avoid any check for `wp-config.php`
 existence, this can be used as an alternative too:

 {{{
 ...
 define( 'ABSPATH', __DIR__ . '/src/' );
 require(__DIR__."/src/wp-settings.php");
 ...
 }}}

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


More information about the wp-trac mailing list