定制 noi/imap-idle 二次开发

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

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

noi/imap-idle

Composer 安装命令:

composer require noi/imap-idle

包简介

An implementation of the IMAP IDLE (RFC 2177) based on the pear/Net_IMAP

README 文档

README

Extends pear/Net_IMAP and provides support for the IMAP IDLE command (RFC 2177).

Installation

Add the following lines to your composer.json file:

{
    "require": {
        "noi/imap-idle": "*"
    },
    "repositories": [
        {
            "type": "pear",
            "url": "pear.php.net"
        }
    ]
}

and run Composer install:

$ php composer.phar install

(23-Sep-2013) If you get something similar to the following error:

[UnexpectedValueException] Failed to extract PEAR package /path/to/Net_IMAP/Net_IMAP-1.1.2.tgz to /path/to/Net_IMAP. Reason: Invalid PEAR package. package.xml defines file that is not located inside tarball.

To get beyond this error, you need to add the following lines instead:

{
    "require": {
        "noi/imap-idle": "dev-master"
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "pear-pear/Net_IMAP",
                "version": "1.1.2",
                "source": {
                    "type": "git",
                    "url": "https://github.com/pear/Net_IMAP.git",
                    "reference": "1.1.2"
                },
                "require": {
                    "pear-pear/Net_Socket": ">=1.0.8"
                },
                "autoload": {
                    "classmap": ["./Net/"]
                },
                "include-path": ["./"]
            }
        },
        {
            "type": "pear",
            "url": "pear.php.net"
        }
    ]
}

It seems that this error is caused by Bug #19730.

Usage

<?php
require 'vendor/autoload.php';

$imap = new \Noi\Util\Mail\ImapIdleClient('your.imap.host', 993);
$imap->login('username', 'password');
$imap->selectMailbox('INBOX');

while (!$imap->idle(300) instanceof \PEAR_Error) {
    $mails = $imap->search('UNSEEN');
    foreach ($imap->getMessages($mails) as $mail) {
        echo '==== New Message ====', "\n";
        echo $mail, "\n";
    }
}

License

ImapIdleClient is licensed under the MIT License - see the LICENSE file for details.

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-09-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固