これをいれるナリ
↓
renderHiddenFields() ?>
2009年11月7日土曜日
2009年11月2日月曜日
2009年10月30日金曜日
symfony partialに渡した変数をエスケープしないで表示したい
indexSuccess.php
$sf_data->getRaw('names',ESC_RAW)))?>
-------------------------------------------------------------------------------------------------
_test.php
getRaw('names') ?>
$sf_data->getRaw('names',ESC_RAW)))?>
-------------------------------------------------------------------------------------------------
_test.php
getRaw('names') ?>
2009年10月26日月曜日
symfony criteriaにaddしてエラー
Criteriaに条件をつけるときは、カラム名というかプロパティ名を先に。
add(NantokaPeer::name,$name) → ○
add($name,NantokaPeer::name) → ×
wrapped: Cannot fetch TableMap for undefined table: こんなエラー
確かにSQL文だったらこんなことしないけどO/Rマッパ使ってると
そこらへんの意識が消えてしまう罠。
add(NantokaPeer::name,$name) → ○
add($name,NantokaPeer::name) → ×
wrapped: Cannot fetch TableMap for undefined table: こんなエラー
確かにSQL文だったらこんなことしないけどO/Rマッパ使ってると
そこらへんの意識が消えてしまう罠。
2009年10月20日火曜日
2009年10月15日木曜日
symfony プラグインでサムネール
リスト用にGDでサムネール作るかと思ったら
プラグインでサムネール作ってくれるんですなー
楽ですなー
いい時代ですなー
http://articles.sitepoint.com/article/symfony-beginners-tutorial/4
プラグインでサムネール作ってくれるんですなー
楽ですなー
いい時代ですなー
http://articles.sitepoint.com/article/symfony-beginners-tutorial/4
symfonyでN1関係のテーブルをひとつのFormで操作するサンプルがあるサイト
http://dev.markhaus.com/blog/2008/12/a-way-to-edit-n-1-relationships-in-one-form-with-symfony-12/
SymfonyのsfFormInputFileEditableでフィールドが余分じゃぁ、と怒られた
画像のアップロード先を/uploads/images/にしてたが
怒られるので普通に/uploads/に変更したら直った
------------------------------------------------
更新
原因はこれか
sfConfig::get('sf_upload_dir')は絶対パスを吐く
怒られるので普通に/uploads/に変更したら直った
------------------------------------------------
更新
原因はこれか
sfConfig::get('sf_upload_dir')は絶対パスを吐く
shellスクリプト始めてみた
shellスクリプトはじめてみたら、いきなりコケタ
制御文で
if["$1" = "baka"];then
echo "omae ha erai"
fi
これだとエラー
if[ "$1" = "baka"];then
↑
ここにスペース空けてやると動いた
理由は[]はコマンド(testコマンド)だからだそうだ
制御文で
if["$1" = "baka"];then
echo "omae ha erai"
fi
これだとエラー
if[ "$1" = "baka"];then
↑
ここにスペース空けてやると動いた
理由は[]はコマンド(testコマンド)だからだそうだ
2009年7月9日木曜日
php4とphp5を共存させてみる
php4とphp5を共存させなければならない事態が生じたので
やり方をメモ
事前に必要なものを揃える
PHP5.2.10のソースを持ってくる
GDに必要なもの
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mcrypt --enable-roxen-zts --enable-zend-multibyte --enable-track-vars --enable-mbstring --enable-mbregex --with-zlib --with-gd --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --enable-gd-native-ttf
httpd.confに追加↓
LoadModule php5_module modules/libphp5.so
php5.2.10だとPEARやPECLの通信がこける、そのための対処↓
cd /usr/local/php/lib/php/.channels/
vi pear.php.net.reg
a:6:{s:7:"attribs";a:4:{s:7:"version";s:3:"1.0";s:5:"xmlns";s:31:"http://pear.php.net/chan
nel-1.0";s:9:"xmlns:xsi";s:41:"http://www.w3.org/2001/XMLSchema-instance";s:18:"xsi:schema
Location";s:71:"http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd";}
s:4:"name";s:12:"pear.php.net";s:14:"suggestedalias";s:4:"pear";s:7:"summary";s:40:"PHP Ex
tension and Application Repository";s:7:"servers";a:2:{s:7:"primary";a:1:{s:4:"rest";a:1:{
s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:
25:"http://pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:
"_content";s:25:"http://pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"R
EST1.2";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:
"type";s:7:"REST1.3";}s:8:"_content";s:25:"http://pear.php.net/rest/";}}}}s:6:"mirror";a:2
:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"host";s:15:"us.pear.php.net";}s:4:"rest";a:1:{s:7:"base
url";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:28:"http:
//us.pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_cont
ent";s:28:"http://us.pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST
1.2";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:
"type";s:7:"REST1.3";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}}}}i:1;a:2:{s:7:
"attribs";a:3:{s:4:"host";s:15:"de.pear.php.net";s:3:"ssl";s:3:"yes";s:4:"port";s:4:"3452"
;}s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";
}s:8:"_content";s:34:"https://de.pear.php.net:3452/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4
:"type";s:7:"REST1.1";}s:8:"_content";s:34:"https://de.pear.php.net:3452/rest/";}i:2;a:2:{
s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:34:"https://de.pear.php.net:
3452/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:34:"ht
tps://de.pear.php.net:3452/rest/";}}}}}}s:13:"_lastmodified";a:2:{s:4:"ETag";s:20:""2fe96-
59a-31a3fc80"";s:13:"Last-Modified";s:29:"Tue, 02 Jun 2009 05:55:46 GMT";}}
vi pecl.php.net.reg
a:6:{s:4:"name";s:12:"pecl.php.net";s:14:"suggestedalias";s:4:"pecl";s:7:"summary";s:31:"P
HP Extension Community Library";s:7:"servers";a:1:{s:7:"primary";a:2:{s:6:"xmlrpc";a:1:{s:
8:"function";a:10:{i:0;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:9
:"logintest";}i:1;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:26:"pa
ckage.listLatestReleases";}i:2;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_cont
ent";s:15:"package.listAll";}i:3;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_co
ntent";s:12:"package.info";}i:4;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_con
tent";s:22:"package.getDownloadURL";}i:5;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}
s:8:"_content";s:22:"package.getDownloadURL";}i:6;a:2:{s:7:"attribs";a:1:{s:7:"version";s:
3:"1.0";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:7;a:2:{s:7:"attribs";a:1:{s:7:
"version";s:3:"1.1";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:8;a:2:{s:7:"attrib
s";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:14:"package.search";}i:9;a:2:{s:7:"attri
bs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"channel.listAll";}}}s:4:"rest";a:1:
{s:7:"baseurl";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s
:25:"http://pecl.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8
:"_content";s:25:"http://pecl.php.net/rest/";}}}}}s:15:"validatepackage";a:2:{s:8:"_conten
t";s:19:"PEAR_Validator_PECL";s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}}s:13:"_lastmodi
fied";s:31:"Thu, 03 Jan 2008 11:48:06 -0700";}
pecl install apc
↓re2cがこの時点でなかったのでこけた
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
re2cをゲット
wget http://sourceforge.net/projects/re2c/files/re2c/re2c-0.13.5.tar.gz
re2cをビルドしたら再び
pecl install apc
が、しかし、またなんかいっとる
↓
Sorry, I was not able to successfully run APXS. Possible reasons:
1. Perl is not installed;
2. Apache was not compiled with DSO support (--enable-module=so);
3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs
The output of apxs follows
/tmp/pear/temp/APC/configure: line 3439: apxs: command not found
configure: error: Aborting
ERROR: `/tmp/pear/temp/APC/configure --with-apxs' failed
apxsが/usr/local/apache2/bin/apxs入ってるのでパスを通してやる、この場合/usr/binのなかにapxsのリンクこさえる
pecl install apcにリトライ
↓
Build process completed successfully
Installing '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/apc.so'
install ok: channel://pecl.php.net/APC-3.0.19
configuration option "php_ini" is not set to php.ini location
You should add "extension=apc.so" to php.ini
成功したのでapc.soをextensions配下に移動してphp.iniを編集
extension_dir = "/usr/local/php/lib/php/extensions"
extension=apc.so
やり方をメモ
apacheを最新のものにソースからインストール
PHPをソースからインストール
事前に必要なものを揃える
PHP5.2.10のソースを持ってくる
GDに必要なもの
- libpng
- jpeglib
- freetype
- re2c
- mcrypt
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-mcrypt --enable-roxen-zts --enable-zend-multibyte --enable-track-vars --enable-mbstring --enable-mbregex --with-zlib --with-gd --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local/lib --enable-gd-native-ttf
httpd.confに追加↓
LoadModule php5_module modules/libphp5.so
php5.2.10だとPEARやPECLの通信がこける、そのための対処↓
cd /usr/local/php/lib/php/.channels/
vi pear.php.net.reg
a:6:{s:7:"attribs";a:4:{s:7:"version";s:3:"1.0";s:5:"xmlns";s:31:"http://pear.php.net/chan
nel-1.0";s:9:"xmlns:xsi";s:41:"http://www.w3.org/2001/XMLSchema-instance";s:18:"xsi:schema
Location";s:71:"http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd";}
s:4:"name";s:12:"pear.php.net";s:14:"suggestedalias";s:4:"pear";s:7:"summary";s:40:"PHP Ex
tension and Application Repository";s:7:"servers";a:2:{s:7:"primary";a:1:{s:4:"rest";a:1:{
s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:
25:"http://pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:
"_content";s:25:"http://pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"R
EST1.2";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:
"type";s:7:"REST1.3";}s:8:"_content";s:25:"http://pear.php.net/rest/";}}}}s:6:"mirror";a:2
:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"host";s:15:"us.pear.php.net";}s:4:"rest";a:1:{s:7:"base
url";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:28:"http:
//us.pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_cont
ent";s:28:"http://us.pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST
1.2";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:
"type";s:7:"REST1.3";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}}}}i:1;a:2:{s:7:
"attribs";a:3:{s:4:"host";s:15:"de.pear.php.net";s:3:"ssl";s:3:"yes";s:4:"port";s:4:"3452"
;}s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";
}s:8:"_content";s:34:"https://de.pear.php.net:3452/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4
:"type";s:7:"REST1.1";}s:8:"_content";s:34:"https://de.pear.php.net:3452/rest/";}i:2;a:2:{
s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:34:"https://de.pear.php.net:
3452/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:34:"ht
tps://de.pear.php.net:3452/rest/";}}}}}}s:13:"_lastmodified";a:2:{s:4:"ETag";s:20:""2fe96-
59a-31a3fc80"";s:13:"Last-Modified";s:29:"Tue, 02 Jun 2009 05:55:46 GMT";}}
vi pecl.php.net.reg
a:6:{s:4:"name";s:12:"pecl.php.net";s:14:"suggestedalias";s:4:"pecl";s:7:"summary";s:31:"P
HP Extension Community Library";s:7:"servers";a:1:{s:7:"primary";a:2:{s:6:"xmlrpc";a:1:{s:
8:"function";a:10:{i:0;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:9
:"logintest";}i:1;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:26:"pa
ckage.listLatestReleases";}i:2;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_cont
ent";s:15:"package.listAll";}i:3;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_co
ntent";s:12:"package.info";}i:4;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_con
tent";s:22:"package.getDownloadURL";}i:5;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}
s:8:"_content";s:22:"package.getDownloadURL";}i:6;a:2:{s:7:"attribs";a:1:{s:7:"version";s:
3:"1.0";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:7;a:2:{s:7:"attribs";a:1:{s:7:
"version";s:3:"1.1";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:8;a:2:{s:7:"attrib
s";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:14:"package.search";}i:9;a:2:{s:7:"attri
bs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"channel.listAll";}}}s:4:"rest";a:1:
{s:7:"baseurl";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s
:25:"http://pecl.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8
:"_content";s:25:"http://pecl.php.net/rest/";}}}}}s:15:"validatepackage";a:2:{s:8:"_conten
t";s:19:"PEAR_Validator_PECL";s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}}s:13:"_lastmodi
fied";s:31:"Thu, 03 Jan 2008 11:48:06 -0700";}
pecl install apc
↓re2cがこの時点でなかったのでこけた
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
re2cをゲット
wget http://sourceforge.net/projects/re2c/files/re2c/re2c-0.13.5.tar.gz
re2cをビルドしたら再び
pecl install apc
が、しかし、またなんかいっとる
↓
Sorry, I was not able to successfully run APXS. Possible reasons:
1. Perl is not installed;
2. Apache was not compiled with DSO support (--enable-module=so);
3. 'apxs' is not in your path. Try to use --with-apxs=/path/to/apxs
The output of apxs follows
/tmp/pear/temp/APC/configure: line 3439: apxs: command not found
configure: error: Aborting
ERROR: `/tmp/pear/temp/APC/configure --with-apxs' failed
apxsが/usr/local/apache2/bin/apxs入ってるのでパスを通してやる、この場合/usr/binのなかにapxsのリンクこさえる
pecl install apcにリトライ
↓
Build process completed successfully
Installing '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/apc.so'
install ok: channel://pecl.php.net/APC-3.0.19
configuration option "php_ini" is not set to php.ini location
You should add "extension=apc.so" to php.ini
成功したのでapc.soをextensions配下に移動してphp.iniを編集
extension_dir = "/usr/local/php/lib/php/extensions"
extension=apc.so
登録:
投稿 (Atom)