windawake/tp-remote2model

Convert remote API data into tp5 model

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/windawake/tp-remote2model

dev-main 2021-09-05 15:56 UTC

This package is auto-updated.

Last update: 2025-09-24 14:21:07 UTC


README

  • thinkphp调用的model代码无需修改,可以直接实现服务化。
  • 原理是将远程api接口,转为tp5 model,兼容80%以上的model方法。
  • 目前仅支持tp5.0,tp5.1。

快速预览

composer require windawake/tp-remote2model:dev-main

安装phpunit,把phpunit.xml复制到项目根目录下

cd windawake/tp-remote2model/examples/website && php run.php

在项目根目录下,执行单元测试

  • ./vendor/bin/phpunit --filter=testFind
  • ./vendor/bin/phpunit --filter=testWhereIn
  • ./vendor/bin/phpunit --filter=testWith
  • ./vendor/bin/phpunit --filter=testUpdate