Download the PHP package luofei614/socketlog without Composer

On this page you can find all versions of the php package luofei614/socketlog. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package socketlog

一,简介

SocketLog 是一款高效的、探针式的服务器端程序调试和分析工具。

将“探针”引入到目标项目后,SocketLog 会通过在服务端启动的一个 WebSocket 服务,将程序执行过程中收集到的调试信息推送到客户端。 客户端会通过一个 Chrome 插件将调试信息打印到浏览器的 Console 中,这些信息包括程序的运行时间、吞吐率、内存消耗;PHP 的 Error、warning、notice 信息;程序执行的 SQL 语句以及对 SQL 语句的 explain 等等。

SocketLog 使用 PHP 和 NodeJs 开发,是 FirePHP 和 ChromePHP 的替代者,特别适合用于调试 Ajax 方式发起的请求和 API 项目。

1、使用场景举例:

用 SocketLog 来做微信开发调试。

举一个常见的场景:你在做微信 API 开发的时候,是否遇到了 API 有 bug,微信只提示“该公众账号暂时无法提供服务,请稍候再试” ?

我们根本不知道 API 出了什么问题,由于不能打印信息,只能通过日志来排查,这种方式的调试效率实在是太低了。

现在有了 SocketLog 就不一样了,我们可以知道微信给 API 传递了哪些参数,程序有错误我们也能看见错误信息。

2、SocketLog 的用途:

3、文件和目录简要说明:

4、效果展示:

针对一个开源的 Web 项目,我们想基于它做二次开发。如果能在浏览网站的时候,可以从浏览器的 Console 中知道程序都做了些什么,这对二次开发将十分有帮助。

下面的效果图显示,在浏览 discuz 程序时,Console 中打印出了:

二,安装与使用

1、安装:

2、示例:

3、配置:

在载入 slog.function.php 文件后,还可以对 SocketLog 进行一些配置。

4,支持 composer(暂不推荐):

5,支持 ThinkPHP:

ThinkPHP5 之后,在框架层集成了 SocketLog,只需要设置配置即可用。参考:远程调试

6,对数据库进行调试:

SocketLog 还能对 SQL 语句进行调试,自动对 SQL 语句进行 explain 分析,打印出有性能问题的 SQL 语句。 如下图所示。

注意:有时候在数据比较少的情况下,MySQL 查询不会使用索引,explain 也会提示 Using filesort 等性能问题,其实这时候并不是真正有性能问题,你需要自行判断,或者增加更多的数据再测试。

7,对 API 进行调试:

网站调用了 API ,如何将 API 程序的调试信息也打印到浏览器的 Console 中?

8,区分正式和开发环境:

9,分析开源程序:

有了 SocketLog,我们能很方便的分析开源程序,下面以 OneThink 为例,大家可以在 http://www.topthink.com/topic/2228.html 下载最新的 OneThink 程序。 安装好 OneThink 后,按下面步骤增加 SocketLog 程序。

通过 Console 的日志,访问每一页我们都知道程序干了些什么,这是一件很爽的事情。

提示: 另一种更简单的方法,因为 OneThink 每次执行完 SQL 语句都会调用 $this->debug, 所以我们可以把 slog($this->queryStr, $this->_linkID); 直接写在 Db.class.php 文件的 debug() 方法中。 这样不管是 mysqli 还是 mysql 驱动都有效。

三,视频教程

http://edu.normalcoder.com/course/941

感谢猿团的张盛翔(诺墨)提供教程。

四,About Me


All versions of socketlog with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package luofei614/socketlog contains the following files

Loading the files please wait ....