dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Move inclusion of the Composer autoloader to after inclusion of DefaultSettings"
[lhc/web/wiklou.git]
/
maintenance
/
importTextFile.php
diff --git
a/maintenance/importTextFile.php
b/maintenance/importTextFile.php
index
adb5063
..
e081c20
100644
(file)
--- a/
maintenance/importTextFile.php
+++ b/
maintenance/importTextFile.php
@@
-24,15
+24,15
@@
$options = array( 'help', 'nooverwrite', 'norc' );
$optionsWithArgs = array( 'title', 'user', 'comment' );
$options = array( 'help', 'nooverwrite', 'norc' );
$optionsWithArgs = array( 'title', 'user', 'comment' );
-require_once
( __DIR__ . '/commandLine.inc' )
;
-echo
( "Import Text File\n\n" )
;
+require_once
__DIR__ . '/commandLine.inc'
;
+echo
"Import Text File\n\n"
;
if ( count( $args ) < 1 || isset( $options['help'] ) ) {
showHelp();
} else {
$filename = $args[0];
if ( count( $args ) < 1 || isset( $options['help'] ) ) {
showHelp();
} else {
$filename = $args[0];
- echo
( "Using {$filename}..." )
;
+ echo
"Using {$filename}..."
;
if ( is_file( $filename ) ) {
$title = isset( $options['title'] ) ? $options['title'] : titleFromFilename( $filename );
if ( is_file( $filename ) ) {
$title = isset( $options['title'] ) ? $options['title'] : titleFromFilename( $filename );
@@
-40,7
+40,7
@@
if ( count( $args ) < 1 || isset( $options['help'] ) ) {
if ( is_object( $title ) ) {
if ( is_object( $title ) ) {
- echo
( "\nUsing title '" . $title->getPrefixedText() . "'..." )
;
+ echo
"\nUsing title '" . $title->getPrefixedText() . "'..."
;
if ( !$title->exists() || !isset( $options['nooverwrite'] ) ) {
$text = file_get_contents( $filename );
if ( !$title->exists() || !isset( $options['nooverwrite'] ) ) {
$text = file_get_contents( $filename );
@@
-49,30
+49,31
@@
if ( count( $args ) < 1 || isset( $options['help'] ) ) {
if ( is_object( $user ) ) {
if ( is_object( $user ) ) {
- echo
( "\nUsing username '" . $user->getName() . "'..." )
;
+ echo
"\nUsing username '" . $user->getName() . "'..."
;
$wgUser =& $user;
$comment = isset( $options['comment'] ) ? $options['comment'] : 'Importing text file';
$flags = 0 | ( isset( $options['norc'] ) ? EDIT_SUPPRESS_RC : 0 );
$wgUser =& $user;
$comment = isset( $options['comment'] ) ? $options['comment'] : 'Importing text file';
$flags = 0 | ( isset( $options['norc'] ) ? EDIT_SUPPRESS_RC : 0 );
- echo
( "\nPerforming edit..." )
;
+ echo
"\nPerforming edit..."
;
$page = WikiPage::factory( $title );
$page = WikiPage::factory( $title );
- $page->doEdit( $text, $comment, $flags, false, $user );
- echo( "done.\n" );
+ $content = ContentHandler::makeContent( $text, $title );
+ $page->doEditContent( $content, $comment, $flags, false, $user );
+ echo "done.\n";
} else {
} else {
- echo
( "invalid username.\n" )
;
+ echo
"invalid username.\n"
;
}
} else {
}
} else {
- echo
( "page exists.\n" )
;
+ echo
"page exists.\n"
;
}
} else {
}
} else {
- echo
( "invalid title.\n" )
;
+ echo
"invalid title.\n"
;
}
} else {
}
} else {
- echo
( "does not exist.\n" )
;
+ echo
"does not exist.\n"
;
}
}
}
}