ysugimoto / Terrier

A simple mailform written by PHP
http://ysugimoto.github.io/Terrier/
MIT License
9 stars 1 forks source link

Parse error: in .../application/Terrier/Template.php(226) : runtime-created function on line 1 #1

Closed kenjis closed 10 years ago

kenjis commented 10 years ago

エラーが出て動作しません。

Parse error: in /Users/kenji/work/Terrier/application/Terrier/Template.php(226) : runtime-created function on line 1

手順:

$ git clone https://github.com/ysugimoto/Terrier.git
$ cd Terrier
$ ./terrier init
$ php -S localhost:8000

ブラウザで http://localhost:8000/ にアクセス。

環境:

$ php -v
PHP 5.5.10 (cli) (built: Apr 10 2014 17:49:22) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans
ysugimoto commented 10 years ago

ご指摘ありがとうございます。確認しますー

スタンドアローンサーバの場合に出るようですね…Apacheだと出ませんでした。

ysugimoto commented 10 years ago

正規表現エンジンの問題なのか、テンプレート解析中に文字化けするワードがありました。 /uフラグをつけることで回避しました。

kenjis commented 10 years ago

ああ、ロケールの問題ですか。

ysugimoto commented 10 years ago

なるほど、ロケールですか。

Locale::setDefault('ja-JP');

など入れておくのが安全でしょうか

kenjis commented 10 years ago

日本語前提のアプリなら、ロケールも日本語に設定しておくのが正しいでしょうね。 ロケールの影響を受ける関数が正しく動作しない可能性がありますから。

ただし、ロケール名は環境依存なので決め打ちできません。

参考: http://d.hatena.ne.jp/hnw/20120501

ysugimoto commented 10 years ago

なるほど。では現状のままの方が良さそうですね。 スタンドアローンサーバでデプロイすることは無いでしょうし。

ありがとうございます。