Mediawiki i SyntaxHighlight_GeSHi

Dakle, pratio uputstvo: http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi

Instalirao, podesio datoteke, resetova apache ali tag ne fercera. S obzirom da se sa wikijem do sada nisam susretao, svi prijedlozi bi dobrodosli, e.g. koje config datoteke da edituje, gdje da trazim errors i sl.

Rekreirao sam scenario, skinuo latest MediWiki, svukao preko svn-a extenzije i GeSHi,

SyntaxHighlight_GeSHi dir smjestio u extensions/
u LocalSettings.php na kraju dodao :

# GeSHi require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");
Dodao u klasi da mu je dotted border za css, nisam radio onaj hack za div-ove

Copy/Paste njihov primjer i radi iz prve…

isto sve to odradio osim sto je mediawiki i geshi instaliran preko apt-get.a

I naravno, u pitanju je Ubuntu 8.04, moguce da su zastarjeli paketi.

Probam danas na squeeze-u sve odraditi.

Po meni je losa praksa instalirati web aplikacije preko package manager-a, iz vise razloga.

Meni ne samo za web aplikacije, iako mi rade sve kako treba zasad, nego inace neke kompleksnije aplikacije sto moraju biti “compiled just right”. Recimo kodeci i media editing alati, sa kojima sam imao problema dosad. Uvijek se svede na “nije stavljen --enable-insert_option_here flag pri kompajliranju”.

Ma znam, ali ne vidim sta je toliko komplikovano u mediawiki-u. Geshi je fakat jednostavna stvar, ubacis dir u extensions/, ubacis ovu liniju:

require_once( "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php" );

u LocalSettings.php

i sve bi trebalo da radi.

Ali meni ne prepoznaje tag nikako.

Zna li neko da li mediawiki zapisuje bilo koje log datoteke i gdje? I kako mogu provjeriti varijable iz LocalSettings.php skripte?

Npr. kada uradim

daje mi praznu liniju. Ali s obzirom da se vjerovatno izvrsava u svom subshellu, ovo je za ocekivati. Inace kada hocu da provjerim varijable, samo dodam echo $imevarijable unutar startup skripte, i prilikom startanja naravno vidim koja je vrijednost zapisana u varijabli.

Eh sad, ne znam sta starta mediawiki (apache2?), tako da ne mogu provjeriti vrijednost $IP varijable u mediawiki subshellu.

Pokusaj da umjesto $IP varijable uneses punu putanju GeSHi extenzije
npr.

Sto se tice tih varijabli, pokusaj sa npr.
test.php

<?php require_once("LocalSettings.php"); echo $varijabla; ?>

Probao sam zamjeniti $IP sa

/var/lib/mediawiki/

sto je prefix /extensions direktorija, nije funkcionisalo.

Ovaj drugi dio nisam skontao, gdje da napravim test.php i kako da ga testiram?

U dir gdje se nalazi LocalSettings.php, dakle gdje je i index.php od wiki.

Kasnije u browser kada otvoris wiki unesi samo /test.php umjesto /index.php/Main_Page ili ako imas instaliran php-cli iz shell-a

Mozda pomogne u dijagnozi:

root@admserver01:/var/lib/mediawiki# ls -l total 20 lrwxrwxrwx 1 root root 32 2010-09-30 19:11 AdminSettings.php -> /etc/mediawiki/AdminSettings.php lrwxrwxrwx 1 root root 28 2010-09-30 19:11 api.php -> /usr/share/mediawiki/api.php drwxrwxrwx 2 www-data www-data 4096 2010-12-17 16:45 config drwxr-xr-x 3 root root 4096 2010-12-20 17:04 extensions drwx------ 2 www-data www-data 4096 2010-07-12 23:09 images lrwxrwxrwx 1 root root 33 2010-09-30 19:11 img_auth.php -> /usr/share/mediawiki/img_auth.php lrwxrwxrwx 1 root root 29 2010-09-30 19:11 includes -> /usr/share/mediawiki/includes lrwxrwxrwx 1 root root 30 2010-09-30 19:11 index.php -> /usr/share/mediawiki/index.php lrwxrwxrwx 1 root root 38 2010-09-30 19:11 install-utils.inc -> /usr/share/mediawiki/install-utils.inc lrwxrwxrwx 1 root root 30 2010-09-30 19:11 languages -> /usr/share/mediawiki/languages -rw-rw-rw- 1 www-data www-data 4714 2011-01-03 18:09 LocalSettings.php lrwxrwxrwx 1 root root 32 2010-09-30 19:11 maintenance -> /usr/share/mediawiki/maintenance lrwxrwxrwx 1 root root 40 2010-09-30 19:11 opensearch_desc.php -> /usr/share/mediawiki/opensearch_desc.php lrwxrwxrwx 1 root root 36 2010-09-30 19:11 profileinfo.php -> /usr/share/mediawiki/profileinfo.php lrwxrwxrwx 1 root root 33 2010-09-30 19:11 redirect.php -> /usr/share/mediawiki/redirect.php lrwxrwxrwx 1 root root 35 2010-09-30 19:11 redirect.phtml -> /usr/share/mediawiki/redirect.phtml lrwxrwxrwx 1 root root 26 2010-09-30 19:11 skins -> /usr/share/mediawiki/skins lrwxrwxrwx 1 root root 38 2010-09-30 19:11 StartProfiler.php -> /usr/share/mediawiki/StartProfiler.php lrwxrwxrwx 1 root root 29 2010-09-30 19:11 Test.php -> /usr/share/mediawiki/Test.php lrwxrwxrwx 1 root root 30 2010-09-30 19:11 thumb.php -> /usr/share/mediawiki/thumb.php lrwxrwxrwx 1 root root 34 2010-09-30 19:11 trackback.php -> /usr/share/mediawiki/trackback.php lrwxrwxrwx 1 root root 31 2010-09-30 19:11 wiki.phtml -> /usr/share/mediawiki/wiki.phtml root@admserver01:/var/lib/mediawiki#

