Last modified: 2009-08-03 21:57:29 UTC
Created attachment 6140 [details] don't assume $CWD $ php radioscanningtw.jidanni.org/maintenance/convertUserOptions.php Warning: require(./commandLine.inc): failed to open stream: No such file OK, here's the patch for this one. You might want to check the rest: $ find . -path \*/.svn -prune -o -type f|xargs grep -h commandLine.inc|sort|uniq -c|sort -nr > 49 require_once( 'commandLine.inc' ); > 17 require_once( "commandLine.inc" ); > 10 require_once( dirname(__FILE__).'/../commandLine.inc' ); > 9 require_once 'commandLine.inc'; > 4 require_once('commandLine.inc'); > 4 require( dirname(__FILE__).'/../commandLine.inc' ); > 3 require_once( dirname(__FILE__) . '/../commandLine.inc' ); > 2 require_once(dirname(__FILE__).'/../commandLine.inc'); > 2 require_once( dirname(__FILE__) . '/../commandLine.inc' ); > 2 require_once "commandLine.inc"; > 2 require( dirname( __FILE__ ) .'/../commandLine.inc' ); > 2 require "commandLine.inc"; > 2 include_once( "commandLine.inc" ); > 2 include('commandLine.inc'); > 1 require_once( dirname(__FILE__).'/commandLine.inc' ); > 1 require_once( dirname(__FILE__).'/../maintenance/commandLine.inc' ); > 1 require_once( dirname(__FILE__) . '/../maintenance/commandLine.inc' ); > 1 require_once( dirname(__FILE__) . '/' . 'commandLine.inc' ); > 1 require_once( dirname( __FILE__ ). '/../maintenance/commandLine.inc' ); > 1 require_once( dirname( __FILE__ ) . '/commandLine.inc' ); > 1 require_once( "$IP/maintenance/commandLine.inc" ); > 1 require( dirname( __FILE__ ) . '/../commandLine.inc' ); > 1 require( 'commandLine.inc' ); > 1 require( './commandLine.inc' ); > 1 require( '../commandLine.inc' ); > 1 require 'commandLine.inc'; > 1 * The include paths change after this file is included from commandLine.inc, > 1 require_once( dirname(__FILE__).'/../maintenance/commandLine.inc' ); > 1 require_once( 'commandLine.inc' );
There is only one commandLine.inc: $ find -name commandLine.inc ./maintenance/commandLine.inc So all of these could be replaced by one single best choice. Of all of them, 1 require( './commandLine.inc' ); 1 require( '../commandLine.inc' ); are the ones that will put one's program out of business if one is not in the proper current directory. maintenance/language/digit2html.php, and maintenance/convertUserOptions.php are implicated. Please apply this patch for the latter. The rest can wait for now.
Fixed a few in r54244. All the ones in /maintenance should call 'commandLine.inc' directly. No paths, nothing. Things outside of it will use dirname(__FILE__) and use relative paths as appropriate.
Actually fixed in r54312, require commandLine.inc (or in new scripts: Maintenance.php) using the full path every time.