Download the PHP package claytonkreisel/wpdb-tools without Composer

On this page you can find all versions of the php package claytonkreisel/wpdb-tools. 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 wpdb-tools

WordPress Database Table Tools

A package to aid in WordPress theme and plugin development by adding classes that quickly allow you to add and manage custom tables to the WordPress database. This uses native WordPress API functions and makes it easy to setup model based I/O using abstract parent classes.

PHP Version Requirements

Version 1 of this library should work on PHP 7.4 or newer.

How to Install

Composer Install

or

Manual Install

Download the package and manually place it in your application then simply include the file like this at the beginning of your application:

How to Use

Custom Tables

This library contains a parent abstract class of . This class allows you to create a child class that will manage your database columns using an array defined in a child method and provides you with methods to , , and rows within that table.

Creating a Custom Table Class

In order to create a custom table you will create a child class that extends the class within this package.

NOTE: If you wish to create a table that also has a relational "metadata" table much like the and structure native to WordPress then please refer to the class. This class will simply create a single table without a corresponding meta table. That class will create and manage both the main table and the metadata table without the need of defining a class.

To create a Table you will put the following code in your functions.php file or another file that is included in your plugin or theme. This assumes you have already installed or included the classes through composer or manually.

After you have written this code you can now create a new instance of this class. Upon construction this class will fire a method that checks to see if the version of the database has changed. If it has then a database altering and cleanup will occur.

NOTE: Columns that are removed from the columns array method will remain in the database until you explicitly remove them using the method. This is to protect from accidental deletion of data.

Inserting a Row in a Custom Table

In order to insert a new row into a custom table you simply call the method on the object you initiated.

Inserting Multiple Rows in a Custom Table

In order to insert multiple rows into a custom table you simply call the method on the object you initiated with multiple associative arrays of data as the parameter.

NOTE: In order for this method to work properly the same keys must be passed in each iteration of the associative array.

Selecting Rows from Custom Tables

There are multiple ways to select data from your custom table. For more complex selections you can write your own statement or use an array driven method in order to make your syntax cleaner. Either way you will only need to use one of three methods in order to select data; , select or select_or.

Using the , and Methods

The method gives you the most versatility in your data selection approach. This method takes 3 parameters at present: , and .

The simply returns all the rows in the table. This method only takes the last 2 parameters at present: and .


All versions of wpdb-tools with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 claytonkreisel/wpdb-tools contains the following files

Loading the files please wait ....