Mglaser has uploaded a new change for review. https://gerrit.wikimedia.org/r/291883
Change subject: Settings: Allowed bluespice.com as additional feed url ...................................................................... Settings: Allowed bluespice.com as additional feed url Use central url instead of redirect url Change-Id: I4327a7a6d04d13b9c557566f105f7715ffbdd76a --- M includes/DefaultSettings.php A includes/contentpackage/ContentPackageImporter.php A maintenance/BSImportContentPackage.php 3 files changed, 81 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceFoundation refs/changes/83/291883/1 diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c8b9330..b710441 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -37,6 +37,7 @@ $wgApiFrameOptions = 'SAMEORIGIN'; $wgRSSUrlWhitelist = array( "http://blog.blue-spice.org/feed/", + "http://blog.bluespice.com/feed/", "http://blog.hallowelt.com/feed/", ); $wgExternalLinkTarget = '_blank'; diff --git a/includes/contentpackage/ContentPackageImporter.php b/includes/contentpackage/ContentPackageImporter.php new file mode 100644 index 0000000..0a330a6 --- /dev/null +++ b/includes/contentpackage/ContentPackageImporter.php @@ -0,0 +1,27 @@ +<?php + +/** + * This class imports content packages + */ +class BsContentPackageImporter extends WikiImporter { + + /** + * + * @param string $sFilename Path to content package file + */ + public function __construct( $sFilename ) { + + if ( !file_exists( $sFilename ) ) { + throw new MWException( "Content Package not found: " . $sFilename ); + }; + + $rHandle = fopen( $sFilename, 'rt' ); + $oSource = new ImportStreamSource( $rHandle ); + + parent::__construct( $oSource ); + + //Make sure we also get files imported + $this->setImportUploads( true ); + } + +} \ No newline at end of file diff --git a/maintenance/BSImportContentPackage.php b/maintenance/BSImportContentPackage.php new file mode 100644 index 0000000..6198814 --- /dev/null +++ b/maintenance/BSImportContentPackage.php @@ -0,0 +1,53 @@ +<?php +/* + * This script imports content packages + */ + +require_once( 'BSMaintenance.php' ); + +class BSImportContentPackage extends BSMaintenance { + + public function __construct() { + $this->addOption( 'src', 'The path to the content package folder', /* mandatory */ true, true ); + + parent::__construct(); + } + + public function execute() { + $this->output( "This is BSImportContentPackage" ); + + $sFilename = $this->getOption( 'src' ); + + $this->output( "Content package file is : " . $sFilename ); + + $oImporter = new BsContentPackageImporter( $sFilename ); + + if ( $this->hasOption( 'debug' ) ) { + $oImporter->setDebug( true ); + } + if ( $this->hasOption( 'no-updates' ) ) { + $oImporter->setNoUpdates( true ); + } + + $oImporter->setPageCallback( array ( &$this, 'reportPage' ) ); + $oImporter->setUploadCallback( array ( &$this, 'reportUpload' ) ); + + return $oImporter->doImport(); + } + + public function reportPage( $oPage ) { + $this->output( "Importing page: " . $oPage[0]->getFullText() ); + } + + public function reportUpload( $oRevision ) { + $this->output( "Importing file: " . $oRevision->getFilename() ); + } + +} + +$maintClass = 'BSImportContentPackage'; +if ( defined( 'RUN_MAINTENANCE_IF_MAIN' ) ) { + require_once( RUN_MAINTENANCE_IF_MAIN ); +} else { + require_once( DO_MAINTENANCE ); # Make this work on versions before 1.17 +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/291883 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4327a7a6d04d13b9c557566f105f7715ffbdd76a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BlueSpiceFoundation Gerrit-Branch: master Gerrit-Owner: Mglaser <gla...@hallowelt.biz> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits