« 2007年09月 | メイン | 2007年11月 »
2007年10月25日
メールをPHPに渡したときの環境変数
qmail から PHPにメールをパイプで渡した時の環境変数の例
(他のMTAでもそうなのかは調べてない)
$_ENV = Array
(
[HOST2] => buken
[HOST3] => buken
[SENDER] => dummy@ezweb.ne.jp
[RECIPIENT] => buken.net-dummy@buken.net
[HOST4] => buken
[DTLINE] => Delivered-To: buken.net-dummy@buken.net
[HOST] => buken.net
[EXT] => dummy
[USER] => buken.net
[LOCAL] => buken.net-dummy
[PATH] => /var/qmail/bin:/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/var/qmail/bin:/usr/local/bin
[RPLINE] => Return-Path: <dummy@ezweb.ne.jp>
[PWD] => /home/vpopmail/domains/buken.net
[NEWSENDER] => dummy@ezweb.ne.jp
[SHLVL] => 1
[HOME] => /home/vpopmail/domains/buken.net
[EXT3] =>
[EXT2] =>
[EXT4] =>
[UFLINE] => From dummy@ezweb.ne.jp Thu Oct 25 02:12:52 2007
[_] => /usr/local/bin/php
投稿者 muuming : 11:14 | コメント (0)
2007年10月23日
smarty 年代タグを作る
{html_select_date prefix="EndDate" end_year="+1" field_order="YMD" month_format="%m月" day_format="%02d日"}
これで
と表示される。
特定の日を選択状態にしたければ
time=$time
を入れる
{html_select_date prefix="EndDate" end_year="+1" field_order="YMD" time=$time month_format="%m月" day_format="%02d日"}
投稿者 muuming : 10:45 | コメント (0)
2007年10月18日
http://linux.paken.org/index.php?rsync%A4%C7%A4%AA%BC%EA%B7%DA%A5%D0%A5%C3%A5%AF%A5%A2%A5%C3%A5%D7
より
rsync -a --delete /path/to/dir /path/to/copydir
投稿者 muuming : 13:11 | コメント (0)
便利ちゃん関数(ど忘れ用メモ)
■ob_implicit_flush() は、 自動フラッシュをオンまたはオフに切替えます。
True = 常に発射
False = 処理完了後に発射
関数を呼び出した際のデフォルト値()の場合 True
■set_time_limit()は、実行時間の最大値を制限する
スクリプトが実行可能な秒数を設定します。
この制限にかかるとスクリプトは致命的エラーを返します。
デフォルトの制限値は 30 秒です。
なお、php.iniでmax_execution_timeの 値が定義されている場合にはそれを用います。
のため、処理を終わらせたくない場合はset_time_limit(0)を定義する。
■ignore_user_abortは、接続が切断された際にスクリプトの実行を終了するかどうかを設定する
処理をどうしても終わらせたくない場合がありますが、その時に定義しておくとよさげです。
2007年10月11日
postgresエスケープ
pg_escape_string
恥ずかしいので隠しとこ(゜▽゜)
pg_escape_string() は、データベースに挿入するための 文字列をエスケープします。
PostgreSQL フォーマットにエスケープされた 文字列を返します。
addslashes() の代わりにこの関数を 使用することを推奨します。
カラム型が bytea の場合は、代わりに pg_escape_bytea() を使用しなければなりません。
2007年10月09日
PHP古いバージョンから新しいバージョンを受け流す
http://jp2.php.net/releases/index.php
みっけ!
2007年10月05日
サーチ窓が見えぬ・・・
投稿者 muuming : 15:07 | コメント (0)
2007年10月03日
youtube ぽいのを作ってみた
http://gavie.net
タグ埋め込みでブログに表示できるかテストを兼ねて
the Flash Player to see this player.
投稿者 muuming : 12:25 | コメント (0)
2007年10月02日
エースリケン
エースリケンさすが!
高速です。
CentOsの設定
[centosplus]
enabled=1
の設定でPHP5も持ってきますよ
vi /etc/yum.repos.d/CentOS-Base.repo
---------------------------------------------------------------------------------
# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/os/$basearch/
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1
#released updates
[update]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/updates/$basearch/
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/addons/$basearch/
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=1
protect=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/centosplus/$basearch/
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://ftp.riken.jp/Linux/centos/$releasever/contrib/$basearch/
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
priority=2
protect=1
[dag]
name=Dag RPM Repository for Redhat EL4
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
---------------------------------------------------------------------------------