[SMW-devel] raising composer features

2013-11-25 Thread Lists
Hi, 


this morning I made some beta tests on the new composer oportunities.

MW 1.22.R0 + SMW 1.9

results:
- successfully installed MW 1.22 via composer with an composer.json (command
line failed)
- ext. SWM was not installed (command git not found)
- ext. validator was placed in the expected folder (extension top level,
type: mediawiki-extension)
- ext. data-values and param-processor where put in wiki-root/vendor
(type: library) 


I would make some assumptions, but I am new to this tech and some of my
related questions are still open.
So I only report my first expressions.

By the way... there is currently no git installed on my test-system.

I installed one of my own ext. (type mediawiki-extension) but autoload.php
seems to be placed wrong. 

I also played with composer the whole weekend and got some individual
dev.-problems: scripting with composer-events failed,
create an installer-plugin failed ;-).  


cheers.


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread James HK
Hi,

If you follow the steps below non of your described issues are occurring:

* Install MW 1.22
* Rename composer-example.json to composer.json
* Add mediawiki/semantic-mediawiki: dev-master and
minimum-stability : dev to the composer.json placed within the MW
directory (for more details see [1])
* Run composer install or composer update from the MW directory

That's all you have to do.

[1] 
https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/docs/INSTALL.md#composer-installation

Cheers


On 11/26/13, Lists li...@psycholutions.com wrote:
 Hi,


 this morning I made some beta tests on the new composer oportunities.

 MW 1.22.R0 + SMW 1.9

 results:
 - successfully installed MW 1.22 via composer with an composer.json
 (command
 line failed)
 - ext. SWM was not installed (command git not found)
 - ext. validator was placed in the expected folder (extension top level,
 type: mediawiki-extension)
 - ext. data-values and param-processor where put in wiki-root/vendor
 (type: library)


 I would make some assumptions, but I am new to this tech and some of my
 related questions are still open.
 So I only report my first expressions.

 By the way... there is currently no git installed on my test-system.

 I installed one of my own ext. (type mediawiki-extension) but autoload.php
 seems to be placed wrong.

 I also played with composer the whole weekend and got some individual
 dev.-problems: scripting with composer-events failed,
 create an installer-plugin failed ;-).


 cheers.


 --
 Shape the Mobile Experience: Free Subscription
 Software experts and developers: Be at the forefront of tech innovation.
 Intel(R) Software Adrenaline delivers strategic insight and game-changing
 conversations that shape the rapidly evolving mobile landscape. Sign up now.

 http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
 ___
 Semediawiki-devel mailing list
 Semediawiki-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread Jeroen De Dauw
Hey Lists,

If you are getting an error because git is not installed, we, that sucks. I
was under the impression Composer would be smart enough to get the code as
tarball in such a case. Though perhaps it normally is, and simply cannot do
this in your case, as you are likely specifying dev-master (which refers to
the master branch on git) to be installed.

Two things I suggest trying, that might get around this issue:

* add the --prefer-dist flag at the end of your Composer install command
when running it. This will get packages as tarballs when available.
* rather then using dev-master as version, use *

In any case, I highly suspect that this will not occur when specifying 1.9
once it has been released. You can try installing version 1.0 the
SubPageList extension [0] and see if you run into the same issue or not.

[0] https://github.com/wikimedia/mediawiki-extensions-SubPageList

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread Lists
Hi Jeroen,

this works. SubPageList is no problem too.

I got Semantic MediaWiki (Version 1.9 beta-1) incl. 

DataValues
DataValues (Version 0.1.1)  Collection of objects representing various
kinds of values Jeroen De Dauw
DataValues Geo (Version 0.1)Geographical value objects, parsers and
formatters  Jeroen De Dauw and The Wikidata team
DataValues Number (Version 0.1) Numerical value objects, parsers and
formatters  The Wikidata team
DataValues Time (Version 0.1)   Time value objects, parsers and formatters
The Wikidata team
DataValues Validators (Version 0.1) Contains common ValueValidator
implementations Jeroen De Dauw and The Wikidata team
DataValuesCommon (Version 0.1.1)Contains common implementations of
the interfaces defined by DataValuesInterfaces  Jeroen De Dauw and The
Wikidata team
DataValuesInterfaces (Version 0.1.2)Defines interfaces for ValueParsers,
ValueFormatters and ValueValidators Jeroen De Dauw
Other

But some extensions are now in wikiroot/vendor others in wikiroot/extensions

What about:
include_once( __DIR__ . '/vendor/autoload.php' );

Befor I begin to make my extensions composer compatible I want to make clear
what I have to include.

In the entry point of SMW it tries to include autoload with: 

include_once( __DIR__ . '/vendor/autoload.php' );

...but in extensions/SemanticMediawiki resist no autoload.php.

...does... 

autoload: {
files: [MyExtension.php]
 
...mean I'am a substitution of autoload.php?


By the way after installing subpages in a second turn SMW was uninstalled!
;-). Might be because of my composer.json...I replaced the require
statements.

Any ideas how to implement partial updates and different repositories?


cheers.

-Ursprüngliche Nachricht-
Von: Jeroen De Dauw [mailto:jeroended...@gmail.com] 
Gesendet: Dienstag, 26. November 2013 02:09
An: Lists
Cc: Semantic MediaWiki developers
Betreff: Re: [SMW-devel] raising composer features

Hey Lists,


If you are getting an error because git is not installed, we, that sucks. I
was under the impression Composer would be smart enough to get the code as
tarball in such a case. Though perhaps it normally is, and simply cannot do
this in your case, as you are likely specifying dev-master (which refers to
the master branch on git) to be installed.


