Matthias Mullie has uploaded a new change for review.
https://gerrit.wikimedia.org/r/166772
Change subject: Get rid of ApiQueryFlow
......................................................................
Get rid of ApiQueryFlow
* It's been deprecated for awhile.
* We pretty much ignore it, so could be broken any time
* Pretty sure we didn't even have consumers yet
Change-Id: I871cc6cfbadb99397a155044cadd23d1e944f204
---
M Flow.php
M autoload.php
D includes/api/ApiQueryFlow.php
3 files changed, 0 insertions(+), 127 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/72/166772/1
diff --git a/Flow.php b/Flow.php
index 2b34dbb..955893b 100755
--- a/Flow.php
+++ b/Flow.php
@@ -57,7 +57,6 @@
// This file is autogenerated by scripts/gen-autoload.php
require __DIR__ . '/autoload.php';
-$wgAPIListModules['flow'] = 'ApiQueryFlow';
$wgAPIModules['flow-parsoid-utils'] = 'ApiParsoidUtilsFlow';
$wgAPIModules['flow'] = 'ApiFlow';
$wgAPIPropModules['flowinfo'] = 'ApiQueryPropFlowInfo';
diff --git a/autoload.php b/autoload.php
index c57e24c..8cffdaa 100644
--- a/autoload.php
+++ b/autoload.php
@@ -19,7 +19,6 @@
$wgAutoloadClasses['ApiFlowViewTopicList'] = __DIR__ .
'/includes/api/ApiFlowViewTopicList.php';
$wgAutoloadClasses['ApiFlowViewTopicSummary'] = __DIR__ .
'/includes/api/ApiFlowViewTopicSummary.php';
$wgAutoloadClasses['ApiParsoidUtilsFlow'] = __DIR__ .
'/includes/api/ApiParsoidUtilsFlow.php';
-$wgAutoloadClasses['ApiQueryFlow'] = __DIR__ .
'/includes/api/ApiQueryFlow.php';
$wgAutoloadClasses['ApiQueryPropFlowInfo'] = __DIR__ .
'/includes/api/ApiQueryPropFlowInfo.php';
$wgAutoloadClasses['FlowHooks'] = __DIR__ . '/Hooks.php';
$wgAutoloadClasses['Flow\\Actions\\CompareHeaderRevisionsAction'] = __DIR__ .
'/includes/Actions/CompareHeaderRevisionsAction.php';
diff --git a/includes/api/ApiQueryFlow.php b/includes/api/ApiQueryFlow.php
deleted file mode 100644
index 4951f68..0000000
--- a/includes/api/ApiQueryFlow.php
+++ /dev/null
@@ -1,125 +0,0 @@
-<?php
-
-use Flow\Container;
-use Flow\Model\Anchor;
-use Flow\Model\Workflow;
-use Flow\Model\UUID;
-use Flow\WorkflowLoader;
-use Flow\WorkflowLoaderFactory;
-
-/**
- * This API is deprecated and should not be used. Instead use
- * ApiFlowView(Header|Post|Topic|TopicList|TopicSummary)
- *
- * @deprecated
- */
-class ApiQueryFlow extends ApiQueryBase {
- /**
- * @var WorkflowLoader
- */
- protected $loader;
-
- /**
- * @var Workflow
- */
- protected $workflow;
-
- /**
- * @var Container
- */
- protected $container;
-
- public function __construct( $query, $moduleName ) {
- parent::__construct( $query, $moduleName, 'flow' );
- }
-
- public function execute() {
- $this->container = Flow\Container::getContainer();
- // Get the parameters
- $params = $this->extractRequestParams();
- $passedParams = FormatJson::decode( $params['params'], true );
-
- $pageTitle = Title::newFromText( $params['page'] );
- $id = $params['workflow'] ? UUID::create( $params['workflow'] )
: null;
-
- /** @var WorkflowLoaderFactory $factory */
- $factory = $this->container['factory.loader.workflow'];
- $this->loader = $factory->createWorkflowLoader( $pageTitle, $id
);
- $result = array(
- 'workflow' =>
$this->loader->getWorkflow()->getId()->getAlphadecimal()
- );
- foreach( $this->loader->createBlocks() as $block ) {
- $block->init( $this->getContext(), $params['action'] );
-
- $blockParams = array();
- if ( isset( $passedParams[$block->getName()] ) ) {
- $blockParams = $passedParams[$block->getName()];
- }
-
- if ( $block->canRender( $params['action'] ) ) {
- $result['blocks'][] = $block->renderAPI(
$blockParams );
- }
- }
-
- array_walk_recursive( $result, function( &$value ) {
- // This is required untill php 5.4.0 after which we can
- // implement the JsonSerializable interface for Anchor
- if ( $value instanceof Anchor ) {
- $value = $value->toArray();
- }
- } );
-
- $this->getResult()->addValue( 'query', $this->getModuleName(),
$result );
- $this->setWarning( 'This API is deprecated and should not be
used. Instead use ApiFlowView(Header|Post|Topic|TopicList|TopicSummary).' );
- }
-
- public function getAllowedParams() {
- return array(
- 'workflow' => array(
- ),
- 'page' => array(
- ApiBase::PARAM_REQUIRED => true,
- ),
- 'action' => array(
- ApiBase::PARAM_DFLT => 'view',
- ),
- 'params' => array(
- ApiBase::PARAM_DFLT => '{}',
- ),
- );
- }
-
- public function getDescription() {
- return 'Shim to query to the internal Flow API. This API is
obsolete and ' .
- 'has been superseded by submodules of action=flow.';
- }
-
- public function getParamDescription() {
- return array(
- 'workflow' => 'Hex-encoded ID of the workflow to query',
- 'page' => 'Title of the page to query',
- 'action' => 'The view-type action to take',
- 'params' => 'View parameters to pass to each block,
indexed by block name',
- );
- }
-
- public function getExamples() {
- return array(
- 'api.php?action=query&list=flow&flowpage=Talk:Flow_QA',
- );
- }
-
- static public function array_merge_array( array $arrays ) {
- switch( count( $arrays ) ) {
- case 0:
- return array();
-
- case 1:
- return reset( $arrays );
-
- default:
- return call_user_func_array( 'array_merge', $arrays );
- }
-
- }
-}
--
To view, visit https://gerrit.wikimedia.org/r/166772
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I871cc6cfbadb99397a155044cadd23d1e944f204
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits