bobbingwide / oik-batch

Batch interface to WordPress
https://www.oik-plugins.com/oik-plugins/oik-batch
GNU General Public License v2.0
0 stars 0 forks source link
phpunit-tests wordpress-cli

oik-batch

banner

Description

Batch interface to WordPress

Components

oik-wp

oik-batch

Installation

  1. Upload the contents of the oik-batch plugin to the `/wp-content/plugins/oik-batch' directory
  2. Do not activate the oik-batch plugin through the 'Plugins' menu in WordPress
  3. Invoke from the command line using a batch file

Frequently Asked Questions

What other components are in oik-batch?

What are the dependencies?

oik-batch.php and oik-wp.php

As of v0.8.7 oik-batch is no longer dependent upon the oik base plugin's files for batch processing.

If you activate either oik-batch or oik-wp then it will report a dependency on the oik base plugin.

For other routines, such as createapi2.php, which is used for listing and defining the APIs implemented by a WordPress plugin, theme or WordPress core itself, you will need the following:

How do I invoke the routines?

Create a batch file for each of the main routines

oikwp.bat for invoking oik-wp.php

rem Run oik-wp in batch mode so that you can test some code outwith the browser
php c:\apache\htdocs\wordpress\wp-content\plugins\oik-batch\oik-wp.php %*

Run the routine from the required installation's folder where the php file exists. This allows oik-wp to determine the correct wp-config file to use. eg

cd \apache\htdocs\oikcom\wp-content\plugins\oik-shortcodes
oikwp

batch.bat for invoking oik-batch.php

php c:\apache\htdocs\wordpress\wp-content\plugins\oik-batch\oik-batch.php %*

pass the name of the PHP file to invoke as the first parameter

e.g. To invoke listapis2 use:

batch listapis2 <i>plugin</i>

Alternatively oik-batch.php can be included in the main routine.

php c:\apache\htdocs\wordpress\wp-content\plugins\oik-batch\createapi2.php --plugin=%1 --site=https://oik-plugins.co.uk --apikey=apikey

wu.bat for invoking oik-phpunit.php

set PRE_PHPUNIT_CD=%CD%
set PHPUNIT=c:\apache\htdocs\phpLibraries\phpunit\phpunit-8.4.1.phar
php C:\apache\htdocs\wordpress\wp-content\plugins\oik-batch\oik-phpunit.php "--verbose" "--disallow-test-output" "--stop-on-error" "--stop-on-failure" "--log-junit=phpunit.json" %*

Screenshots

  1. oik-batch in action performing createapi2.php

Upgrade Notice

1.1.2

Update for support for PHP 8.1 and PHP 8.2.

Changelog

1.1.2