Two things I suggest trying, that might get around this issue:


* add the --prefer-dist flag at the end of your Composer install command
when running it. This will get packages as tarballs when available.

* rather then using dev-master as version, use *


In any case, I highly suspect that this will not occur when specifying 1.9
once it has been released. You can try installing version 1.0 the
SubPageList extension [0] and see if you run into the same issue or not.

[0] https://github.com/wikimedia/mediawiki-extensions-SubPageList


Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--



--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread Jeroen De Dauw
Hey Lists,

 But some extensions are now in wikiroot/vendor others in
wikiroot/extensions

The idea here is that extensions end up in wikiroot/extensions, and all
other packages end up in wikiroot/vendor. This should already be the case
when doing an SMW install. Though not all my packages have been updated to
use the mediawiki-extension type yet, so some extensions might currently be
ending up in wikiroot/vendor, which will be fixed in due time.

What about:
 include_once( __DIR__ . '/vendor/autoload.php' );

 Befor I begin to make my extensions composer compatible I want to make
 clear
 what I have to include.

 In the entry point of SMW it tries to include autoload with:

 include_once( __DIR__ . '/vendor/autoload.php' );

 ...but in extensions/SemanticMediawiki resist no autoload.php.

 ...does...

 autoload: {
 files: [MyExtension.php]

 ...mean I'am a substitution of autoload.php?


If you want to make your package installable via Composer, you just need to
correctly specify things in the autoload section, as I described in my blog
post. If you are writing a MediaWiki extension, you do not need to bother
with the composer autoloader, or even really know it exists.

The autoloader is supposed to be included by the package into which the
Composer install is done. In our case this is MediaWiki core (or the
Extension Installer). You thus can provide support for installing
dependencies into a MediaWiki extension, as SMW has been doing for a while.
This supports an entirely different workflow then the one I'm recommending
MediaWiki users to follow though. It is mainly of use to developers. For
instance, you can include the autoloader from your test bootstarp, so one
can clone a project and just run phpunit, without having to set things up
manually. Example:
https://github.com/DataValues/Geo/blob/master/tests/bootstrap.php

By the way after installing subpages in a second turn SMW was uninstalled!
 ;-). Might be because of my composer.json...I replaced the require
 statements.


Well doh! If you remove the package from your package list, Composer will
be helpful and clean it up for you next time you run its updater!

Any ideas how to implement partial updates and different repositories?


I'm not sure what you mean by this. Can you detail what this functionality
would entail and why it is useful?

Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--
--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] raising composer features

2013-11-25 Thread Lists
Hi Jeroen,


ok, as far as I understand

include_once( __DIR__ . '/vendor/autoload.php' );

...is meant to be...

require_once( __DIR__ . '/../vendor/autoload.php' );

...and autoload.php will resist in wikiroot/vendor together with additional
packages which are not mediawiki-extensions.

We do not need multiple autoloader.php.

Then I can follow your blog instructions.

I'm not sure what you mean by this.

Well for example if I want to install an extension locally from disk
(zip-archive) into directory extensions I have to change 

the global composer.json under wikiroot (packagist: false etc.). Or is
there another workflow? Or is there a way to target different

sections of the entry repositories: in the global composer.json under
wikiroot?


cheers.


-Ursprüngliche Nachricht-
Von: Jeroen De Dauw [mailto:jeroended...@gmail.com] 
Gesendet: Dienstag, 26. November 2013 03:48
An: Lists
Cc: Semantic MediaWiki developers
Betreff: Re: [SMW-devel] raising composer features

Hey Lists,


 But some extensions are now in wikiroot/vendor others in 
 wikiroot/extensions


The idea here is that extensions end up in wikiroot/extensions, and all
other packages end up in wikiroot/vendor. This should already be the case
when doing an SMW install. Though not all my packages have been updated to
use the mediawiki-extension type yet, so some extensions might currently be
ending up in wikiroot/vendor, which will be fixed in due time.



What about:
include_once( __DIR__ . '/vendor/autoload.php' );

Befor I begin to make my extensions composer compatible I want to
make clear
what I have to include.

In the entry point of SMW it tries to include autoload with:

include_once( __DIR__ . '/vendor/autoload.php' );

...but in extensions/SemanticMediawiki resist no autoload.php.

...does...

autoload: {
files: [MyExtension.php]

...mean I'am a substitution of autoload.php?



If you want to make your package installable via Composer, you just need to
correctly specify things in the autoload section, as I described in my blog
post. If you are writing a MediaWiki extension, you do not need to bother
with the composer autoloader, or even really know it exists.


The autoloader is supposed to be included by the package into which the
Composer install is done. In our case this is MediaWiki core (or the
Extension Installer). You thus can provide support for installing
dependencies into a MediaWiki extension, as SMW has been doing for a while.
This supports an entirely different workflow then the one I'm recommending
MediaWiki users to follow though. It is mainly of use to developers. For
instance, you can include the autoloader from your test bootstarp, so one
can clone a project and just run phpunit, without having to set things up
manually. Example:
https://github.com/DataValues/Geo/blob/master/tests/bootstrap.php



By the way after installing subpages in a second turn SMW was
uninstalled!
;-). Might be because of my composer.json...I replaced the require
statements.



Well doh! If you remove the package from your package list, Composer will be
helpful and clean it up for you next time you run its updater!



Any ideas how to implement partial updates and different
repositories?



I'm not sure what you mean by this. Can you detail what this functionality
would entail and why it is useful?


Cheers

--
Jeroen De Dauw
http://www.bn2vs.com
Don't panic. Don't be evil. ~=[,,_,,]:3
--



--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel