2015-02-01から1ヶ月間の記事一覧
一応メモを残すけどlaravel/installerは不便だった。「composer create-project」のほうが便利。Windowsだと「laravel new」が失敗する。 > composer global require "laravel/installer=~1.1" Changed current directory to C:/Users/futari/AppData/Roamin…
winscp.comをCMDから直接実行する際に/scriptオプションでテキストを指定する。 "C:\Program Files (x86)\WinSCP\winscp.com" /script="myserver.txt" myserver.txtの中身。 option batch on open admin:password@127.0.0.1 get /tmp/backup.tar close exit
Form::openで直接メソッドを指定する。 {{ Form::open(['action' => ['UserController@change', $user->id]]) }} {{ Form::close() }}これにはroute.phpへの記述も必要。 Route::post('user/change', 'UserController@change');
Pythonのsubprocessを使って標準出力を入手したい。 import subprocess cmdline = 'echo test' p = subprocess.Popen(cmdline, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) while True: line = p.stdout.readline() if not line: break pri…
Python3で作ったスクリプトをWindowsのコマンドプロンプト上で実行したら、日本語部分のdecodeが失敗した。この部分が line.strip().decode('ascii')こういうエラーを出す。 UnicodeDecodeError: 'ascii' codec can't decode byte 0x82 in position 28: inva…
Excelで作成したCSVファイルをLaravelに読み込んでみた。 $buf = mb_convert_encoding(file_get_contents( Input::file('csv')->getRealPath()), 'utf-8', 'sjis-win'); $lines = explode("\n", $buf); array_pop($lines); array_shift($lines); 最後のarray…
artisan用のコマンドは名前が変わって「コンソール」になった。なのでmake:consoleでコマンドを作る。 php artisan make:console FutariUpdate --command=futari:updateapp\Console\Kernel.phpにコマンドを登録する。 use Illuminate\Console\Scheduling\Sch…
Laravel4で自作メソッドにidを渡す。 Viewの書き方 {{ Form::open(['action' => ['JisakuController@insert',$jisaku->id]) }} routes.phpの書き方 Route::post('jisakus/{id}/insert', 'JisakuController@insert') コントローラーの書き方 public function …
Laravel 5 がリリースされた。時は来た!それだけだ!