phan安装

使用composer安装

composer global require phan/phan

如果报ast错
安装php-ast扩展:
pecl install ast
如果不能安装扩展,需要把pecl的路径加入到php配置里

查看pecl安装位置
pear config-get php_dir

把路径加入都php.ini都include_path里面


查看pear版本号
pear version

安装成功会在目录下有
~/.composer/vendor/bin

配置config.php

要运行phan,需要创建config.php文件,文件指定了当前php版本,静态分析的目录,忽略的目录,使用的插件等。在对应的项目下,创建./phan目录,将config.php文件放入此目录下。我的config.php如下

 

**
 * This configuration will be read and overlaid on top of the
 * default configuration. Command line arguments will be applied
 * after this file is read.
 */
return [

    // Supported values: '7.0', '7.1', '7.2', '7.3', null.
    // If this is set to null,
    // then Phan assumes the PHP version which is closest to the minor version
    // of the php executable used to execute phan.
    "target_php_version" => 7.1,

    // A list of directories that should be parsed for class and
    // method information. After excluding the directories
    // defined in exclude_analysis_directory_list, the remaining
    // files will be statically analyzed for errors.
    //
    // Thus, both first-party and third-party code being used by
    // your application should be included in this list.
    'directory_list' => [//指定运行语法分析的目录
        'demo/',

    ],

    // A directory list that defines files that will be excluded
    // from static analysis, but whose class and method
    // information should be included.
    //
    // Generally, you'll want to include the directories for
    // third-party code (such as "vendor/") in this list.
    //
    // n.b.: If you'd like to parse but not analyze 3rd
    //       party code, directories containing that code
    //       should be added to the `directory_list` as
    //       to `exclude_analysis_directory_list`.
    "exclude_analysis_directory_list" => [//指定忽略的目录
        'test/',

    ],

    // A list of plugin files to execute.
    // See https://github.com/phan/phan/tree/master/.phan/plugins for even more.
    // (Pass these in as relative paths.
    // Base names without extensions such as 'AlwaysReturnPlugin'
    // can be used to refer to a plugin that is bundled with Phan)
    'plugins' => [
        // checks if a function, closure or method unconditionally returns.

        // can also be written as 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php'
        'AlwaysReturnPlugin',
        // Checks for syntactically unreachable statements in
        // the global scope or function bodies.
        'UnreachableCodePlugin',
        'DollarDollarPlugin',
        'DuplicateArrayKeyPlugin',
        'PregRegexCheckerPlugin',
        'PrintfCheckerPlugin',
    ],
];

 

https://github.com/phan/phan

执行命令

~/.composer/vendor/bin/phan -k 你的路径/.phan/config.php -o 你的路径/.phan/output

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
For macroscopically anisotropic media in which the variations in the phase stiffness tensor are small, formal solutions to the boundary-value problem have been developed in the form of perturbation series (Dederichs and Zeller, 1973; Gubernatis and Krumhansl, 1975 ; Willis, 1981). Due to the nature of the integral operator, one must contend with conditionally convergent integrals. One approach to this problem is to carry out a “renormalization” procedure which amounts to identifying physically what the conditionally convergent terms ought to contribute and replacing them by convergent terms that make this contribution (McCoy, 1979). For the special case of macroscopically isotropic media, the first few terms of this perturbation expansion have been explicitly given in terms of certain statistical correlation functions for both three-dimensional media (Beran and Molyneux, 1966 ; Milton and Phan-Thien, 1982) and two-dimensional media (Silnutzer, 1972 ; Milton, 1982). A drawback of all of these classical perturbation expansions is that they are only valid for media in which the moduli of the phases are nearly the same, albeit applicable for arbitrary volume fractions. In this paper we develop new, exact perturbation expansions for the effective stiffness tensor of macroscopically anisotropic composite media consisting of two isotropic phases by introducing an integral equation for the so-called “cavity” strain field. The expansions are not formal but rather the nth-order tensor coefficients are given explicitly in terms of integrals over products of certain tensor fields and a determinant involving n-point statistical correlation functions that render the integrals absolutely convergent in the infinite-volume limit. Thus, no renormalization analysis is required because the procedure used to solve the integral equation systematically leads to absolutely convergent integrals. Another useful feature of the expansions is that they converge rapidly for a class of dispersions for all volume fractions, even when the phase moduli differ significantly.
06-02

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值