ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
PHP 5.2.11 で Pear インストール
日時: 2010/02/28 11:07
名前: lightbox



Mail_mimeDecode

ブラウザでダウンロード
拡張子:
>go-pear

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : local
Please confirm local copy by typing 'yes' : yes

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : C:\php_5211
 2. Temporary directory for processing            : C:\php_5211\tmp
 3. Temporary directory for downloads             : C:\php_5211\tmp
 4. Binaries directory                            : C:\php_5211
 5. PHP code directory ($php_dir)                 : C:\php_5211\pear
 6. Documentation directory                       : C:\php_5211\docs
 7. Data directory                                : C:\php_5211\data
 8. User-modifiable configuration files directory : C:\php_5211\cfg
 9. Public Web Files directory                    : C:\php_5211\www
10. Tests directory                               : C:\php_5211\tests
11. Name of configuration file                    : C:\php_5211\pear.ini
12. Path to CLI php.exe                           : .

1-12, 'all' or Enter to continue:

*WARNING*
We found php.exe under ., it uses an unknown SAPI. PEAR commandline
tool has not been tested with it, if you have a CLI (or CGI) php.exe available,
we strongly recommend using it.

Beginning install...
Configuration written to C:\php_5211\pear.ini...
Initialized registry...
Preparing to install...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.3.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.3.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.9.0.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar...
installing phar://go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar...
install ok: channel://pear.php.net/Archive_Tar-1.3.3
install ok: channel://pear.php.net/Console_Getopt-1.2.3
install ok: channel://pear.php.net/Structures_Graph-1.0.2
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.9.0
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
<C:\php_5211\pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.

Current include path           : .;C:\php5\pear
Configured directory           : C:\php_5211\pear
Currently used php.ini (guess) :
Press Enter to continue:

** WARNING! Old version found at C:\php_5211, please remove it or be sure to use the new c:\php_5211\pear.bat command

The 'pear' command is now at your service at c:\php_5211\pear.bat

** The 'pear' command is not currently in your PATH, so you need to
** use 'c:\php_5211\pear.bat' until you have added
** 'C:\php_5211' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

  http://pear.php.net/faq.php
  http://pear.php.net/manual/

Thanks for using go-pear!

続行するには何かキーを押してください . . .

>pear
Commands:
build                  Build an Extension From C Source
bundle                 Unpacks a Pecl Package
channel-add            Add a Channel
channel-alias          Specify an alias to a channel name
channel-delete         Remove a Channel From the List
channel-discover       Initialize a Channel from its server
channel-info           Retrieve Information on a Channel
channel-login          Connects and authenticates to remote channel server
channel-logout         Logs out from the remote channel server
channel-update         Update an Existing Channel
clear-cache            Clear Web Services Cache
config-create          Create a Default configuration file
config-get             Show One Setting
config-help            Show Information About Setting
config-set             Change Setting
config-show            Show All Settings
convert                Convert a package.xml 1.0 to package.xml 2.0 format
cvsdiff                Run a "cvs diff" for all files in a package
cvstag                 Set CVS Release Tag
download               Download Package
download-all           Downloads each available package from the default channel
info                   Display information about a package
install                Install Package
list                   List Installed Packages In The Default Channel
list-all               List All Packages
list-channels          List Available Channels
list-files             List Files In Installed Package
list-upgrades          List Available Upgrades
login                  Connects and authenticates to remote server [Deprecated in favor of channel-login]
logout                 Logs out from the remote server [Deprecated in favor of channel-logout]
makerpm                Builds an RPM spec file from a PEAR package
package                Build Package
package-dependencies   Show package dependencies
package-validate       Validate Package Consistency
pickle                 Build PECL Package
remote-info            Information About Remote Packages
remote-list            List Remote Packages
run-scripts            Run Post-Install Scripts bundled with a package
run-tests              Run Regression Tests
search                 Search remote package database
shell-test             Shell Script Test
sign                   Sign a package distribution file
svntag                 Set SVN Release Tag
uninstall              Un-install Package
update-channels        Update the Channel List
upgrade                Upgrade Package
upgrade-all            Upgrade All Packages [Deprecated in favor of calling upgrade with no parameters]
Usage: pear [options] command [command-options] <parameters>
Type "pear help options" to list all options.
Type "pear help shortcuts" to list all command shortcuts.
Type "pear help <command>" to get the help for the specified command.

>pear channel-update pear.php.net
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded

>pear search mime
Retrieving data...0%
..MATCHED PACKAGES, CHANNEL PEAR.PHP.NET:
=======================================
PACKAGE         STABLE/(LATEST) LOCAL
Mail_Mime       1.6.0 (stable)        Mail_Mime provides classes to create MIME messages.
Mail_mimeDecode 1.5.1 (stable)        Provides a class to decode mime messages.
MIME_Type       1.2.0 (stable)        Utility class for dealing with MIME types

>pear install -f -a -o Mail_mimeDecode
downloading Mail_mimeDecode-1.5.1.tgz ...
Starting to download Mail_mimeDecode-1.5.1.tgz (9,571 bytes)
.....done: 9,571 bytes
downloading Mail_Mime-1.6.0.tgz ...
Starting to download Mail_Mime-1.6.0.tgz (29,925 bytes)
...done: 29,925 bytes
install ok: channel://pear.php.net/Mail_Mime-1.6.0
install ok: channel://pear.php.net/Mail_mimeDecode-1.5.1

メンテナンス

@nifty LaCoocan で PHP を利用したメール転送処理 ( No.1 )
日時: 2010/02/28 11:30
名前: lightbox


日時: 2010/02/28 11:30
名前: lightbox
@nifty LaCoocan では、メール転送の設定で 50 個までメールアドレスを作成
できるのですが、転送に使えるのは一つだけで、他は CGI を実行する事ができる
ようになっています。そこで、PHP でメールを送信すれば、全て転送に利用
できます

拡張子:
<?
header( "pragma: no-cache" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );
header( "Cache-control: no-cache" );
header( "Content-Type: text/javascript; Charset=euc-jp" );

// メールデータ入力
$input = stream_get_contents(STDIN);

// デバッグ用
$f = uniqid().".log";
file_put_contents( $f, $input );

// メールデコード用 Pear ライブラリ
require_once 'Mail/mimeDecode.php';

// 転送用
$params['include_bodies'] = true;
$params['decode_bodies']  = false;
$params['decode_headers'] = false;
$params['crlf'] = "\r\n";
$decoder = new Mail_mimeDecode($input);
$structure = $decoder->decode($params);

// 本文に From データを JIS で追加する為
$params2['include_bodies'] = true;
$params2['decode_bodies']  = false;
$params2['decode_headers'] = true;
$params2['crlf'] = "\r\n";
$decoder2 = new Mail_mimeDecode($input);
$structure2 = $decoder2->decode($params2);

// デバッグ用
$result = print_r($structure,true);
$f = uniqid().".log";
file_put_contents( $f, $result );

// sendmail で送信
$ret = mail( 
	"転送先メールアドレス", 
	$structure->headers['subject'], 
	$structure->body."\nFrom: ".$structure2->headers['from'],
	"From: サービスで登録したメールアドレス"
);
if ( $ret === false ) {
	$result = "NG";
}
else {
	$result = "OK";
}

// デバッグ用
$f = uniqid().".log";
file_put_contents( $f, $result );

?>
OK
このアーティクルの参照用URLをクリップボードにコピー メンテナンス