[code]root@admserver01:/usr/share# ls -l med*
mediawiki:
total 92
lrwxrwxrwx 1 root root 36 2010-09-30 19:11 AdminSettings.php -> /var/lib/mediawiki/AdminSettings.php
-rw-r–r-- 1 root root 2937 2008-03-03 08:09 api.php
lrwxrwxrwx 1 root root 25 2010-09-30 19:11 config -> /var/lib/mediawiki/config
lrwxrwxrwx 1 root root 29 2010-09-30 19:11 extensions -> /var/lib/mediawiki/extensions
lrwxrwxrwx 1 root root 25 2010-09-30 19:11 images -> /var/lib/mediawiki/images
-rw-r–r-- 1 root root 3095 2010-07-12 23:09 img_auth.php
drwxr-xr-x 9 root root 12288 2010-09-30 19:11 includes
-rw-r–r-- 1 root root 3218 2008-03-03 08:09 index.php
-rw-r–r-- 1 root root 3772 2008-03-03 08:09 install-utils.inc
drwxr-xr-x 4 root root 4096 2010-09-30 19:11 languages
lrwxrwxrwx 1 root root 36 2010-09-30 19:11 LocalSettings.php -> /var/lib/mediawiki/LocalSettings.php
drwxr-xr-x 8 root root 4096 2010-09-30 19:11 maintenance
-rw-r–r-- 1 root root 1532 2008-03-03 08:09 opensearch_desc.php
-rw-r–r-- 1 root root 6174 2010-07-12 23:09 profileinfo.php
-rw-r–r-- 1 root root 289 2008-03-03 08:09 redirect.php
-rw-r–r-- 1 root root 91 2008-03-03 08:09 redirect.phtml
drwxr-xr-x 9 root root 4096 2010-09-30 19:11 skins
-rw-r–r-- 1 root root 603 2008-03-03 08:09 StartProfiler.php
-rw-r–r-- 1 root root 12822 2008-03-03 08:09 Test.php
-rw-r–r-- 1 root root 3159 2010-07-12 23:09 thumb.php
-rw-r–r-- 1 root root 1373 2008-03-03 08:09 trackback.php
-rw-r–r-- 1 root root 88 2008-03-03 08:09 wiki.phtml

mediawiki-extensions:
total 276
-rw-r–r-- 1 root root 20572 2006-10-23 11:25 Cite.php
-rw-r–r-- 1 root root 11942 2007-06-29 03:36 Expr.php
-rw-r–r-- 1 root root 2159 2007-06-29 03:36 ExtensionFunctions.php
-rw-r–r-- 1 root root 2754 2007-06-29 03:36 Footnote.php
-rw-r–r-- 1 root root 7825 2006-10-23 11:25 inputbox.php
-rw-r–r-- 1 root root 57316 2007-06-29 03:36 LdapAuthentication.php
-rw-r–r-- 1 root root 10686 2007-07-05 14:40 NewestPages.i18n.php
-rw-r–r-- 1 root root 5366 2007-06-29 03:36 NewestPages.page.php
-rw-r–r-- 1 root root 1509 2007-06-29 03:36 NewestPages.php
-rw-r–r-- 1 root root 1004 2007-07-16 22:42 PageCSS.php
-rw-r–r-- 1 root root 2653 2007-06-29 03:36 ParserFunctions.i18n.php
-rw-r–r-- 1 root root 8259 2007-06-29 03:36 ParserFunctions.php
-rw-r–r-- 1 root root 1966 2006-10-23 11:25 poem.php
-rw-r–r-- 1 root root 638 2007-07-09 20:49 RenameUserJob.php
-rw-r–r-- 1 root root 6460 2006-10-23 11:25 SpecialLastUserLogin.php
-rw-r–r-- 1 root root 12223 2007-07-09 20:49 SpecialRenameuser_body.php
-rw-r–r-- 1 root root 53385 2007-07-11 16:16 SpecialRenameuser.i18n.php
-rw-r–r-- 1 root root 1887 2007-07-09 20:49 SpecialRenameuser.php
-rw-r–r-- 1 root root 4930 2007-06-29 03:36 SprintfDateCompat.php
-rw-r–r-- 1 root root 6436 2007-10-28 09:22 SyntaxHighlight_GeSHi.class.php
-rw-r–r-- 1 root root 8056 2007-07-21 03:25 SyntaxHighlight_GeSHi.i18n.php
-rw-r–r-- 1 root root 2435 2007-07-21 03:26 SyntaxHighlight_GeSHi.php
root@admserver01:/usr/share#[/code]
Dakle, SyntaxHighlight_GeSHi.class.php mi se nalazi na dva mjesta,

