Wikimedia tool framework (php)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Wikimedia tool framework (php)

Petr Bena
Hi,

It's been some time since we launched tool labs and there is
incredible number of tools now. They all however have 2 major
problems. Every tool has own, different layout / css style (which may
be confusing the users of these tools) and every developer of these
tools probably have to reinvent a wheel at some point as they all have
to do some common tool setup - eg. they have to create some basic php
skeleton that would access wikimedia resources, from databases,
memcache, reddis to API's and so on.

What about creating some common uniform framework in php that, just as
pywikipediabot that is used to create bots, would be used to create
web-based tools. So that maintainer of a tool would just fork or clone
this framework and wouldn't have to spend their time creating
functions that would generate html pages with wikimedia uniform style
(similar to how vector looks, for example, or just any uniform style,
so that tools would look similar), access wikimedia databases, OAuth,
ldap, API...

I believe it would not just make creation of new tools incredibly
simple, but it would also make all tools have consistent look and
feel, and thus improve the end user experience. What you think? Is
there someone who would like to work on that?

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: [Labs-l] Wikimedia tool framework (php)

Petr Bena
Yes please provide some links to all these solutions if you can I will try
to reuse as much as possible
On Dec 8, 2014 5:51 PM, "Platonides" <[hidden email]> wrote:

> I coded such frameworks some years ago. It was based on MediaWiki code,
> so it (a) looked similar to MW code, (b) would be easier to port if it was
> to be converted into a MediaWiki extension, (c) had quite advanced code
> ready to use (like the database access primitives or creating a gallery).
>
> The code is ~200 lines of library code plus ~250 for the skin (ie. skipped
> for cli scripts).
> Mostly glue so that it could load from a db from a project, to use
> ToolserverI18N instead of MW native ones, etc.
> The html showed either Vector or Monobook skin, including links to view
> the tool translated and even warned about the status of each Toolserver
> cluster (doesn't have an equivalence in labs).
>
> If you are interested on this code, it can be used as a basis for the
> framework. It should be brought up to date with modern MediaWiki, though.
> On the plus side, that would allow my old toolserver tools to run again :)
>
> _______________________________________________
> Labs-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/labs-l
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Wikimedia tool framework (php)

svetlana
In reply to this post by Petr Bena
In my view, if a Labs tool is a success, it should be written as a wiki Extension and deployed to relevant wikis. What you're saying essentially means that there is a need to make the wiki truly extensible without much pain.

- https://www.mediawiki.org/wiki/OOjs_UI for example, but people insist it's not ready for production and is internal to Visual Editor folks. Quoting James:
> OOUI is not stable enough to encourage people to use it full-tilt (we make breaking changes every week or so), so this [writing documentation for it] feels very premature --Jdforrester (WMF) (talk) 17:47, 4 September 2014 (UTC)

- I believe Wikibase (Wikidata) is meant to make database operations easier. I have no idea what database toolkits they provide (you may want to check with wikidata-l).

--
svetlana

Petr Bena <[hidden email]> wrote:

> Hi,
>
> It's been some time since we launched tool labs and there is
> incredible number of tools now. They all however have 2 major
> problems. Every tool has own, different layout / css style (which may
> be confusing the users of these tools) and every developer of these
> tools probably have to reinvent a wheel at some point as they all have
> to do some common tool setup - eg. they have to create some basic php
> skeleton that would access wikimedia resources, from databases,
> memcache, reddis to API's and so on.
>
> What about creating some common uniform framework in php that, just as
> pywikipediabot that is used to create bots, would be used to create
> web-based tools. So that maintainer of a tool would just fork or clone
> this framework and wouldn't have to spend their time creating
> functions that would generate html pages with wikimedia uniform style
> (similar to how vector looks, for example, or just any uniform style,
> so that tools would look similar), access wikimedia databases, OAuth,
> ldap, API...
>
> I believe it would not just make creation of new tools incredibly
> simple, but it would also make all tools have consistent look and
> feel, and thus improve the end user experience. What you think? Is
> there someone who would like to work on that?
>
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Wikimedia tool framework (php)

James Forrester-4
On 8 December 2014 at 13:10, svetlana <[hidden email]> wrote:

> - https://www.mediawiki.org/wiki/OOjs_UI for example, but people insist
> it's not ready for production and is internal to Visual Editor folks.
> Quoting James:
> > OOUI is not stable enough to encourage people to use it full-tilt (we
> make breaking changes every week or so), so this [writing documentation for
> it] feels very premature --Jdforrester (WMF) (talk) 17:47, 4 September 2014
> (UTC)
>

​Out of date statement. :-)​ The team is hard at work on the documentation
side.

J.
--
James D. Forrester
Product Manager, Editing
Wikimedia Foundation, Inc.

[hidden email] | @jdforrester
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Wikimedia tool framework (php)

