Download the PHP package nyco/wp-open-data-transients without Composer

On this page you can find all versions of the php package nyco/wp-open-data-transients. 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 wp-open-data-transients

NYCO WP Open Data Transients

This WordPress Plugin will provide an interface in the WP Admin to save saving external Open Data as WordPress transients and a developer API to interact with them. You can read more about the WordPress Transients API in the Codex.

Features

Usage

Installation

It uses composer/installers to install it to the plugin directly using Composer. Just run:

composer require nyco/wp-open-data-transients

You can also download the package and add it manually to your plugin directory.

App Token

A token will be sent in the header (X-App-Token) to the Open Data endpoint to authenticate your application for for saving data. This can be set in the same admin or as an environment variable $_ENV['OPEN_DATA_APP_TOKEN']. The NYCO WP Config plugin can be used to manage environment variables.

Saved Transients

Transients can be saved by adding a valid name (letters and underscores only) and valid url. Clicking "Save Transient" will save the transient and cache the request. Once it is saved, the developer API can be used to get the data. The developer API also exposes the save and set methods used by the admin interface.

Typing the name of an already saved transient and clicking "Save Transient" will update the transient data cache.

Developer API

Once the plugin is installed, you can reference the name space to use it;

use NYCO\Transients as Transients;

Save

The transient needs to be saved with a valid name (letters and underscores only) and valid url before it can be exposed to the get methods.

Transients::save('your_transient_name', 'https://opendata.com/endpoint');

Set

Uses WordPress' wp_remote_get and set_transient methods to retrieve the saved endpoint and save the response body. It will expect a JSON response and will be saved as a PHP Object.

Transients::set('your_transient_name');

Get

Returns a saved transient. If the transient is empty (expired) it will use the set method to re-cache it.

Transients::get('your_transient_name');

Potential Improvements

This plugin only provides a small interface for saving external Open Data as WordPress Transients and external data and is not a fully fledged transient manager.

About NYCO

NYC Opportunity is the New York City Mayor's Office for Economic Opportunity. We are committed to sharing open source software that we use in our products. Feel free to ask questions and share feedback. Follow @nycopportunity on Github, Twitter, Facebook, and Instagram.


All versions of wp-open-data-transients with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ^1
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 nyco/wp-open-data-transients contains the following files

Loading the files please wait ...