Download the PHP package pressbooks/pb-cli without Composer

On this page you can find all versions of the php package pressbooks/pb-cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pb-cli

pressbooks/pb-cli

A suite of wp-cli commands for Pressbooks.

Build Status

Quick links: Support

Using

This package implements the following commands:

wp scaffold book-theme

Generate the files needed for a Pressbooks book theme.

wp scaffold book-theme <slug> <vendor> [--theme_name=<title>] [--description=<description>] [--uri=<uri>] [--author=<author>] [--author_uri=<author_uri>] [--github_account=<github_account>] [--github_repo=<github_repo>] [--license=<license>] [--textdomain=<textdomain>] [--version=<version>] [--dir=<dir>] [--activate] [--enable-network] [--force]

Default behavior is to create the following files:

Unless specified with --dir=<dir>, the theme is placed in the themes directory.

OPTIONS

<slug>
    Slug for the new theme.

<vendor>
    Vendor for the new theme. Used in composer.json and package.json.

[--theme_name=<title>]
    What to put in the 'Theme Name:' header in 'style.css'. Defaults to <slug>.

[--description=<description>]
    Human-readable description for the theme.

[--uri=<uri>]
    What to put in the 'Theme URI:' header in 'style.css'.

[--author=<author>]
    What to put in the 'Author:' header in 'style.css'.

[--author_uri=<author_uri>]
    What to put in the 'Author URI:' header in 'style.css'.

[--github_account=<github_account>]
    The GitHub account that owns this project (e.g. 'pressbooks'). Defaults to vendor.

[--github_repo=<github_repo>]
    The GitHub repo name for this project (e.g. 'pressbooks-book'). Defaults to slug.

[--license=<license>]
    What to put in the 'License:' header in 'style.css'.
    ---
    default: GPL 2.0+
    ---

[--textdomain=<textdomain>]
    Text domain for the theme. Defaults to <slug>.

[--version=<version>]
    Version for the theme.
    ---
    default: 1.0
    ---

[--dir=<dir>]
    Specify a destination directory for the command. Defaults to the themes directory.

[--activate]
    Activate the newly created book theme.

[--enable-network]
    Enable the newly created book theme for the entire network.

[--force]
    Overwrite files that already exist.

wp pb issue-template

Generate an issue template for a Pressbooks theme or plugin, placing it in .github/ISSUE_TEMPLATE.md.

wp pb issue-template <slug> --type=<type> --owner=<owner> [--dir=<dir>] [--force]

OPTIONS

<slug>
    Slug for the theme or plugin (e.g. pressbooks, pressbooks-book).

--type=<type>
    The type of repo for which we're generating an issue template. Must be `theme` or `plugin`.

--owner=<owner>
    The GitHub username of this repo's owner (e.g. pressbooks).

[--dir=<dir>]
    Specify a destination directory for the command. Defaults to the theme or plugin's directory.

[--force]
    Overwrite files that already exist.

wp pb theme lock

Lock a book's theme.

wp pb theme lock --url=<url>

OPTIONS

--url=<url>
    The URL of the target book.

wp pb theme unlock

Unlock a book's theme.

wp pb theme unlock --url=<url>

OPTIONS

--url=<url>
    The URL of the target book.

wp pb clone

Clone a book.

wp pb clone <source> <destination> --user=<user>

OPTIONS

<source>
    URL

<destination>
    Book slug on the current network

--user=<user>
    sets request to a specific WordPress user

wp pb populate-books-admins

It populates pb_book_admins blog metada for each blog with comma-separated book administrator's user IDs.

wp pb network-aggregate

Aggregate Koko Analytics (visits & referrers) across every site in a Pressbooks multisite using batched processing, retries and failure backoff.

wp pb network-aggregate [--mode=<visits|referrers|both>] [--batch-size=<n>] [--start-id=<blog_id>] [--max-sites=<n>] [--since-failures] [--lock-timeout=<sec>] [--retries=<n>]

OPTIONS

--mode=<visits|referrers|both>
    Which data to aggregate. Default: both.

--batch-size=<n>
    Number of blogs per batch (controls memory). Default: 200.

--start-id=<blog_id>
    Begin at this numeric blog ID (skip smaller IDs). Default: 0.

--max-sites=<n>
    Stop after processing this many sites. Default: unlimited.

--since-failures
    Process only previously failed sites whose backoff has expired.

--lock-timeout=<sec>
    Seconds to wait for MySQL GET_LOCK before aborting gracefully. Default: 5.

--retries=<n>
    Max attempts per blog+mode before recording a failure. Default: 3.

BEHAVIOR

EXAMPLES

Process entire network (both modes):

wp pb network-aggregate --mode=both --batch-size=200

Visits only with higher retry budget:

wp pb network-aggregate --mode=visits --retries=5

Retry only previously failed blogs:

wp pb network-aggregate --since-failures --batch-size=300

Stagger large networks (start at ID 1000, cap at 500 sites):

wp pb network-aggregate --start-id=1000 --max-sites=500
TROUBLESHOOTING Symptom Cause Fix
Cannot declare interface Mustache_Loader Duplicate Mustache autoload (WP-CLI + plugin) Run with --skip-plugins=pressbooks,pressbooks-network-analytics or predefine WP_CLI_SKIP_PLUGINS
"Another aggregation is running" Advisory lock held by another process Retry later or raise --lock-timeout
Repeated failures for certain blogs Persistent data/plugin errors Use --since-failures; inspect failure table entries
High memory usage Batch size too large Lower --batch-size (e.g. 100)

Skip plugins if needed:

wp --skip-plugins=pressbooks,pressbooks-network-analytics pb network-aggregate

Failure table columns: blog_id, mode, last_error, attempts, last_attempt_at, next_attempt_at (cleared on success).

Internal logic (Runner, LockManager, BackoffStrategy, etc.) lives in inc/NetworkStats/.

Installing

Installing this package requires WP-CLI v2.5.0 or greater. Update to the latest stable release with wp cli update.

Once you've done so, you can install this package with:

wp package install [email protected]:pressbooks/pb-cli.git

Upgrade Notice

2.1.0


All versions of pb-cli with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pressbooks/pb-cli contains the following files

Loading the files please wait ...