php-spider

Posted by 夏泽民

$composer install



php怎么判断函数,类,类方法是不是存在

Posted by 夏泽民
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1php判断系统函数或自己写的函数是否存在
bool function_exists ( string $function_name ) 判断函数是否已经定义例如
if(function_exists('curl_init')){
    curl_init();
}else{
    echo 'not function curl_init';
}
2php判断类是否存在
bool class_exists ( string $class_name [, bool $autoload = true ] ) 检查一个类是否已经定义一定以返回true否则返回false例如
if(class_exists('MySQL')){
    $myclass=new MySQL();
}
3php判断类里面的某个方法是否已经定义
bool method_exists ( mixed $object , string $method_name ) 检查类的方法是否存在例如
$directory=new Directory;
if(!method_exists($directory,'read')){
    echo '未定义read方法!';
}


composer-source

Posted by 夏泽民

1、安装 curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer 如果上面出现问题 可以这样 curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer 如果curl下载较慢,一直卡在downloading 可以这样 wget https://getcomposer.org/installer php installer mv composer.phar /usr/local/bin/composer 2、配置国内源



php-doc

Posted by 夏泽民

老的版本是phpdoc,从1.3.0开始,更名为phpDocumentor



oauth-github-api

Posted by 夏泽民


Search

Popular posts

Anything in here will be replaced on browsers that support the canvas element

Recent posts

This blog is maintained by 夏泽民

Get in touch with me at 465474307@qq.com

Subscribe to our mailing list

* indicates required