Index: trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php |
— | — | @@ -0,0 +1,26 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Sets up the storage backend currently selected in LocalSettings.php |
| 5 | + * (or the default MySQL store if no other store was selected). This |
| 6 | + * is equivalent to clicking the respective button on the page |
| 7 | + * Special:SMWAdmin. However, the latter may timeout if the setup involves |
| 8 | + * migrating a lot of existing data. |
| 9 | + * |
| 10 | + * Note: this file must be placed in MediaWiki's "maintenance" directory! |
| 11 | + * |
| 12 | + * Usage: |
| 13 | + * php SMW_refreshData.php [options...] |
| 14 | + * |
| 15 | + * @author Markus Krötzsch |
| 16 | + */ |
| 17 | + |
| 18 | +require_once( 'commandLine.inc' ); |
| 19 | + |
| 20 | +global $smwgIP; |
| 21 | +require_once($smwgIP . '/includes/SMW_GlobalFunctions.php'); |
| 22 | + |
| 23 | +smwfGetStore()->setup(); |
| 24 | + |
| 25 | +print "\n\nDone."; |
| 26 | + |
| 27 | + |
Property changes on: trunk/extensions/SemanticMediaWiki/maintenance/SMW_setup.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 28 | + native |
Index: trunk/extensions/SemanticMediaWiki/specials/SMWAdmin/SMW_SpecialSMWAdmin.php |
— | — | @@ -42,10 +42,10 @@ |
43 | 43 | if ($sure == 'yes') { |
44 | 44 | $wgOut->disable(); // raw output |
45 | 45 | ob_start(); |
46 | | - print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Setting up Storage for Semantic MediaWiki</title></head><body><p style=\"font-family: courier, fixed, monospace; \">"; |
| 46 | + print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\" dir=\"ltr\">\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><title>Setting up Storage for Semantic MediaWiki</title></head><body><p><pre>"; |
47 | 47 | header( "Content-type: application/rdf+xml; charset=UTF-8" ); |
48 | 48 | $result = smwfGetStore()->setup(); |
49 | | - print '</p>'; |
| 49 | + print '</pre></p>'; |
50 | 50 | if ($result === true) { |
51 | 51 | print '<p><b>The storage engine was set up successfully.</b></p>'; |
52 | 52 | } |
Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore.php |
— | — | @@ -687,7 +687,7 @@ |
688 | 688 | |
689 | 689 | function setup($verbose = true) { |
690 | 690 | global $wgDBname; |
691 | | - $this->reportProgress('Setting up standard database configuration for SMW ...<br /><br />',$verbose); |
| 691 | + $this->reportProgress("Setting up standard database configuration for SMW ...\n\n",$verbose); |
692 | 692 | |
693 | 693 | $fname = 'SMW::setupDatabase'; |
694 | 694 | $db =& wfGetDB( DB_MASTER ); |
— | — | @@ -718,7 +718,7 @@ |
719 | 719 | } |
720 | 720 | |
721 | 721 | $this->setupIndex($smw_relations, array('subject_id','relation_title','object_title,object_namespace'), $db); |
722 | | - $this->reportProgress('Relation table set up successfully.<br />',$verbose); |
| 722 | + $this->reportProgress("Relation table set up successfully.\n",$verbose); |
723 | 723 | |
724 | 724 | // create attribute table |
725 | 725 | if ($db->tableExists($smw_attributes) === false) { |
— | — | @@ -736,7 +736,7 @@ |
737 | 737 | } |
738 | 738 | |
739 | 739 | $this->setupIndex($smw_attributes, array('subject_id','attribute_title','value_num','value_xsd'), $db); |
740 | | - $this->reportProgress('Attribute table set up successfully.<br />',$verbose); |
| 740 | + $this->reportProgress("Attribute table set up successfully.\n",$verbose); |
741 | 741 | |
742 | 742 | // create table for long string attributes |
743 | 743 | if ($db->tableExists($smw_longstrings) === false) { |
— | — | @@ -751,7 +751,7 @@ |
752 | 752 | } |
753 | 753 | |
754 | 754 | $this->setupIndex($smw_longstrings, array('subject_id','attribute_title'), $db); |
755 | | - $this->reportProgress('Table for long string values (Type:Text) set up successfully.<br />',$verbose); |
| 755 | + $this->reportProgress("Table for long string values (Type:Text) set up successfully.\n",$verbose); |
756 | 756 | |
757 | 757 | // create table for special properties |
758 | 758 | if ($db->tableExists($smw_specialprops) === false) { |
— | — | @@ -765,9 +765,9 @@ |
766 | 766 | $res = $db->query( $sql, $fname ); |
767 | 767 | } |
768 | 768 | $this->setupIndex($smw_specialprops, array('subject_id', 'property_id'), $db); |
769 | | - $this->reportProgress('Table for special properties set up successfully.<br />',$verbose); |
| 769 | + $this->reportProgress("Table for special properties set up successfully.\n",$verbose); |
770 | 770 | |
771 | | - $this->reportProgress('Database initialised successfully.<br />',$verbose); |
| 771 | + $this->reportProgress("Database initialised successfully.\n",$verbose); |
772 | 772 | return true; |
773 | 773 | } |
774 | 774 | |