﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
11549,Enable loading of the WordPress environment from external php script,mp2300,,"For some integration projects, it is useful to load the WordPress environment from an external php script. This can be done by including wp-load.php
Afterwards all the WordPress functions can be used.

This is only possible if wp-load.php is included from the global scope. If it is included from inside a function, it will fail. This limitation makes it difficult to integrate WordPress with other projects.

wp-load.php fails because of the use of global objects and assign by reference. A simple solution would be to declare $wpdb, $wp_widget_factory, $_wp_deprecated_widgets_callbacks for global in wp-settings.php
The creation of WP_Widget_Factory in wp-settings.php needs to be changed from
$wp_widget_factory =& new WP_Widget_Factory();
to
$wp_widget_factory = new WP_Widget_Factory();

The syntax for creation of WP_Widget_Factory should be conditioned by the PHP version, to maintain backwards compatibility with PHP 4.
",feature request,new,normal,Future Release,General,,minor,,needs-patch close,mp2300
