-R
--languages=php
--php-kinds=cif
--regex-php=/^[ \t]*trait[ \t]+([a-z0_9_]+)/\1/t,traits/i
--exclude=app/*
--exclude=bin/*
--exclude=web/*
--exclude=tests/*
--exclude=var/*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getFilterParameters() | |
{ | |
$default = [ | |
'isAudited' => ['value' => 2], | |
]; | |
$this->datagridValues = array_merge($default, $this->datagridValues); | |
return parent::getFilterParameters(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
// 使用 php -l / phpmd / php-cs-fixer做检查,需要在项目根目录添加phpmd.xml(如果使用phpmd),.php_cs(如果使用phpcs并且有自定义的配置)文件 | |
// 使用前执行 chmod +x path/to/pre-commit | |
exec('git diff HEAD --name-only --diff-filter=AMRC', $filenames); | |
$filenames = array_filter($filenames, function($filename) { | |
return pathinfo($filename, PATHINFO_EXTENSION) === 'php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<ruleset name="Symfony2 Project"> | |
<description>Coding sniffer rules for Symfony2</description> | |
<rule ref="Symfony2"> | |
<exclude name="Symfony2.Commenting.ClassComment"/> | |
<exclude name="Symfony2.Commenting.FunctionComment"/> | |
<exclude name="PEAR.Functions.FunctionCallSignature.Indent"/> | |
</rule> | |
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach (new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator('.', FilesystemIterator::SKIP_DOTS)), '/\.m3u8$/') as $file) { | |
$name = $file->getBasename(sprintf('.%s', $file->getExtension())); | |
$content = file_get_contents($file->getRealPath()); | |
$newContent = str_replace($name, urlencode($name), $content); | |
file_put_contents($file->getRealPath(), $newContent); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tweet($message, $username, $password) | |
{ | |
$context = stream_context_create(array( | |
'http' => array( | |
'method' => 'POST', | |
'header' => sprintf("Authorization: Basic %s\r\n", base64_encode($username.':'.$password)). | |
"Content-type: application/x-www-form-urlencoded\r\n", | |
'content' => http_build_query(array('status' => $message)), | |
'timeout' => 5, | |
), |
:verbose set isk?
:verbose imap
:verbose se ?
庐山烟雨浙江潮
未到千般恨不消
到得原来无别事
庐山烟雨浙江潮
NewerOlder