FuelPHPはほとんど関係ない内容になっていきそうです...
- Project Settings > PHP で"Interpreter"を正しく設定、"OK"を押下
- Run > Edit Configurations...と進む
- 左上の"+"ボタンを押下、"PHPUnit"を選択
- "Name"に任意の名前を入力
| command: | |
| cat fuel/app/tmp/test.eml | php oil r xxx | |
| PHP: | |
| $xxx = file_get_contents('php://stdin'); | |
| echo $xxx; |
| /** | |
| * Get first day on target month | |
| * | |
| * @param string $yyyymm | |
| * @param int $add_month | |
| * @param string $fmt | |
| * @return string | |
| */ | |
| public static function get_first_day($yyyymm = null, $add_month = 0, $fmt = 'Y-m-d') | |
| { |
| public static function auto_link($str, $is_blank = true) | |
| { | |
| $target = $is_blank ? ' target="_blank"' : ''; | |
| $patterns = array("/(https?|ftp)(:\/\/[[:alnum:]\+\$\;\?\.%,!#~*\/:@&=_-]+)/i"); | |
| $replacements = array("<a href=\"\\1\\2\"{$target}>\\1\\2</a>"); | |
| return preg_replace($patterns, $replacements, $str); | |
| } |
| public static function mk_hash($index, $min_length = 0) { | |
| $ascii_ranges = array( | |
| array(48,57), //0 to 9 | |
| array(65,90), //A to Z | |
| array(97,122), //a to z | |
| ); | |
| $asciis = array(); | |
| foreach ($ascii_ranges as $ascii_range) |
| RewriteEngine On | |
| RewriteBase /xxx | |
| RewriteCond %{HTTP_USER_AGENT} iPod [OR] | |
| RewriteCond %{HTTP_USER_AGENT} iPhone [OR] | |
| RewriteCond %{HTTP_USER_AGENT} iPad [OR] | |
| RewriteCond %{HTTP_USER_AGENT} Android | |
| RewriteRule ^(.*)/yyy/(.*)$ $1/zzz/$2 [R] |
| # ディレクトリ容量1GB以上を表示 | |
| $ du -h | grep [0-9]G | |
| # ディレクトリ容量100MB以上を表示 | |
| $ du -h | grep [0-9][0-9][0-9]M | |
| # gemのアップデート | |
| $ sudo gem update --system | |
| $ sudo gem update |
| <?php | |
| namespace Doctrine\DBAL\Types; | |
| use Doctrine\DBAL\Platforms\AbstractPlatform; | |
| class PointType extends Type | |
| { | |
| public function getName() { |
| # サブモジュールのリファレンスを更新 | |
| $ git submodule foreach git pull origin master | |
| # 普通にcheckoutしても元に戻らなかったファイルを以下で戻した | |
| $ git checkout HEAD file_name | |
| # 親を持たないブランチを作成 | |
| $ git checkout --orphan brunch_name |
| node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.min.js |