Skip to content

Latest commit

 

History

History
 
 

ThinkPHP5

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

How to Use in ThinkPHP5.0x

Limitation

- version checked
PHP 7+
topthink/framework 5.0.*

Steps

  1. Import pinpoint entry header into thinkphp/start.php as below
## start.php

<?php

namespace think;

// ThinkPHP 引导文件
// 1. 加载基础文件
require __DIR__ . '/base.php';

###################################################################
define('AOP_CACHE_DIR', __DIR__ . '/../Cache/');
define('PLUGINS_DIR', __DIR__ . '/../Plugins/');
define('APPLICATION_NAME','app-thinkphp'); // your application name
define('APPLICATION_ID','app-thinkphp');  // your application id
define('PINPOINT_USE_CACHE','YES');
require_once __DIR__ . '/../vendor/pinpoint-apm/pinpoint-php-aop/auto_pinpointed.php';
###################################################################
// 2. 执行应用
App::run()->send();
  1. require pinpoint-php-aop into your composer.json
    "require": {
        "php": ">=5.4.0",
        "topthink/framework": "5.0.*",
        "pinpoint-apm/pinpoint-php-aop": "dev-master"  <-- import pinpoint-php-aop
    },
  1. composer install #( composer update)
  2. copy setting.ini into your PLUGINS_DIR folder.

ps Tell pinpoint-php-aop your framework is Thinkph>p5.0.x !

怎样监控ThinkPHP5.0x 框架

版本限制

- version checked
PHP 7+
topthink/framework 5.0.*

步骤

  1. thinkphp/start.php插入pinpoint 入口代码
## start.php

<?php

namespace think;

// ThinkPHP 引导文件
// 1. 加载基础文件
require __DIR__ . '/base.php';

###################################################################
define('AOP_CACHE_DIR', __DIR__ . '/../Cache/');
define('PLUGINS_DIR', __DIR__ . '/../Plugins/');
define('APPLICATION_NAME','app-thinkphp'); // your application name
define('APPLICATION_ID','app-thinkphp');  // your application id
define('PINPOINT_USE_CACHE','YES');
require_once __DIR__ . '/../vendor/pinpoint-apm/pinpoint-php-aop/auto_pinpointed.php';
###################################################################
// 2. 执行应用
App::run()->send();
  1. 包含 pinpoint-php-aop 在你的composer.json
    "require": {
        "php": ">=5.4.0",
        "topthink/framework": "5.0.*",
        "pinpoint-apm/pinpoint-php-aop": "dev-master"  <-- import pinpoint-php-aop
    },
  1. composer install #( composer update)
  2. 拷贝 setting.ini 到你的插件 PLUGINS_DIR 目录下.

用了告诉pinpoint-php-aop当前框架的配置文件