/var/lib/mediawiki/extensions/SyntaxHighlight_GeSHi/

i

/usr/share/mediawiki-extensions/

Ondak pozovi jedan od tih sa apsolutnom putanjom.

Da, ali u

require_once( "/var/lib/mediawiki/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php" );

pozivam

SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php

a ne

SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php

.php je mediawiki extension, .class.php je zvanicna GeSHi php klasa koju koristi ova extenzija.

Dakle ti pozivas SyntaxHighlight_GeSHi.php, a u njemu bi trebalo da je uradjen include GeSHi klase.

[code]root@admserver01:/usr/share/mediawiki# ls
AdminSettings.php extensions includes languages opensearch_desc.php redirect.phtml test.php trackback.php
api.php images index.php LocalSettings.php profileinfo.php skins Test.php wiki.phtml
config img_auth.php install-utils.inc maintenance redirect.php StartProfiler.php thumb.php

root@admserver01:/usr/share/mediawiki# php test.php
This file is part of MediaWiki and is not a valid entry point
root@admserver01:/usr/share/mediawiki#[/code]

[code]# If you customize your file layout, set $IP to the directory that contains

the other MediaWiki files. It will be used as a base to locate files.

if( defined( ‘MW_INSTALL_PATH’ ) ) {
$IP = MW_INSTALL_PATH;
} else {
$IP = dirname( FILE );
}[/code]
Dakle MW_INSTALL_PATH je lokacija, else, uzima punu putanju do trenutnog file-a, koji je u tom slucaju LocalSettings.php

Moja preporuka je da skines mediawiki i instaliras kao obicnu web aplikaciju, ovde je previse petljanja sa sym links i 10 razlicitih lokacija.

Ups! Dieser Link scheint nicht zu funktionieren. Vorschläge: Suche bei Google:

btw,

root@admserver01:/var/lib/mediawiki/extensions/SyntaxHighlight_GeSHi# ls -l total 92 drwxr-xr-x 6 root root 4096 2011-01-04 19:04 geshi -rw-r--r-- 1 root root 2284 2010-12-20 17:04 README -rw-r--r-- 1 root root 9611 2010-12-20 17:04 SyntaxHighlight_GeSHi.class.php -rw-r--r-- 1 root root 64325 2010-12-20 17:04 SyntaxHighlight_GeSHi.i18n.php -rw-r--r-- 1 root root 2880 2010-12-20 17:04 SyntaxHighlight_GeSHi.php root@admserver01:/var/lib/mediawiki/extensions/SyntaxHighlight_GeSHi#
Dakle, i .class.php i .php se nalaze u direktoriju:

/var/lib/mediawiki/extensions/SyntaxHighlight_GeSHi/

I kada definisem aboslut path do .php datoteke, opet ne funkcionise.

[quote=Bo][code]# If you customize your file layout, set $IP to the directory that contains

the other MediaWiki files. It will be used as a base to locate files.

if( defined( ‘MW_INSTALL_PATH’ ) ) {
$IP = MW_INSTALL_PATH;
} else {
$IP = dirname( FILE );
}[/code]
Dakle MW_INSTALL_PATH je lokacija, else, uzima punu putanju do trenutnog file-a, koji je u tom slucaju LocalSettings.php

Moja preporuka je da skines mediawiki i instaliras kao obicnu web aplikaciju, ovde je previse petljanja sa sym links i 10 razlicitih lokacija.[/quote]
Sutra cu dalje, bice da cu ukinuti cijeli distro, nabaciti squeeze i od nule. Nema mi nista gore nego ceprkati po konfiguraciji koju je neko drugi napravio, gubim vrijeme samo dok skontam gdje je sta.

@Bo

hvala velika na pomoci, castim pivom kad se vidimo.