承接 nalognl/megaplan-module 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nalognl/megaplan-module

Composer 安装命令:

composer require nalognl/megaplan-module

包简介

Cache, authentication and request handlers for nalognl_megaplan and nalognl_new_deal plugins.

README 文档

README

Build Status Total Downloads Latest Stable Version

Cache, authentication and request handlers for nalognl_megaplan and nalognl_new_deal WordPress plugins. These 2 plugins have common functionality, and in order to not repeat the same code in both plugins this package was created. It contains Megaplan authentication functionality, base 64 encoding and caching.

Load configurations

Load configurations in your boot file by calling load() method. These parameters are required for package to work. Also your WordPress plugin must have directories storage and storage/cache.

\Nalognl\MegaplanModule\Config::new()->load([
    'plugin_path' => '/var/www/html/wp-content/plugins/nalognl_megaplan',
    'cache_dir_path' => '/var/www/uploads/global-storage/cache',
    'megaplan_host' => getenv('NNND_HOST'),
    'megaplan_login' => getenv('NNND_LOGIN'),
    'megaplan_password' => getenv('NNND_PASSWORD'),
    'megaplan_hash_password' => getenv('NNND_MD5_HASH_PASSWORD'),
    'megaplan_api1_auth_uri' => getenv('NNND_AUTH_URI'),
    'megaplan_api3_auth_uri' => getenv('NNND_API3_AUTH_URI'),
]);

Usage

Megaplan request

You need to have RequestMegaplan1.php and RequestMegaplan3.php for both APIs. They must extend Nalognl\MegaplanModule\Http\RequestMegaplan\RequestMegaplan class, it gives you throwIfError() and getEnvOrThrow() methods, and most importantly request property with methods: post() and get(). Most of your methods in classes that extend RequestMegaplan will look something like that:

public function getOffers(array $data): array
{
    $uri = $this->getEnvOrThrow('NNND_OFFERS_LIST_URI');

    $res = $this->request->post($uri, $data);
    $this->throwIfError($res, 'API1: При попытке взять товары с мегаплана');

    return $res->data->offers;
}

Get started

To install the package you need to have Composer PHP package manager installed on your machine. Then you need to run the command below in the plugin directory.

composer require nalognl/megaplan-module

统计信息

  • 总下载量: 94
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固