Download the PHP package thezombieguy/wpc without Composer

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

Wordpress Custom Theme library

This library is intended to give WordPress developers a little extra functionality when building custom themes.

This library includes advanced theme templates with variable injection, API wrapper for easier endpoint development, and a simple caching system that stores cached objects to the file system.

Install

You can install with composer

Usage

More information is available in the docs folder.

Theme

First create a template in your theme folder. For this example, we will create templates/test.php

And now, in one of your page templates, add the following code.

The wpc_theme function takes 2 parameters. The location of the template relative to your wordpress theme directory (not that you do not need to provide the php extension, just the name), and a set of variables that you want to pass to your template.

Each array variable will be passed to the template and extracted as its own variable. You may also access the Theme class directly by invoking the \WPC\Theme class.

Cache

Create a new cache object. This will create a wpc_cache folder in your uploads folder if it doesn't already exist. Make sure you have the correct permissions.

Now cache some data to the filesystem.

Once it is cached, you can retrieve it later.

Cache returns an object when calling cached data. $myCacheData->time represents when this ws cached. $myCacheData->data is the data you put into the cache.

You can check the $myCacheData->time and after a certain amount of time, you can delete and recache trhe object again with updated information.

You can also wipe the cache folder with

This will destory all cached objects.

API

Create endpoints that will call back to a custom PHP class.

First create a callback class that will handle your endpoint.

Now create an array of endpoints to wish to register. Note the handler/callback parameters in the url string must match you class/method created above.

Now go and update your permalinks in WordPress or you will not see this in action. Go to Settings->Permalinks and click Save changes.

Now when you go to your endpoint url http://example.com/api/numbers/1/2 you will see a json string output with the values you specified.

The redirect string MUST contain the __api, handler, and callback variables or your endpoint will not execute.


All versions of wpc with dependencies

PHP Build Version
Package Version
No informations.
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 thezombieguy/wpc contains the following files

Loading the files please wait ....