calderawp / data-source
Caldera data sourcing
0.2.0
2019-04-22 17:38 UTC
Requires
- php: ^7.2
Requires (Dev)
- php: ^7.2
- antecedent/patchwork: ^2.0
- brain/monkey: ^2.2
- mockery/mockery: ^1.2
- phpunit/phpunit: ^7.3
- squizlabs/php_codesniffer: 3.*
This package is auto-updated.
Last update: 2024-11-23 06:31:27 UTC
README
This package provides a layer between the source of data and consumption. The idea is that if the database and other sources of data have the same interface, it will not matter what database -- or API -- the data comes from.
👀🌋 This Is A Module Of The Caldera Framework
-
🌋 Find Caldera Forms Here:
-
🌋 Issues and pull requests, should be submitted to the main Caldera repo.
Overview
This is used in the forms package for the database, but not for the REST API, which is a bad smell that needs corrected.
Usage
Install
- Add to your package:
composer require calderawp/http
- Install for development:
git clone git@github.com:CalderaWP/http.git && composer install
Examples
use calderawp\DB\Factory; use calderawp\interop\Attribute; calderawp\interop\Collections\Attributes; $tableName = 'cf_whatever'; $primaryKey = 'id'; $indexes = ['name']; $tableSchema = $factory->tableSchema([], $tableName, $primaryKey, $indexes);
Testing
- Run unit tests and integration tests
composer tests
- Run unit tests
composer test:unit
- Run integration tests
composer test:integration
License, Copyright, etc.
Copyright 2018+ CalderaWP LLC and licensed under the terms of the GNU GPL license. Please share with your neighbor.