Brian Wolff
In reply to this post by svetlana
On Dec 8, 2014 5:10 PM, "svetlana" <[hidden email]> wrote:
>
> In my view, if a Labs tool is a success, it should be written as a wiki
Extension and deployed to relevant wikis. What you're saying essentially
means that there is a need to make the wiki truly extensible without much
pain.

Thats not neccesarily true. There are many different types of tools with
different criteria for success. Some may be appropriate to be turned into
an extension, but some arent.

A wrapper library that exports a mediawiki like interface for tools so that
a tool could easily be ported to an extension would be really cool. However
that's not neccesarily what petrb is proposing (although that is one way to
implement what he's proposing)

> - I believe Wikibase (Wikidata) is meant to make database operations
easier. I have no idea what database toolkits they provide (you may want to
check with wikidata-l).
>
> --

Surely generic db abstraction layer is not wikibase's primary function...

--bawolff
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: Wikimedia tool framework (php)

Magnus Manske-2
Just to chime in here, my tools (the ones that generate HTML from PHP, that
is) are all based on the same style code, so it would be easy to change
them centrally.

That said, much of the per-tool styles are based on bootstrap, so using
something else would mean changing a lot of them. I just hit 100 [1], so
... probably not.


[1] https://tools.wmflabs.org/hay/directory/#/author/Magnus%20Manske

On Mon, Dec 8, 2014 at 10:13 PM, Brian Wolff <[hidden email]> wrote:

> On Dec 8, 2014 5:10 PM, "svetlana" <[hidden email]> wrote:
> >
> > In my view, if a Labs tool is a success, it should be written as a wiki
> Extension and deployed to relevant wikis. What you're saying essentially
> means that there is a need to make the wiki truly extensible without much
> pain.
>
> Thats not neccesarily true. There are many different types of tools with
> different criteria for success. Some may be appropriate to be turned into
> an extension, but some arent.
>
> A wrapper library that exports a mediawiki like interface for tools so that
> a tool could easily be ported to an extension would be really cool. However
> that's not neccesarily what petrb is proposing (although that is one way to
> implement what he's proposing)
>
> > - I believe Wikibase (Wikidata) is meant to make database operations
> easier. I have no idea what database toolkits they provide (you may want to
> check with wikidata-l).
> >
> > --
>
> Surely generic db abstraction layer is not wikibase's primary function...
>
> --bawolff
> _______________________________________________
> Wikitech-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Reply | Threaded
Open this post in threaded view
|

Re: [Labs-l] Wikimedia tool framework (php)

Krinkle
In reply to this post by Petr Bena
I also have a home-grown framework:
https://github.com/Krinkle/toollabs-base

Originally created for my Toolserver tools. Recently rewritten for Tool Labs.

A few example tools:

* https://tools.wmflabs.org/orphantalk/
* https://tools.wmflabs.org/usage/?action=usage&group=Krinkle
* https://tools.wmflabs.org/intuition/
* https://tools.wmflabs.org/wikiinfo/
* https://tools.wmflabs.org/snapshots/

Some Tool Labs oriented features:

* Interface for LabsDB.
* Interface for Wikimedia wikis.
* Integration with Intuition for localisation.
* Integration with tool-labs Redis for caching.

Some back-end features:
* Caching layers (Redis, FileSystem, Memory).
* LocalSettings-driven (ala MediaWiki).
* Incorporates MediaWiki's Html.php, Sanitizer.php, GitInfo.php.
* HttpRequest interface.

Front-end features:
* Bootstrap
* jQuery

Having said that, it's a pile of shitty hacks. I'd be happy to collaborate on something else.

— Krinkle

On 8 Dec 2014, at 15:30, Petr Bena <[hidden email]> wrote:

> Hi,
>
> It's been some time since we launched tool labs and there is
> incredible number of tools now. They all however have 2 major
> problems. Every tool has own, different layout / css style (which may
> be confusing the users of these tools) and every developer of these
> tools probably have to reinvent a wheel at some point as they all have
> to do some common tool setup - eg. they have to create some basic php
> skeleton that would access wikimedia resources, from databases,
> memcache, reddis to API's and so on.
>
> What about creating some common uniform framework in php that, just as
> pywikipediabot that is used to create bots, would be used to create
> web-based tools. So that maintainer of a tool would just fork or clone
> this framework and wouldn't have to spend their time creating
> functions that would generate html pages with wikimedia uniform style
> (similar to how vector looks, for example, or just any uniform style,
> so that tools would look similar), access wikimedia databases, OAuth,
> ldap, API...
>
> I believe it would not just make creation of new tools incredibly
> simple, but it would also make all tools have consistent look and
> feel, and thus improve the end user experience. What you think? Is
> there someone who would like to work on that?
>
> _______________________________________________
> Labs-l mailing list
> [hidden email]
> https://lists.wikimedia.org/mailman/listinfo/labs-l

_______________________________________________
Wikitech-l mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l