使用什么 PHP 类来访问 NNTP

发布于 2024-08-01 18:07:32 字数 66 浏览 6 评论 0原文

我想通过 PHP 访问 NNTP 服务器、组和消息。 您有推荐的现有课程吗? 最好是 PHP5 和良好的 OOP。

I'd like to access NNTP servers, groups, and messages through PHP. Is there any existing class you'd recommend? Preferably PHP5 and good OOP.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

陪你到最终 2024-08-08 18:07:32

它不是一个类,但 php 安装必须编译有 php-imap 扩展,并且您可以通过直接 php 调用完成您想要的所有操作。

您可以看到文档从这里开始: http://us.php.net/manual /en/book.imap.php

打开与 NNTP 服务器的连接的示例可以在 imap_open 主题中找到。

像这样:

  // To connect to an group on an NNTP server on port 119 on the local server, use:
  $nntp = imap_open ("{localhost:119/nntp}comp.test", "", "");

或者

  // To connect to a nonlocal server without specifying a group:
  $server = "{news.servername.com/nntp:119}";
  $nntp = imap_open($server,"","",OP_HALFOPEN); 

然后您可以请求您想要的信息:

  $headers = imap_headers($nntp);     
  $threads = imap_thread($nntp);

这不完全是您所要求的,但我希望它有帮助。

It's not a class, but must php installs have the php-imap extension compiled in and you can do all you want with straight php calls.

You can see documentation starts here: http://us.php.net/manual/en/book.imap.php

Examples of opening a connection to an NNTP server can be found in the imap_open topic.

Like this:

  // To connect to an group on an NNTP server on port 119 on the local server, use:
  $nntp = imap_open ("{localhost:119/nntp}comp.test", "", "");

OR

  // To connect to a nonlocal server without specifying a group:
  $server = "{news.servername.com/nntp:119}";
  $nntp = imap_open($server,"","",OP_HALFOPEN); 

Then you can just request the info that you want:

  $headers = imap_headers($nntp);     
  $threads = imap_thread($nntp);

That's not exactly what you'd asked for, but I hope it helps.

纸短情长 2024-08-08 18:07:32

也不是一个类,也不是 OOP,也不是 PHP 5 特定的,http://news.php 后面的代码。 net 可以在这里找到:

php-news 来源

Also not a class, and also not OOP, and also not PHP 5 specific, the code behind http://news.php.net is available here:

php-news sources

挽袖吟 2024-08-08 18:07:32

我一直在用这个。 http://pear.php.net/manual/en /package.networking.net-nntp.client.php
看起来效果很好。 我正在使用 PHP 5.3 和 5.4

I have been using this. http://pear.php.net/manual/en/package.networking.net-nntp.client.php
It seems to work very well. I am using Php 5.3 and 5.4

九公里浅绿 2024-08-08 18:07:32

在这个问题上也有点自我推销。 我是 php-nntp 的维护者(https://github.com/RobinvdVleuten/php-nntp )并尝试比旧的 PEAR 包(http://pear. php.net/package/Net_NNTP/),许多 NZB 网站仍在使用它。

To be also a bit self-promoting on this question. I am the maintainer php-nntp (https://github.com/RobinvdVleuten/php-nntp) and tried to be more OOP and future-proof compared to the old PEAR package (http://pear.php.net/package/Net_NNTP/) which is still used in many NZB sites out there.

中二柚 2024-08-08 18:07:32

我知道这个问题很久以前就被问过,但我的回答可以帮助其他人。

我一直在寻找好的 PHP 类来访问 NNTP。 然而,它们中的大多数都是基于某些较低版本的 PHP 构建的。

我能找到的唯一一个完全支持最新 PHP 版本的程序是由 Usenet 提供商(我作为首席开发人员)开发的。

您可以在这里找到它: https://www.usenetxl.nl/dev/

有相当多的文档。 课程本身也有文档。

I know this question was asked a long time ago, but my answer could help others out.

I've been searching for good PHP Classes to access NNTP. Most of them, however, are built on some lower versions of PHP.

The only one I could find that fully supports the most recent PHP version was developed by a Usenet provider (with me as Lead Developer).

You can find it here: https://www.usenetxl.nl/dev/

There is quite some documentation. There is also documentation in the classes themselves.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文