定制 rem42/scraper-prestashop 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

rem42/scraper-prestashop

最新稳定版本:v4.0.4

Composer 安装命令:

composer require rem42/scraper-prestashop

包简介

API Prestashop 1.7

README 文档

README

Packagist version Packagist download Packagist name Packagist php version Github licence Depenabot Codeclimate lines of code Codeclimate maintainability

Scraper can handle multiple request type and transform them into object in order to create some API.

Installation

composer require rem42/scraper-prestashop

Requirement

  • PHP >= 8.1

Usage

Initiate the client with the http client of your choice that implement the Symfony\Contracts\HttpClient\HttpClientInterface interface.

<?php

use Scraper\Scraper\Client;
use Symfony\Component\HttpClient\CurlHttpClient;
use Symfony\Component\HttpClient\NativeHttpClient;

$client = new Client(
    new CurlHttpClient()
    // OR
    new NativeHttpClient()
);

Then you can use the client to make request to the API.

Product list

<?php

use Scraper\ScraperPrestashop\Request\PrestashopGetRequest;
use Scraper\ScraperPrestashop\Entity\PrestashopProducts;

$request = new PrestashopGetRequest(
    'host.com', // Your prestashop host
    'key', // Your prestashop webservice key
    'products', // The resource you want to get, like 'products'
);

// optional for list request
$request
    ->addFilter('limit', 1)
    ->addFilter('offset', 1)
;

/** @var PrestashopProducts $products */
$products = $client->execute($request);

$products->getProducts(); // Return an array of PrestashopProduct

Product detail

<?php

use Scraper\ScraperPrestashop\Request\PrestashopGetRequest;
use Scraper\ScraperPrestashop\Entity\PrestashopProduct;

$request = new PrestashopGetRequest(
    'host.com', // Your prestashop host
    'key', // Your prestashop webservice key
    'products', // The resource you want to get, like 'products'
);

$request->setId(42);

/** @var PrestashopProduct $product */
$product = $client->execute($request);

$product->name; // Return the product name
$product->dateAdd; // Return the product creation date

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固