Not logged in. · Lost password · Register
Page:  1  2  3  next 

All posts by iainhallam (33)

topic: Changing a config setting from PHP  in the forum: General Help and Support Development
iainhallam #1
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: Changing a config setting from PHP
As per my other post about automating plugin installations for an extensive internal template, is there a good way to set a single configuration value for the Wiki from PHP code, or would I be better off appending lines to the local.php file?
topic: Installing plugin from PHP  in the forum: General Help and Support Development
iainhallam #2
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: Installing plugin from PHP
I've got a fairly extensive template that is for internal use (so it won't make it to the template registry) and I'd like it to be able to install the plugins that it needs automatically if they're not already installed on the Wiki I put it on. I've taken a look at the extension manager code, but I'm not much the wiser as to how I would call it to look up the plugin's installers from dokuwiki.org and then run the install. Are there any useful pointers people could give, please?
topic: Replacing bundled plugin admin screen  in the forum: General Help and Support Development
iainhallam #3
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 59808
The ACL plugin is protected, and can't be disabled from the web interface.
topic: Returning an AUTH_X level from action plugin  in the forum: General Help and Support Development
iainhallam #4
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: Returning an AUTH_X level from action plugin
I've been using the AUTH_ACL_CHECK event and the page for it (https://www.dokuwiki.org/devel:event:auth_acl_check) says:

BEFORE handlers should return one of the AUTH_* constants and prevent the default action auth_aclcheck_cb().

Reading that, I tried the following:

return AUTH_ADMIN;

Result: no permissions. If instead I do this:

$event->result = AUTH_ADMIN;
return true;

I get the proper permissions.

Should the event page say to set the event result, rather than return?
topic: Replacing bundled plugin admin screen  in the forum: General Help and Support Development
iainhallam #5
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: Replacing bundled plugin admin screen
I'm writing an extension to DokuWiki's ACL system, and I've so far got the raw checks working - I can use my own entries in acl.auth.php to allow or deny access - but now I'd like to replace the user interface of the ACL plugin to load my own code. As far as I can see, there aren't any events that would allow me to intercept the handle() and html() methods of the ACL plugin. Is there a better way?
topic: [SOLVED] How to handle() multiple syntaxes in plugin  in the forum: General Help and Support Development
iainhallam #6
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 59538
Good to know; thanks.
topic: [Solved] Automated plugin installation  in the forum: General Help and Support Installation and Configuration
iainhallam #7
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 59509
Perfect; thanks! Is there a way to return only a single value (downloadurl), or shall I just process it my end?
topic: [Solved] Automated plugin installation  in the forum: General Help and Support Installation and Configuration
iainhallam #8
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 59504
My use case is that my scripts install a blank DokuWIki by downloading and uncompressing the stable tar.gz, and I'd like to be able to populate the installation with the plugins I need, but by just having a file or configuration in the script that lists the plugins that should be installed, along the lines of:

sqlite
wrap

At this point, the script will need to either emulate the extension plugin and find out where to download the plugins from dokuwiki.org, or I was wondering if there was some way I could call the extension manager PHP to install the plugins - at least I wouldn't be duplicating code then and wouldn't have to scrape the dw.org pages.
topic: [Solved] Automated plugin installation  in the forum: General Help and Support Installation and Configuration
iainhallam #9
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 59496
That's the easy direction - going from a plugin file to the short name for installation, because as you say, there's the plugin.info.txt. I want to do the opposite, though: given the short name of a plugin, I need to find its download URL and then install it.
topic: [Solved] Automated plugin installation  in the forum: General Help and Support Installation and Configuration
iainhallam #10
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 59492
DokuWiki can look up where to get the zip file from, though, using the name of the plugin. I'd prefer not to have to parse the DokuWiki website myself for that information if possible.
topic: [Solved] Automated plugin installation  in the forum: General Help and Support Installation and Configuration
iainhallam #11
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: [Solved] Automated plugin installation
Hi, all.

I'm working on deploying DokuWiki by BASh script, and it's all working so far, but I haven't got a way to automate the installation of the plugins I want to put in the installation. Does anyone know a good way of doing this? Ideally, I'd like to be able to call DokuWiki's own installation routines, since the bare installation is working fine.

Thanks,

Iain.
This post was edited on 2018-01-30, 00:42 by iainhallam.
topic: [SOLVED] How to handle() multiple syntaxes in plugin  in the forum: General Help and Support Development
iainhallam #12
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: [SOLVED] How to handle() multiple syntaxes in plugin
I'm writing a substitution plugin that uses addSpecialPattern to match a complex syntax, but I'd like to provide a much simpler version that assumes defaults for a lot of options.

I was thinking of having a second addSpecialPattern in connectTo() to do this, but how do I tell which has been matched in my handle() method? The matches will need processing slightly differently to get to the correct state before I can pass on to render().
This post was edited on 2018-02-25, 21:06 by iainhallam.
topic: New Vagrant VM environment for testing plugins  in the forum: General Help and Support Development
iainhallam #13
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: New Vagrant VM environment for testing plugins
I've been testing a few plugins recently and decided to do most of it in virtual machines managed by Vagrant. As I was installing DokuWiki frequently into these VMs, but I still wanted it to be visible in my host operating system where I was doing the development (so I could inspect changes as the plugin operated) I wrapped up the whole environment and the scripts used to install a fresh working copy of DokuWiki into a GitHub project:

https://github.com/iainhallam/vagrant-dokuwiki-plugin

If you're working on a plugin, you can create the appropriate directories above the plugin files, download this repo, and write a short BASh script to do any configuration your plugin needs, then you have a reproducible environment for testing the plugin just by running the command vagrant up and pointing your browser at localhost:10080.

If you make a mess of the installation, you can use vagrant destroy and start again. (If you mess up the plugin files, I'm assuming you're using some kind of source code versioning...).

Anyway, I thought it might be useful to anyone who does a lot of testing or plugin development.
topic: Fatal error: Call to undefined function random_int()  in the forum: General Help and Support Installation and Configuration
iainhallam #14
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 55492
I've opened a GitHub issue for this:

https://github.com/splitbrain/dokuwiki/issues/1852
topic: Fatal error: Call to undefined function random_int()  in the forum: General Help and Support Installation and Configuration
iainhallam #15
Member since May 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 54623
Quote by turnermm on 2016-11-23, 02:43:
This function requires php 7.  It is not called in the stable distribution of dokuwiki.

This has just popped up again, now that the stable version does call random_int. I see that vendor/paragonie/random_compat/ is present, but running on PHP 5.6 on Ubuntu 16.04, I'm getting an error when trying install.php:

Fatal error: Call to undefined function random_int() in /var/www/public/inc/PassHash.class.php on line 630
Close Smaller – Larger + Reply to this post:
Special characters:
Page:  1  2  3  next 
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-17, 08:49:11 (UTC +01:00)