承接 kegi/netscape-cookie-file-handler 相关项目开发

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

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

kegi/netscape-cookie-file-handler

最新稳定版本:1.0.3

Composer 安装命令:

composer require kegi/netscape-cookie-file-handler

包简介

Netscape Cookie File Handler

README 文档

README

Build Status Latest Stable Version Test Coverage

Issue Count Code Climate SensioLabsInsight

This library allows you to manipulate Netscape Cookie File (eg. Cookies generated by CURL).

Requirements

This is library is only available for PHP7+ There is no other dependencies

Installation

This library is available on packagist (Composer)

composer require kegi/netscape-cookie-file-handler

What are Cookies Files ?

The Netscape cookie files are widely used. Curl, by example, allows you to select a file (called the cookie jar) to save and read the cookies using this format. This library will help you to manipulate and read those cookies.

Example

Simple example of reading + writing cookies

/*Open and parse the cookie file*/

$configuration = (new Configuration())->setCookieDir('cookies/');
$cookieJar = (new CookieFileHandler($configuration))->parseFile('my_cookie_file');

/*Add (and save) a cookie*/

$cookieJar->add(
    (new Cookie())
        ->setHttpOnly(true)
        ->setPath('/foo')
        ->setSecure(true)
        ->setExpire(new DateTime('2020-02-20 20:20:02'))
        ->setName('foo')
        ->setValue('bar')
)->persist();

Documentation

Learn how to use the library here : documentation.

Contribution

Feel free to contact me or send pull requests !

统计信息

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

GitHub 信息

  • Stars: 23
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-02-15