[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

oik_batch_run_script() – Run a script in batch

You appear to be a bot. Output may be restricted

Description

Run a script in batch

Usage

oik_batch_run_script( $script );

Parameters

$script
( string ) required – the file to load and run

Returns

void

TO DO

Check these comments If the file name given is in the form of a plugin file name e.g. plugin/plugin.php then we can invoke it using oik_path() If it's just a simple name then we assume it's in the ??? folder and we need to append .php and invoke it using oik_path() If it's a fully specified file name that exists then we call it directly. The script can be run by simply loading the file and/or it can implement an action hook for "run_$script"

Source

File name: oik-batch/libs/oik-cli.php
Lines:
1 to 30 of 30
function oik_batch_run_script( $script ) {
  if ( file_exists( $script ) ) {
    oik_require( "oik-login.inc", "oik-batch" );
    require_once( $script ); 
    echo "Script required once: $script" . PHP_EOL;
    do_action( "run_$script" );
    echo "Did: run_$script" . PHP_EOL;
  } else {
    $script_parts = pathinfo( $script );
    print_r( $script_parts );
    $dirname = bw_array_get( $script_parts, "dirname", null );
    if ( $dirname == "." ) {
      $dirname = "oik-wp"; // @TODO - make it choose the current directory
      $dirname = "oik-batch"; // @TODO - make it choose the current directory
    } 
    $filename = bw_array_get( $script_parts, "filename", null );
    $extension = bw_array_get( $script_parts, "extension", ".php" );
    
       
    $required_file = WP_PLUGIN_DIR . "/$dirname/$filename$extension";
    echo $required_file . PHP_EOL;
    if ( file_exists( $required_file ) ) {
      require_once( $required_file );
    } else {
      echo "Cannot find script to run: $required_file" . PHP_EOL;
    }
    // Should this call do_action( "run_$??? " ). If so, what's $???
    // How does WP-cli work?  
  }
}
 
 View on GitHub

Published: March 14, 2017 | Last updated: March 14, 2017

Information

Function name: oik_batch_run_script
Plugin ref: oik-batch
Version: 1.0.0
Sourcefile: libs/oik-cli.php
File ref: libs/oik-cli.php
Deprecated?: No
API Letters: B,O,R,S

Recent plugin updates

UK-tides v3.1.1 UK-tides v3.1.1 is built with the latest wp-scripts. It's been tested with WordPress 6.2 and Gutenberg 15.7.0 ...
oik-weight-zone-shipping v0.2.6 oik-weight-zone-shipping v0.2.6 has been tested with WooCommerce 7.4.0. ...
sb-chart-block v1.2.3 SB Chart Block v1.2.3 contains a fix for an Uncaught Error: Call to undefined function bw_trace2()  ...
SB Chart Block v1.2.1 Update to SB Chart Block v1.2.0 for custom colors, font size options and multiple y-axis charts.  ...
oik-css v2.1.0 Update to oik-css v2.1.0 for the ability to style CSS and GeSHi output in documentation. ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: herb@bobbingwide.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.2.2. PHP: 7.4.33. Memory limit: 768M