<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>オレのメモ(仮)</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/" />
    <link rel="self" type="application/atom+xml" href="http://community.giga-works.com/atom.xml" />
    <id>tag:community.giga-works.com,2009-02-22://3</id>
    <updated>2012-02-13T13:56:58Z</updated>
    <subtitle>（サイトの説明）</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Commercial 4.23-ja</generator>

<entry>
    <title>Native extensions for Adobe AIR with iOS - 2 -</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/flex/native-extensions-for-adobe-air-with-ios---2--.html" />
    <id>tag:community.giga-works.com,2012://3.168</id>

    <published>2012-02-13T13:00:39Z</published>
    <updated>2012-02-13T13:56:58Z</updated>

    <summary>Native extensions for Adobe AIR with iOS...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="MacOS X" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<strong><big>Native extensions for Adobe AIR with iOS</big></strong><br>
<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="ProcessList.jpg" src="http://community.giga-works.com/2012/02/13/ProcessList.jpg" width="320" height="480" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
iPhoneでのNative extensionも試してみました。<br>
Adobe AIRとObjective-C/C/C++で開発が出来ます。<br>
<br>
Windows(C#)と比べると、かなり開発はし易いですが、まぁネイティブ側を知っておかないとダメですね。<br>
<br>
<a href="http://code.google.com/p/ane-lab/">ane-lab(AIR Native Extension is Lab codes) - Google Project Hosting</a> に作ったサンプルをコミットさせて頂きましたので、参考にして下さい。<br>
間違ってるかもしれないので、決して鵜呑みにしないように。<br>
<br>
<br>
開発環境<br>
&nbsp;Xcode4<br>
&nbsp;Adobe FlashBuilder4.6<br>
<br>
サンプルは今現在起動しているアプリケーションの一覧を表示するだけのアプリです。<br>
<br>
<br>
作るのは３つ。<br>
<br>
Cocoa touch static library<br>
Flexライブラリプロジェクト(SWC)<br>
Flexモバイルプロジェクト（iOS AIRアプリ）<br>
<br>
<br>
FlashBuilderでの作業は基本的に<a href="http://community.giga-works.com/c-sharp/c-air-native-extension---3--.html">Windows(C#)と変わりません</a>ので、そちらを参照して下さい。<br>
一応コードは貼っておきます。<br>
<br>
FlashBuilderを使用して、Flexライブラリプロジェクト(SWC)とFlexモバイルプロジェクト（iOS AIRアプリ）を作成します。<br>
<br>
まずはSWCから。<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="swc.jpg" src="http://community.giga-works.com/2012/02/13/swc.jpg" width="291" height="316" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
[&nbsp; ProcessExtension.as ]<br>
------------------------<br>
package com.chocbanana.iphone{<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; import flash.events.Event;<br>
&nbsp;&nbsp;&nbsp; import flash.events.EventDispatcher;<br>
&nbsp;&nbsp;&nbsp; import flash.events.IEventDispatcher;<br>
&nbsp;&nbsp;&nbsp; import flash.events.StatusEvent;<br>
&nbsp;&nbsp;&nbsp; import flash.external.ExtensionContext;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; public class ProcessExtension extends EventDispatcher{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private var _ExtensionContext:ExtensionContext;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public function ProcessExtension(target:IEventDispatcher=null){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //TODO: implement function<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; super(target);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
_ExtensionContext =
ExtensionContext.createExtensionContext("com.chocbanana.iphone.ProcessExtension",
null);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public function dispose():void{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _ExtensionContext.dispose();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public function getProcessList():Array {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return _ExtensionContext.call("getProcessList") as Array;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
[ EOF ]<br>
------------------------<br>
<br>
<br>
[ descriptor.xml ]<br>
------------------------<br>
&lt;extension xmlns="http://ns.adobe.com/air/extension/3.1"&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;id&gt;com.chocbanana.iphone.ProcessExtension&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;versionNumber&gt;1.0&lt;/versionNumber&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;platforms&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;platform name="iPhone-ARM"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;applicationDeployment&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;nativeLibrary&gt;libProcessListExtension.a&lt;/nativeLibrary&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;initializer&gt;initializer&lt;/initializer&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;finalizer&gt;finalizer&lt;/finalizer&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/applicationDeployment&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/platform&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/platforms&gt;<br>
&lt;/extension&gt;<br>
[ EOF ]<br>
------------------------<br>
<br>
<br>
<br>
で、ANEを作成するためのadtコマンドのオプションはこちら。<br>
<br>
[ adt-option ]<br>
------------------------<br>
-package -target ane libProcessList_Extension.ane descriptor.xml
-swc&nbsp; libProcessList_Extension.swc -platform iPhone-ARM
library.swf&nbsp; libProcessListExtension.a<br>
------------------------<br>
<br>
<br>
では、Flexモバイルアプリです。<br>
やり方は<a href="http://community.giga-works.com/c-sharp/c-air-native-extension---4--.html">Windowsの方とそう大して変わりません。</a><br>
生成されたaneファイルとswcファイルをプロジェクトに追加しておいて下さい。<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="flashbuilder.jpg" src="http://community.giga-works.com/2012/02/13/flashbuilder.jpg" width="368" height="349" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
[ ProcessList.mxml ]<br>
------------------------<br>
&lt;?xml version="1.0" encoding="utf-8"?&gt;<br>
&lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160"&gt;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &lt;fx:Script&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;![CDATA[<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import com.chocbanana.iphone.ProcessExtension;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import mx.collections.ArrayList;<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; [Bindable]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private var ar:ArrayList = new ArrayList();<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private var ane:ProcessExtension = new ProcessExtension();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protected function btn_getProcess_clickHandler(event:MouseEvent):void<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this.ar.removeAll();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var _ar:Array =
ane.getProcessList();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for(var i:int =0;
i&lt;_ar.length; i++){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
this.ar.addItem(_ar[i]);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(e:Error){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; trace(e.message);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; trace(e.getStackTrace());<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ]]&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/fx:Script&gt;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &lt;fx:Declarations&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;!-- 非ビジュアルエレメント (サービス、値オブジェクトなど) をここに配置 --&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/fx:Declarations&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;s:VGroup x="0" y="0" width="100%" height="100%" horizontalAlign="center" verticalAlign="bottom"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:List id="lst_processList" width="100%" height="100%" dataProvider="{ar}"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:Button id="btn_getProcess"
label="ボタン" click="btn_getProcess_clickHandler(event)"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:Spacer width="10" height="10"/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/s:VGroup&gt;<br>
&lt;/s:Application&gt;<br>
<br>
[ EOF ]<br>
------------------------<br>
<br>
リリースビルドして、実機にて動作する事を確認して下さい。<br>
<br>
お疲れさまでした。<br>
<br>
# 証明書やプロビジョニングファイルなどの説明は省いています。<br>
# 各自で調べて下さい。<br>
<br>]]>
        
    </content>
</entry>

<entry>
    <title>Native extensions for Adobe AIR with iOS - 1 -</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/flex/native-extensions-for-adobe-air-with-ios---1--.html" />
    <id>tag:community.giga-works.com,2012://3.167</id>

    <published>2012-02-13T12:56:37Z</published>
    <updated>2012-02-13T13:43:27Z</updated>

    <summary>Native extensions for Adobe AIR with iOS...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="MacOS X" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<strong><big>Native extensions for Adobe AIR with iOS</big></strong><br>
<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="ProcessList.jpg" src="http://community.giga-works.com/2012/02/13/ProcessList.jpg" width="320" height="480" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
iPhoneでのNative extensionも試してみました。<br>
Adobe AIRとObjective-C/C/C++で開発が出来ます。<br>
<br>
Windows(C#)と比べると、かなり開発はし易いですが、まぁネイティブ側を知っておかないとダメですね。<br>
<br>
<a href="http://code.google.com/p/ane-lab/">ane-lab(AIR Native Extension is Lab codes) - Google Project Hosting</a> に作ったサンプルをコミットさせて頂きましたので、参考にして下さい。<br>
間違ってるかもしれないので、決して鵜呑みにしないように。<br>
<br>
<br>
開発環境<br>
&nbsp;Xcode4<br>
&nbsp;Adobe FlashBuilder4.6<br>
<br>
サンプルは今現在起動しているアプリケーションの一覧を表示するだけのアプリです。<br>
<br>
<br>
作るのは３つ。<br>
<br>
Cocoa touch static library<br>
Flexライブラリプロジェクト(SWC)<br>
Flexモバイルプロジェクト（iOS AIRアプリ）<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="xcode-project.jpg" src="http://community.giga-works.com/2012/02/13/xcode-project.jpg" width="338" height="234" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
まずはCocoa touch static libraryから。<br>
Xcode ProjectにAdobe AIR.frameworkを追加しておきましょう。<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="xcode.jpg" src="http://community.giga-works.com/2012/02/13/xcode.jpg" width="264" height="332" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
以下参照。<br>
<br>
[ ProcessListExtension.h ]<br>
--------------------------------<br>
//<br>
//&nbsp; ProcessListExtension.h<br>
//&nbsp; ProcessListExtension<br>
//<br>
//&nbsp; Created by&nbsp; on 12/02/01.<br>
//&nbsp; Copyright (c) 2012年 __MyCompanyName__. All rights reserved.<br>
//<br>
#import &lt;UIKit/UIKit.h&gt;<br>
#import &lt;Foundation/Foundation.h&gt;<br>
#import &lt;Adobe AIR/Adobe AIR.h&gt;<br>
#import &lt;sys/sysctl.h&gt;<br>
#import &lt;pwd.h&gt;<br>
<br>
@interface ProcessListExtension : NSObject<br>
<br>
<br>
FREObject getProcessList(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]);<br>
<br>
void contextFinalizer(FREContext ctx);<br>
void contextInitializer(void* extData, const uint8_t* ctxType,
FREContext ctx, uint32_t* numFunctions, const FRENamedFunction**
functions);<br>
void initializer(void** extData, FREContextInitializer* ctxInitializer, FREContextFinalizer* ctxFinalizer);<br>
void finalizer(void** extData);<br>
<br>
@end<br>
<br>
[ EOF ]<br>
--------------------------------<br>
<br>
<br>
[ ProcessListExtension.m ]<br>
--------------------------------<br>
//<br>
//&nbsp; ProcessListExtension.m<br>
//&nbsp; ProcessListExtension<br>
//<br>
//&nbsp; Created by&nbsp; on 12/02/01.<br>
//&nbsp; Copyright (c) 2012年 __MyCompanyName__. All rights reserved.<br>
//<br>
<br>
#import "ProcessListExtension.h"<br>
#import "InstalledApplicationPlist.h"<br>
<br>
@implementation ProcessListExtension<br>
<br>
<br>
/*<br>
&nbsp;* http://d.hatena.ne.jp/terazzo/comment?date=20120131<br>
&nbsp;*/<br>
FREObject getProcessList(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[]) {&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; FREObject result = NULL;<br>
&nbsp;&nbsp;&nbsp; FREObject _pNameAndId = NULL;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0};<br>
&nbsp;&nbsp;&nbsp; size_t miblen = 4;<br>
&nbsp;&nbsp;&nbsp; size_t size;<br>
&nbsp;&nbsp;&nbsp; int st = sysctl(mib, miblen, NULL, &amp;size, NULL, 0);<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; struct kinfo_proc * process = NULL;<br>
&nbsp;&nbsp;&nbsp; struct kinfo_proc * newprocess = NULL;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; do {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size += size / 10;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newprocess = realloc(process, size);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!newprocess){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (process){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; free(process);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return nil;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; process = newprocess;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; st = sysctl(mib, miblen, process, &amp;size, NULL, 0);<br>
&nbsp;&nbsp;&nbsp; } while (st == -1 &amp;&amp; errno == ENOMEM);<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; if (st == 0){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (size % sizeof(struct kinfo_proc) == 0){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int nprocess = size / sizeof(struct kinfo_proc);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nprocess){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
FRENewObject((const uint8_t*)"Array", 0, NULL, &amp;result, nil);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char* name = NULL;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSString * processID = nil;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSString * processName = nil;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSString * pNameAndId = nil;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSString * userName = nil;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
InstalledApplicationPlist* plist = [[[InstalledApplicationPlist alloc]
init] autorelease];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int j=0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (int i = nprocess - 1; i &gt;= 0; i--){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
uid_t&nbsp; p_uid = process[i].kp_eproc.e_pcred.p_ruid;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
name = user_from_uid(p_uid, 0);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
processID = [NSString stringWithFormat:@"%d", process[i].kp_proc.p_pid];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
processName = [NSString stringWithFormat:@"%s",
process[i].kp_proc.p_comm];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
userName = [NSString stringWithFormat:@"%s", name];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pNameAndId = [NSString stringWithFormat:@"%@:%@:%@", processID,
processName, userName];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if([userName isEqualToString:@"mobile"]){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if ([plist AppInstalled:processName] == YES){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
FRENewObjectFromUTF8(strlen([pNameAndId UTF8String])+1, (const
uint8_t*)[pNameAndId UTF8String], &amp;_pNameAndId);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
FRESetArrayElementAt(result, j++, _pNameAndId);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; free(process);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; return result;<br>
}<br>
<br>
void contextInitializer(void* extData, const uint8_t* ctxType,
FREContext ctx, uint32_t* numFunctions, const FRENamedFunction**
functions) {<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; *numFunctions = 1;<br>
&nbsp;&nbsp;&nbsp; FRENamedFunction*&nbsp; func= (FRENamedFunction*) malloc(sizeof(FRENamedFunction) * (*numFunctions));<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; func[0].name = (const uint8_t*) "getProcessList";<br>
&nbsp;&nbsp;&nbsp; func[0].functionData = NULL;<br>
&nbsp;&nbsp;&nbsp; func[0].function = &amp;getProcessList;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; *functions = func;<br>
}<br>
void contextFinalizer(FREContext ctx) {<br>
&nbsp;&nbsp;&nbsp; return;<br>
}<br>
<br>
void initializer(void** extData, FREContextInitializer* ctxInitializer, FREContextFinalizer* ctxFinalizer) {<br>
&nbsp;&nbsp;&nbsp; *ctxInitializer = &amp;contextInitializer;<br>
&nbsp;&nbsp;&nbsp; *ctxFinalizer = &amp;contextFinalizer;<br>
}<br>
<br>
void finalizer(void** extData) {<br>
&nbsp;&nbsp;&nbsp; <br>
}<br>
<br>
@end<br>
<br>
[ EOF ]<br>
--------------------------------<br>
<br>
[ InstalledApplicationPlist.h ]<br>
--------------------------------<br>
//<br>
//&nbsp; InstalledApplicationPlist.h<br>
//&nbsp; ProcessListExtension<br>
//<br>
//&nbsp; Created by&nbsp; on 12/02/09.<br>
//&nbsp; Copyright (c) 2012年 __MyCompanyName__. All rights reserved.<br>
//<br>
<br>
#import &lt;Foundation/Foundation.h&gt;<br>
<br>
@interface InstalledApplicationPlist : NSObject<br>
<br>
&nbsp;- (NSDictionary*) getCacheDict;<br>
&nbsp;//- (NSArray*) installedAppsSystem;<br>
&nbsp;//- (NSArray*) installedAppsUser;<br>
<br>
&nbsp;// Bundle identifier (eg. com.apple.mobilesafari) used to track apps<br>
&nbsp;- (BOOL) AppInstalled:(NSString *) bundleIdentifier;<br>
<br>
@end<br>
<br>
[ EOF ]<br>
--------------------------------<br>
<br>
[ InstalledApplicationPlist.m ]<br>
--------------------------------<br>
//<br>
//&nbsp; InstalledApplicationPlist.m<br>
//&nbsp; ProcessListExtension<br>
//<br>
//&nbsp; Created by&nbsp; on 12/02/09.<br>
//&nbsp; Copyright (c) 2012年 __MyCompanyName__. All rights reserved.<br>
//<br>
<br>
#import "InstalledApplicationPlist.h"<br>
<br>
@implementation InstalledApplicationPlist<br>
<br>
/*<br>
&nbsp;* http://www.iphonedevsdk.com/forum/iphone-sdk-development/22289-possible-retrieve-these-information.html<br>
&nbsp;*/<br>
&nbsp;- (NSDictionary *) getCacheDict{<br>
&nbsp;&nbsp;&nbsp;&nbsp; NSDictionary *cacheDict = nil;// code herect;<br>
&nbsp;&nbsp;&nbsp;&nbsp; static NSString *const cacheFileName = @"com.apple.mobile.installation.plist";<br>
&nbsp;&nbsp;&nbsp;&nbsp; NSString *relativeCachePath = [[@"Library"
stringByAppendingPathComponent: @"Caches"]
stringByAppendingPathComponent: cacheFileName];<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; //[[NSHomeDirectory()
stringByAppendingPathComponent: @"../.."]
stringByAppendingPathComponent: relativeCachePath];<br>
&nbsp;&nbsp;&nbsp;&nbsp; NSString *path = nil;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp; for (short i = 0; 1; i++){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (i) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
case 0: // Jailbroken apps will find the cache here; their home
directory is /var/mobile<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
path = [NSHomeDirectory() stringByAppendingPathComponent:
relativeCachePath];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
case 1: // App Store apps and Simulator will find the cache here; home
(/var/mobile/) is 2 directories above sandbox folder<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
path = [[NSHomeDirectory() stringByAppendingPathComponent: @"../.."]
stringByAppendingPathComponent: relativeCachePath];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
case 2: // If the app is anywhere else, default to hardcoded
/var/mobile/<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
path = [@"/var/mobile" stringByAppendingPathComponent:
relativeCachePath];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default: // Cache not found (loop not broken)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Ensure that file exists<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BOOL isDir = NO;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ([[NSFileManager
defaultManager] fileExistsAtPath: path isDirectory: &amp;isDir]
&amp;&amp; !isDir) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cacheDict&nbsp;&nbsp;&nbsp; = [NSDictionary
dictionaryWithContentsOfFile: path];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return cacheDict;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ([[NSFileManager
defaultManager] fileExistsAtPath: path isDirectory: &amp;isDir]
&amp;&amp; !isDir) // Ensure that file exists<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
cacheDict = [NSDictionary dictionaryWithContentsOfFile: path];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (cacheDict) // If
cache is loaded, then break the loop. If the loop is not "broken," it
will return NO later (default: case)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; return nil;<br>
}<br>
/*<br>
&nbsp;- (NSArray *) installedAppsSystem {<br>
&nbsp;&nbsp;&nbsp; // Then all the user (App Store /var/mobile/Applications) apps<br>
&nbsp;&nbsp;&nbsp; NSDictionary* system = [[self getCacheDict] objectForKey: @"System"];<br>
&nbsp;&nbsp;&nbsp; NSLog(@"Installed Applications = %@",[system allKeys]); <br>
&nbsp;&nbsp;&nbsp; return [system allKeys];<br>
&nbsp;&nbsp;&nbsp; //return nil;<br>
}<br>
<br>
&nbsp;- (NSArray *) installedAppsUser {<br>
&nbsp;&nbsp;&nbsp; // Then all the user (App Store /var/mobile/Applications) apps<br>
&nbsp;&nbsp;&nbsp; NSDictionary* user = [[self getCacheDict] objectForKey: @"User"];<br>
&nbsp;&nbsp;&nbsp; NSLog(@"Installed Applications = %@",[user allKeys]); <br>
&nbsp;&nbsp;&nbsp; return [user allKeys];<br>
&nbsp;&nbsp;&nbsp; //return nil;<br>
}<br>
*/<br>
<br>
- (BOOL) AppInstalled:(NSString *) processName {<br>
&nbsp;&nbsp;&nbsp; NSString* const bundleIdentifier = @"CFBundleExecutable";<br>
<br>
&nbsp;&nbsp;&nbsp; NSDictionary* systems = [[self getCacheDict] objectForKey: @"System"];<br>
&nbsp;&nbsp;&nbsp; for(NSDictionary* _system in systems){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSDictionary* sysDict = [systems objectForKey:_system];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSString* CFBundleExecutable = [sysDict objectForKey:bundleIdentifier];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if([processName isEqualToString:CFBundleExecutable]){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return YES;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; NSDictionary* users = [[self getCacheDict] objectForKey: @"User"];<br>
&nbsp;&nbsp;&nbsp; for(NSDictionary* _user in users){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSDictionary* userDict = [users objectForKey:_user];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NSString* CFBundleExecutable = [userDict objectForKey:bundleIdentifier];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if([processName isEqualToString:CFBundleExecutable]){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return YES;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; // If nothing returned YES already, we'll return NO now<br>
&nbsp;&nbsp;&nbsp; return NO;<br>
}<br>
<br>
@end<br>
<br>
[ EOF ]<br>
--------------------------------<br>
<br>
Xcodeはここまで。<br>
続いて、FlashBuilderを使用してSWCとAIRモバイルアプリケーションを作成していきます。<br>
<br>]]>
        
    </content>
</entry>

<entry>
    <title>C# で作る AIR Native Extension - 4 -</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/c-sharp/c-air-native-extension---4--.html" />
    <id>tag:community.giga-works.com,2012://3.166</id>

    <published>2012-01-29T16:57:11Z</published>
    <updated>2012-01-29T17:20:08Z</updated>

    <summary>C# で作る AIR Native Extension Adobe AIR3 か...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="c#" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<h1>C# で作る AIR Native Extension</h1>
<br>
Adobe AIR3 から ANE という&nbsp;ネイティブ拡張機能が実装されたのでWindowsで試してみました。<br>
<br>
全部で4ページにまとめます。<br>
<br>
今回で終わりです。<br>
<br>
<br>
開発環境<br>
&nbsp;Windows XP SP3<br>
&nbsp;Visual Studio 2010 Express Edition( C# / VC++ )<br>
&nbsp;FlashBuilder4.6( FlexSDK4.6 )<br>
<br>
<br>
<a href="http://code.google.com/p/ane-lab/">ane-lab(AIR
Native Extension is Lab codes) - Google Project Hosting</a>
にC#で作ったサンプルをコミットさせて頂きましたので、参考にして下さい。<br>
間違ってるかもしれないので、決して鵜呑みにしないように。<br>
<br>
<br>
<big><strong>4.FlashBuilderでAIRアプリを作るよ！最後だよ！</strong></big><br>
<br>
<br>
FlashBuilder4.6を使用してFlexデスクトップアプリケーション（AIR）を仕上げましょう。<br>
先回作成したANEファイルから、ネイティブな処理を呼び出せるようになります。<br>
<br>
<br>
Flexプロジェクトにライブラリプロジェクトを参照させ、ANEファイルをlibsディレクトリにコピーします。<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-swc-append.png" src="http://community.giga-works.com/2012/01/30/air-swc-append.png" width="691" height="249" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-ane-append.png" src="http://community.giga-works.com/2012/01/30/air-ane-append.png" width="284" height="337" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
ANEファイルをコピーしたら、Flexプロジェクトのビルドパスにある「ネイティブエクステンション」にANEファイルを追加します。<br>
<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-ane-append-project.png" src="http://community.giga-works.com/2012/01/30/air-ane-append-project.png" width="745" height="195" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
<br>
<br>
ANEファイルを追加すると、ApplicationList-app.xmlファイルに<br>
<br>
&lt;extensions&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;extensionID&gt;com.chocbanana.win.ApplicationListExtension&lt;/extensionID&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/extensions&gt;<br>
&lt;/application&gt;<br>
<br>
という記述が追加されます。<br>
<br>
ここまで終ったらActionScriptのコーディングです。<br>
以下参照。<br>
<br>
<br>
[ ApplicationList.mxml ]<br>
-------------------------------<br>
&lt;?xml version="1.0" encoding="utf-8"?&gt;<br>
&lt;s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
xmlns:s="library://ns.adobe.com/flex/spark" <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
xmlns:mx="library://ns.adobe.com/flex/mx"&gt;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &lt;fx:Script&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;![CDATA[<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; import
com.chocbanana.win.ApplicationListExtension;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; import mx.collections.ArrayCollection;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; private var ane:ApplicationListExtension
= new ApplicationListExtension();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; [Bindable]<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; private var ar:ArrayCollection = new
ArrayCollection();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; protected function
btn_applicationList_clickHandler(event:MouseEvent):void<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO
Auto-generated method stub<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var
_ar:Array = ane.getApplicationList();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
ar.removeAll();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for(var
i:int=0; i&lt;_ar.length; i++){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; var appName:String = _ar[i] as String;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; ar.addItem(appName);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ]]&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/fx:Script&gt;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &lt;fx:Declarations&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;!-- 非ビジュアルエレメント (サービス、値オブジェクトなど) をここに配置 --&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/fx:Declarations&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;s:Panel x="0" y="0" width="100%"
height="100%" fontWeight="bold"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;title="Show Installed
Applications"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;s:VGroup x="0" y="0" width="100%" height="100%"
horizontalAlign="center"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp; verticalAlign="middle"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;s:List id="lst_ApplicationList"
width="80%" height="80%" dataProvider="{ar}"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; fontWeight="normal"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;s:Button
id="btn_applicationList" label="アプリケーション一覧の取得"<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;
click="btn_applicationList_clickHandler(event)"
fontWeight="bold"/&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;/s:VGroup&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/s:Panel&gt;<br>
&lt;/s:WindowedApplication&gt;<br>
[ EOF ]<br>
-------------------------------<br>
<br>
Flexプロジェクトをビルドして下さい。<br>
証明書は最初に作成したと思うので、もう既にありますね？<br>
<br>
<br>
ではリリースビルドです。<br>
リリースビルドのエクスポートをクリックして、[ 署名済みネイティブインストーラー ] を選択して下さい。<br>
証明書のパスワードを入力して、[ 終了 ] をクリックすると、ネイティブなインストーラー（EXEファイル）が生成されます。<br>
<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-releasebuild.png" src="http://community.giga-works.com/2012/01/30/air-releasebuild.png" width="603" height="390" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-releasebuild02.png" src="http://community.giga-works.com/2012/01/30/air-releasebuild02.png" width="603" height="249" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
インストーラーが作成されたら、それをダブルクリックして、インストールして下さい。<br>
<br>
<span
 style="font-weight: bold; color: rgb(255, 0, 0);">1番最初
に作成したC#のDLLはこのインストーラーの中や、ANEファイルの中には含まれていません</span>の
で、アプリケーションを実行すると、異常終了します。<br>
<br>
インストールされたアプリケーションは、C:\ProgramFiles\ApplicationListにありますので、そのディレクトリを開いて、
C#のDLLのみを手動でコピーします。<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-dll-copy.png" src="http://community.giga-works.com/2012/01/30/air-dll-copy.png" width="939" height="426" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
再度、AIRアプリケーションを実行してみましょう。<br>
無事に実行が終ると、インストールされているアプリケーションの一覧が表示されると思います。<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-native-application.png" src="http://community.giga-works.com/2012/01/30/air-native-application.png" width="580" height="528" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
<br>
<br>
お疲れ様でした。<br>
<br>
<br>
Appendix - インストーラーについて -<br>
<br>
ANEを利用したAIRアプリケーションでは、今現在FlashBuilderにてC#のDLLを含めてインストーラー（配布形式）にまとめることが出来
ません。<br>
で、これをどうしたら良いか&hellip;という点なのですが、AIRアプリケーションにはサイレントインストールさせるためのインストールオ
プションがあると思います。<br>
<br>
で、このインストールオプションと、Windowsのもう１つのインストール形式である、MSIパッケージを組み合わせれば、全てを同梱した形で配布出来
るようになると思います。<br>
<br>
これを行うには、SharpDevelopとWixを利用すると、msiパッケージを作成出来るので、そちらで（XMLを書いて）msiパッケージとして
1まとめにし、配布する&hellip;というのが妥当だと思います。<br>
<br>
あ、高価なインストーラー作成アプリを使うなら、この項目は必要ないです。<br>
参考程度に留めておいて下さい。<br>
<br>
]]>
        
    </content>
</entry>

<entry>
    <title>C# で作る AIR Native Extension - 3 -</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/c-sharp/c-air-native-extension---3--.html" />
    <id>tag:community.giga-works.com,2012://3.165</id>

    <published>2012-01-29T15:11:10Z</published>
    <updated>2012-01-29T15:25:06Z</updated>

    <summary>C# で作る AIR Native Extension Adobe AIR3 か...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="c#" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<h1>C# で作る AIR Native Extension</h1>
<br>
Adobe AIR3 から ANE という&nbsp;ネイティブ拡張機能が実装されたのでWindowsで試してみました。<br>
<br>
全部で4ページにまとめます。<br>
<br>
今回はその3ページ目、あと一息です。<br>
<br>
<br>
開発環境<br>
&nbsp;Windows XP SP3<br>
&nbsp;Visual Studio 2010 Express Edition( C# / VC++ )<br>
&nbsp;FlashBuilder4.6( FlexSDK4.6 )<br>
<br>
<br>
<a href="http://code.google.com/p/ane-lab/">ane-lab(AIR
Native Extension is Lab codes) - Google Project Hosting</a>
にC#で作ったサンプルをコミットさせて頂きましたので、参考にして下さい。<br>
間違ってるかもしれないので、決して鵜呑みにしないように。<br>
<br>
<br>
<br>
<big><strong>3.FlashBuilder
でSWCとAIRアプリを作るよ！</strong></big><br>
<br>
<br>
FlashBuilder4.6使用して、Flexライブラリ（SWC）とFlexデスクトップアプリケーション（AIR）を作成していきます。<br>
2つ同時に作業した方が分かりやすいかもしれません。<br>
<br>
これで、SWCからadtコマンドでANEファイルを生成し、ネイティブな処理を呼び出せるようになります。<br>
<br>
<br>
ではまずAIRアプリのレイアウト及び、証明書の作成から。<br>
先に証明書を作成しておかないと、SWCを作るときにメンドイのです。<br>
<br>
画面レイアウトと、証明書が出来たらSWC（Flexライブラリ）を作ります。<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-app-layout.png" src="http://community.giga-works.com/2012/01/30/air-app-layout.png" width="886" height="550" class="mt-image-none" style="" /></span>
<br><br><br><br><br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-app-syomeisyo.png" src="http://community.giga-works.com/2012/01/30/air-app-syomeisyo.png" width="1010" height="559" class="mt-image-none" style="" /></span>
<br><br><br><br><br>
<strong><big>Flexライブラリプロジェクトを作りましょう。</big></strong><br>
<br>
プロジェクトのプロパティ設定で、[ Flexライブラリコンパイラー ]　-&gt; [ Aodbe AIRライブラリを含める
]　のチェックがONになっていることを確認して下さい。<br>
<br>
binディレクトリに VC++で作成したDLLと、先程作ったFlexアプリの証明書を入れておきます。<br>
<br>
次に、srcディレクトリに ASのパッケージと、assetsディレクトリ。assetsディレクトリ内にdescriptor.xmlを作成します。<br>
<br>
内容は以下の通りで。<br>
<br>
[ assets/descriptor.xml ]<br>
------------------------<br>
&lt;extension xmlns="http://ns.adobe.com/air/extension/3.1"&gt;<br>
&nbsp;&nbsp;&nbsp;
&lt;id&gt;com.chocbanana.win.ApplicationListExtension&lt;/id&gt;<br>
&nbsp;&nbsp;&nbsp;
&lt;versionNumber&gt;1.0&lt;/versionNumber&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;platforms&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;platform name="Windows-x86"&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;applicationDeployment&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;nativeLibrary&gt;libApplicationList.dll&lt;/nativeLibrary&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;initializer&gt;initializer&lt;/initializer&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;finalizer&gt;finalizer&lt;/finalizer&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &lt;/applicationDeployment&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;/platform&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;/platforms&gt;<br>
&lt;/extension&gt;<br>
[ EOF ]<br>
------------------------<br>
<br>
このXMLファイルが書けたら、binディレクトリにコピーしておいて下さい。<br>
<br>
<br>
<br>
[ com.chocbanana.win.ApplicationListExtension.as ]<br>
------------------------<br>
package com.chocbanana.win{<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; import flash.events.Event;<br>
&nbsp;&nbsp;&nbsp; import flash.events.EventDispatcher;<br>
&nbsp;&nbsp;&nbsp; import flash.events.IEventDispatcher;<br>
&nbsp;&nbsp;&nbsp; import flash.events.StatusEvent;<br>
&nbsp;&nbsp;&nbsp; import flash.external.ExtensionContext;<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; public class ApplicationListExtension
extends EventDispatcher {<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private
var _ExtensionContext:ExtensionContext;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public
function ApplicationListExtension(target:IEventDispatcher=null) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; //TODO: implement function<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; super(target);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; _ExtensionContext =
ExtensionContext.createExtensionContext("com.chocbanana.win.ApplicationListExtension",
null);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public
function dispose():void{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; _ExtensionContext.dispose();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public
function getApplicationList():Array {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; return
_ExtensionContext.call("GetApplicationList") as Array;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
[ EOF ]<br>
------------------------<br>
<br>
ASファイル内で、FREのContextを作成し、callメソッドで、DLLの関数を呼びます。<br>
戻り値はFREOｂectで指定した戻り値の型ですね。<br>
<br>
で、これのビルドを行うとSWCファイルが出来ると思います。<br>
<br>
SWCファイルが出来たら、それをそのまま選択して、右クリック、コピーして貼り付けして下さい。<br>
名前の拡張子をzipにします。<br>
<br>
そのzipファイルをダブルクリックして、解凍すると、中にlibrary.swfファイルがあるので、それもbinディレクトリに含めます。<br>
解凍したzipファイルと、フォルダは要らないので、削除しておいて下さい。<br>
<br><br><br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-swc-package.png" src="http://community.giga-works.com/2012/01/30/air-swc-package.png" width="266" height="303" class="mt-image-none" style="" /></span>
<br><br><br><br><br>
ここから、ADTコマンドを使って、ANEファイルを作ります。<br>
FlashBuilderの [ 実行 ] -&gt; [ 外部ツール ] -&gt; [ 外部ツールの構成
]　を選択して、以下の様に。<br>
<br><br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-adt-command.png" src="http://community.giga-works.com/2012/01/30/air-adt-command.png" width="591" height="640" class="mt-image-none" style="" /></span>
<br><br><br><br><br><br>
[ ADTコマンドの引数（改行は挟まず、スペースで） ]<br>
------------------------<br>
-package -storetype pkcs12 -keystore test.p12 -target ane
libApplicationList_Extension.ane descriptor.xml -swc&nbsp;
libApplicationList_Extension.swc -platform Windows-x86
library.swf&nbsp; libApplicationList.dll<br>
------------------------<br>
<br>
実行すると証明書のパスワードを聞いてくるので、入力してEnter。<br>
libApplicationList_Extension.aneファイルがbinディレクトリに生成されます。<br>
<br>
生成されたANEファイルをコピーして、AIRアプリのlibsディレクトリにコピーして下さい。<br>
<br>
ひとまずはココまで。<br>
次回はAIRアプリの仕上げです。<br>
<br>
]]>
        
    </content>
</entry>

<entry>
    <title>C# で作る AIR Native Extension - 2 -</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/c-sharp/c-air-native-extension---2--.html" />
    <id>tag:community.giga-works.com,2012://3.164</id>

    <published>2012-01-29T13:31:29Z</published>
    <updated>2012-01-29T13:40:17Z</updated>

    <summary>C# で作る AIR Native Extension Adobe AIR3 か...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="c#" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<h1>C# で作る AIR Native Extension</h1>
<br>
Adobe AIR3 から ANE という&nbsp;ネイティブ拡張機能が実装されたのでWindowsで試してみました。<br>
<br>
全部で4ページにまとめます。<br>
<br>
今回はその2ページ目です。<br>
<br>
<br>
開発環境<br>
&nbsp;Windows XP SP3<br>
&nbsp;Visual Studio 2010 Express Edition( C# / VC++ )<br>
&nbsp;FlashBuilder4.6( FlexSDK4.6 )<br>
<br>
<br>
<a href="http://code.google.com/p/ane-lab/">ane-lab(AIR
Native Extension is Lab codes) - Google Project Hosting</a>
にC#で作ったサンプルをコミットさせて頂きましたので、参考にして下さい。<br>
間違ってるかもしれないので、決して鵜呑みにしないように。<br>
<br>
<br>
<br>
<big><strong>2.VC
++でDLL作るよ！</strong></big><br>
<br>
<br>
Visual Studio 2010 Express Edition VC++
を使用して、AIRライブラリ（SWC）からコールするためのDLLを作成していきます。<br>
VC++でCLRライブラリプロジェクトを選択してください。<br>
<br>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="vc-project.png" src="http://community.giga-works.com/2012/01/29/vc-project.png" width="621" height="142" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
<br>
<br>
先回作成したC#のDLLとtlbファイル、及びAIR SDKに同梱されているヘッダーファイルとlibファイルをプロジェクトに追加します。<br>
<br><br><br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="cs-dll.png" src="http://community.giga-works.com/2012/01/29/cs-dll.png" width="745" height="178" class="mt-image-none" style="" /></span>
<br><br><br><br><br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="air-lib.png" src="http://community.giga-works.com/2012/01/29/air-lib.png" width="443" height="198" class="mt-image-none" style="" /></span>
<br><br><br><br><br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="project-files.png" src="http://community.giga-works.com/2012/01/29/project-files.png" width="647" height="355" class="mt-image-none" style="" /></span>
<br><br><br><br><br>
で、ヘッダーファイル2つとメインのCPPファイルを書きます。<br>
<br>
<br>
[ Stdafx.h ]<br>
------------------------------<br>
// stdafx.h : 標準のシステム インクルード ファイルのインクルード ファイル、または<br>
// 参照回数が多く、かつあまり変更されない、プロジェクト専用のインクルード ファイル<br>
// を記述します。<br>
<br>
#pragma once<br>
#include "FlashRuntimeExtensions.h";<br>
<br>
[ EOF ]<br>
------------------------------<br>
<br>
<br>
[ libApplicationList.h ]<br>
------------------------------<br>
// libApplicationList.h<br>
#pragma once<br>
#include &lt;stdlib.h&gt;<br>
#include &lt;wchar.h&gt;<br>
#include &lt;windows.h&gt;<br>
<br>
#using &lt;mscorlib.dll&gt;<br>
#using "ApplicationList_CS.dll"<br>
<br>
using namespace System;<br>
using namespace System::Runtime::InteropServices;<br>
using namespace System::Collections;<br>
using namespace ApplicationList_CS;<br>
<br>
namespace libApplicationList {<br>
<br>
&nbsp;&nbsp;&nbsp; public ref class Class1<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO:
このクラスの、ユーザーのメソッドをここに追加してください。<br>
&nbsp;&nbsp;&nbsp; };<br>
}<br>
[ EOF ]<br>
------------------------------<br>
<br>
[ libApplicationList.cpp ]<br>
------------------------------<br>
// これは メイン DLL ファイルです。<br>
<br>
#include "stdafx.h"<br>
#include "libApplicationList.h"<br>
<br>
<br>
extern "C" __declspec(dllexport) void initializer(void** extData,
FREContextInitializer* ctxInitializer, FREContextFinalizer*
ctxFinalizer);<br>
extern "C" __declspec(dllexport) void finalizer(void** extData);<br>
<br>
void ConvertToUni(String^ _str, char* szBuf, const int bufLen)<br>
{<br>
&nbsp;&nbsp;&nbsp; IntPtr ptr =
Marshal::StringToHGlobalUni(_str);<br>
&nbsp;&nbsp;&nbsp; const char* str =
static_cast&lt;const char*&gt;(ptr.ToPointer());<br>
&nbsp;&nbsp;&nbsp; WideCharToMultiByte(CP_UTF8, 0,
(wchar_t*)str, -1, szBuf, bufLen, NULL, NULL);<br>
&nbsp;&nbsp;&nbsp; Marshal::FreeHGlobal(ptr);<br>
}<br>
<br>
FREObject GetApplicationList(FREContext ctx, void* funcData, uint32_t
argc, FREObject argv[]){<br>
&nbsp;&nbsp;&nbsp; FREObject resultObj;<br>
&nbsp;&nbsp;&nbsp; FREObject elementObj;<br>
<br>
&nbsp;&nbsp;&nbsp; ApplicationList_CS::AppList_CS^ cs =
gcnew ApplicationList_CS::AppList_CS();<br>
&nbsp;&nbsp;&nbsp; ArrayList^ list = gcnew ArrayList();<br>
&nbsp;&nbsp;&nbsp; list = cs-&gt;getApplicationNames();<br>
<br>
&nbsp;&nbsp;&nbsp; // Application Name buffer<br>
&nbsp;&nbsp;&nbsp; const int bufLen = 1024;<br>
&nbsp;&nbsp;&nbsp; char szBuf[bufLen];<br>
<br>
&nbsp;&nbsp;&nbsp; const int count = list-&gt;Count;<br>
<br>
&nbsp;&nbsp;&nbsp; FRENewObject((const uint8_t*)"Array", 0,
NULL, &amp;resultObj, NULL);<br>
&nbsp;&nbsp;&nbsp; FRESetArrayLength(resultObj, count);<br>
<br>
&nbsp;&nbsp;&nbsp; for(int i=0; i&lt;count; i++){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String^
str = (String^)list[i];<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
ConvertToUni(str, szBuf, bufLen);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
FRENewObjectFromUTF8(strlen(szBuf)+1, (const uint8_t *)szBuf,
&amp;elementObj);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
FRESetArrayElementAt(resultObj, i, elementObj);<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; return resultObj; <br>
}<br>
void contextFinalizer(FREContext ctx)<br>
{<br>
&nbsp;&nbsp;&nbsp; return;<br>
}<br>
<br>
void contextInitializer(void* extData, const uint8_t* ctxType,
FREContext ctx, uint32_t* numFunctions, const FRENamedFunction**
functions)<br>
{<br>
&nbsp;&nbsp;&nbsp; *numFunctions = 1;<br>
&nbsp;&nbsp;&nbsp; FRENamedFunction*&nbsp; func=
(FRENamedFunction*)malloc(sizeof(FRENamedFunction) * (*numFunctions));<br>
<br>
&nbsp;&nbsp;&nbsp; func[0].name = (const uint8_t*)
"GetApplicationList";<br>
&nbsp;&nbsp;&nbsp; func[0].functionData = NULL;<br>
&nbsp;&nbsp;&nbsp; func[0].function =
&amp;GetApplicationList;<br>
<br>
&nbsp;&nbsp;&nbsp; *functions = func;<br>
}<br>
<br>
void initializer(void** extData, FREContextInitializer* ctxInitializer,
FREContextFinalizer* ctxFinalizer)<br>
{<br>
&nbsp;&nbsp;&nbsp; *ctxInitializer =
&amp;contextInitializer;<br>
&nbsp;&nbsp;&nbsp; *ctxFinalizer =
&amp;contextFinalizer;<br>
}<br>
<br>
void finalizer(void** extData)<br>
{<br>
&nbsp;&nbsp;&nbsp; <br>
}<br>
[ EOF ]<br>
------------------------------<br>
<br>
ポイントは<br>
<br>
contextInitializerのFRENamedFunctionでActionScriptからCallされる名前を定義しているのと、ネイ
ティブの処理として<br>
<br>
Marshal::StringToHGlobalUni(_str);<br>
WideCharToMultiByte(CP_UTF8, 0,
(wchar_t*)str, -1, szBuf, bufLen, NULL, NULL);<br>
<br>
を使用している点でしょう。<br>
<br>
WindowsではOS内部の値はUnicodeで格納されているため、UnicodeからUTF8に変換しないと、AIRに持っていったときに文字化け
して表示されます。<br>
ですので、WMIやレジストリなどから&rdquo;マルチバイト文字&rdquo;を引っ張ってくるときは要注意です。<br>
<br>
あとは、ArrayList^ listに格納された文字列を1つ1つ分解して、FREObjectの構造体に突っ込む作業です。<br>
全部突っ込んだらreturnで戻して終わりです。<br>
<br>
AIR側に渡すために各パラメータを細かく分解してから、それぞれ格納し直す作業がメンドイですね&hellip;。<br>
<br>
<br>
では、次回はFlashBuilderでFlexライブラリプロジェクト(SWC)とFlexプロジェクト（デスクトップ AIRアプリ）を作ります。<br>
<br>
]]>
        
    </content>
</entry>

<entry>
    <title>C# で作る AIR Native Extension</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/c-sharp/c-air-native-extension.html" />
    <id>tag:community.giga-works.com,2012://3.163</id>

    <published>2012-01-28T17:35:17Z</published>
    <updated>2012-01-29T17:22:16Z</updated>

    <summary>C# で作る AIR Native Extension Adobe AIR3 か...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="c#" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<h1>C#
で作る AIR Native Extension</h1>
<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="ApplicationList.png" src="http://community.giga-works.com/2012/01/29/ApplicationList.png" width="508" height="402" class="mt-image-none" style="" /></span><br>
<br>
<br>
Adobe AIR3 から ANE という&nbsp;ネイティブ拡張機能が実装されたのでWindowsで試してみました。<br>
<br>
全部で4ページにまとめます。<br>
<br>
今回はその1ページ目です。<br>
<br>
<br>
開発環境<br>
&nbsp;Windows XP SP3<br>
&nbsp;Visual Studio 2010 Express Edition( C# / VC++ )<br>
&nbsp;FlashBuilder4.6( FlexSDK4.6 )<br>
<br>
<br>
まぁ、アレです、各プラットフォーム固有の機能が使えたりするというヤツです。<br>
Windowsならね、わざわざAIRでやらなくてもね、C#で全部出来るからね&hellip;、あんまり意味無いかもしれませんけどね。
orz<br>
フロントエンドをAIRでまとめて、各プラットフォームごとにANEで固有機能を実装して&hellip;という具合にアプリを作るなら、ANE
はアリです。<br>
<br>
が、結構かなりシビアにキツイです。キツイっス&hellip;。orz<br>
<br>
レジストリにアクセスしたり、WMI（<span class="st">Windows
Management
Instrumentation</span>）を使ってハードウェア・ソフト
ウェアの情報を取得したり、C#のAPIに丸投げしたり出来ま
す。はい。<br>
<br>
<a href="http://code.google.com/p/ane-lab/">ane-lab(AIR
Native Extension is Lab codes) - Google Project Hosting</a>
にC#で作ったサンプルをコミットさせて頂きましたので、参考にして下さい。<br>
間違ってるかもしれないので、決して鵜呑みにしないように。<br>
<br>
<br>
で、作り方。<br>
<br>
<br>
作るのは4つ。<br>
<br>
C#クラスライブラリ（C#のDLL）<br>
VC++のCLRのクラスライブラリ(VC++ CLR/DLL)<br>
Flexライブラリプロジェクト(SWC)<br>
Flexプロジェクト（デスクトップ AIRアプリ）<br>
<br>
です。<br>
<br>
<br>
<br>
<big><strong>1.C#でDLL作るよ！</strong></big><br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="template.png" src="http://community.giga-works.com/2012/01/29/template.png" width="550" height="204" class="mt-image-none" style="" /></span>
<br>
<br>
最初にキモを抑えて起きましょう。<br>
C#で作ったDLLをVC++から参照して、VC++で作るDLLの中でFlashRuntimeExtensionsを組み込むことにより、AIRアプ
リに通知することが出来るようになります。<br>
<br>
えー？？？ですよね。C#からVC++のDLLをImportする&hellip;のではなく、その逆です。VC++からC#のDLLを参照しま
す。<br>
イヤーな予感がします。はい。<br>
<br>
<br>
キモはコレ！<br>
VC++から参照出来るように、「アセンブリをCOM参照可能にする」のチェックと、「COM相互運用機能の登録」のチェックをONにしておきます。<br>
これでVC++からCOM経由でC#のクラスやそのメンバを参照出来るようになります。<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="CS_Setting01.png" src="http://community.giga-works.com/2012/01/29/CS_Setting01.png" width="709" height="586" class="mt-image-none" style="" /></span>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="CS_Setting02.png" src="http://community.giga-works.com/2012/01/29/CS_Setting02.png" width="691" height="568" class="mt-image-none" style="" /></span>
<br><br>
ここで1つ注意。<br>
<br>
COM
参照可能にする、とかCOM相互運用機能の登録とありますが、これはWindowsのCOMという機能を利用/経由（.NET/C#がCOMにラップされ
る）して、VC++から.NET
Objectを操作出来るようにする（マネージドからアンマネージにアクセスする）&hellip;というものです。<br>
<br>
詳しくは「COM ・ RCW ・ 参照カウント
」などのキーワードで調べてください。<br>
<br>
C#（.NET）にはGC（ガベージコレクション）という機能があります。が、COMはMSのドキュメントによると、「COM
自身は、オブジェクトが不要になったと判断しても、メモリから自動的にオブジェクトを削除するわけではありません。不要なオブジェクトの削除は、オブジェ
クトのプログラマが行います。プログラマは、参照カウントに基づいて、オブジェクトを削除できるかどうかを判断します。」とあります。(<a
 href="http://msdn.microsoft.com/ja-jp/library/4947zb56%28v=vs.100%29.aspx">http://msdn.microsoft.com/ja-jp/library/4947zb56%28v=vs.100%29.aspx</a>)<br>
<br>
<br>
完全にGCと相反していますね&hellip;。C#でどうやんのよ、それ&hellip;。<br>
<br>
えー、通常C#で開発をする場合、変数にスコープがあり、このスコープから抜けるとGCの対象になる（実際にGCが何時行われるかはプログラマからは分か
りませんが）&hellip;のですが、VC++から参照させるために、C#のライブラリをCOM参照させる必要があるため、C#側のインスタン
スを明示的に解放してやる必要があります。<br>
<br>
MSのドキュメントにも「<span id="result_box"
 class="short_text" lang="ja"><span
 class="">すべての</span><span>ア
ウト</span><span>ポ
インタ</span><span>パ
ラメータを</span><span>明
示的に</span><span
 class="">NULLに設定</span><span
 class="">する必要があります。</span></span>」
と記載されています。（<a
 href="http://msdn.microsoft.com/ja-jp/library/ms686638.aspx">http://msdn.microsoft.com/ja-jp/library/ms686638.aspx</a>）&amp;
rdquo;すばらしいGoogle翻訳&rdquo;。<br>
<br>
えー、ですので、C#側でも不必要な変数にはNULLを入れてやって下さい。<br>
そうしないと、AIRアプリのプロセスが正常に終了しない場合があります。<br>
<br>
あと、string[]
とかは使わない方が良いです。使うなら、List&lt;string&gt;とかCollection.Genericを使いましょ
う。<br>
<br>
<br>
<br>
では、サンプルです。<br>
OS内にインストールされているアプリケーション一覧を表示します。<br>
これで、えろげとかもバッチリだね！（ぉ<br>
<br>
プロジェクト名は &rdquo; ApplicationList_CS &rdquo; です。<br>
<br>
<br>
[ App.cs ]<br>
----------------------------------------<br>
using System;<br>
using System.Collections;<br>
using System.Collections.Generic;<br>
using System.Management;<br>
using Microsoft.Win32;<br>
<br>
namespace ApplicationList_CS {<br>
&nbsp;&nbsp;&nbsp; class App {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//HotFix情報<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
private const string root = "root\\CIMV2";<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
private const string query = "SELECT * FROM Win32_QuickFixEngineering
WHERE ServicePackInEffect &lt;&gt; '' AND InstalledBy
&lt;&gt; ''";<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
public ArrayList getApplicationNames() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
List&lt;string&gt; hotfix = new List&lt;string&gt;();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
List&lt;string&gt; app = new List&lt;string&gt;();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ManagementObjectSearcher searcher = new ManagementObjectSearcher(root,
query);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
foreach (ManagementObject queryObj in searcher.Get()) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hotfix.Add((string)queryObj["HotFixID"]);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} catch (Exception e) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Console.WriteLine(e.StackTrace);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} finally {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
searcher = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RegistryKey regKey = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RegistryKey _subRegKey = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//アプリケーション情報<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string reg = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\";<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string regValue = "DisplayName";<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
regKey = Registry.LocalMachine.OpenSubKey(reg);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string[] subkey = regKey.GetSubKeyNames();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
foreach (string keyName in subkey) {<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
_subRegKey = Registry.LocalMachine.OpenSubKey(reg + keyName);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string value = (string)_subRegKey.GetValue(regValue);<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (value != null) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (int j = 0; j &lt; hotfix.Count; j++) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (value.Contains(hotfix[j].ToString())) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} else if (value.Contains("KB")) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} else {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
app.Add(value);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//value = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
app.TrimExcess();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
reg = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
regValue = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
subkey = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} catch (NullReferenceException e) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Console.WriteLine(e.StackTrace);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} finally {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
regKey.Close();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
_subRegKey.Close();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
app.Sort();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (int i = 0; i &lt; (app.Count - 1); i++) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (app[i].Equals(app[i + 1])) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
app.RemoveAt(i);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} catch (Exception ex) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Console.WriteLine(ex.Message);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
app.TrimExcess();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hotfix = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return new ArrayList(app);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
[ EOF ]<br>
----------------------------------------<br>
<br>
<br>
<br>
[ AppList_CS.cs ]<br>
----------------------------------------<br>
using System;<br>
using System.Collections;<br>
<br>
namespace ApplicationList_CS {<br>
&nbsp;&nbsp;&nbsp; public class AppList_CS {<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
private App app = new App();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
public ArrayList getApplicationNames() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
return app.getApplicationNames();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
}<br>
[ EOF ]<br>
----------------------------------------<br>
<br>
<br>
やっちゃダメなダメ・コードも記載しておきます。絶対やっちゃダメだよｗ<br>
配列多すぎ。orz<br>
<br>
<br>
[ アプリケーション名・バージョン・HotFix情報を取得する変なC#コード ]<br>
----------------------------------------<br>
private void setApplicationReg() {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string[] val1 = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string[] val2 = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string[] val3 = null;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ArrayList application;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ArrayList applicationVersion;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ArrayList hotfix;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
application = new ArrayList(); // application<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
applicationVersion = new ArrayList(); // applicationVersion<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hotfix = new ArrayList(); // HotFix<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//HotFix情報<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string root = "root\\CIMV2";<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string query = "SELECT * FROM Win32_QuickFixEngineering WHERE
ServicePackInEffect &lt;&gt; '' AND InstalledBy
&lt;&gt; ''";<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ManagementObjectSearcher searcher = new ManagementObjectSearcher(root,
query);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int cnt = 0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
foreach (ManagementObject queryObj in searcher.Get()) { cnt++; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val1 = new string[cnt];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int i=0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
foreach (ManagementObject queryObj in searcher.Get()) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val1[i] = (string)queryObj["HotFixID"];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
i++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}catch(Exception e){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string error = e.StackTrace;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//Console.WriteLine(e.StackTrace);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//アプリケーション情報<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string reg = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\";<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string regValue = "DisplayName";<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RegistryKey regKey = Registry.LocalMachine.OpenSubKey(reg);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string[] subkey = regKey.GetSubKeyNames();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int max = subkey.Length;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
regKey.Close();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//アプリケーションの総数<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val2 = new string[max];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val3 = new string[max];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RegistryKey _subRegKey = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
int i = 0;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
foreach (string keyName in subkey) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
_subRegKey = Registry.LocalMachine.OpenSubKey(reg + keyName);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if ((string)_subRegKey.GetValue(regValue) != null) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val2[i] = (string)_subRegKey.GetValue("DisplayName");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val3[i] = (string)_subRegKey.GetValue("DisplayVersion");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
i++;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
_subRegKey.Close();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} catch (NullReferenceException e) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string error = e.StackTrace;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//Console.WriteLine(e.StackTrace);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (int i = 0; i &lt; val2.Length; i++) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if(val2[i] != null){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for(int j = 0; j &lt; val1.Length; j++){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (val2[i].Contains(val1[j])) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hotfix.Add(val2[i]);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val2[i] = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val3[i] = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}else if(val2[i].Contains("KB")){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hotfix.Add(val2[i]);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val2[i] = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
val3[i] = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
foreach(string _val in val2){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if( _val == null){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} else {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
application.Add(_val);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
foreach (string _val in val3) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (_val == null) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} else {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
applicationVersion.Add(_val);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
application.TrimToSize();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
applicationVersion.TrimToSize();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hotfix.TrimToSize();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
application.Sort();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (int i = 0; i &lt; application.Count; i++ ) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (application[i].Equals(application[i + 1])) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
application.RemoveAt(i);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}catch(Exception){<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
application.TrimToSize();<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
this.application = new string[application.Count];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
this.applicationVersion = new string[applicationVersion.Count];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
this.hotfix = new string[hotfix.Count];<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (int i = 0; i &lt; application.Count; i++) {
this.application[i] = (string)application[i]; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (int i = 0; i &lt; applicationVersion.Count; i++) {
this.applicationVersion[i] = (string)applicationVersion[i]; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for (int i = 0; i &lt; hotfix.Count; i++) { this.hotfix[i] =
(string)hotfix[i]; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} catch (NullReferenceException ne) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Console.WriteLine(ne.StackTrace);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
----------------------------------------<br>
<br>
<br>
<br>
もうちょっとだけ続くんじゃ。<br>
<br>
<br>
ダメじゃない方のコードをコンパイルすると、DLLとtlbファイルが出来ますので、その2つをVC++のプロジェクトで使用します。<br>
<br>
で、結局このDLLってどうなるのっ？ってことなのですが、「Visual Studioコマンドプロンプト」というのがあります。<br>
このDOS窓で、oleviewと入力すると、COMを使用しているアプリケーションやコンポーネントが見れたりします。<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="oleview.png" src="http://community.giga-works.com/2012/01/29/oleview.png" width="762" height="373" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
えー、2ページ目に続きますが、今度はVC++を使って、AIRアプリとを繋ぐDLLを作成していきます。<br>
<br>
]]>
        
    </content>
</entry>

<entry>
    <title>BlazeDS + SpringFramework + MyBatis + HSQLDBの連携 / Annotation編</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/flex/-blazeds-springframework-mybatis-hsqldb-annotation.html" />
    <id>tag:community.giga-works.com,2011://3.162</id>

    <published>2011-10-31T14:31:30Z</published>
    <updated>2011-10-31T14:33:47Z</updated>

    <summary>【 BlazeDS + SpringFramework + MyBatis + ...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Java" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[【 BlazeDS + SpringFramework + MyBatis + HSQLDBの連携 】<br>
      <br>
      <br>
      <br>
      Spring Framework3.0.5 - DI(Dependency Injection)コンテナ<br>
      MyBatis3.0.6 - O/R Mapper<br>
      HSQLDB2.2.5 - Java製RDB<br>
      <br>
      <br>
      <br>
      Spring2.0.x + iBatis2.x + HSQLDB1.8.xを Spring3.0.5 + MyBatis3.0.6
      + HSQLDB2.2.5で置き換えてみました。<br>
      こちらはAnnotationベースでの実装となります。<br>
      <br>
      DBのScirpt, FlexのMXML・ASは変わりませんので、XMLベースで実装したドキュメントを参考にして下さい。<br>
      MyBatisを使用して、Annotationベースの実装を2種類(Annotation指定のものと、
      SelectBuilder/SqlBuilderを使用したもの)試してみました。<br>
      XML書かなくていいので、こちらの方が便利ではあるけれど、ソース追いかけるのがヤヤコシイかな？<br>
      <br>
      <br>
      <br>
      [ web.xml ]<br>
      ---<br>
      &lt;?xml version="1.0"?&gt;<br>
      &lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
      Application 2.3//EN"<br>
      &nbsp;&nbsp;&nbsp; "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;<br>
      <br>
      &lt;web-app&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;display-name&gt;Spring
      BlazeDS&lt;/display-name&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;context-param&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/context-param&gt;<br>
      <br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;!-- Filter config with GZIP --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;filter&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;filter-name&gt;CompressingFilter&lt;/filter-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;filter-class&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      com.planetj.servlet.filter.compression.CompressingFilter<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/filter-class&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;init-param&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;param-name&gt;debug&lt;/param-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;param-value&gt;false&lt;/param-value&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/init-param&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;init-param&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;param-name&gt;statsEnabled&lt;/param-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;param-value&gt;false&lt;/param-value&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/init-param&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/filter&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;filter-mapping&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;filter-name&gt;CompressingFilter&lt;/filter-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/filter-mapping&gt;<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &lt;listener&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;<br>&nbsp;&nbsp;&nbsp;
      &lt;/listener&gt;<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &lt;servlet&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;servlet-name&gt;MessageBrokerServlet&lt;/servlet-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;servlet-class&gt;flex.messaging.MessageBrokerServlet&lt;/servlet-class&gt;<br>&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &lt;init-param&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;param-name&gt;services.configuration.file&lt;/param-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;param-value&gt;/WEB-INF/flex/services-config.xml&lt;/param-value&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/init-param&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/servlet&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;servlet&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;servlet-name&gt;HttpContextUtilServlet&lt;/servlet-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;servlet-class&gt;com.chocbanana.http.HttpContextUtilServlet&lt;/servlet-class&gt;<br>&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp;
      &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/servlet&gt;<br>
      <br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;servlet-mapping&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;servlet-name&gt;MessageBrokerServlet&lt;/servlet-name&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;url-pattern&gt;/messagebroker/*&lt;/url-pattern&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/servlet-mapping&gt;<br>
      &lt;/web-app&gt;<br>
      [ EOF ]<br>
      ---<br>
      <br>
      [ HttpContextUtilServlet.java ]<br>
      ---<br>
      package com.chocbanana.http;<br>
      <br>
      import java.io.Serializable;<br>
      <br>
      import javax.servlet.ServletException;<br>
      <br>
      import org.springframework.web.context.WebApplicationContext;<br>
      import
      org.springframework.web.context.support.WebApplicationContextUtils;<br>
      <br>
      <br>
      public class HttpContextUtilServlet extends
      javax.servlet.http.HttpServlet implements Serializable {<br>
      <br>
      &nbsp;&nbsp;&nbsp; private static WebApplicationContext ctx;<br>
      &nbsp;&nbsp;&nbsp; /**<br>
      &nbsp;&nbsp;&nbsp; &nbsp;* <br>
      &nbsp;&nbsp;&nbsp; &nbsp;*/<br>
      &nbsp;&nbsp;&nbsp; private static final long serialVersionUID =
      1L;<br>
      <br>
      &nbsp;&nbsp;&nbsp; @Override<br>
      &nbsp;&nbsp;&nbsp; public void destroy() {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated
      method stub<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      //dao.shutdown();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      e.printStackTrace();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; super.destroy();<br>
      &nbsp;&nbsp;&nbsp; }<br>
      <br>
      &nbsp;&nbsp;&nbsp; @Override<br>
      &nbsp;&nbsp;&nbsp; public synchronized void init() throws
      ServletException {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated
      method stub<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; super.init();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(ctx ==
      null) ctx =
WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());<br>&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      e.printStackTrace();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; public synchronized static
      WebApplicationContext getContext(){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return ctx;<br>
      &nbsp;&nbsp;&nbsp; }<br>
      }<br>
      [ EOF ]<br>
      ---<br>
      <br>
      <br>
      <br>
      [ applicationContext.xml ]<br>
      ---<br>
      &lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
      &lt;beans xmlns="http://www.springframework.org/schema/beans"<br>
      &nbsp;&nbsp;&nbsp;
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br>
      &nbsp;&nbsp;&nbsp;
      xmlns:tx="http://www.springframework.org/schema/tx"<br>
      &nbsp;&nbsp;&nbsp;
      xmlns:context="http://www.springframework.org/schema/context"<br>
      &nbsp;&nbsp;&nbsp;
      xsi:schemaLocation="http://www.springframework.org/schema/beans<br>
      &nbsp;&nbsp;
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd<br>
      &nbsp;&nbsp; http://www.springframework.org/schema/tx<br>
      &nbsp;&nbsp;
      http://www.springframework.org/schema/tx/spring-tx-3.0.xsd<br>
      &nbsp;&nbsp; http://www.springframework.org/schema/context<br>
      &nbsp;&nbsp;
http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;<br><br>
      &nbsp;&nbsp;&nbsp; &lt;!-- jdbc.propertiesを認識させる
      propertyConfigurer --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;bean id="propertyConfigurer"<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;<br>&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &lt;property name="locations"&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;list&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &lt;value&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      classpath:/com/chocbanana/dao/database.properties<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &lt;/value&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &lt;/list&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/property&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;!-- jdbc.propertiesの設定値をdataSourceにインジェクション
      --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;bean id="dataSource"<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property
      name="driverClassName" value="${db.driver}" /&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property name="url"
      value="${db.url}" /&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property name="username"
      value="${db.user}" /&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property name="password"
      value="${db.pass}" /&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;!-- Dao Mapperのサービスクラス・パッケージをコンポーネントスキャンだぜ！
      --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;context:component-scan
      base-package="com.chocbanana.dao.service"/&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;<br>
      &nbsp;&nbsp;&nbsp; &lt;!-- enable autowire --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;context:annotation-config /&gt;<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &lt;bean id="sqlSessionFactory"
      class="org.mybatis.spring.SqlSessionFactoryBean"&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property
      name="dataSource" ref="dataSource" /&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &lt;!-- トランザクション制御のインターセプターを構成 --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;bean id="transactionManager"<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;<br>&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &lt;property name="dataSource" ref="dataSource"
      /&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &lt;!--
      実装クラスのTransactionalアノテーションでジョイントポイントの認識をさせる&nbsp; --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;!--
      @transaction-managerのデフォルトは"transactionManager"だが念のため指定&nbsp;
      --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;!--
      @proxy-target-classをtureにしておく。CGLIBでプロキシーを作る方が多少速いらしい --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;!-- --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;tx:annotation-driven
      transaction-manager="transactionManager" proxy-target-class="true"
      /&gt;<br>
      &nbsp;&nbsp;&nbsp; <br>
      <br>
      &nbsp;&nbsp;&nbsp; &lt;!-- アノテーションベースのMapper --&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;!--<br>
      &nbsp;&nbsp;&nbsp; &nbsp;- コンポーネントスキャンでスキャンだぜ。Injectionされるだぜー。<br>
      &nbsp;&nbsp;&nbsp; &nbsp;- MyBatisのDAO Mapperです。<br>
      &nbsp;&nbsp;&nbsp; --&gt;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&lt;bean
      class="org.mybatis.spring.mapper.MapperScannerConfigurer"&gt;<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;property
      name="basePackage" value="com.chocbanana.dao.mapper" /&gt;<br>
      &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
      &lt;/beans&gt;<br>
      [ EOF ]<br>
      ---<br>
      <br>
      <br>
      [ database.properties ]<br>
      ---<br>
      #Wed Apr 01 22:43:23 JST 2009<br>
      db.pass=<br>
#db.url=jdbc\:hsqldb\:file:/Users/hoehoe/Documents/workspace/WEB-INF/resource/db<br>
      db.url=jdbc\:hsqldb\:file:C:/Documents and Settings/hoehoe/My
      Documents/EclipseProject/SpringBlazeDS/WEB-INF/resource/db<br>
      db.driver=org.hsqldb.jdbc.JDBCDriver<br>
      db.user=sa<br>
      [ EOF ]<br>
      ---<br>
      <br>
      <br>
      [ DaoMapper.java ]<br>
      ---<br>
      package com.chocbanana.dao.mapper;<br>
      <br>
      import java.util.ArrayList;<br>
      <br>
      import org.apache.ibatis.annotations.Insert;<br>
      import org.apache.ibatis.annotations.InsertProvider;<br>
      import org.apache.ibatis.annotations.Select;<br>
      import org.apache.ibatis.annotations.SelectProvider;<br>
      import org.springframework.dao.DataAccessException;<br>
      <br>
      import com.chocbanana.bean.PostMessage;<br>
      <br>
      public interface DaoMapper {<br>
      <br>
      &nbsp;&nbsp;&nbsp; /* Annotation base */<br>
      &nbsp;&nbsp;&nbsp; @Select("SELECT TOP 1000 * FROM MESSAGE ORDER
      BY ID DESC")<br>
      &nbsp;&nbsp;&nbsp; ArrayList&lt;PostMessage&gt; getMessages()
      throws DataAccessException;<br>
      <br>
      &nbsp;&nbsp;&nbsp; @Insert("INSERT INTO MESSAGE (NAME, MAIL,
      MESSAGE, DAY) VALUES (#{name}, #{mail}, #{message}, #{day})")<br>
      &nbsp;&nbsp;&nbsp; int putMessages(PostMessage Message) throws
      DataAccessException;<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; /* SelectBuilder and SqlBuilder base&nbsp; */<br>
      &nbsp;&nbsp;&nbsp;
      @SelectProvider(type=com.chocbanana.dao.provider.SelectProvider.class,
      method="selectMessage")<br>
      &nbsp;&nbsp;&nbsp; ArrayList&lt;PostMessage&gt; selectMessages()
      throws DataAccessException;<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp;
      @SelectProvider(type=com.chocbanana.dao.provider.SelectProvider.class,
      method="selectOne")<br>
      &nbsp;&nbsp;&nbsp; PostMessage selectOne(PostMessage message)
      throws DataAccessException;<br>
      <br>
      &nbsp;&nbsp;&nbsp;
      @InsertProvider(type=com.chocbanana.dao.provider.SqlProvider.class,
      method="insertMessage")<br>
      &nbsp;&nbsp;&nbsp; int insertMessages(PostMessage messge) throws
      DataAccessException;<br>
      &nbsp;&nbsp;&nbsp; <br>
      }<br>
      [ EOF ]<br>
      ---<br>
      <br>
      [ SelectProvider.java ]<br>
      ---<br>
      package com.chocbanana.dao.provider;<br>
      <br>
      import static org.apache.ibatis.jdbc.SelectBuilder.BEGIN;<br>
      import static org.apache.ibatis.jdbc.SelectBuilder.FROM;<br>
      import static org.apache.ibatis.jdbc.SelectBuilder.SELECT;<br>
      import static org.apache.ibatis.jdbc.SelectBuilder.SQL;<br>
      import static org.apache.ibatis.jdbc.SelectBuilder.ORDER_BY;<br>
      import static org.apache.ibatis.jdbc.SelectBuilder.WHERE;<br>
      <br>
      import com.chocbanana.bean.PostMessage;<br>
      <br>
      public class SelectProvider {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;public static String selectMessage() {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;BEGIN();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SELECT("TOP 1000 * ");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;FROM("MESSAGE");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ORDER_BY("ID DESC");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return SQL();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;}<br>
      <br>
      &nbsp;&nbsp;&nbsp; &nbsp;public static String
      selectOne(PostMessage message) {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;BEGIN();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;SELECT("*");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;FROM("MESSAGE");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;WHERE("ID like
      #{id}");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return SQL();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;}<br>
      }<br>
      [ EOF ]<br>
      ---<br>
      <br>
      <br>
      [ SqlProvider.java ]<br>
      ---<br>
      package com.chocbanana.dao.provider;<br>
      <br>
      import static org.apache.ibatis.jdbc.SelectBuilder.BEGIN;<br>
      import static org.apache.ibatis.jdbc.SqlBuilder.INSERT_INTO;<br>
      import static org.apache.ibatis.jdbc.SqlBuilder.VALUES;<br>
      import static org.apache.ibatis.jdbc.SqlBuilder.SQL;<br>
      <br>
      import com.chocbanana.bean.PostMessage;<br>
      <br>
      public class SqlProvider {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;public static String
      insertMessage(PostMessage message){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;BEGIN();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;INSERT_INTO("MESSAGE");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;VALUES("NAME, MAIL,
      MESSAGE, DAY", "#{name}, #{mail}, #{message}, #{day}");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return SQL();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;}<br>
      }<br>
      [ EOF ]<br>
      ---<br>
      <br>
      <br>
      [ FooService.java ]<br>
      ---<br>
      package com.chocbanana.dao.service;<br>
      <br>
      import java.util.ArrayList;<br>
      import org.springframework.dao.DataAccessException;<br>
      import org.springframework.transaction.annotation.Transactional;<br>
      <br>
      import com.chocbanana.bean.PostMessage;<br>
      <br>
      @Transactional<br>
      public interface FooService {<br>
      &nbsp;&nbsp;&nbsp; public ArrayList&lt;PostMessage&gt;
      getMessages() throws DataAccessException;<br>
      &nbsp;&nbsp;&nbsp; public int putMessages(PostMessage Message)
      throws DataAccessException;<br>
      &nbsp;&nbsp;&nbsp; public ArrayList&lt;PostMessage&gt;
      selectMessages() throws DataAccessException;<br>
      &nbsp;&nbsp;&nbsp; public PostMessage selectOne(PostMessage
      message) throws DataAccessException;<br>
      &nbsp;&nbsp;&nbsp; public int insertMessages(PostMessage messge)
      throws DataAccessException;<br>
      }<br>
      <br>
      [ EOF ]<br>
      ---<br>
      <br>
      [ FooServiceImpl.java ]<br>
      ---<br>
      package com.chocbanana.dao.service;<br>
      <br>
      import java.util.ArrayList;<br>
      <br>
      import org.springframework.beans.factory.annotation.Autowired;<br>
      import org.springframework.dao.DataAccessException;<br>
      import org.springframework.stereotype.Service;<br>
      <br>
      import com.chocbanana.bean.PostMessage;<br>
      import com.chocbanana.dao.mapper.DaoMapper;<br>
      <br>
      @Service("fooService")<br>
      public class FooServiceImpl implements FooService {<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; @Autowired<br>
      &nbsp;&nbsp;&nbsp; private DaoMapper daoMapper;<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; public void setDaoMapper(DaoMapper daoMapper){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this.daoMapper = daoMapper;<br>
      &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; public ArrayList&lt;PostMessage&gt;
      getMessages() throws DataAccessException{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return
      this.daoMapper.getMessages();<br>
      &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; public int putMessages(PostMessage Message)
      throws DataAccessException{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return
      this.daoMapper.putMessages(Message);&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; public ArrayList&lt;PostMessage&gt;
      selectMessages() throws DataAccessException{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return
      this.daoMapper.selectMessages();<br>
      &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; public PostMessage selectOne(PostMessage
      message) throws DataAccessException{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return
      this.daoMapper.selectOne(message);<br>
      &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; public int insertMessages(PostMessage messge)
      throws DataAccessException{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return
      this.daoMapper.insertMessages(messge);<br>
      &nbsp;&nbsp;&nbsp; }<br>
      }<br>
      [ EOF ]<br>
      ---<br>
      <br>
      <br>
      <br>
      [ FlexService.java ]<br>
      ---<br>
      package com.chocbanana.ws;<br>
      <br>
      import java.text.SimpleDateFormat;<br>
      import java.util.ArrayList;<br>
      <br>
      import javax.annotation.Resource;<br>
      <br>
      import com.chocbanana.bean.*;<br>
      import com.chocbanana.dao.Db2DaoInterface;<br>
      import com.chocbanana.dao.service.FooService;<br>
      import com.chocbanana.http.HttpContextUtilServlet;<br>
      <br>
      @SuppressWarnings("serial")<br>
      public class FlexService implements java.io.Serializable{<br>
      <br>
      &nbsp;&nbsp;&nbsp; @Resource<br>
      &nbsp;&nbsp;&nbsp; private static FooService service;<br>
      <br>
      &nbsp;&nbsp;&nbsp; private static final String
      BEAN_TYPE="fooService";<br>
      <br>
      &nbsp;&nbsp;&nbsp; public FlexService(){ <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; service = (FooService)
      HttpContextUtilServlet.getContext().getBean(BEAN_TYPE);<br>
      &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; public ArrayList&lt;ResultMessage&gt;
      getMessages(){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      ArrayList&lt;ResultMessage&gt; result = new
      ArrayList&lt;ResultMessage&gt;();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      ArrayList&lt;PostMessage&gt; list;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; list =
      service.selectMessages(); /* service.getMessages(); */ <br>
      <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      java.util.Iterator&lt;PostMessage&gt; it = list.iterator();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      ResultMessage resultMsg = null;<br>
      <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      while(it.hasNext()){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; PostMessage _msg = it.next();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; resultMsg = new ResultMessage();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; resultMsg.setMessage(<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      _msg.getId() +&nbsp; " " + <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      _msg.getName() + " " + <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      _msg.getMail() + " " + <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      _msg.getDay() + " " + "\n\n" + <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      _msg.getMessage());<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp; result.add(resultMsg);<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      e.printStackTrace();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return result;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; public int putMessages(PostMessage message) {<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int ret=0;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String day = "";<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SimpleDateFormat format =
      new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; day = format.format(new
      java.util.Date());<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; message.setDay(day);<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      if("".equals(message.getMessage())){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 0;<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ret =
      service.insertMessages(message); /* service.putMessages(message);
      */ <br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      e.printStackTrace();<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return
      ret;<br>
      &nbsp;&nbsp;&nbsp; }<br>
      }<br>
      [ EOF ]<br>
      ---<br>
    </p>]]>
        
    </content>
</entry>

<entry>
    <title>BlazeDS + SpringFramework + MyBatis + HSQLDBの連携</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/flex/blazeds-springframework-mybatis-hsqldb.html" />
    <id>tag:community.giga-works.com,2011://3.161</id>

    <published>2011-10-31T14:29:10Z</published>
    <updated>2011-10-31T14:31:04Z</updated>

    <summary> 【 BlazeDS + SpringFramework + MyBatis +...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Java" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[ 【 BlazeDS + SpringFramework + MyBatis + HSQLDBの連携 】<br>
    <br>
    <br>
    <br>
    Spring Framework3.0.5 - DI(Dependency Injection)コンテナ<br>
    MyBatis3.0.6 - O/R Mapper<br>
    HSQLDB2.2.5 - Java製RDB<br>
    <br>
    <br>
    <br>
    Spring2.0.x + iBatis2.x + HSQLDB1.8.xを Spring3.0.5 + MyBatis3.0.6 +
    HSQLDB2.2.5で置き換えてみました。<br>
    こちらはXMLベースでの実装となります。<br>
    <br>
    packageの階層に注意してください。<br>
    <br>
    <br>
    <br>
    [ db.script -抜粋- ]<br>
    ---<br>
    CREATE CACHED TABLE MESSAGE(<br>
    &nbsp;&nbsp;&nbsp; ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START
    WITH 1) NOT NULL PRIMARY KEY,<br>
    &nbsp;&nbsp;&nbsp; NAME VARCHAR(255) NOT NULL,<br>
    &nbsp;&nbsp;&nbsp; MAIL VARCHAR(255) NOT NULL,<br>
    &nbsp;&nbsp;&nbsp; MESSAGE VARCHAR(65535) NOT NULL,<br>
    &nbsp;&nbsp;&nbsp; DAY VARCHAR(255) NOT NULL<br>
    &nbsp;&nbsp;&nbsp; );<br>
    [ EOF ]<br>
    ---<br>
    <br>
    <br>
    <br>
    [ web.xml ]<br>
    ---<br>
    &lt;?xml version="1.0"?&gt;<br>
    &lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
    Application 2.3//EN"<br>
    &nbsp;&nbsp;&nbsp; "http://java.sun.com/dtd/web-app_2_3.dtd"&gt;<br>
    <br>
    &lt;web-app&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;display-name&gt;Spring
    BlazeDS&lt;/display-name&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;!-- Contextに渡すXML --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;context-param&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;param-value&gt;/WEB-INF/applicationContext-xml.xml&lt;/param-value&gt;<br>&nbsp;&nbsp;&nbsp;
    &lt;/context-param&gt;<br>
    <br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;!-- Filter config with GZIP --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;filter&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;filter-name&gt;CompressingFilter&lt;/filter-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;filter-class&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    com.planetj.servlet.filter.compression.CompressingFilter<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/filter-class&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;init-param&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;param-name&gt;debug&lt;/param-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;param-value&gt;false&lt;/param-value&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/init-param&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;init-param&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;param-name&gt;statsEnabled&lt;/param-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;param-value&gt;false&lt;/param-value&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/init-param&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/filter&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;filter-mapping&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;filter-name&gt;CompressingFilter&lt;/filter-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/filter-mapping&gt;<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;listener&gt;<br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;<br>&nbsp;&nbsp;&nbsp;
    &lt;/listener&gt;<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;servlet&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;servlet-name&gt;MessageBrokerServlet&lt;/servlet-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;servlet-class&gt;flex.messaging.MessageBrokerServlet&lt;/servlet-class&gt;<br>&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &lt;init-param&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;param-name&gt;services.configuration.file&lt;/param-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;param-value&gt;/WEB-INF/flex/services-config.xml&lt;/param-value&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/init-param&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/servlet&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;servlet&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;servlet-name&gt;HttpContextUtilServlet&lt;/servlet-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;servlet-class&gt;com.chocbanana.http.HttpContextUtilServlet&lt;/servlet-class&gt;<br>&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &lt;load-on-startup&gt;2&lt;/load-on-startup&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/servlet&gt;<br>
    <br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;servlet-mapping&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;servlet-name&gt;MessageBrokerServlet&lt;/servlet-name&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;url-pattern&gt;/messagebroker/*&lt;/url-pattern&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/servlet-mapping&gt;<br>
    &lt;/web-app&gt;<br>
    [EOF]<br>
    ---<br>
    <br>
    <br>
    [ HttpContextUtilServlet.java ]<br>
    ---<br>
    package com.chocbanana.http;<br>
    <br>
    import java.io.Serializable;<br>
    <br>
    import javax.servlet.ServletException;<br>
    <br>
    import org.springframework.web.context.WebApplicationContext;<br>
    import
    org.springframework.web.context.support.WebApplicationContextUtils;<br>
    <br>
    <br>
    public class HttpContextUtilServlet extends
    javax.servlet.http.HttpServlet implements Serializable {<br>
    <br>
    &nbsp;&nbsp;&nbsp; private static WebApplicationContext ctx;<br>
    &nbsp;&nbsp;&nbsp; /**<br>
    &nbsp;&nbsp;&nbsp; &nbsp;* <br>
    &nbsp;&nbsp;&nbsp; &nbsp;*/<br>
    &nbsp;&nbsp;&nbsp; private static final long serialVersionUID = 1L;<br>
    <br>
    &nbsp;&nbsp;&nbsp; @Override<br>
    &nbsp;&nbsp;&nbsp; public void destroy() {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated method
    stub<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    //dao.shutdown();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    e.printStackTrace();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; super.destroy();<br>
    &nbsp;&nbsp;&nbsp; }<br>
    <br>
    &nbsp;&nbsp;&nbsp; @Override<br>
    &nbsp;&nbsp;&nbsp; public synchronized void init() throws
    ServletException {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // TODO Auto-generated method
    stub<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; super.init();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(ctx ==
    null) ctx =
WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());<br>&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    e.printStackTrace();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; public synchronized static WebApplicationContext
    getContext(){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return ctx;<br>
    &nbsp;&nbsp;&nbsp; }<br>
    }<br>
    [EOF]<br>
    ---<br>
    <br>
    <br>
    [ applicationContext.xml ]<br>
    ---<br>
    &lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
    &lt;beans xmlns="http://www.springframework.org/schema/beans"<br>
    &nbsp;&nbsp;&nbsp;
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br>
    &nbsp;&nbsp;&nbsp;
    xmlns:tx="http://www.springframework.org/schema/tx"<br>
    &nbsp;&nbsp;&nbsp;
    xsi:schemaLocation="http://www.springframework.org/schema/beans<br>
    &nbsp;&nbsp;
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd<br>
    &nbsp;&nbsp; http://www.springframework.org/schema/tx<br>
    &nbsp;&nbsp;
    http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;!-- jdbc.propertiesを認識させる propertyConfigurer
    --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;bean id="propertyConfigurer"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;<br>&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &lt;property name="locations"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;list&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &lt;value&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    classpath:/com/chocbanana/dao/database.properties<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &lt;/value&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;/list&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/property&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;!-- jdbc.propertiesの設定値をdataSourceにインジェクション
    --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;bean id="dataSource"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property
    name="driverClassName" value="${db.driver}" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property name="url"
    value="${db.url}" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property name="username"
    value="${db.user}" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property name="password"
    value="${db.pass}" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;!--
    MyBatisのフロントになるsqmMapClientを構成。プロパティ値にMapper.xmlのパスを指定するだけ --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;bean id="sqlSessionFactory"
    class="org.mybatis.spring.SqlSessionFactoryBean"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property name="dataSource"
    ref="dataSource" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property
    name="mapperLocations"
    value="classpath:/com/chocbanana/dao/Mapper.xml" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;!-- トランザクション制御のインターセプターを構成 --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;bean id="transactionManager"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;<br>&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &lt;property name="dataSource" ref="dataSource"
    /&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;!--
    実装クラスのTransactionalアノテーションでジョイントポイントの認識をさせる&nbsp; --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;!--
    @transaction-managerのデフォルトは"transactionManager"だが念のため指定&nbsp; --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;!--
    @proxy-target-classをtureにしておく。CGLIBでプロキシーを作る方が多少速いらしい --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;!-- --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;tx:annotation-driven
    transaction-manager="transactionManager" proxy-target-class="true"
    /&gt;<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;!-- XMLベースのDAO --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;bean id="daoXml"
    class="com.chocbanana.dao.Db2Dao"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;property
    name="sqlSessionFactory" ref="sqlSessionFactory" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/bean&gt;<br>
    &lt;/beans&gt;<br>
    [EOF]<br>
    ---<br>
    <br>
    [ database.properties ]<br>
    ---<br>
    #Wed Apr 01 22:43:23 JST 2009<br>
    db.pass=<br>
#db.url=jdbc\:hsqldb\:file:/Users/hoehoe/Documents/workspace/WEB-INF/resource/db<br>
    db.url=jdbc\:hsqldb\:file:C:/Documents and Settings/hoehoe/My
    Documents/EclipseProject/SpringBlazeDS/WEB-INF/resource/db<br>
    db.driver=org.hsqldb.jdbc.JDBCDriver<br>
    db.user=sa<br>
    [EOF]<br>
    ---<br>
    <br>
    <br>
    <br>
    <br>
    [ Db2DaoInterface.java ]<br>
    ---<br>
    /*<br>
    &nbsp;* Created on 2005/06/19<br>
    &nbsp;*<br>
    &nbsp;* TODO To change the template for this generated file go to<br>
    &nbsp;* Window - Preferences - Java - Code Style - Code Templates<br>
    &nbsp;*/<br>
    package com.chocbanana.dao;<br>
    <br>
    import java.util.ArrayList;<br>
    <br>
    import org.springframework.dao.DataAccessException;<br>
    import com.chocbanana.bean.PostMessage;<br>
    /**<br>
    &nbsp;* @author hoehoe<br>
    &nbsp;*<br>
    &nbsp;* TODO To change the template for this generated type comment
    go to<br>
    &nbsp;* Window - Preferences - Java - Code Style - Code Templates<br>
    &nbsp;*/<br>
    public interface Db2DaoInterface {<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; ArrayList&lt;PostMessage&gt; getMessages() throws
    DataAccessException;<br>
    &nbsp;&nbsp;&nbsp; int putMessages(PostMessage Message) throws
    DataAccessException;<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; void shutdown() throws DataAccessException;<br>
    &nbsp;&nbsp;&nbsp; <br>
    }<br>
    [EOF]<br>
    ---<br>
    <br>
    [ Db2Dao.java ]<br>
    ---<br>
    /*<br>
    &nbsp;* Created on 2005/06/18<br>
    &nbsp;*<br>
    &nbsp;* TODO To change the template for this generated file go to<br>
    &nbsp;* Window - Preferences - Java - Code Style - Code Templates<br>
    &nbsp;*/<br>
    package com.chocbanana.dao;<br>
    <br>
    import java.sql.SQLException;<br>
    import java.util.ArrayList;<br>
    <br>
    import org.mybatis.spring.support.SqlSessionDaoSupport;<br>
    import org.springframework.dao.DataAccessException;<br>
    import org.springframework.transaction.annotation.Propagation;<br>
    import org.springframework.transaction.annotation.Transactional;<br>
    <br>
    import com.chocbanana.bean.PostMessage;<br>
    <br>
    /**<br>
    &nbsp;* @author hoehoe<br>
    &nbsp;*<br>
    &nbsp;* TODO To change the template for this generated type comment
    go to<br>
    &nbsp;* Window - Preferences - Java - Code Style - Code Templates<br>
    &nbsp;*/<br>
    public class Db2Dao extends SqlSessionDaoSupport implements
    Db2DaoInterface{<br>
    &nbsp;&nbsp;&nbsp; @SuppressWarnings("unchecked")<br>
    &nbsp;&nbsp;&nbsp; @Transactional(readOnly=true,
    propagation=Propagation.REQUIRED)<br>
    &nbsp;&nbsp;&nbsp; public ArrayList&lt;PostMessage&gt; getMessages()
    throws DataAccessException{<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return
    (ArrayList&lt;PostMessage&gt;)
    getSqlSession().selectList("com.chocbanana.dao.Mapper.getMessage");<br>
    &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; @Transactional(readOnly=false,
    rollbackFor=SQLException.class)<br>
    &nbsp;&nbsp;&nbsp; public int putMessages(PostMessage message)
    throws DataAccessException{<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return
    getSqlSession().insert("com.chocbanana.dao.Mapper.putMessage",
    message);<br>
    &nbsp;&nbsp;&nbsp; }<br>
    <br>
    &nbsp;&nbsp;&nbsp; public void shutdown() throws
    DataAccessException{<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    getSqlSession().selectOne("shutdown");<br>
    &nbsp;&nbsp;&nbsp; }<br>
    }<br>
    [EOF]<br>
    ---<br>
    <br>
    <br>
    [ /com/chocbanana/dao/Mapper.xml ]<br>
    ---<br>
    &lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br>
    &lt;!DOCTYPE mapper<br>
    &nbsp;&nbsp;&nbsp; PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"<br>
    &nbsp;&nbsp;&nbsp; "http://mybatis.org/dtd/mybatis-3-mapper.dtd"&gt;<br>
    &lt;!--<br>
    &nbsp;&nbsp;&nbsp; Copyright 2010-2011 The myBatis Team<br>
    <br>
    &nbsp;&nbsp;&nbsp; Licensed under the Apache License, Version 2.0
    (the "License");<br>
    &nbsp;&nbsp;&nbsp; you may not use this file except in compliance
    with the License.<br>
    &nbsp;&nbsp;&nbsp; You may obtain a copy of the License at<br>
    <br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    http://www.apache.org/licenses/LICENSE-2.0<br>
    <br>
    &nbsp;&nbsp;&nbsp; Unless required by applicable law or agreed to in
    writing, software<br>
    &nbsp;&nbsp;&nbsp; distributed under the License is distributed on
    an "AS IS" BASIS,<br>
    &nbsp;&nbsp;&nbsp; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
    either express or implied.<br>
    &nbsp;&nbsp;&nbsp; See the License for the specific language
    governing permissions and<br>
    &nbsp;&nbsp;&nbsp; limitations under the License.<br>
    --&gt;<br>
    <br>
    &lt;!--<br>
    &nbsp;&nbsp;&nbsp; version: $Id: UserMapper.xml 2444 2010-09-15
    07:38:37Z simone.tripodi $<br>
    --&gt;<br>
    &lt;mapper namespace="com.chocbanana.dao.Mapper"&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;select id="getMessage"&nbsp;
    resultType="com.chocbanana.bean.PostMessage"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SELECT TOP 1000 * FROM MESSAGE
    ORDER BY ID DESC<br>
    &nbsp;&nbsp;&nbsp; &lt;/select&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;insert id="putMessage"
    parameterType="com.chocbanana.bean.PostMessage" &gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; INSERT INTO MESSAGE (NAME,
    MAIL, MESSAGE, DAY) VALUES (#{name}, #{mail}, #{message}, #{day})<br>
    &nbsp;&nbsp;&nbsp; &lt;/insert&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;!-- database shutdown --&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;sql id="shutdown"&gt;shutdown&lt;/sql&gt;<br>
    &lt;/mapper&gt;<br>
    [EOF]<br>
    ---<br>
    <br>
    <br>
    <br>
    [ FlexService.java ]<br>
    ---<br>
    package com.chocbanana.ws;<br>
    <br>
    import java.text.SimpleDateFormat;<br>
    import java.util.ArrayList;<br>
    <br>
    import com.chocbanana.bean.*;<br>
    import com.chocbanana.dao.Db2DaoInterface;<br>
    import com.chocbanana.http.HttpContextUtilServlet;<br>
    <br>
    @SuppressWarnings("serial")<br>
    public class FlexService implements java.io.Serializable{<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; private static Db2DaoInterface dao;<br>
    &nbsp;&nbsp;&nbsp; private static final String BEAN_TYPE = "daoXml";<br>
    <br>
    &nbsp;&nbsp;&nbsp; public FlexService(){ <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dao = (Db2DaoInterface)
    HttpContextUtilServlet.getContext().getBean(BEAN_TYPE);<br>
    &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; public ArrayList&lt;ResultMessage&gt;
    getMessages(){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ArrayList&lt;ResultMessage&gt;
    result = new ArrayList&lt;ResultMessage&gt;();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    ArrayList&lt;PostMessage&gt; list = dao.getMessages();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    java.util.Iterator&lt;PostMessage&gt; it = list.iterator();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    ResultMessage resultMsg = null;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    while(it.hasNext()){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; PostMessage _msg = it.next();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; resultMsg = new ResultMessage();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; resultMsg.setMessage(<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    _msg.getId() +&nbsp; " " + <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    _msg.getName() + " " + <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    _msg.getMail() + " " + <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    _msg.getDay() + " " + "\n\n" + <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    _msg.getMessage());<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; result.add(resultMsg);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    e.printStackTrace();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return result;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; public int putMessages(PostMessage message) {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; int ret=0;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String day = "";<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SimpleDateFormat format = new
    SimpleDateFormat("yyyy/MM/dd hh:mm:ss");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; day = format.format(new
    java.util.Date());<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; message.setDay(day);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    if("".equals(message.getMessage())){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 0;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try{<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ret =
    dao.putMessages(message);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }catch(Exception e){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    e.printStackTrace();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return ret;<br>
    &nbsp;&nbsp;&nbsp; }<br>
    }<br>
    ---<br>
    <br>
    <br>
    - Flexのソースコード一覧 -<br>
    <br>
    [ SpringBlazeDS.mxml ]<br>
    ---<br>
    &lt;?xml version="1.0" encoding="utf-8"?&gt;<br>
    &lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp; xmlns:s="library://ns.adobe.com/flex/spark"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp; xmlns:mx="library://ns.adobe.com/flex/mx"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp; minWidth="950" minHeight="500"
    viewSourceURL="srcview/index.html"&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;fx:Script source="SpringBlazeDS.as"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;fx:Declarations&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;!-- Place non-visual
    elements (e.g., services, value objects) here --&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:RemoteObject id="srv"
    endpoint="{'http://{server.name}:{server.port}/SpringBlazeDS/messagebroker/amf'}"
    destination="flexService" showBusyCursor="true"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:method name="getMessages" result="resultMessage(event)"
    fault="faultMessage(event)"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/s:RemoteObject&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/fx:Declarations&gt;<br>
    <br>
    &nbsp;&nbsp;&nbsp; &lt;s:Panel x="0" y="0" width="100%"
    height="100%" title="SpringBlazeDS"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:HGroup x="10" y="10"
    width="100%" verticalAlign="middle"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Spacer width="20" height="10"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Button id="btn_post" label="Post"
    click="btn_post_clickHandler(event)"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; fontWeight="bold"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Spacer width="15" height="10"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Button id="btn_reload" label="Reload"
    click="btn_reload_clickHandler(event)"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; fontWeight="bold"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/s:HGroup&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:Spacer x="10" y="39"
    width="20" height="10"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:HGroup x="10" y="56"
    width="100%" height="85%"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:DataGrid width="100%" height="100%"
    dataProvider="{srv.getMessages.lastResult}"
    creationComplete="d1_creationCompleteHandler(event)"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &lt;s:columns&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:ArrayList&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:GridColumn dataField="message" headerText="" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/s:ArrayList&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &lt;/s:columns&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;/s:DataGrid&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Spacer width="10" height="10"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/s:HGroup&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;/s:Panel&gt;<br>
    &lt;/s:Application&gt;<br>
    [ EOF ]<br>
    ---<br>
    <br>
    <br>
    [ SpringBlazeDS.as ]<br>
    ---<br>
    <br>
    import flash.events.MouseEvent;<br>
    <br>
    import mx.controls.Alert;<br>
    import mx.events.FlexEvent;<br>
    import mx.managers.PopUpManager;<br>
    import mx.rpc.events.FaultEvent;<br>
    import mx.rpc.events.ResultEvent;<br>
    <br>
    protected function btn_post_clickHandler(event:MouseEvent):void<br>
    {<br>
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; var post:Post =
    Post(PopUpManager.createPopUp(this, Post, true));<br>
    &nbsp;&nbsp;&nbsp; post.addEventListener(FlexEvent.REMOVE,
    closePopUp);<br>
    &nbsp;&nbsp;&nbsp; PopUpManager.centerPopUp(post);<br>
    }<br>
    private function closePopUp(e:FlexEvent):void{<br>
    &nbsp;&nbsp;&nbsp; srv.getMessages();<br>
    }<br>
    <br>
    public function resultUser(event:ResultEvent):void{<br>
    <br>
    }<br>
    protected function btn_reload_clickHandler(event:MouseEvent):void<br>
    {<br>
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; srv.getMessages();<br>
    }<br>
    <br>
    protected function d1_creationCompleteHandler(event:FlexEvent):void<br>
    {<br>
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; srv.getMessages();<br>
    }<br>
    <br>
    public function resultMessage(event:ResultEvent):void{<br>
    <br>
    }<br>
    <br>
    public function faultMessage(event:FaultEvent):void{<br>
    &nbsp;&nbsp;&nbsp; Alert.show(event.toString());<br>
    }<br>
    [ EOF ]<br>
    ---<br>
    <br>
    <br>
    [ Post.mxml ]<br>
    ---<br>
    &lt;?xml version="1.0" encoding="utf-8"?&gt;<br>
    &lt;s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp; xmlns:s="library://ns.adobe.com/flex/spark"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp; xmlns:mx="library://ns.adobe.com/flex/mx"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp; width="800" height="400"
    creationComplete="t1_creationCompleteHandler(event)"
    close="t1_closeHandler(event)" title="PostMessage"&gt;<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;fx:Script&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;![CDATA[<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import
    com.chocbanana.bean.PostMessge;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import
    mx.controls.Alert;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import
    mx.events.CloseEvent;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import
    mx.events.FlexEvent;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import
    mx.managers.PopUpManager;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import
    mx.rpc.events.FaultEvent;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; import
    mx.rpc.events.ResultEvent;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protected
    function btn_cancel_clickHandler(event:MouseEvent):void<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; txt_message.text = "";<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protected
    function btn_post_clickHandler(event:MouseEvent):void<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; var post:PostMessge = new PostMessge();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; post.name = txt_name.text;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; if(post.name == ""){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; post.name =
    "以下、名無しに変わりましてfxug-nagoyaがお送りします";<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; post.mail = "sage";<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; post.message = txt_message.text;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; if(post.message == ""){<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Alert.show("本文が空です。");<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; srv.putMessages(post);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protected
    function t1_closeHandler(event:CloseEvent):void<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; PopUpManager.removePopUp(this);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protected
    function t1_creationCompleteHandler(event:FlexEvent):void<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; txt_message.setFocus();<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protected
    function method1_resultHandler(event:ResultEvent):void<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; PopUpManager.removePopUp(this);<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protected
    function method1_faultHandler(event:FaultEvent):void<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; // TODO Auto-generated method stub<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; Alert.show(event.message.toString());<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ]]&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/fx:Script&gt;<br>
    &nbsp;&nbsp;&nbsp; <br>
    &nbsp;&nbsp;&nbsp; &lt;fx:Declarations&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;!-- Place non-visual
    elements (e.g., services, value objects) here --&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:RemoteObject id="srv"
    endpoint="{'http://{server.name}:{server.port}/SpringBlazeDS/messagebroker/amf'}"
    destination="flexService" showBusyCursor="true"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:method name="putMessages"
    result="method1_resultHandler(event)"
    fault="method1_faultHandler(event)" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/s:RemoteObject&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/fx:Declarations&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;s:VGroup x="10" y="10" width="780"
    height="346"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:HGroup
    verticalAlign="middle"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:Label
    text="Name： "/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:TextInput id="txt_name" width="320"
    text="以下、名無しに変わりましてfxug-nagoyaがお送りします"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/s:HGroup&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:VGroup width="770"
    verticalAlign="bottom"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Spacer height="5" width="5" /&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:Label
    text="Message： "/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:TextArea id="txt_message" width="100%" height="200"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/s:VGroup&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:Spacer width="20"
    height="10"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;s:HGroup width="100%"
    horizontalAlign="right" verticalAlign="middle"&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Button id="btn_cancel" label="Cancel"
    click="btn_cancel_clickHandler(event)"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Spacer width="20" height="10"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Button id="btn_post" label="Post"
    click="btn_post_clickHandler(event)"<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; fontWeight="bold"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
    &lt;s:Spacer width="20" height="10"/&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/s:HGroup&gt;<br>
    &nbsp;&nbsp;&nbsp; &lt;/s:VGroup&gt;<br>
    <br>
    &lt;/s:TitleWindow&gt;<br>
    <br>
    [ EOF ]<br>
    ---<br>
    <br>
    <br>]]>
        
    </content>
</entry>

<entry>
    <title>AdobeAIRとiReportで帳票作成（見積書）</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/java/adobeairireport.html" />
    <id>tag:community.giga-works.com,2011://3.160</id>

    <published>2011-07-04T09:30:17Z</published>
    <updated>2011-07-09T02:27:07Z</updated>

    <summary><![CDATA[ 社内から帳票作成とその情報を一括管理出来るように&hellip;という要望を頂...]]></summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Java" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<br>
社内から帳票作成とその情報を一括管理出来るように&hellip;という要望を頂いたので、AdobeAIRで実装してみました。<br>
<br>
<br>
<a href="http://community.giga-works.com/2011/07/04/Demo.zip">サンプルアプリのソース</a>と
<span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://community.giga-works.com/2011/07/09/FxUG%E5%90%8D%E5%8F%A4%E5%B1%8B%E5%8B%89%E5%BC%B7%E4%BC%9A%E8%B3%87%E6%96%99_20110709.pdf">FxUG名古屋勉強会資料_20110709.pdf</a></span>
を置いておきます。<br><br><br>
必要となるJavaのライブラリ一式。<br>
----------------------<br>
aopalliance-1.0.jar<br>
asm-2.2.3.jar<br>
backport-util-concurrent.jar<br>
cglib-nodep-2.1_3.jar<br>
commons-beanutils.jar<br>
commons-collections-3.2.1.jar<br>
commons-dbcp-1.4.jar<br>
commons-digester.jar<br>
commons-fileupload-1.2.1.jar<br>
commons-io-1.3.2.jar<br>
commons-logging-1.1.1.jar<br>
commons-pool-1.5.4.jar<br>
cxf-2.2.12.jar<br>
FastInfoset-1.2.7.jar<br>
flex-messaging-common.jar<br>
flex-messaging-core.jar<br>
flex-messaging-remoting.jar<br>
freemarker-2.3.16.jar<br>
geronimo-annotation_1.0_spec-1.1.1.jar<br>
geronimo-servlet_2.5_spec-1.2.jar<br>
geronimo-stax-api_1.0_spec-1.0.1.jar<br>
geronimo-ws-metadata_2.0_spec-1.1.2.jar<br>
ibatis-2.3.4.726.jar<br>
iText-2.1.7.jar<br>
iTextAsian.jar<br>
jasperreports-4.0.1.jar<br>
jasperreports-extensions-3.5.3.jar<br>
jasperreports-fonts-4.0.1.jar<br>
javassist.jar<br>
jaxb-api-2.1.jar<br>
jaxb-impl-2.1.13.jar<br>
jcommon-1.0.16.jar<br>
jdt-compiler-3.1.1.jar<br>
log4j-1.2.16.jar<br>
log4j.dtd<br>
neethi-2.0.4.jar<br>
ognl-3.0.jar<br>
opensaml-1.1.jar<br>
pjl-comp-filter-1.7.jar<br>
poi-3.7-20101029.jar<br>
postgresql-8.3-603.jdbc4.jar<br>
saaj-api-1.3.jar<br>
saaj-impl-1.3.2.jar<br>
serializer-2.7.1.jar<br>
spring-aop.jar<br>
spring-beans.jar<br>
spring-context-support.jar<br>
spring-context.jar<br>
spring-core.jar<br>
spring-jdbc.jar<br>
spring-jms.jar<br>
spring-orm.jar<br>
spring-test.jar<br>
spring-tx.jar<br>
spring-web.jar<br>
spring-webmvc-struts.jar<br>
spring.jar<br>
sql-map-2.dtd<br>
sql-map-config-2.dtd<br>
struts2-convention-plugin-2.2.1.jar<br>
struts2-core-2.2.1.jar<br>
wsdl4j-1.6.2.jar<br>
wss4j-1.5.8.jar<br>
wstx-asl-3.2.9.jar<br>
xalan-2.7.1.jar<br>
xml-resolver-1.2.jar<br>
XmlSchema-1.4.5.jar<br>
xmlsec-1.4.3.jar<br>
xwork-core-2.2.1.jar<br>
----------------------<br>
<br>
<br>
<br>
PDFとして作成された帳票を表示。<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="pict0003.jpg" src="http://community.giga-works.com/2011/07/04/pict0003.jpg" width="1024" height="768" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
iReportでテンプレートを作成し、データを流し込んで、PDFを作成します。<br>
<br>
<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="pict0005.jpg" src="http://community.giga-works.com/2011/07/04/pict0005.jpg" width="1024" height="768" class="mt-image-none" style="" /></span>
<br>
<br>
<br>
※データは架空のものです。<br>
ご参考まで。<br>
<br>]]>
        
    </content>
</entry>

<entry>
    <title>ApacheとResinとStruts2とFlex(BlazeDS)の連携</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/java/apacheresinstruts2flexblazeds.html" />
    <id>tag:community.giga-works.com,2011://3.159</id>

    <published>2011-01-27T12:48:37Z</published>
    <updated>2011-01-27T15:39:20Z</updated>

    <summary>  ApacheとResinとStruts2とFlex(BlazeDS)の連携 ...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Apache" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Java" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[  ApacheとResinとStruts2とFlex(BlazeDS)の連携<br>
<br>
メモしときます。<br>
<br>

Project名はHello。<br>

HelloWorld ! を表示します。<br>

<br>

<br>

[ resin.conf ] <br>

----------<br>

# web-appのRoot設定<br>

&lt;web-app id="/" root-directory='C:\Documents and Settings\hoehoe\My Documents\EclipseProject\Hello'/&gt;<br>

----------<br>

<br>

<br>

[ WEB-INF/lib/ ]<br>

----------<br>

aopalliance-1.0.jar<br>

asm-2.2.3.jar<br>

backport-util-concurrent.jar<br>

cglib-nodep-2.1_3.jar<br>

commons-beanutils.jar<br>

commons-dbcp-1.4.jar<br>

commons-digester.jar<br>

commons-fileupload-1.2.1.jar<br>

commons-io-1.3.2.jar<br>

commons-logging-1.1.1.jar<br>

commons-pool-1.5.4.jar<br>

cxf-2.2.9.jar<br>

dir.txt<br>

FastInfoset-1.2.7.jar<br>

flex-messaging-common.jar<br>

flex-messaging-core.jar<br>

flex-messaging-remoting.jar<br>

freemarker-2.3.16.jar<br>

geronimo-annotation_1.0_spec-1.1.1.jar<br>

geronimo-servlet_2.5_spec-1.2.jar<br>

geronimo-stax-api_1.0_spec-1.0.1.jar<br>

geronimo-ws-metadata_2.0_spec-1.1.2.jar<br>

ibatis-2.3.4.726.jar<br>

javassist.jar<br>

jaxb-api-2.1.jar<br>

jaxb-impl-2.1.13.jar<br>

jcommon-1.0.16.jar<br>

log4j-1.2.16.jar<br>

log4j.dtd<br>

neethi-2.0.4.jar<br>

ognl-3.0.jar<br>

opensaml-1.1.jar<br>

pjl-comp-filter-1.7.jar<br>

postgresql-8.3-603.jdbc4.jar<br>

saaj-api-1.3.jar<br>

saaj-impl-1.3.2.jar<br>

serializer-2.7.1.jar<br>

spring-aop.jar<br>

spring-beans.jar<br>

spring-context-support.jar<br>

spring-context.jar<br>

spring-core.jar<br>

spring-jdbc.jar<br>

spring-jms.jar<br>

spring-orm.jar<br>

spring-test.jar<br>

spring-tx.jar<br>

spring-web.jar<br>

sql-map-2.dtd<br>

sql-map-config-2.dtd<br>

struts2-convention-plugin-2.2.1.jar<br>

struts2-core-2.2.1.jar<br>

wsdl4j-1.6.2.jar<br>

wss4j-1.5.8.jar<br>

wstx-asl-3.2.9.jar<br>

xalan-2.7.1.jar<br>

xml-resolver-1.2.jar<br>

XmlSchema-1.4.5.jar<br>

xmlsec-1.4.3.jar<br>

xwork-core-2.2.1.jar<br>

----------<br>

<br>

<br>

<br>

<br>

[ web.xml ]<br>

----------<br>

&lt;?xml version="1.0"?&gt;<br>

&lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"<br>

&nbsp;&nbsp; &nbsp;xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br>

&nbsp;&nbsp; &nbsp;xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;<br>

<br>

&nbsp;&nbsp; &nbsp;&lt;!-- Flex(BlazeDSもFilter経由。先にBlazeDSのFilterを記述しておくこと) --&gt;<br>

&nbsp;&nbsp; &nbsp;&lt;filter&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;filter-name&gt;flex&lt;/filter-name&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;filter-class&gt;hello.filter.FlexFilter&lt;/filter-class&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;init-param&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;param-name&gt;services.configuration.file&lt;/param-name&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&lt;param-value&gt;/WEB-INF/flex/services-config.xml&lt;/param-value&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/init-param&gt;<br>

&nbsp;&nbsp; &nbsp;&lt;/filter&gt;<br>

<br>

&nbsp;&nbsp; &nbsp;&lt;filter-mapping&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;filter-name&gt;flex&lt;/filter-name&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;url-pattern&gt;/messagebroker/*&lt;/url-pattern&gt;<br>

&nbsp;&nbsp; &nbsp;&lt;/filter-mapping&gt;<br>

<br>

<br>

&nbsp;&nbsp; &nbsp;&lt;filter&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;filter-name&gt;struts2&lt;/filter-name&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;filter-class&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/filter-class&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;init-param&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;param-name&gt;actionPackages&lt;/param-name&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;param-value&gt;hello.action&lt;/param-value&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/init-param&gt;<br>

&nbsp;&nbsp; &nbsp;&lt;/filter&gt;<br>

<br>

&nbsp;&nbsp; &nbsp;&lt;filter-mapping&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;filter-name&gt;struts2&lt;/filter-name&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;url-pattern&gt;/struts2/*&lt;/url-pattern&gt;<br>

&nbsp;&nbsp; &nbsp;&lt;/filter-mapping&gt;<br>

&lt;/web-app&gt;<br>

[EOF]<br>

----------<br>

<br>

<br>

Struts2の配置 アノテーションを使用するのでstruts.xmlなどは無いです。<br>

<br>

[ hello.action.HelloAction ]<br>

----------<br>

package hello.action;<br>

<br>

import org.apache.struts2.convention.annotation.Namespace;<br>

import org.apache.struts2.convention.annotation.Result;<br>

import org.apache.struts2.convention.annotation.Results;<br>

<br>

import com.opensymphony.xwork2.ActionSupport;<br>

<br>

/**<br>

&nbsp;* 相変わらず標準出力に欧米の挨拶をかますだけのアクション。<br>

&nbsp;*/<br>

@Namespace("/struts2")<br>

@Results({<br>

&nbsp;&nbsp;&nbsp; @Result(name="success", location="hello.jsp"),<br>

&nbsp;&nbsp;&nbsp; @Result(name="failure", location="error.jsp")<br>

})<br>

public class HelloAction extends ActionSupport {<br>

//public class SayHelloAction {<br>

&nbsp;&nbsp; &nbsp;private static final long serialVersionUID = 1L;<br>

<br>

&nbsp;&nbsp; &nbsp;/**<br>

&nbsp;&nbsp; &nbsp; * アクション実行メソッド。<br>

&nbsp;&nbsp; &nbsp; */<br>

&nbsp;&nbsp;&nbsp; public String execute() {<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // アクション実行の結果を文字列で返す。<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ActionSupport.SUCCESS;<br>

&nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; public String getMessage(){<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return "Hello World!!";<br>

&nbsp;&nbsp;&nbsp; }<br>

}<br>

[ EOF ]<br>

----------<br>

<br>

<br>

[ /WEB-INF/content/struts2/hello.jsp ]<br>

----------<br>

&lt;%@ page language="java" contentType="text/html; charset=UTF-8"<br>

&nbsp;&nbsp;&nbsp; pageEncoding="UTF-8"%&gt;<br>

&lt;%@ taglib prefix="s" uri="/struts-tags" %&gt;<br>

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;<br>

&lt;html&gt;<br>

&lt;head&gt;<br>

&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;<br>

&lt;title&gt;Insert title here&lt;/title&gt;<br>

&lt;/head&gt;<br>

&lt;body&gt;<br>

&lt;s:property value="message"/&gt;<br>

&lt;/body&gt;<br>

&lt;/html&gt;<br>

[ EOF ]<br>

----------<br>

<br>

<br>

[ hello.filter.FlexFilter ]<br>

----------<br>

package hello.filter;<br>

<br>

import java.io.IOException;<br>

import java.util.Enumeration;<br>

<br>

import javax.servlet.Filter;<br>

import javax.servlet.FilterChain;<br>

import javax.servlet.FilterConfig;<br>

import javax.servlet.ServletConfig;<br>

import javax.servlet.ServletException;<br>

import javax.servlet.ServletRequest;<br>

import javax.servlet.ServletResponse;<br>

import javax.servlet.http.HttpServletRequest;<br>

import javax.servlet.http.HttpServletResponse;<br>

<br>

import org.springframework.mock.web.MockServletConfig;<br>

<br>

import flex.messaging.MessageBrokerServlet;<br>

<br>

/**<br>

&nbsp;* The MessageBrokerServlet has a lower priority than Filters, regardless of the<br>

&nbsp;* url-pattern we use. For that reason I created a filter that directly extends<br>

&nbsp;* the MessageBrokerServlet but behaves as a filter. This might be quite dodgy<br>

&nbsp;* but that's the only way I found to integrate struts 2 and Adobe Flex/BlazeDS.<br>

&nbsp;* Anyone who knows a simpler way please email me at info at spltech.co.uk<br>

&nbsp;* <br>

&nbsp;* @author Armindo Cachada<br>

&nbsp;* <br>

&nbsp;*/<br>

public class FlexFilter extends MessageBrokerServlet implements Filter {<br>

<br>

&nbsp;&nbsp; &nbsp;/**<br>

&nbsp;&nbsp; &nbsp; * <br>

&nbsp;&nbsp; &nbsp; */<br>

&nbsp;&nbsp; &nbsp;private static final long serialVersionUID = 1L;<br>

<br>

&nbsp;&nbsp; &nbsp;public void destroy() {<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;super.destroy();<br>

&nbsp;&nbsp; &nbsp;}<br>

<br>

&nbsp;&nbsp; &nbsp;/**<br>

&nbsp;&nbsp; &nbsp; * If this method is called the parent service method of the<br>

&nbsp;&nbsp; &nbsp; * MessageBrokerServlet is called, which does whatever BlazeDS needs to do<br>

&nbsp;&nbsp; &nbsp; * to communicate with the flex client. Note Here that any subsequent filter<br>

&nbsp;&nbsp; &nbsp; * will not be called because I am not invoking filterChain.doFilter/ That<br>

&nbsp;&nbsp; &nbsp; * is on purpose, because if it does, the normal struts 2 action mapping<br>

&nbsp;&nbsp; &nbsp; * mechanism will be called.<br>

&nbsp;&nbsp; &nbsp; * <br>

&nbsp;&nbsp; &nbsp; */<br>

&nbsp;&nbsp; &nbsp;public void doFilter(ServletRequest servletrequest,<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ServletResponse servletresponse, FilterChain filterchain)<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;throws IOException, ServletException {<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;this.service((HttpServletRequest) servletrequest,<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;(HttpServletResponse) servletresponse);<br>

&nbsp;&nbsp; &nbsp;}<br>

<br>

&nbsp;&nbsp; &nbsp;/**<br>

&nbsp;&nbsp; &nbsp; * Note the use here of MockServletConfig. This utility class is available<br>

&nbsp;&nbsp; &nbsp; * in the spring framework. It is meant to be used for testing but I am<br>

&nbsp;&nbsp; &nbsp; * actually giving it a real purpose :)<br>

&nbsp;&nbsp; &nbsp; */<br>

&nbsp;&nbsp; &nbsp;public void init(FilterConfig filterconfig) throws ServletException {<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println("filter called");<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;MockServletConfig servletConfig = new MockServletConfig(filterconfig<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;.getServletContext());<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Enumeration filterParameters = filterconfig.getInitParameterNames();<br>

<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;while (filterParameters.hasMoreElements()) {<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;String filterParameter = (String) filterParameters.nextElement();<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;System.out.println("Found parameter: " + filterParameter);<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;String value = filterconfig.getInitParameter(filterParameter);<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;servletConfig.addInitParameter(filterParameter, value);<br>

<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;super.init(servletConfig);<br>

&nbsp;&nbsp; &nbsp;}<br>

<br>

}<br>

[ EOF ]<br>

----------<br>

<br>

<br>

[ /WEB-INF/flex/services-config.xml ]<br>

----------<br>

&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>

&lt;services-config&gt;<br>

<br>

&nbsp;&nbsp; &nbsp;&lt;services&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;!-- service要素には何でもいいからIDが要る模様 --&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;service id="remoting-service"<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;class="flex.messaging.services.RemotingService"&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;adapters&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;adapter-definition id="java-object"<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; 
&nbsp;class="flex.messaging.services.remoting.adapters.JavaAdapter"<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;default="true" /&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/adapters&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;default-channels&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;channel ref="my-amf" /&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;channel ref="my-secure-amf"/&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/default-channels&gt;<br>

<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;!-- 
destination要素のIDが mx:RemoteObjectの destination プロパティに対応する --&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;!-- リモート呼び出しを可能にしたい Beanの数だけ destination要素を記述する --&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;destination id="fxService"&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;properties&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&lt;!-- リモート呼び出ししたいJava Beansのクラス名 --&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; 
&nbsp;&lt;source&gt;hello.ws.FlexService&lt;/source&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&lt;!-- 注：この Beanはステートレスである --&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/properties&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/destination&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/service&gt;<br>

&nbsp;&nbsp; &nbsp;&lt;/services&gt;<br>

<br>

&nbsp;&nbsp; &nbsp;&lt;channels&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;channel-definition id="my-amf"<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;class="mx.messaging.channels.AMFChannel"&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;!--<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;ここで構成されたエンドポイントURLを mx:RemoteObjectの<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;endpoint プロパティにセットする<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{}内は実行時に自動で置き換えられるのでこの記述のままで良い。<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;--&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;endpoint<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;class="flex.messaging.endpoints.AMFEndpoint" /&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;properties&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&lt;add-no-cache-headers&gt;false&lt;/add-no-cache-headers&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/properties&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/channel-definition&gt;<br>

<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;!-- SSL用チャンネルの定義 --&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;channel-definition 
id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;endpoint 
url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure"
 class="flex.messaging.endpoints.SecureAMFEndpoint"/&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;properties&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&lt;add-no-cache-headers&gt;false&lt;/add-no-cache-headers&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/properties&gt;<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;/channel-definition&gt;<br>

&nbsp;&nbsp; &nbsp;&lt;/channels&gt;<br>

&lt;/services-config&gt;<br>

[ EOF ]<br>

----------<br>

<br>

<br>

[ hello.ws.FlexService ]<br>

----------<br>

package hello.ws;<br>

<br>

@SuppressWarnings("serial")<br>

public class FlexService implements java.io.Serializable{<br>

&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>

&nbsp;&nbsp;&nbsp; public FlexService(){<br>

&nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; public String sayHello(){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return "Hello World !";<br>

&nbsp;&nbsp;&nbsp; }<br>

}<br>

[ EOF ]<br>

----------<br>

<br>

<br>

<br>

Apache<br>

[ httpd.conf -Apache- ]<br>

----------<br>

#<br>

# mod_caucho Resin Configuration<br>

#<br>

#Include conf/extra/httpd-proxy.conf<br>

LoadModule caucho_module /usr/local/apache/modules/mod_caucho.so<br>

<br>

ResinConfigServer 127.0.0.1 6800<br>

CauchoConfigCacheDirectory /tmp<br>

CauchoStatus yes<br>

&lt;Location /struts2/*&gt;<br>

&nbsp; SetHandler caucho-request<br>

&lt;/Location&gt;<br>

[ EOF ]<br>

----------<br>

<br>

<br>

Flex<br>

[ Hello.mxml ]<br>

----------<br>

&lt;?xml version="1.0" encoding="utf-8"?&gt;<br>

&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" 
layout="absolute" backgroundColor="white" creationComplete="init();"&gt;<br>

&lt;mx:Script source="Hello.as"/&gt;<br>

&nbsp;&nbsp;&nbsp; &lt;mx:RemoteObject id="srv" endpoint="{lbl_endPoint.text}" destination="fxService" showBusyCursor="true"&gt;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;mx:method name="sayHello" result="resultHello(event);" fault="faultHello(event);"/&gt;<br>

&nbsp;&nbsp;&nbsp; &lt;/mx:RemoteObject&gt;<br>

&nbsp;&nbsp;&nbsp; &lt;mx:Button x="65" y="59" label="click" id="btn_message" click="btn_message_click();"/&gt;<br>

&nbsp;&nbsp;&nbsp; &lt;mx:Text x="38" y="33" id="txt_message" text="{srv.sayHello.lastResult}"/&gt;<br>

&nbsp;&nbsp;&nbsp; &lt;mx:Label x="84" y="114" id="lbl_endPoint"/&gt;<br>

&lt;/mx:Application&gt;<br>

[ EOF ]<br>

----------<br>

<br>

[ Hello.as ]<br>

----------<br>

// ActionScript file<br>

import hello.EndPoint;<br>

<br>

import mx.controls.Alert;<br>

import mx.rpc.events.FaultEvent;<br>

import mx.rpc.events.ResultEvent;<br>

<br>

private function init():void{<br>

&nbsp;&nbsp;&nbsp; lbl_endPoint.text = EndPoint.getEndPointRevers();<br>

}<br>

private function btn_message_click():void{<br>

&nbsp;&nbsp;&nbsp; srv.sayHello();<br>

}<br>

<br>

private function resultHello(event:ResultEvent):void{<br>

&nbsp;&nbsp;&nbsp; Alert.show(event.message.toString());<br>

}<br>

private function faultHello(event:FaultEvent):void{<br>

&nbsp;&nbsp;&nbsp; Alert.show(event.message.toString());<br>

}<br>

[ EOF ]<br>

----------<br>

<br>

<br>

[ hello.EndPoint.as ]<br>

----------<br>

package hello {<br>

<br>

&nbsp;&nbsp;&nbsp; import flash.external.ExternalInterface;<br>

&nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; import mx.messaging.ChannelSet;<br>

&nbsp;&nbsp;&nbsp; import mx.messaging.channels.AMFChannel;<br>

&nbsp;&nbsp;&nbsp; import mx.rpc.remoting.mxml.RemoteObject;<br>

<br>

&nbsp;&nbsp;&nbsp; public class EndPoint {<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; private static var remote:RemoteObject;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public function EndPoint() {<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //TODO: implement function<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public static function getEndPointRevers():String{<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var endPointURL:String = ExternalInterface.call("getFQDN");<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; endPointURL = endPointURL + "messagebroker/amf";<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return endPointURL;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; public static function getRemoteObject():RemoteObject{<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; //var remote:RemoteObject = new RemoteObject();<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(remote == null){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; remote = new RemoteObject();<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; var cs:ChannelSet = new ChannelSet();<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; var ac:AMFChannel = new AMFChannel("my-amf", 
EndPoint.getEndPointRevers());<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cs.addChannel(ac);<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; remote.destination = "flexService";<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; remote.channelSet = cs;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return remote;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; }<br>

}<br>

[ EOF ]<br>

----------<br>

<br>

[ index.template.html(JavaScript) ]<br>

----------<br>

&lt;script language="JavaScript" type="text/javascript"&gt;<br>

&lt;!--<br>

//------------------------------------------------------------------------------<br>

// MyScript<br>

function setTitle(){<br>

&nbsp;&nbsp;&nbsp; if(location.href.indexOf("#",0) == -1){<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.title = "IntraMaster";<br>

&nbsp;&nbsp;&nbsp; }else{<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.title = "IntraMaster";<br>

&nbsp;&nbsp;&nbsp; }<br>

}<br>

function getURL(){<br>

&nbsp;&nbsp;&nbsp; return (document.URL);<br>

}<br>

function getPort(){<br>

&nbsp;&nbsp;&nbsp; var protocol = location.protocol;<br>

&nbsp;&nbsp;&nbsp; var port = location.port;<br>

&nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; if(protocol == "http:"){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(port == ""){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; port = 80;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }else{<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; }else if(protocol == "https:"){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(port == ""){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; port = 443;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }else{<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; return port;<br>

}<br>

function getFQDN(){<br>

&nbsp;&nbsp;&nbsp; var fqdn = "";<br>

&nbsp;&nbsp;&nbsp; var hostname = location.hostname;<br>

&nbsp;&nbsp;&nbsp; var protocol = location.protocol;<br>

&nbsp;&nbsp;&nbsp; var port = location.port;<br>

&nbsp;&nbsp;&nbsp; var href= location.href;<br>

&nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; var a;<br>

&nbsp;&nbsp;&nbsp; var b;<br>

&nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; var lastIndex = href.lastIndexOf("/");<br>

&nbsp;&nbsp;&nbsp; href = href.substring(0, lastIndex);<br>

&nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; if(href.indexOf("~") == -1){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(port == ""){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fqdn = protocol + "//" + hostname + "/"<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }else{<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fqdn = protocol + "//" + hostname + ":" + port + "/"<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; }else{<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; a = href.split("//")[1];<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; b = a.split("/")[1];<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if(port == ""){<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fqdn = protocol + "//" + hostname + "/" + b;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }else{<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fqdn = protocol + "//" + hostname + ":" + port + "/" + b;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; }<br>

&nbsp;&nbsp;&nbsp; //fqdn = "http://127.0.0.1:8081/messagebroker/amf";<br>

&nbsp;&nbsp;&nbsp; return fqdn;<br>

}<br>

<br>

function getUserAgent(){<br>

&nbsp;&nbsp;&nbsp; var ua = navigator.userAgent;<br>

&nbsp;&nbsp;&nbsp; var strOS;<br>

&nbsp;&nbsp;&nbsp; <br>

&nbsp;&nbsp;&nbsp; if(ua.indexOf("Win") &gt;= 0){ strOS = "Win"; }<br>

&nbsp;&nbsp;&nbsp; else if(ua.indexOf("Mac") &gt;= 0){ strOS = "Mac"; }<br>

&nbsp;&nbsp;&nbsp; else if(ua.indexOf("Linux") &gt;= 0){ strOS = "Linux"; }<br>

&nbsp;&nbsp;&nbsp; else{ strOS = ""; }<br>

<br>

&nbsp;&nbsp;&nbsp; return strOS;<br>

}<br>

<br>

//------------------------------------------------------------------------------<br>

//--&gt;<br>

&lt;/script&gt;<br>

[ EOF ]<br>

----------<br>

&nbsp;
<br>
    Tomcatと連携する場合はApacheのコンパイル時に ./configure --enable-proxy
    --enable-proxy-ajp を有効にし、<br>
    /usr/local/apache2/conf/extra/httpd-proxy.conf を新規に作成後、以下を記述保存します。 <br>
    <br>
    以下の例では、/struts2/* ( /struts2以下のすべてのリクエスト ) に対して ProxyPass を設定しています。<br>
    <br>
    &lt;Location /struts2/&gt;<br>
    ProxyPass ajp://localhost:8009/<br>
    &lt;/Location&gt;<br>
    <br>
]]>
        
    </content>
</entry>

<entry>
    <title>最新のportsの取得と展開</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/unix-bsd-linux/ports.html" />
    <id>tag:community.giga-works.com,2010://3.156</id>

    <published>2010-12-24T16:50:57Z</published>
    <updated>2010-12-24T16:54:44Z</updated>

    <summary> 分かんなかったのでmemoさせて下さい。 $ fetch ftp://ftp....</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Unix / BSD / Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<br>
分かんなかったのでmemoさせて下さい。<br>
<br>
<strong>$ fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz</strong><br>
<strong>$ tar -zxvf ./ports.tar.gz -C /usr/</strong><br>
<br>
ISOイメージとかからしかインストールしたことが無かったのです。<br>
なのでインストール時に一緒にPortsも入れちゃってたので今まで知らなかったにょ。orz<br>
<br>]]>
        
    </content>
</entry>

<entry>
    <title>グループポリシー(GPO)が同期されない イベントID 13508 ソース NtFrs</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/windows/gpo-id-13508-ntfrs.html" />
    <id>tag:community.giga-works.com,2010://3.155</id>

    <published>2010-12-04T06:23:44Z</published>
    <updated>2010-12-04T06:26:34Z</updated>

    <summary>複数のDCがある環境でGPOが適用されないので調べてみたらDC間でGPOが同期さ...</summary>
    <author>
        <name>Gigaworks</name>
        
    </author>
    
        <category term="Windows" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[複数のDCがある環境でGPOが適用されないので調べてみたらDC間でGPOが同期されていなかった。<br />イベントログには イベントID 13508 ソース NtFrs が出てる。<br /><br />グループポリシーエディタでドメイン名を右クリックすると各DC内に保存されている設定内容が表示されるので、各DCの中の設定を比較してみるとさっき変更した部分が同期されてない。<br />複製がうまくいってないといということね。<br /><br />FRS(File Replication Service)を再起動してもダメだったので以下を参照<br /><a href="http://support.microsoft.com/kb/290762">http://support.microsoft.com/kb/290762</a><br /><br />要はSYSVOL または DFS 共有内のファイルが一貫していない場合に手動で再複製する方法です。<br /><br />手順は以下の通り<br /><br />権限のある複製（正常な方）としてFRSを停止してから<br />HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NtFrs\Parameters\Backup/Restore\Process at Startup の BurFlagsを「<b>D4</b>」(DWORD)にセット<br /><br />権限のない復元（↑のやつが複製される側）としてFRSを停止してから<br />HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NtFrs\Parameters\Backup/Restore\Process at Startup の BurFlagsを「<b>D2</b>」(DWORD)にセット<br /><br />双方のサーバーでFRSを起動すっとD4をセットしたサーバーの内容がD2へ複製されます。<br /><br />正常に同期が行われるとイベントログのファイルレプリケーションサービスに 13516 13553 13554 等が出るはず。<br /><br /><br />そもそもなんでこのエラーが起きたのか分からなかったのですが、DCをVMWareへP2Vしたタイミングな気がします。理由は不明(笑)]]>
        
    </content>
</entry>

<entry>
    <title>Apache2.2 + PHP + Python + MySQL インストール memo</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/unix-bsd-linux/apache22-php-python-mysql-memo.html" />
    <id>tag:community.giga-works.com,2010://3.154</id>

    <published>2010-10-22T17:34:59Z</published>
    <updated>2010-10-22T17:43:00Z</updated>

    <summary>コレの解決方法も兼ねて、memoしておきます。 FreeBSD7.3 + Apa...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Unix / BSD / Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<a href="http://community.giga-works.com/unix-bsd-linux/apachemod-pythonsegmentation-fault11.html">コレ</a>の解決方法も兼ねて、memoしておきます。<br>
<br>
FreeBSD7.3 + Apache2.2 + PHP5.3.3 + MySQL5.1.x + Python2.7 + mod_wsgi-3.3 で解決。<br>
<br>
<br>
&nbsp;# history<br>
&nbsp;<br>
&nbsp;&nbsp; 10&nbsp; mkdir DL<br>
&nbsp;&nbsp; 11&nbsp; cd DL/<br>
&nbsp;&nbsp; 12&nbsp; ls<br>
&nbsp;&nbsp; 13&nbsp; fetch
http://ftp.gnu.org/gnu/wget/wget-latest.tar.gz<br>
&nbsp;&nbsp; 14&nbsp; tar xzfv wget-latest.tar.gz <br>
&nbsp;&nbsp; 15&nbsp; cd wget-1.12/<br>
&nbsp;&nbsp; 16&nbsp; ./configure<br>
&nbsp;&nbsp; 17&nbsp; make<br>
&nbsp;&nbsp; 18&nbsp; make install<br>
&nbsp;&nbsp; 19&nbsp; which wget<br>
<br>
&nbsp;&nbsp; 20&nbsp; cd ..<br>
&nbsp;&nbsp; 21&nbsp; wget http://zlib.net/zlib-1.2.5.tar.gz<br>
&nbsp;&nbsp; 22&nbsp; tar xzfv zlib-1.2.5.tar.gz <br>
&nbsp;&nbsp; 23&nbsp; cd zlib-1.2.5<br>
&nbsp;&nbsp; 24&nbsp; ls<br>
&nbsp;&nbsp; 25&nbsp; ./configure <br>
&nbsp;&nbsp; 26&nbsp; make<br>
&nbsp;&nbsp; 27&nbsp; make install<br>
<br>
&nbsp;&nbsp; 28&nbsp; cd ..<br>
&nbsp;&nbsp; 29&nbsp; wget http://www.ijg.org/files/jpegsrc.v8b.tar.gz<br>
&nbsp;&nbsp; 30&nbsp; tar xzfv jpegsrc.v8b.tar.gz <br>
&nbsp;&nbsp; 31&nbsp; cd jpeg-8b/<br>
&nbsp;&nbsp; 32&nbsp; ./configure<br>
&nbsp;&nbsp; 33&nbsp; make<br>
&nbsp;&nbsp; 34&nbsp; make install<br>
<br>
&nbsp;&nbsp; 35&nbsp; cd ..<br>
&nbsp;&nbsp; 36&nbsp; wget
http://prdownloads.sourceforge.net/libpng/libpng-1.4.3.tar.gz<br>
&nbsp;&nbsp; 37&nbsp; tar xzfv libpng-1.4.3.tar.gz <br>
&nbsp;&nbsp; 38&nbsp; cd libpng-1.4.3<br>
&nbsp;&nbsp; 39&nbsp; ls<br>
&nbsp;&nbsp; 40&nbsp; ./configure<br>
&nbsp;&nbsp; 41&nbsp; make<br>
&nbsp;&nbsp; 42&nbsp; make install<br>
<br>
&nbsp;&nbsp; 43&nbsp; cd ..<br>
&nbsp;&nbsp; 44&nbsp; wget
http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.4.2.tar.gz<br>
&nbsp;&nbsp; 45&nbsp; tar xzfv freetype-2.4.2.tar.gz <br>
&nbsp;&nbsp; 46&nbsp; cd freetype-2.4.2<br>
&nbsp;&nbsp; 47&nbsp; ls<br>
&nbsp;&nbsp; 48&nbsp; ./configure <br>
&nbsp;&nbsp; 49&nbsp; cd /usr/ports/devel/gmake<br>
&nbsp;&nbsp; 50&nbsp; make<br>
&nbsp;&nbsp; 51&nbsp; make install<br>
<br>
&nbsp;&nbsp; 53&nbsp; cd DL/freetype-2.4.2<br>
&nbsp;&nbsp; 54&nbsp; GNUMAKE=gmake ./configure<br>
&nbsp;&nbsp; 55&nbsp; make<br>
&nbsp;&nbsp; 56&nbsp; gmake<br>
&nbsp;&nbsp; 57&nbsp; gmake install<br>
<br>
&nbsp;&nbsp; 58&nbsp; cd ..<br>
&nbsp;&nbsp; 59&nbsp; wget
http://www.libgd.org/releases/gd-2.0.35.tar.gz<br>
&nbsp;&nbsp; 60&nbsp; tar xzfv gd-2.0.35.tar.gz <br>
&nbsp;&nbsp; 61&nbsp; cd gd-2.0.35<br>
&nbsp;&nbsp; 62&nbsp; ./configure<br>
&nbsp;&nbsp; 63&nbsp; make<br>
&nbsp;&nbsp; 64&nbsp; make install<br>
&nbsp;&nbsp; 65&nbsp; wget
ftp://xmlsoft.org/libxml2/libxml2-git-snapshot.tar.gz<br>
&nbsp;&nbsp; 66&nbsp; mv libxml2-git-snapshot.tar.gz ../.<br>
<br>
&nbsp;&nbsp; 67&nbsp; cd ../<br>
&nbsp;&nbsp; 68&nbsp; ls<br>
&nbsp;&nbsp; 69&nbsp; tar xzfv libxml2-git-snapshot.tar.gz <br>
&nbsp;&nbsp; 70&nbsp; cd libxml2-<br>
&nbsp;&nbsp; 71&nbsp; cd libxml2-git-snapshot.tar.gz <br>
&nbsp;&nbsp; 72&nbsp; tarxzfv&nbsp; libxml2-git-snapshot.tar.gz <br>
&nbsp;&nbsp; 73&nbsp; tar xzfv&nbsp; libxml2-git-snapshot.tar.gz <br>
&nbsp;&nbsp; 74&nbsp; cd libxml2-git-snapshot.tar.gz <br>
&nbsp;&nbsp; 75&nbsp; cd libxml2-2.7.7/<br>
&nbsp;&nbsp; 76&nbsp; ./configure<br>
&nbsp;&nbsp; 77&nbsp; mkdir m4<br>
&nbsp;&nbsp; 78&nbsp; ./configure<br>
&nbsp;&nbsp; 79&nbsp; make<br>
&nbsp;&nbsp; 80&nbsp; make install<br>
&nbsp;&nbsp; 81&nbsp; which perl<br>
<br>
&nbsp;&nbsp; 82&nbsp; cd ../<br>
&nbsp;&nbsp; 83&nbsp; ls<br>
&nbsp;&nbsp; 84&nbsp; rm -rf ./*<br>
&nbsp;&nbsp; 85&nbsp; cd /usr/<br>
&nbsp;&nbsp; 86&nbsp; ls<br>
&nbsp;&nbsp; 87&nbsp; rm ports.tar.gz <br>
&nbsp;&nbsp; 88&nbsp; rm -rf ports/<br>
&nbsp;&nbsp; 89&nbsp; bg<br>
&nbsp;&nbsp; 90&nbsp; wget wget
ftp://ftp.freebsd.org/pub/FreeBSD/branches/-current/ports.tar.gz<br>
&nbsp;&nbsp; 91&nbsp; wget
ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz<br>
&nbsp;&nbsp; 92&nbsp; tar xzf ports.tar.gz <br>
&nbsp;&nbsp; 93&nbsp; cd ports/lang/perl5.12/<br>
&nbsp;&nbsp; 95&nbsp; make<br>
&nbsp;&nbsp; 96&nbsp; make test<br>
&nbsp;&nbsp; 97&nbsp; make install<br>
&nbsp;&nbsp; 98&nbsp; which perl<br>
<br>
# えー、ここまでやっといて何ですが...、webalizerをportsからインストールすれば良かったんじゃね？orz<br>
# 誰となく。<br>
<br>
<br>
&nbsp; 100&nbsp; pushd /usr/ports/databases/mysql51-server/<br>
&nbsp; 101&nbsp; make fetch<br>
&nbsp; 102&nbsp; make patch<br>
&nbsp; 103&nbsp; make<br>
&nbsp; 104&nbsp; make install<br>
&nbsp; 105&nbsp; make clean<br>
<br>
<br>
&nbsp; 112&nbsp; cd ../../lang/python27<br>
&nbsp; 113&nbsp; make fetch<br>
&nbsp; 114&nbsp; make patch<br>
&nbsp; 115&nbsp; make install clean<br>
&nbsp; 116&nbsp; make<br>
&nbsp; 117&nbsp; make install<br>
&nbsp; 118&nbsp; make clean<br>
<br>
<br>
&nbsp; 123&nbsp; pushd /usr/ports/devel/<br>
&nbsp; 134&nbsp; cd apr1/<br>
&nbsp; 135&nbsp; cat Makefile | more<br>
&nbsp; 136&nbsp; make fetch<br>
&nbsp; 137&nbsp; make<br>
&nbsp; 138&nbsp; make install clean<br>
<br>
&nbsp; 139&nbsp; cd ~/DL/<br>
&nbsp; 141&nbsp; wget http://chocbanana.com/php-5.3.3.tar.gz<br>
&nbsp; 142&nbsp; mkdir /usr/local/src<br>
&nbsp; 143&nbsp; mv php-5.3.3.tar.gz /usr/local/src/<br>
&nbsp; 144&nbsp; pushd /usr/local/src/<br>
&nbsp; 145&nbsp; tar xzf php-5.3.3.tar.gz <br>
&nbsp; 146&nbsp; wget http://chocbanana.com/httpd-2.2.17.tar.gz<br>
&nbsp; 147&nbsp; tar xzf httpd-2.2.17.tar.gz <br>
&nbsp; 148&nbsp; cd httpd-2.2.17<br>
&nbsp; 155&nbsp; ./configure --prefix=/usr/local/apache2&nbsp;
--enable-suexec --with-suexec-caller=daemon
--with-suexec-userdir=homepage --with-suexec-docroot=/home&nbsp;
--with-suexec-logfile=/usr/local/apache2/logs/suexec_log
--with-suexec-uidmin=1000 --with-suexec-gidmin=1000
--with-suexec-safepath="/bin:/usr/bin"&nbsp; --enable-module=log_agent
--enable-module=log_referer --enable-module=so --enable-module=rewrite
--enable-rewrite=shared
--enable-ssl--with-apr=/usr/local/apr/bin/apr-1-config--with-apr-util=/usr/local/apr-util/bin/apu-1-config
--enable-rule=SHARED_CORE&nbsp; --enable-rule=EXPAT<br>
&nbsp; 156&nbsp; make<br>
&nbsp; 162&nbsp; make install<br>
<br>
<br>
&nbsp; 169&nbsp; pushd /usr/ports/security/libmcrypt/<br>
&nbsp; 170&nbsp; make fetch<br>
&nbsp; 171&nbsp; make<br>
&nbsp; 172&nbsp; make install<br>
&nbsp; 194&nbsp; cd work/<br>
&nbsp; 196&nbsp; cd libmcrypt-2.5.8/<br>
&nbsp; 198&nbsp; cd libltdl/<br>
&nbsp; 200&nbsp; ./configure --enable-ltdl-install<br>
&nbsp; 201&nbsp; make<br>
&nbsp; 202&nbsp; make install<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd ../../../<br>
&nbsp; 203&nbsp; make clean<br>
&nbsp; 204&nbsp; popd <br>
<br>
<br>
<br>
&nbsp; 210&nbsp; cd ../<br>
&nbsp; 211&nbsp; ls<br>
&nbsp; 212&nbsp; wget http://chocbanana.com/dl/mod_wsgi-3.3.tar.gz<br>
&nbsp; 213&nbsp; tar xzf mod_wsgi-3.3.tar.gz <br>
&nbsp; 214&nbsp; cd mod_wsgi-3.3<br>
&nbsp; 215&nbsp; ls<br>
&nbsp; 216&nbsp; ./configure --help<br>
&nbsp; 217&nbsp; ./configure --with-python=/usr/local/bin/python
--with-apxs=/usr/local/apache2/bin/apxs <br>
&nbsp; 218&nbsp; make<br>
&nbsp; 219&nbsp; make install<br>
&nbsp; 220&nbsp; make clean<br>
<br>
<br>
&nbsp; 277&nbsp; wget
http://www.djangoproject.com/download/1.2.3/tarball/<br>
&nbsp; 278&nbsp; tar xzf Django-1.2.3.tar.gz <br>
&nbsp; 279&nbsp; ls<br>
&nbsp; 280&nbsp; cd Django-1.2.3<br>
&nbsp; 282&nbsp; python setup.py install<br>
&nbsp; 290&nbsp; ls -lh /usr/local/lib/python2.7/site-packages/django/<br>
<br>
<br>
&nbsp; 381&nbsp; pushd DL/php-5.3.3<br>
&nbsp; 388&nbsp; ./configure --enable-mbstring
--with-apxs2=/usr/local/apache2/bin/apxs --without-pgsql --with-gd
--with-zlib --with-jpeg-dir=/usr/local/lib
--with-png-dir=/usr/local/lib --with-freetype-dir=/usr/local
--with-mcrypt=/usr/local --prefix=/usr/local/php --with-mysql<br>
&nbsp; 389&nbsp; make<br>
&nbsp; 390&nbsp; make test<br>
&nbsp; 391&nbsp; make install<br>
&nbsp; 394&nbsp; make clean<br>
&nbsp; 395&nbsp; popd <br>
<br>
<br>
<br>
[ /usr/local/apache2/conf/httpd.conf ]<br>
------------------<br>
#<br>
# This is the main Apache HTTP server configuration file.&nbsp; It
contains the<br>
# configuration directives that give the server its instructions.<br>
# See &lt;URL:http://httpd.apache.org/docs/2.2&gt; for detailed
information.<br>
# In particular, see <br>
# &lt;URL:http://httpd.apache.org/docs/2.2/mod/directives.html&gt;<br>
# for a discussion of each configuration directive.<br>
#<br>
# Do NOT simply read the instructions in here without understanding<br>
# what they do.&nbsp; They're here only as hints or reminders.&nbsp; If
you are unsure<br>
# consult the online docs. You have been warned.&nbsp; <br>
#<br>
# Configuration and logfile names: If the filenames you specify for many<br>
# of the server's control files begin with "/" (or "drive:/" for
Win32), the<br>
# server will use that explicit path.&nbsp; If the filenames do *not*
begin<br>
# with "/", the value of ServerRoot is prepended -- so "logs/foo_log"<br>
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the<br>
# server as "/usr/local/apache2/logs/foo_log".<br>
<br>
#<br>
# ServerRoot: The top of the directory tree under which the server's<br>
# configuration, error, and log files are kept.<br>
#<br>
# Do not add a slash at the end of the directory path.&nbsp; If you
point<br>
# ServerRoot at a non-local disk, be sure to point the LockFile
directive<br>
# at a local disk.&nbsp; If you wish to share the same ServerRoot for
multiple<br>
# httpd daemons, you will need to change at least LockFile and PidFile.<br>
#<br>
ServerRoot "/usr/local/apache2"<br>
<br>
#<br>
# Listen: Allows you to bind Apache to specific IP addresses and/or<br>
# ports, instead of the default. See also the &lt;VirtualHost&gt;<br>
# directive.<br>
#<br>
# Change this to Listen on specific IP addresses as shown below to <br>
# prevent Apache from glomming onto all bound IP addresses.<br>
#<br>
#Listen 12.34.56.78:80<br>
Listen 80<br>
<br>
#<br>
# Dynamic Shared Object (DSO) Support<br>
#<br>
# To be able to use the functionality of a module which was built as a
DSO you<br>
# have to place corresponding `LoadModule' lines at this location so the<br>
# directives contained in it are actually available _before_ they are
used.<br>
# Statically compiled modules (those listed by `httpd -l') do not need<br>
# to be loaded here.<br>
#<br>
# Example:<br>
# LoadModule foo_module modules/mod_foo.so<br>
#<br>
LoadModule rewrite_module modules/mod_rewrite.so<br>
LoadModule php5_module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
modules/libphp5.so<br>
LoadModule wsgi_module&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
modules/mod_wsgi.so<br>
<br>
&lt;IfModule !mpm_netware_module&gt;<br>
&lt;IfModule !mpm_winnt_module&gt;<br>
#<br>
# If you wish httpd to run as a different user or group, you must run<br>
# httpd as root initially and it will switch.&nbsp; <br>
#<br>
# User/Group: The name (or #number) of the user/group to run httpd as.<br>
# It is usually good practice to create a dedicated user and group for<br>
# running httpd, as with most system services.<br>
#<br>
User daemon<br>
Group daemon<br>
<br>
&lt;/IfModule&gt;<br>
&lt;/IfModule&gt;<br>
<br>
# 'Main' server configuration<br>
#<br>
# The directives in this section set up the values used by the 'main'<br>
# server, which responds to any requests that aren't handled by a<br>
# &lt;VirtualHost&gt; definition.&nbsp; These values also provide
defaults for<br>
# any &lt;VirtualHost&gt; containers you may define later in the file.<br>
#<br>
# All of these directives may appear inside &lt;VirtualHost&gt;
containers,<br>
# in which case these default settings will be overridden for the<br>
# virtual host being defined.<br>
#<br>
<br>
#<br>
# ServerAdmin: Your address, where problems with the server should be<br>
# e-mailed.&nbsp; This address appears on some server-generated pages,
such<br>
# as error documents.&nbsp; e.g. admin@your-domain.com<br>
#<br>
ServerAdmin you@example.com<br>
<br>
#<br>
# ServerName gives the name and port that the server uses to identify
itself.<br>
# This can often be determined automatically, but we recommend you
specify<br>
# it explicitly to prevent problems during startup.<br>
#<br>
# If your host doesn't have a registered DNS name, enter its IP address
here.<br>
#<br>
#ServerName www.example.com:80<br>
<br>
#<br>
# DocumentRoot: The directory out of which you will serve your<br>
# documents. By default, all requests are taken from this directory, but<br>
# symbolic links and aliases may be used to point to other locations.<br>
#<br>
DocumentRoot "/usr/local/apache2/htdocs"<br>
<br>
#<br>
# Each directory to which Apache has access can be configured with
respect<br>
# to which services and features are allowed and/or disabled in that<br>
# directory (and its subdirectories). <br>
#<br>
# First, we configure the "default" to be a very restrictive set of <br>
# features.&nbsp; <br>
#<br>
&lt;Directory /&gt;<br>
&nbsp;&nbsp;&nbsp; Options FollowSymLinks<br>
&nbsp;&nbsp;&nbsp; AllowOverride None<br>
&nbsp;&nbsp;&nbsp; Order deny,allow<br>
&nbsp;&nbsp; # Deny from all<br>
&nbsp;&nbsp;&nbsp; Allow from all<br>
&lt;/Directory&gt;<br>
<br>
#<br>
# Note that from this point forward you must specifically allow<br>
# particular features to be enabled - so if something's not working as<br>
# you might expect, make sure that you have specifically enabled it<br>
# below.<br>
#<br>
<br>
#<br>
# This should be changed to whatever you set DocumentRoot to.<br>
#<br>
&lt;Directory "/usr/local/apache2/htdocs"&gt;<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # Possible values for the Options directive are
"None", "All",<br>
&nbsp;&nbsp;&nbsp; # or any combination of:<br>
&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; Indexes Includes FollowSymLinks
SymLinksifOwnerMatch ExecCGI MultiViews<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # Note that "MultiViews" must be named *explicitly*
--- "Options All"<br>
&nbsp;&nbsp;&nbsp; # doesn't give it to you.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # The Options directive is both complicated and
important.&nbsp; Please see<br>
&nbsp;&nbsp;&nbsp; #
http://httpd.apache.org/docs/2.2/mod/core.html#options<br>
&nbsp;&nbsp;&nbsp; # for more information.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; Options Indexes FollowSymLinks<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # AllowOverride controls what directives may be
placed in .htaccess files.<br>
&nbsp;&nbsp;&nbsp; # It can be "All", "None", or any combination of the
keywords:<br>
&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp; Options FileInfo AuthConfig Limit<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; AllowOverride None<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # Controls who can get stuff from this server.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; Order allow,deny<br>
&nbsp;&nbsp;&nbsp; Allow from all<br>
<br>
&lt;/Directory&gt;<br>
<br>
#<br>
# DirectoryIndex: sets the file that Apache will serve if a directory<br>
# is requested.<br>
#<br>
&lt;IfModule dir_module&gt;<br>
&nbsp;&nbsp;&nbsp; DirectoryIndex index.html index.php<br>
&lt;/IfModule&gt;<br>
<br>
#<br>
# The following lines prevent .htaccess and .htpasswd files from being <br>
# viewed by Web clients. <br>
#<br>
&lt;FilesMatch "^\.ht"&gt;<br>
&nbsp;&nbsp;&nbsp; Order allow,deny<br>
&nbsp;&nbsp;&nbsp; Deny from all<br>
&nbsp;&nbsp;&nbsp; Satisfy All<br>
&lt;/FilesMatch&gt;<br>
<br>
#<br>
# ErrorLog: The location of the error log file.<br>
# If you do not specify an ErrorLog directive within a
&lt;VirtualHost&gt;<br>
# container, error messages relating to that virtual host will be<br>
# logged here.&nbsp; If you *do* define an error logfile for a
&lt;VirtualHost&gt;<br>
# container, that host's errors will be logged there and not here.<br>
#<br>
ErrorLog "logs/error_log"<br>
<br>
#<br>
# LogLevel: Control the number of messages logged to the error_log.<br>
# Possible values include: debug, info, notice, warn, error, crit,<br>
# alert, emerg.<br>
#<br>
LogLevel warn<br>
<br>
&lt;IfModule log_config_module&gt;<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # The following directives define some format
nicknames for use with<br>
&nbsp;&nbsp;&nbsp; # a CustomLog directive (see below).<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; LogFormat "%h %l %u %t \"%r\" %&gt;s %b
\"%{Referer}i\" \"%{User-Agent}i\"" combined<br>
&nbsp;&nbsp;&nbsp; LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common<br>
<br>
&nbsp;&nbsp;&nbsp; &lt;IfModule logio_module&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # You need to enable mod_logio.c to use
%I and %O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LogFormat "%h %l %u %t \"%r\" %&gt;s %b
\"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio<br>
&nbsp;&nbsp;&nbsp; &lt;/IfModule&gt;<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # The location and format of the access logfile
(Common Logfile Format).<br>
&nbsp;&nbsp;&nbsp; # If you do not define any access logfiles within a
&lt;VirtualHost&gt;<br>
&nbsp;&nbsp;&nbsp; # container, they will be logged here.&nbsp;
Contrariwise, if you *do*<br>
&nbsp;&nbsp;&nbsp; # define per-&lt;VirtualHost&gt; access logfiles,
transactions will be<br>
&nbsp;&nbsp;&nbsp; # logged therein and *not* in this file.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; CustomLog "logs/access_log" common<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # If you prefer a logfile with access, agent, and
referer information<br>
&nbsp;&nbsp;&nbsp; # (Combined Logfile Format) you can use the
following directive.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; #CustomLog "logs/access_log" combined<br>
&lt;/IfModule&gt;<br>
<br>
&lt;IfModule alias_module&gt;<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # Redirect: Allows you to tell clients about
documents that used to <br>
&nbsp;&nbsp;&nbsp; # exist in your server's namespace, but do not
anymore. The client <br>
&nbsp;&nbsp;&nbsp; # will make a new request for the document at its
new location.<br>
&nbsp;&nbsp;&nbsp; # Example:<br>
&nbsp;&nbsp;&nbsp; # Redirect permanent /foo http://www.example.com/bar<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # Alias: Maps web paths into filesystem paths and is
used to<br>
&nbsp;&nbsp;&nbsp; # access content that does not live under the
DocumentRoot.<br>
&nbsp;&nbsp;&nbsp; # Example:<br>
&nbsp;&nbsp;&nbsp; # Alias /webpath /full/filesystem/path<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # If you include a trailing / on /webpath then the
server will<br>
&nbsp;&nbsp;&nbsp; # require it to be present in the URL.&nbsp; You
will also likely<br>
&nbsp;&nbsp;&nbsp; # need to provide a &lt;Directory&gt; section to
allow access to<br>
&nbsp;&nbsp;&nbsp; # the filesystem path.<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # ScriptAlias: This controls which directories
contain server scripts. <br>
&nbsp;&nbsp;&nbsp; # ScriptAliases are essentially the same as Aliases,
except that<br>
&nbsp;&nbsp;&nbsp; # documents in the target directory are treated as
applications and<br>
&nbsp;&nbsp;&nbsp; # run by the server when requested rather than as
documents sent to the<br>
&nbsp;&nbsp;&nbsp; # client.&nbsp; The same rules about trailing "/"
apply to ScriptAlias<br>
&nbsp;&nbsp;&nbsp; # directives as to Alias.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"<br>
<br>
&lt;/IfModule&gt;<br>
<br>
&lt;IfModule cgid_module&gt;<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # ScriptSock: On threaded servers, designate the
path to the UNIX<br>
&nbsp;&nbsp;&nbsp; # socket used to communicate with the CGI daemon of
mod_cgid.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; #Scriptsock logs/cgisock<br>
&lt;/IfModule&gt;<br>
<br>
#<br>
# "/usr/local/apache2/cgi-bin" should be changed to whatever your
ScriptAliased<br>
# CGI directory exists, if you have that configured.<br>
#<br>
&lt;Directory "/usr/local/apache2/cgi-bin"&gt;<br>
&nbsp;&nbsp;&nbsp; AllowOverride None<br>
&nbsp;&nbsp;&nbsp; Options None<br>
&nbsp;&nbsp;&nbsp; Order allow,deny<br>
&nbsp;&nbsp;&nbsp; Allow from all<br>
&lt;/Directory&gt;<br>
<br>
#<br>
# DefaultType: the default MIME type the server will use for a document<br>
# if it cannot otherwise determine one, such as from filename
extensions.<br>
# If your server contains mostly text or HTML documents, "text/plain" is<br>
# a good value.&nbsp; If most of your content is binary, such as
applications<br>
# or images, you may want to use "application/octet-stream" instead to<br>
# keep browsers from trying to display binary files as though they are<br>
# text.<br>
#<br>
DefaultType text/plain<br>
<br>
&lt;IfModule mime_module&gt;<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # TypesConfig points to the file containing the list
of mappings from<br>
&nbsp;&nbsp;&nbsp; # filename extension to MIME-type.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; TypesConfig conf/mime.types<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # AddType allows you to add to or override the MIME
configuration<br>
&nbsp;&nbsp;&nbsp; # file specified in TypesConfig for specific file
types.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; #AddType application/x-gzip .tgz<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # AddEncoding allows you to have certain browsers
uncompress<br>
&nbsp;&nbsp;&nbsp; # information on the fly. Note: Not all browsers
support this.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; #AddEncoding x-compress .Z<br>
&nbsp;&nbsp;&nbsp; #AddEncoding x-gzip .gz .tgz<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # If the AddEncoding directives above are
commented-out, then you<br>
&nbsp;&nbsp;&nbsp; # probably should define those extensions to
indicate media types:<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; AddType application/x-compress .Z<br>
&nbsp;&nbsp;&nbsp; AddType application/x-gzip .gz .tgz<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # AddHandler allows you to map certain file
extensions to "handlers":<br>
&nbsp;&nbsp;&nbsp; # actions unrelated to filetype. These can be either
built into the server<br>
&nbsp;&nbsp;&nbsp; # or added with the Action directive (see below)<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # To use CGI scripts outside of ScriptAliased
directories:<br>
&nbsp;&nbsp;&nbsp; # (You will also need to add "ExecCGI" to the
"Options" directive.)<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; #AddHandler cgi-script .cgi<br>
<br>
&nbsp;&nbsp;&nbsp; # For type maps (negotiated resources):<br>
&nbsp;&nbsp;&nbsp; #AddHandler type-map var<br>
<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # Filters allow you to process content before it is
sent to the client.<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; # To parse .shtml files for server-side includes
(SSI):<br>
&nbsp;&nbsp;&nbsp; # (You will also need to add "Includes" to the
"Options" directive.)<br>
&nbsp;&nbsp;&nbsp; #<br>
&nbsp;&nbsp;&nbsp; #AddType text/html .shtml<br>
&nbsp;&nbsp;&nbsp; #AddOutputFilter INCLUDES .shtml<br>
<br>
&nbsp;&nbsp;&nbsp; # Add Type PHP<br>
&nbsp;&nbsp;&nbsp; AddType application/x-httpd-php .php<br>
&lt;/IfModule&gt;<br>
<br>
#<br>
# The mod_mime_magic module allows the server to use various hints from
the<br>
# contents of the file itself to determine its type.&nbsp; The
MIMEMagicFile<br>
# directive tells the module where the hint definitions are located.<br>
#<br>
#MIMEMagicFile conf/magic<br>
<br>
#<br>
# Customizable error responses come in three flavors:<br>
# 1) plain text 2) local redirects 3) external redirects<br>
#<br>
# Some examples:<br>
#ErrorDocument 500 "The server made a boo boo."<br>
#ErrorDocument 404 /missing.html<br>
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"<br>
#ErrorDocument 402 http://www.example.com/subscription_info.html<br>
#<br>
<br>
#<br>
# EnableMMAP and EnableSendfile: On systems that support it, <br>
# memory-mapping or the sendfile syscall is used to deliver<br>
# files.&nbsp; This usually improves server performance, but must<br>
# be turned off when serving from networked-mounted <br>
# filesystems or if support for these functions is otherwise<br>
# broken on your system.<br>
#<br>
#EnableMMAP off<br>
#EnableSendfile off<br>
<br>
# Supplemental configuration<br>
#<br>
# The configuration files in the conf/extra/ directory can be <br>
# included to add extra features or to modify the default configuration
of <br>
# the server, or you may simply copy their contents here and change as <br>
# necessary.<br>
<br>
# Server-pool management (MPM specific)<br>
#Include conf/extra/httpd-mpm.conf<br>
<br>
# Multi-language error messages<br>
#Include conf/extra/httpd-multilang-errordoc.conf<br>
<br>
# Fancy directory listings<br>
#Include conf/extra/httpd-autoindex.conf<br>
<br>
# Language settings<br>
#Include conf/extra/httpd-languages.conf<br>
<br>
# User home directories<br>
#Include conf/extra/httpd-userdir.conf<br>
<br>
# Real-time info on requests and configuration<br>
#Include conf/extra/httpd-info.conf<br>
<br>
# Virtual hosts<br>
#Include conf/extra/httpd-vhosts.conf<br>
<br>
# Local access to the Apache HTTP Server Manual<br>
#Include conf/extra/httpd-manual.conf<br>
<br>
# Distributed authoring and versioning (WebDAV)<br>
#Include conf/extra/httpd-dav.conf<br>
<br>
# Various default settings<br>
#Include conf/extra/httpd-default.conf<br>
<br>
# Secure (SSL/TLS) connections<br>
#Include conf/extra/httpd-ssl.conf<br>
#<br>
# Note: The following must must be present to support<br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; starting without SSL on platforms
with no /dev/random equivalent<br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; but a statically compiled-in
mod_ssl.<br>
#<br>
&lt;IfModule ssl_module&gt;<br>
SSLRandomSeed startup builtin<br>
SSLRandomSeed connect builtin<br>
&lt;/IfModule&gt;<br>
<br>
# Omajinai kesicha dame !!!<br>
AcceptFilter http none<br>
AcceptFilter https none<br>
<br>
# My conf Inclde<br>
Include conf/extra/httpd-my.conf<br>
<br>
[ EOF ]<br>
------------------<br>
<br>
<br>
<br>
[ php.ini ]<br>
------------------<br>
[PHP]<br>
<br>
;;;;;;;;;;;;;;;;;;;<br>
; About php.ini&nbsp;&nbsp; ;<br>
;;;;;;;;;;;;;;;;;;;<br>
; This file controls many aspects of PHP's behavior.&nbsp; In order for
PHP to<br>
; read it, it must be named 'php.ini'.&nbsp; PHP looks for it in the
current<br>
; working directory, in the path designated by the environment variable<br>
; PHPRC, and in the path that was defined in compile time (in that
order).<br>
; Under Windows, the compile-time path is the Windows directory.&nbsp;
The<br>
; path in which the php.ini file is looked for can be overridden using<br>
; the -c argument in command line mode.<br>
;<br>
; The syntax of the file is extremely simple.&nbsp; Whitespace and Lines<br>
; beginning with a semicolon are silently ignored (as you probably
guessed).<br>
; Section headers (e.g. [Foo]) are also silently ignored, even though<br>
; they might mean something in the future.<br>
;<br>
; Directives are specified using the following syntax:<br>
; directive = value<br>
; Directive names are *case sensitive* - foo=bar is different from
FOO=bar.<br>
;<br>
; The value can be a string, a number, a PHP constant (e.g. E_ALL or
M_PI), one<br>
; of the INI constants (On, Off, True, False, Yes, No and None) or an
expression<br>
; (e.g. E_ALL &amp; ~E_NOTICE), or a quoted string ("foo").<br>
;<br>
; Expressions in the INI file are limited to bitwise operators and
parentheses:<br>
; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitwise OR<br>
; &amp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitwise AND<br>
; ~&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitwise NOT<br>
; !&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; boolean NOT<br>
;<br>
; Boolean flags can be turned on using the values 1, On, True or Yes.<br>
; They can be turned off using the values 0, Off, False or No.<br>
;<br>
; An empty string can be denoted by simply not writing anything after
the equal<br>
; sign, or by using the None keyword:<br>
;<br>
;&nbsp; foo =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; sets
foo to an empty string<br>
;&nbsp; foo = none&nbsp;&nbsp;&nbsp; ; sets foo to an empty string<br>
;&nbsp; foo = "none"&nbsp; ; sets foo to the string 'none'<br>
;<br>
; If you use constants in your value, and these constants belong to a<br>
; dynamically loaded extension (either a PHP extension or a Zend
extension),<br>
; you may only use these constants *after* the line that loads the
extension.<br>
; <br>
;<br>
;;;;;;;;;;;;;;;;;;;<br>
; About this file ;<br>
;;;;;;;;;;;;;;;;;;;<br>
; This is the recommended, PHP 5-style version of the php.ini-dist
file.&nbsp; It<br>
; sets some non standard settings, that make PHP more efficient, more
secure,<br>
; and encourage cleaner coding.<br>
;<br>
; The price is that with these settings, PHP may be incompatible with
some<br>
; applications, and sometimes, more difficult to develop with.&nbsp;
Using this<br>
; file is warmly recommended for production sites.&nbsp; As all of the
changes from<br>
; the standard settings are thoroughly documented, you can go over each
one,<br>
; and decide whether you want to use it or not.<br>
;<br>
; For general information about the php.ini file, please consult the
php.ini-dist<br>
; file, included in your PHP distribution.<br>
;<br>
; This file is different from the php.ini-dist file in the fact that it
features<br>
; different values for several directives, in order to improve
performance, while<br>
; possibly breaking compatibility with the standard out-of-the-box
behavior of<br>
; PHP.&nbsp; Please make sure you read what's different, and modify
your scripts<br>
; accordingly, if you decide to use this file instead.<br>
;<br>
; - register_long_arrays = Off&nbsp;&nbsp;&nbsp;&nbsp; [Performance]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; Disables registration of the older (and
deprecated) long predefined array<br>
;&nbsp;&nbsp;&nbsp;&nbsp; variables ($HTTP_*_VARS).&nbsp; Instead, use
the superglobals that were<br>
;&nbsp;&nbsp;&nbsp;&nbsp; introduced in PHP 4.1.0<br>
; - display_errors =
Off&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Security]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; With this directive set to off, errors that
occur during the execution of<br>
;&nbsp;&nbsp;&nbsp;&nbsp; scripts will no longer be displayed as a part
of the script output, and thus,<br>
;&nbsp;&nbsp;&nbsp;&nbsp; will no longer be exposed to remote
users.&nbsp; With some errors, the error message<br>
;&nbsp;&nbsp;&nbsp;&nbsp; content may expose information about your
script, web server, or database<br>
;&nbsp;&nbsp;&nbsp;&nbsp; server that may be exploitable for
hacking.&nbsp; Production sites should have this<br>
;&nbsp;&nbsp;&nbsp;&nbsp; directive set to off.<br>
; - log_errors =
On&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Security]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; This directive complements the above
one.&nbsp; Any errors that occur during the<br>
;&nbsp;&nbsp;&nbsp;&nbsp; execution of your script will be logged
(typically, to your server's error log,<br>
;&nbsp;&nbsp;&nbsp;&nbsp; but can be configured in several ways).&nbsp;
Along with setting display_errors to off,<br>
;&nbsp;&nbsp;&nbsp;&nbsp; this setup gives you the ability to fully
understand what may have gone wrong,<br>
;&nbsp;&nbsp;&nbsp;&nbsp; without exposing any sensitive information to
remote users.<br>
; - output_buffering = 4096&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Performance]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; Set a 4KB output buffer.&nbsp; Enabling
output buffering typically results in less<br>
;&nbsp;&nbsp;&nbsp;&nbsp; writes, and sometimes less packets sent on
the wire, which can often lead to<br>
;&nbsp;&nbsp;&nbsp;&nbsp; better performance.&nbsp; The gain this
directive actually yields greatly depends<br>
;&nbsp;&nbsp;&nbsp;&nbsp; on which Web server you're working with, and
what kind of scripts you're using.<br>
; - register_argc_argv = Off&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Performance]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; Disables registration of the somewhat
redundant $argv and $argc global<br>
;&nbsp;&nbsp;&nbsp;&nbsp; variables.<br>
; - magic_quotes_gpc =
Off&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Performance]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; Input data is no longer escaped with slashes
so that it can be sent into<br>
;&nbsp;&nbsp;&nbsp;&nbsp; SQL databases without further
manipulation.&nbsp; Instead, you should use the<br>
;&nbsp;&nbsp;&nbsp;&nbsp; function addslashes() on each input element
you wish to send to a database.<br>
; - variables_order = "GPCS"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Performance]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; The environment variables are not hashed into
the $_ENV.&nbsp; To access<br>
;&nbsp;&nbsp;&nbsp;&nbsp; environment variables, you can use getenv()
instead.<br>
; - error_reporting = E_ALL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Code Cleanliness, Security(?)]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; By default, PHP suppresses errors of type
E_NOTICE.&nbsp; These error messages<br>
;&nbsp;&nbsp;&nbsp;&nbsp; are emitted for non-critical errors, but that
could be a symptom of a bigger<br>
;&nbsp;&nbsp;&nbsp;&nbsp; problem.&nbsp; Most notably, this will cause
error messages about the use<br>
;&nbsp;&nbsp;&nbsp;&nbsp; of uninitialized variables to be displayed.<br>
; - allow_call_time_pass_reference = Off&nbsp;&nbsp;&nbsp;&nbsp; [Code
cleanliness]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; It's not possible to decide to force a
variable to be passed by reference<br>
;&nbsp;&nbsp;&nbsp;&nbsp; when calling a function.&nbsp; The PHP 4
style to do this is by making the<br>
;&nbsp;&nbsp;&nbsp;&nbsp; function require the relevant argument by
reference.<br>
; - short_open_tag =
Off&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[Portability]<br>
;&nbsp;&nbsp;&nbsp;&nbsp; Using short tags is discouraged when
developing code meant for redistribution<br>
;&nbsp;&nbsp;&nbsp;&nbsp; since short tags may not be supported on the
target server.<br>
<br>
;;;;;;;;;;;;;;;;;;;;<br>
; Language Options ;<br>
;;;;;;;;;;;;;;;;;;;;<br>
<br>
; Enable the PHP scripting language engine under Apache.<br>
engine = On<br>
<br>
; Enable compatibility mode with Zend Engine 1 (PHP 4.x)<br>
zend.ze1_compatibility_mode = Off<br>
<br>
; Allow the &lt;? tag.&nbsp; Otherwise, only &lt;?php and
&lt;script&gt; tags are recognized.<br>
; NOTE: Using short tags should be avoided when developing applications
or<br>
; libraries that are meant for redistribution, or deployment on PHP<br>
; servers which are not under your control, because short tags may not<br>
; be supported on the target server. For portable, redistributable code,<br>
; be sure not to use short tags.<br>
short_open_tag = Off<br>
<br>
; Allow ASP-style &lt;% %&gt; tags.<br>
asp_tags = Off<br>
<br>
; The number of significant digits displayed in floating point numbers.<br>
precision&nbsp;&nbsp;&nbsp; =&nbsp; 14<br>
<br>
; Enforce year 2000 compliance (will cause problems with non-compliant
browsers)<br>
y2k_compliance = On<br>
<br>
; Output buffering allows you to send header lines (including cookies)
even<br>
; after you send body content, at the price of slowing PHP's output
layer a<br>
; bit.&nbsp; You can enable output buffering during runtime by calling
the output<br>
; buffering functions.&nbsp; You can also enable output buffering for
all files by<br>
; setting this directive to On.&nbsp; If you wish to limit the size of
the buffer<br>
; to a certain size - you can use a maximum number of bytes instead of
'On', as<br>
; a value for this directive (e.g., output_buffering=4096).<br>
output_buffering = 4096<br>
<br>
; You can redirect all of the output of your scripts to a
function.&nbsp; For<br>
; example, if you set output_handler to "mb_output_handler", character<br>
; encoding will be transparently converted to the specified encoding.<br>
; Setting any output handler automatically turns on output buffering.<br>
; Note: People who wrote portable scripts should not depend on this ini<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; directive. Instead, explicitly
set the output handler using ob_start().<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Using this ini directive may
cause problems unless you know what script<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is doing.<br>
; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and you cannot use both
"ob_gzhandler" and "zlib.output_compression".<br>
; Note: output_handler must be empty if this is set 'On' !!!!<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Instead you must use
zlib.output_handler.<br>
;output_handler =<br>
<br>
; Transparent output compression using the zlib library<br>
; Valid values for this option are 'off', 'on', or a specific buffer
size<br>
; to be used for compression (default is 4KB)<br>
; Note: Resulting chunk size may vary due to nature of compression. PHP<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outputs chunks that are few
hundreds bytes each as a result of<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compression. If you prefer a
larger chunk size for better<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; performance, enable
output_buffering in addition.<br>
; Note: You need to use zlib.output_handler instead of the standard<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; output_handler, or otherwise the
output will be corrupted.<br>
zlib.output_compression = Off<br>
;zlib.output_compression_level = -1<br>
<br>
; You cannot specify additional output handlers if
zlib.output_compression<br>
; is activated here. This setting does the same as output_handler but in<br>
; a different order.<br>
;zlib.output_handler =<br>
<br>
; Implicit flush tells PHP to tell the output layer to flush itself<br>
; automatically after every output block.&nbsp; This is equivalent to
calling the<br>
; PHP function flush() after each and every call to print() or echo()
and each<br>
; and every HTML block.&nbsp; Turning this option on has serious
performance<br>
; implications and is generally recommended for debugging purposes only.<br>
implicit_flush = Off<br>
<br>
; The unserialize callback function will be called (with the undefined
class'<br>
; name as parameter), if the unserializer finds an undefined class<br>
; which should be instantiated.<br>
; A warning appears if the specified function is not defined, or if the<br>
; function doesn't include/implement the missing class.<br>
; So only set this entry, if you really want to implement such a<br>
; callback-function.<br>
unserialize_callback_func=<br>
<br>
; When floats &amp; doubles are serialized store serialize_precision
significant<br>
; digits after the floating point. The default value ensures that when
floats<br>
; are decoded with unserialize, the data will remain the same.<br>
serialize_precision = 100<br>
<br>
; Whether to enable the ability to force arguments to be passed by
reference<br>
; at function call time.&nbsp; This method is deprecated and is likely
to be<br>
; unsupported in future versions of PHP/Zend.&nbsp; The encouraged
method of<br>
; specifying which arguments should be passed by reference is in the
function<br>
; declaration.&nbsp; You're encouraged to try and turn this option Off
and make<br>
; sure your scripts work properly with it in order to ensure they will
work<br>
; with future versions of the language (you will receive a warning each
time<br>
; you use this feature, and the argument will be passed by value
instead of by<br>
; reference).<br>
allow_call_time_pass_reference = Off<br>
<br>
;<br>
; Safe Mode<br>
;<br>
; SECURITY NOTE: The FreeBSD Security Officer strongly recommend that<br>
; the PHP Safe Mode feature not be relied upon for security, since the<br>
; issues Safe Mode tries to handle cannot properly be handled in PHP<br>
; (primarily due to PHP's use of external libraries).&nbsp; While many
bugs<br>
; in Safe Mode has been fixed it's very likely that more issues exist<br>
; which allows a user to bypass Safe Mode restrictions.<br>
; For increased security we recommend to always install the Suhosin<br>
; extension.<br>
;<br>
safe_mode = Off<br>
<br>
; By default, Safe Mode does a UID compare check when<br>
; opening files. If you want to relax this to a GID compare,<br>
; then turn on safe_mode_gid.<br>
safe_mode_gid = Off<br>
<br>
; When safe_mode is on, UID/GID checks are bypassed when<br>
; including files from this directory and its subdirectories.<br>
; (directory must also be in include_path or full path must<br>
; be used when including)<br>
safe_mode_include_dir =<br>
<br>
; When safe_mode is on, only executables located in the
safe_mode_exec_dir<br>
; will be allowed to be executed via the exec family of functions.<br>
safe_mode_exec_dir =<br>
<br>
; Setting certain environment variables may be a potential security
breach.<br>
; This directive contains a comma-delimited list of prefixes.&nbsp; In
Safe Mode,<br>
; the user may only alter environment variables whose names begin with
the<br>
; prefixes supplied here.&nbsp; By default, users will only be able to
set<br>
; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).<br>
;<br>
; Note:&nbsp; If this directive is empty, PHP will let the user modify
ANY<br>
; environment variable!<br>
safe_mode_allowed_env_vars = PHP_<br>
<br>
; This directive contains a comma-delimited list of environment
variables that<br>
; the end user won't be able to change using putenv().&nbsp; These
variables will be<br>
; protected even if safe_mode_allowed_env_vars is set to allow to
change them.<br>
safe_mode_protected_env_vars = LD_LIBRARY_PATH<br>
<br>
; open_basedir, if set, limits all file operations to the defined
directory<br>
; and below.&nbsp; This directive makes most sense if used in a
per-directory<br>
; or per-virtualhost web server configuration file. This directive is<br>
; *NOT* affected by whether Safe Mode is turned On or Off.<br>
;open_basedir =<br>
<br>
; This directive allows you to disable certain functions for security
reasons.<br>
; It receives a comma-delimited list of function names. This directive
is<br>
; *NOT* affected by whether Safe Mode is turned On or Off.<br>
disable_functions =<br>
<br>
; This directive allows you to disable certain classes for security
reasons.<br>
; It receives a comma-delimited list of class names. This directive is<br>
; *NOT* affected by whether Safe Mode is turned On or Off.<br>
disable_classes =<br>
<br>
; Colors for Syntax Highlighting mode.&nbsp; Anything that's acceptable
in<br>
; &lt;span style="color: ???????"&gt; would work.<br>
;highlight.string&nbsp; = #DD0000<br>
;highlight.comment = #FF9900<br>
;highlight.keyword = #007700<br>
;highlight.bg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = #FFFFFF<br>
;highlight.default = #0000BB<br>
;highlight.html&nbsp;&nbsp;&nbsp; = #000000<br>
<br>
; If enabled, the request will be allowed to complete even if the user
aborts<br>
; the request. Consider enabling it if executing long request, which
may end up<br>
; being interrupted by the user or a browser timing out.<br>
; ignore_user_abort = On<br>
<br>
; Determines the size of the realpath cache to be used by PHP. This
value should<br>
; be increased on systems where PHP opens many files to reflect the
quantity of<br>
; the file operations performed.<br>
; realpath_cache_size=16k<br>
<br>
; Duration of time, in seconds for which to cache realpath information
for a given<br>
; file or directory. For systems with rarely changing files, consider
increasing this<br>
; value.<br>
; realpath_cache_ttl=120<br>
<br>
;<br>
; Misc<br>
;<br>
; Decides whether PHP may expose the fact that it is installed on the
server<br>
; (e.g. by adding its signature to the Web server header).&nbsp; It is
no security<br>
; threat in any way, but it makes it possible to determine whether you
use PHP<br>
; on your server or not.<br>
expose_php = On<br>
<br>
<br>
;;;;;;;;;;;;;;;;;;;<br>
; Resource Limits ;<br>
;;;;;;;;;;;;;;;;;;;<br>
<br>
max_execution_time = 30&nbsp;&nbsp;&nbsp;&nbsp; ; Maximum execution
time of each script, in seconds<br>
max_input_time = 60&nbsp;&nbsp;&nbsp; ; Maximum amount of time each
script may spend parsing request data<br>
;max_input_nesting_level = 64 ; Maximum input variable nesting level<br>
memory_limit = 128M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Maximum amount of
memory a script may consume (128MB)<br>
<br>
<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
; Error handling and logging ;<br>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
; error_reporting is a bit-field.&nbsp; Or each number up to get
desired error<br>
; reporting level<br>
;
E_ALL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- All errors and warnings (doesn't include E_STRICT)<br>
; E_ERROR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -
fatal run-time errors<br>
; E_RECOVERABLE_ERROR&nbsp; - almost fatal run-time errors<br>
; E_WARNING&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - run-time
warnings (non-fatal errors)<br>
; E_PARSE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -
compile-time parse errors<br>
; E_NOTICE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -
run-time notices (these are warnings which often result<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
from a bug in your code, but it's possible that it was<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
intentional (e.g., using an uninitialized variable and<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
relying on the fact it's automatically initialized to an<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
empty string)<br>
; E_STRICT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -
run-time notices, enable to have PHP suggest changes<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
to your code which will ensure the best interoperability<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
and forward compatibility of your code<br>
; E_CORE_ERROR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - fatal errors that occur
during PHP's initial startup<br>
; E_CORE_WARNING&nbsp;&nbsp;&nbsp; - warnings (non-fatal errors) that
occur during PHP's<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
initial startup<br>
; E_COMPILE_ERROR&nbsp;&nbsp; - fatal compile-time errors<br>
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)<br>
; E_USER_ERROR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - user-generated error
message<br>
; E_USER_WARNING&nbsp;&nbsp;&nbsp; - user-generated warning message<br>
; E_USER_NOTICE&nbsp;&nbsp;&nbsp;&nbsp; - user-generated notice message<br>
;<br>
; Examples:<br>
;<br>
;&nbsp;&nbsp; - Show all errors, except for notices and coding
standards warnings<br>
;<br>
;error_reporting = E_ALL &amp; ~E_NOTICE<br>
;<br>
;&nbsp;&nbsp; - Show all errors, except for notices<br>
;<br>
;error_reporting = E_ALL &amp; ~E_NOTICE | E_STRICT<br>
;<br>
;&nbsp;&nbsp; - Show only errors<br>
;<br>
;error_reporting =
E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR<br>
;<br>
;&nbsp;&nbsp; - Show all errors, except coding standards warnings<br>
;<br>
error_reporting&nbsp; =&nbsp; E_ALL<br>
<br>
; Print out errors (as a part of the output).&nbsp; For production web
sites,<br>
; you're strongly encouraged to turn this feature off, and use error
logging<br>
; instead (see below).&nbsp; Keeping display_errors enabled on a
production web site<br>
; may reveal security information to end users, such as file paths on
your Web<br>
; server, your database schema or other information.<br>
;<br>
; possible values for display_errors:<br>
;<br>
; Off&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Do not
display any errors <br>
; stderr&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Display errors to STDERR
(affects only CGI/CLI binaries!)&nbsp;&nbsp; <br>
; On or stdout - Display errors to STDOUT (default)<br>
;&nbsp; <br>
; To output errors to STDERR with
CGI/CLI:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
;display_errors = "stderr"<br>
;<br>
; Default<br>
;<br>
display_errors = Off<br>
<br>
; Even when display_errors is on, errors that occur during PHP's startup<br>
; sequence are not displayed.&nbsp; It's strongly recommended to keep<br>
; display_startup_errors off, except for when debugging.<br>
display_startup_errors = Off<br>
<br>
; Log errors into a log file (server-specific log, stderr, or error_log
(below))<br>
; As stated above, you're strongly advised to use error logging in
place of<br>
; error displaying on production web sites.<br>
log_errors = On<br>
<br>
; Set maximum length of log_errors. In error_log information about the
source is<br>
; added. The default is 1024 and 0 allows to not apply any maximum
length at all.<br>
log_errors_max_len = 1024<br>
<br>
; Do not log repeated messages. Repeated errors must occur in same file
on same<br>
; line until ignore_repeated_source is set true.<br>
ignore_repeated_errors = Off<br>
<br>
; Ignore source of message when ignoring repeated messages. When this
setting<br>
; is On you will not log errors with repeated messages from different
files or<br>
; source lines.<br>
ignore_repeated_source = Off<br>
<br>
; If this parameter is set to Off, then memory leaks will not be shown
(on<br>
; stdout or in the log). This has only effect in a debug compile, and if<br>
; error reporting includes E_WARNING in the allowed list<br>
report_memleaks = On<br>
<br>
;report_zend_debug = 0<br>
<br>
; Store the last error/warning message in $php_errormsg (boolean).<br>
track_errors = Off<br>
<br>
; Disable the inclusion of HTML tags in error messages.<br>
; Note: Never use this feature for production boxes.<br>
;html_errors = Off<br>
<br>
; If html_errors is set On PHP produces clickable error messages that
direct<br>
; to a page describing the error or function causing the error in
detail.<br>
; You can download a copy of the PHP manual from
http://www.php.net/docs.php<br>
; and change docref_root to the base URL of your local copy including
the<br>
; leading '/'. You must also specify the file extension being used
including<br>
; the dot.<br>
; Note: Never use this feature for production boxes.<br>
;docref_root = "/phpmanual/"<br>
;docref_ext = .html<br>
<br>
; String to output before an error message.<br>
;error_prepend_string = "&lt;font color=ff0000&gt;"<br>
<br>
; String to output after an error message.<br>
;error_append_string = "&lt;/font&gt;"<br>
<br>
; Log errors to specified file.<br>
;error_log = filename<br>
<br>
; Log errors to syslog (Event Log on NT, not valid in Windows 95).<br>
;error_log = syslog<br>
<br>
<br>
;;;;;;;;;;;;;;;;;<br>
; Data Handling ;<br>
;;;;;;;;;;;;;;;;;<br>
;<br>
; Note - track_vars is ALWAYS enabled as of PHP 4.0.3<br>
<br>
; The separator used in PHP generated URLs to separate arguments.<br>
; Default is "&amp;".<br>
;arg_separator.output = "&amp;amp;"<br>
<br>
; List of separator(s) used by PHP to parse input URLs into variables.<br>
; Default is "&amp;".<br>
; NOTE: Every character in this directive is considered as separator!<br>
;arg_separator.input = ";&amp;"<br>
<br>
; This directive describes the order in which PHP registers GET, POST,
Cookie,<br>
; Environment and Built-in variables (G, P, C, E &amp; S respectively,
often<br>
; referred to as EGPCS or GPC).&nbsp; Registration is done from left to
right, newer<br>
; values override older values.<br>
variables_order = "GPCS"<br>
<br>
; Whether or not to register the EGPCS variables as global
variables.&nbsp; You may<br>
; want to turn this off if you don't want to clutter your scripts'
global scope<br>
; with user data.&nbsp; This makes most sense when coupled with
track_vars - in which<br>
; case you can access all of the GPC variables through the
$HTTP_*_VARS[],<br>
; variables.<br>
;<br>
; You should do your best to write your scripts so that they do not
require<br>
; register_globals to be on;&nbsp; Using form variables as globals can
easily lead<br>
; to possible security problems, if the code is not very well thought
of.<br>
register_globals = Off<br>
<br>
; Whether or not to register the old-style input arrays, HTTP_GET_VARS<br>
; and friends.&nbsp; If you're not using them, it's recommended to turn
them off,<br>
; for performance reasons.<br>
register_long_arrays = Off<br>
<br>
; This directive tells PHP whether to declare the argv&amp;argc
variables (that<br>
; would contain the GET information).&nbsp; If you don't use these
variables, you<br>
; should turn it off for increased performance.<br>
register_argc_argv = Off<br>
<br>
; When enabled, the SERVER and ENV variables are created when they're
first<br>
; used (Just In Time) instead of when the script starts. If these
variables<br>
; are not used within a script, having this directive on will result in
a<br>
; performance gain. The PHP directives register_globals,
register_long_arrays,<br>
; and register_argc_argv must be disabled for this directive to have
any affect.<br>
auto_globals_jit = On<br>
<br>
; Maximum size of POST data that PHP will accept.<br>
post_max_size = 8M<br>
<br>
; Magic quotes<br>
;<br>
<br>
; Magic quotes for incoming GET/POST/Cookie data.<br>
magic_quotes_gpc = Off<br>
<br>
; Magic quotes for runtime-generated data, e.g. data from SQL, from
exec(), etc.<br>
magic_quotes_runtime = Off<br>
<br>
; Use Sybase-style magic quotes (escape ' with '' instead of \').<br>
magic_quotes_sybase = Off<br>
<br>
; Automatically add files before or after any PHP document.<br>
auto_prepend_file =<br>
auto_append_file =<br>
<br>
; As of 4.0b4, PHP always outputs a character encoding by default in<br>
; the Content-type: header.&nbsp; To disable sending of the charset,
simply<br>
; set it to be empty.<br>
;<br>
; PHP's built-in default is text/html<br>
default_mimetype = "text/html"<br>
;default_charset = "iso-8859-1"<br>
<br>
; Always populate the $HTTP_RAW_POST_DATA variable.<br>
;always_populate_raw_post_data = On<br>
<br>
<br>
;;;;;;;;;;;;;;;;;;;;;;;;;<br>
; Paths and Directories ;<br>
;;;;;;;;;;;;;;;;;;;;;;;;;<br>
<br>
; UNIX: "/path1:/path2"<br>
;include_path = ".:/php/includes"<br>
;<br>
; Windows: "\path1;\path2"<br>
;include_path = ".;c:\php\includes"<br>
<br>
; The root of the PHP pages, used only if nonempty.<br>
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root<br>
; if you are running php as a CGI under any web server (other than IIS)<br>
; see documentation for security issues.&nbsp; The alternate is to use
the<br>
; cgi.force_redirect configuration below<br>
doc_root =<br>
<br>
; The directory under which PHP opens the script using /~username used
only<br>
; if nonempty.<br>
user_dir =<br>
<br>
; Directory in which the loadable extensions (modules) reside.<br>
; extension_dir = "./"<br>
<br>
; Whether or not to enable the dl() function.&nbsp; The dl() function
does NOT work<br>
; properly in multithreaded servers, such as IIS or Zeus, and is
automatically<br>
; disabled on them.<br>
enable_dl = On<br>
<br>
; cgi.force_redirect is necessary to provide security running PHP as a
CGI under<br>
; most web servers.&nbsp; Left undefined, PHP turns this on by
default.&nbsp; You can<br>
; turn it off here AT YOUR OWN RISK<br>
; **You CAN safely turn this off for IIS, in fact, you MUST.**<br>
; cgi.force_redirect = 1<br>
<br>
; if cgi.nph is enabled it will force cgi to always sent Status: 200
with<br>
; every request.<br>
; cgi.nph = 1<br>
<br>
; if cgi.force_redirect is turned on, and you are not running under
Apache or Netscape<br>
; (iPlanet) web servers, you MAY need to set an environment variable
name that PHP<br>
; will look for to know it is OK to continue execution.&nbsp; Setting
this variable MAY<br>
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.<br>
; cgi.redirect_status_env = ;<br>
<br>
; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support
for CGI.&nbsp; PHP's<br>
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and
to not grok<br>
; what PATH_INFO is.&nbsp; For more information on PATH_INFO, see the
cgi specs.&nbsp; Setting<br>
; this to 1 will cause PHP CGI to fix it's paths to conform to the
spec.&nbsp; A setting<br>
; of zero causes PHP to behave as before.&nbsp; Default is 1.&nbsp; You
should fix your scripts<br>
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.<br>
; cgi.fix_pathinfo=1<br>
<br>
; FastCGI under IIS (on WINNT based OS) supports the ability to
impersonate<br>
; security tokens of the calling client.&nbsp; This allows IIS to
define the<br>
; security context that the request runs under.&nbsp; mod_fastcgi under
Apache<br>
; does not currently support this feature (03/17/2002)<br>
; Set to 1 if running under IIS.&nbsp; Default is zero.<br>
; fastcgi.impersonate = 1;<br>
<br>
; Disable logging through FastCGI connection<br>
; fastcgi.logging = 0<br>
<br>
; cgi.rfc2616_headers configuration option tells PHP what type of
headers to<br>
; use when sending HTTP response code. If it's set 0 PHP sends Status:
header that<br>
; is supported by Apache. When this option is set to 1 PHP will send<br>
; RFC2616 compliant header.<br>
; Default is zero.<br>
;cgi.rfc2616_headers = 0<br>
<br>
<br>
;;;;;;;;;;;;;;;;<br>
; File Uploads ;<br>
;;;;;;;;;;;;;;;;<br>
<br>
; Whether to allow HTTP file uploads.<br>
file_uploads = On<br>
<br>
; Temporary directory for HTTP uploaded files (will use system default
if not<br>
; specified).<br>
;upload_tmp_dir =<br>
<br>
; Maximum allowed size for uploaded files.<br>
upload_max_filesize = 2M<br>
<br>
<br>
;;;;;;;;;;;;;;;;;;<br>
; Fopen wrappers ;<br>
;;;;;;;;;;;;;;;;;;<br>
<br>
; Whether to allow the treatment of URLs (like http:// or ftp://) as
files.<br>
allow_url_fopen = On<br>
<br>
; Whether to allow include/require to open URLs (like http:// or
ftp://) as files.<br>
allow_url_include = Off<br>
<br>
; Define the anonymous ftp password (your email address)<br>
;from="john@doe.com"<br>
<br>
; Define the User-Agent string<br>
; user_agent="PHP"<br>
<br>
; Default timeout for socket based streams (seconds)<br>
default_socket_timeout = 60<br>
<br>
; If your scripts have to deal with files from Macintosh systems,<br>
; or you are running on a Mac and need to deal with files from<br>
; unix or win32 systems, setting this flag will cause PHP to<br>
; automatically detect the EOL character in those files so that<br>
; fgets() and file() will work regardless of the source of the file.<br>
; auto_detect_line_endings = Off<br>
<br>
<br>
;;;;;;;;;;;;;;;;;;;;;;<br>
; Dynamic Extensions ;<br>
;;;;;;;;;;;;;;;;;;;;;;<br>
;<br>
; If you wish to have an extension loaded automatically, use the
following<br>
; syntax:<br>
;<br>
;&nbsp;&nbsp; extension=modulename.extension<br>
;<br>
; For example, on Windows:<br>
;<br>
;&nbsp;&nbsp; extension=msql.dll<br>
;<br>
; ... or under UNIX:<br>
;<br>
;&nbsp;&nbsp; extension=msql.so<br>
;<br>
; Note that it should be the name of the module only; no directory
information<br>
; needs to go here.&nbsp; Specify the location of the extension with the<br>
; extension_dir directive above.<br>
<br>
<br>
; Windows Extensions<br>
; Note that ODBC support is built in, so no dll is needed for it.<br>
; Note that many DLL files are located in the extensions/ (PHP 4) ext/
(PHP 5)<br>
; extension folders as well as the separate PECL DLL download (PHP 5).<br>
; Be sure to appropriately set the extension_dir directive.<br>
<br>
;extension=php_bz2.dll<br>
;extension=php_curl.dll<br>
;extension=php_dba.dll<br>
;extension=php_dbase.dll<br>
;extension=php_exif.dll<br>
;extension=php_fdf.dll<br>
;extension=php_gd2.dll<br>
;extension=php_gettext.dll<br>
;extension=php_gmp.dll<br>
;extension=php_ifx.dll<br>
;extension=php_imap.dll<br>
;extension=php_interbase.dll<br>
;extension=php_ldap.dll<br>
;extension=php_mbstring.dll<br>
;extension=php_mcrypt.dll<br>
;extension=php_mhash.dll<br>
;extension=php_mime_magic.dll<br>
;extension=php_ming.dll<br>
;extension=php_msql.dll<br>
;extension=php_mssql.dll<br>
;extension=php_mysql.dll<br>
;extension=php_mysqli.dll<br>
;extension=php_oci8.dll<br>
;extension=php_openssl.dll<br>
;extension=php_pdo.dll<br>
;extension=php_pdo_firebird.dll<br>
;extension=php_pdo_mssql.dll<br>
;extension=php_pdo_mysql.dll<br>
;extension=php_pdo_oci.dll<br>
;extension=php_pdo_oci8.dll<br>
;extension=php_pdo_odbc.dll<br>
;extension=php_pdo_pgsql.dll<br>
;extension=php_pdo_sqlite.dll<br>
;extension=php_pgsql.dll<br>
;extension=php_pspell.dll<br>
;extension=php_shmop.dll<br>
;extension=php_snmp.dll<br>
;extension=php_soap.dll<br>
;extension=php_sockets.dll<br>
;extension=php_sqlite.dll<br>
;extension=php_sybase_ct.dll<br>
;extension=php_tidy.dll<br>
;extension=php_xmlrpc.dll<br>
;extension=php_xsl.dll<br>
;extension=php_zip.dll<br>
<br>
;;;;;;;;;;;;;;;;;;;<br>
; Module Settings ;<br>
;;;;;;;;;;;;;;;;;;;<br>
<br>
[Date]<br>
; Defines the default timezone used by the date functions<br>
;date.timezone =<br>
date.timezone = "Asia/Tokyo"<br>
<br>
;date.default_latitude = 31.7667<br>
;date.default_longitude = 35.2333<br>
<br>
;date.sunrise_zenith = 90.583333<br>
;date.sunset_zenith = 90.583333<br>
<br>
[filter]<br>
;filter.default = unsafe_raw<br>
;filter.default_flags =<br>
<br>
[iconv]<br>
;iconv.input_encoding = ISO-8859-1<br>
;iconv.internal_encoding = ISO-8859-1<br>
;iconv.output_encoding = ISO-8859-1<br>
<br>
[sqlite]<br>
;sqlite.assoc_case = 0<br>
<br>
[xmlrpc]<br>
;xmlrpc_error_number = 0<br>
;xmlrpc_errors = 0<br>
<br>
[Pcre]<br>
;PCRE library backtracking limit.<br>
;pcre.backtrack_limit=100000<br>
<br>
;PCRE library recursion limit. <br>
;Please note that if you set this value to a high number you may
consume all <br>
;the available process stack and eventually crash PHP (due to reaching
the <br>
;stack size limit imposed by the Operating System).<br>
;pcre.recursion_limit=100000<br>
<br>
[Syslog]<br>
; Whether or not to define the various syslog variables (e.g. $LOG_PID,<br>
; $LOG_CRON, etc.).&nbsp; Turning it off is a good idea
performance-wise.&nbsp; In<br>
; runtime, you can define these variables by calling
define_syslog_variables().<br>
define_syslog_variables&nbsp; = Off<br>
<br>
[mail function]<br>
; For Win32 only.<br>
SMTP = localhost<br>
smtp_port = 25<br>
<br>
; For Win32 only.<br>
;sendmail_from = me@example.com<br>
<br>
; For Unix only.&nbsp; You may supply arguments as well (default:
"sendmail -t -i").<br>
;sendmail_path =<br>
<br>
; Force the addition of the specified parameters to be passed as extra
parameters<br>
; to the sendmail binary. These parameters will always replace the
value of<br>
; the 5th parameter to mail(), even in safe mode.<br>
;mail.force_extra_parameters =<br>
<br>
[SQL]<br>
sql.safe_mode = Off<br>
<br>
[ODBC]<br>
;odbc.default_db&nbsp;&nbsp;&nbsp; =&nbsp; Not yet implemented<br>
;odbc.default_user&nbsp; =&nbsp; Not yet implemented<br>
;odbc.default_pw&nbsp;&nbsp;&nbsp; =&nbsp; Not yet implemented<br>
<br>
; Allow or prevent persistent links.<br>
odbc.allow_persistent = On<br>
<br>
; Check that a connection is still valid before reuse.<br>
odbc.check_persistent = On<br>
<br>
; Maximum number of persistent links.&nbsp; -1 means no limit.<br>
odbc.max_persistent = -1<br>
<br>
; Maximum number of links (persistent + non-persistent).&nbsp; -1 means
no limit.<br>
odbc.max_links = -1<br>
<br>
; Handling of LONG fields.&nbsp; Returns number of bytes to
variables.&nbsp; 0 means<br>
; passthru.<br>
odbc.defaultlrl = 4096<br>
<br>
; Handling of binary data.&nbsp; 0 means passthru, 1 return as is, 2
convert to char.<br>
; See the documentation on odbc_binmode and odbc_longreadlen for an
explanation<br>
; of uodbc.defaultlrl and uodbc.defaultbinmode<br>
odbc.defaultbinmode = 1<br>
<br>
[MySQL]<br>
; Allow or prevent persistent links.<br>
mysql.allow_persistent = On<br>
<br>
; Maximum number of persistent links.&nbsp; -1 means no limit.<br>
mysql.max_persistent = -1<br>
<br>
; Maximum number of links (persistent + non-persistent).&nbsp; -1 means
no limit.<br>
mysql.max_links = -1<br>
<br>
; Default port number for mysql_connect().&nbsp; If unset,
mysql_connect() will use<br>
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the<br>
; compile-time value defined MYSQL_PORT (in that order).&nbsp; Win32
will only look<br>
; at MYSQL_PORT.<br>
mysql.default_port =<br>
<br>
; Default socket name for local MySQL connects.&nbsp; If empty, uses
the built-in<br>
; MySQL defaults.<br>
mysql.default_socket =<br>
<br>
; Default host for mysql_connect() (doesn't apply in safe mode).<br>
mysql.default_host =<br>
<br>
; Default user for mysql_connect() (doesn't apply in safe mode).<br>
mysql.default_user =<br>
<br>
; Default password for mysql_connect() (doesn't apply in safe mode).<br>
; Note that this is generally a *bad* idea to store passwords in this
file.<br>
; *Any* user with PHP access can run 'echo
get_cfg_var("mysql.default_password")<br>
; and reveal this password!&nbsp; And of course, any users with read
access to this<br>
; file will be able to reveal the password as well.<br>
mysql.default_password =<br>
<br>
; Maximum time (in seconds) for connect timeout. -1 means no limit<br>
mysql.connect_timeout = 60<br>
<br>
; Trace mode. When trace_mode is active (=On), warnings for table/index
scans and<br>
; SQL-Errors will be displayed.<br>
mysql.trace_mode = Off<br>
<br>
[MySQLi]<br>
<br>
; Maximum number of links.&nbsp; -1 means no limit.<br>
mysqli.max_links = -1<br>
<br>
; Default port number for mysqli_connect().&nbsp; If unset,
mysqli_connect() will use<br>
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the<br>
; compile-time value defined MYSQL_PORT (in that order).&nbsp; Win32
will only look<br>
; at MYSQL_PORT.<br>
mysqli.default_port = 3306<br>
<br>
; Default socket name for local MySQL connects.&nbsp; If empty, uses
the built-in<br>
; MySQL defaults.<br>
mysqli.default_socket =<br>
<br>
; Default host for mysql_connect() (doesn't apply in safe mode).<br>
mysqli.default_host =<br>
<br>
; Default user for mysql_connect() (doesn't apply in safe mode).<br>
mysqli.default_user =<br>
<br>
; Default password for mysqli_connect() (doesn't apply in safe mode).<br>
; Note that this is generally a *bad* idea to store passwords in this
file.<br>
; *Any* user with PHP access can run 'echo
get_cfg_var("mysqli.default_pw")<br>
; and reveal this password!&nbsp; And of course, any users with read
access to this<br>
; file will be able to reveal the password as well.<br>
mysqli.default_pw =<br>
<br>
; Allow or prevent reconnect<br>
mysqli.reconnect = Off<br>
<br>
[mSQL]<br>
; Allow or prevent persistent links.<br>
msql.allow_persistent = On<br>
<br>
; Maximum number of persistent links.&nbsp; -1 means no limit.<br>
msql.max_persistent = -1<br>
<br>
; Maximum number of links (persistent+non persistent).&nbsp; -1 means
no limit.<br>
msql.max_links = -1<br>
<br>
[OCI8]<br>
; enables privileged connections using external credentials
(OCI_SYSOPER, OCI_SYSDBA)<br>
;oci8.privileged_connect = Off<br>
<br>
; Connection: The maximum number of persistent OCI8 connections per<br>
; process. Using -1 means no limit.<br>
;oci8.max_persistent = -1<br>
<br>
; Connection: The maximum number of seconds a process is allowed to<br>
; maintain an idle persistent connection. Using -1 means idle<br>
; persistent connections will be maintained forever.<br>
;oci8.persistent_timeout = -1<br>
<br>
; Connection: The number of seconds that must pass before issuing a<br>
; ping during oci_pconnect() to check the connection validity. When<br>
; set to 0, each oci_pconnect() will cause a ping. Using -1 disables<br>
; pings completely.<br>
;oci8.ping_interval = 60<br>
<br>
; Tuning: This option enables statement caching, and specifies how<br>
; many statements to cache. Using 0 disables statement caching.<br>
;oci8.statement_cache_size = 20<br>
<br>
; Tuning: Enables statement prefetching and sets the default number of<br>
; rows that will be fetched automatically after statement execution.<br>
;oci8.default_prefetch = 10<br>
<br>
; Compatibility. Using On means oci_close() will not close<br>
; oci_connect() and oci_new_connect() connections.<br>
;oci8.old_oci_close_semantics = Off<br>
<br>
[PostgresSQL]<br>
; Allow or prevent persistent links.<br>
pgsql.allow_persistent = On<br>
<br>
; Detect broken persistent links always with pg_pconnect().<br>
; Auto reset feature requires a little overheads.<br>
pgsql.auto_reset_persistent = Off<br>
<br>
; Maximum number of persistent links.&nbsp; -1 means no limit.<br>
pgsql.max_persistent = -1<br>
<br>
; Maximum number of links (persistent+non persistent).&nbsp; -1 means
no limit.<br>
pgsql.max_links = -1<br>
<br>
; Ignore PostgreSQL backends Notice message or not.<br>
; Notice message logging require a little overheads.<br>
pgsql.ignore_notice = 0<br>
<br>
; Log PostgreSQL backends Noitce message or not.<br>
; Unless pgsql.ignore_notice=0, module cannot log notice message.<br>
pgsql.log_notice = 0<br>
<br>
[Sybase]<br>
; Allow or prevent persistent links.<br>
sybase.allow_persistent = On<br>
<br>
; Maximum number of persistent links.&nbsp; -1 means no limit.<br>
sybase.max_persistent = -1<br>
<br>
; Maximum number of links (persistent + non-persistent).&nbsp; -1 means
no limit.<br>
sybase.max_links = -1<br>
<br>
;sybase.interface_file = "/usr/sybase/interfaces"<br>
<br>
; Minimum error severity to display.<br>
sybase.min_error_severity = 10<br>
<br>
; Minimum message severity to display.<br>
sybase.min_message_severity = 10<br>
<br>
; Compatibility mode with old versions of PHP 3.0.<br>
; If on, this will cause PHP to automatically assign types to results
according<br>
; to their Sybase type, instead of treating them all as strings.&nbsp;
This<br>
; compatibility mode will probably not stay around forever, so try
applying<br>
; whatever necessary changes to your code, and turn it off.<br>
sybase.compatability_mode = Off<br>
<br>
[Sybase-CT]<br>
; Allow or prevent persistent links.<br>
sybct.allow_persistent = On<br>
<br>
; Maximum number of persistent links.&nbsp; -1 means no limit.<br>
sybct.max_persistent = -1<br>
<br>
; Maximum number of links (persistent + non-persistent).&nbsp; -1 means
no limit.<br>
sybct.max_links = -1<br>
<br>
; Minimum server message severity to display.<br>
sybct.min_server_severity = 10<br>
<br>
; Minimum client message severity to display.<br>
sybct.min_client_severity = 10<br>
<br>
[bcmath]<br>
; Number of decimal digits for all bcmath functions.<br>
bcmath.scale = 0<br>
<br>
[browscap]<br>
;browscap = extra/browscap.ini<br>
<br>
[Informix]<br>
; Default host for ifx_connect() (doesn't apply in safe mode).<br>
ifx.default_host =<br>
<br>
; Default user for ifx_connect() (doesn't apply in safe mode).<br>
ifx.default_user =<br>
<br>
; Default password for ifx_connect() (doesn't apply in safe mode).<br>
ifx.default_password =<br>
<br>
; Allow or prevent persistent links.<br>
ifx.allow_persistent = On<br>
<br>
; Maximum number of persistent links.&nbsp; -1 means no limit.<br>
ifx.max_persistent = -1<br>
<br>
; Maximum number of links (persistent + non-persistent).&nbsp; -1 means
no limit.<br>
ifx.max_links = -1<br>
<br>
; If on, select statements return the contents of a text blob instead
of its id.<br>
ifx.textasvarchar = 0<br>
<br>
; If on, select statements return the contents of a byte blob instead
of its id.<br>
ifx.byteasvarchar = 0<br>
<br>
; Trailing blanks are stripped from fixed-length char columns.&nbsp;
May help the<br>
; life of Informix SE users.<br>
ifx.charasvarchar = 0<br>
<br>
; If on, the contents of text and byte blobs are dumped to a file
instead of<br>
; keeping them in memory.<br>
ifx.blobinfile = 0<br>
<br>
; NULL's are returned as empty strings, unless this is set to 1.&nbsp;
In that case,<br>
; NULL's are returned as string 'NULL'.<br>
ifx.nullformat = 0<br>
<br>
[Session]<br>
; Handler used to store/retrieve data.<br>
session.save_handler = files<br>
<br>
; Argument passed to save_handler.&nbsp; In the case of files, this is
the path<br>
; where data files are stored. Note: Windows users have to change this<br>
; variable in order to use PHP's session functions.<br>
;<br>
; As of PHP 4.0.1, you can define the path as:<br>
;<br>
;&nbsp;&nbsp;&nbsp;&nbsp; session.save_path = "N;/path"<br>
;<br>
; where N is an integer.&nbsp; Instead of storing all the session files
in<br>
; /path, what this will do is use subdirectories N-levels deep, and<br>
; store the session data in those directories.&nbsp; This is useful if
you<br>
; or your OS have problems with lots of files in one directory, and is<br>
; a more efficient layout for servers that handle lots of sessions.<br>
;<br>
; NOTE 1: PHP will not create this directory structure automatically.<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; You can use the
script in the ext/session dir for that purpose.<br>
; NOTE 2: See the section on garbage collection below if you choose to<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use subdirectories
for session storage<br>
;<br>
; The file storage module creates files using mode 600 by default.<br>
; You can change that by using<br>
;<br>
;&nbsp;&nbsp;&nbsp;&nbsp; session.save_path = "N;MODE;/path"<br>
;<br>
; where MODE is the octal representation of the mode. Note that this<br>
; does not overwrite the process's umask.<br>
;session.save_path = "/tmp"<br>
<br>
; Whether to use cookies.<br>
session.use_cookies = 1<br>
<br>
;session.cookie_secure =<br>
<br>
; This option enables administrators to make their users invulnerable to<br>
; attacks which involve passing session ids in URLs; defaults to 0.<br>
; session.use_only_cookies = 1<br>
<br>
; Name of the session (used as cookie name).<br>
session.name = PHPSESSID<br>
<br>
; Initialize session on request startup.<br>
session.auto_start = 0<br>
<br>
; Lifetime in seconds of cookie or, if 0, until browser is restarted.<br>
session.cookie_lifetime = 0<br>
<br>
; The path for which the cookie is valid.<br>
session.cookie_path = /<br>
<br>
; The domain for which the cookie is valid.<br>
session.cookie_domain =<br>
<br>
; Whether or not to add the httpOnly flag to the cookie, which makes it
inaccessible to browser scripting languages such as JavaScript.<br>
session.cookie_httponly = <br>
<br>
; Handler used to serialize data.&nbsp; php is the standard serializer
of PHP.<br>
session.serialize_handler = php<br>
<br>
; Define the probability that the 'garbage collection' process is
started<br>
; on every session initialization.<br>
; The probability is calculated by using gc_probability/gc_divisor,<br>
; e.g. 1/100 means there is a 1% chance that the GC process starts<br>
; on each request.<br>
<br>
session.gc_probability = 1<br>
session.gc_divisor&nbsp;&nbsp;&nbsp;&nbsp; = 1000<br>
<br>
; After this number of seconds, stored data will be seen as 'garbage'
and<br>
; cleaned up by the garbage collection process.<br>
session.gc_maxlifetime = 1440<br>
<br>
; NOTE: If you are using the subdirectory option for storing session
files<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (see session.save_path above),
then garbage collection does *not*<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; happen automatically.&nbsp; You
will need to do your own garbage<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; collection through a shell
script, cron entry, or some other method.<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For example, the following script
would is the equivalent of<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setting session.gc_maxlifetime to
1440 (1440 seconds = 24 minutes):<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd
/path/to/sessions; find -cmin +24 | xargs rm<br>
<br>
; PHP 4.2 and less have an undocumented feature/bug that allows you to<br>
; to initialize a session variable in the global scope, albeit
register_globals<br>
; is disabled.&nbsp; PHP 4.3 and later will warn you, if this feature
is used.<br>
; You can disable the feature and the warning separately. At this time,<br>
; the warning is only displayed, if bug_compat_42 is enabled.<br>
<br>
session.bug_compat_42 = 0<br>
session.bug_compat_warn = 1<br>
<br>
; Check HTTP Referer to invalidate externally stored URLs containing
ids.<br>
; HTTP_REFERER has to contain this substring for the session to be<br>
; considered as valid.<br>
session.referer_check =<br>
<br>
; How many bytes to read from the file.<br>
session.entropy_length = 0<br>
<br>
; Specified here to create the session id.<br>
session.entropy_file =<br>
<br>
;session.entropy_length = 16<br>
<br>
;session.entropy_file = /dev/urandom<br>
<br>
; Set to {nocache,private,public,} to determine HTTP caching aspects<br>
; or leave this empty to avoid sending anti-caching headers.<br>
session.cache_limiter = nocache<br>
<br>
; Document expires after n minutes.<br>
session.cache_expire = 180<br>
<br>
; trans sid support is disabled by default.<br>
; Use of trans sid may risk your users security.<br>
; Use this option with caution.<br>
; - User may send URL contains active session ID<br>
;&nbsp;&nbsp; to other person via. email/irc/etc.<br>
; - URL that contains active session ID may be stored<br>
;&nbsp;&nbsp; in publically accessible computer.<br>
; - User may access your site with the same session ID<br>
;&nbsp;&nbsp; always using URL stored in browser's history or bookmarks.<br>
session.use_trans_sid = 0<br>
<br>
; Select a hash function<br>
; 0: MD5&nbsp;&nbsp; (128 bits)<br>
; 1: SHA-1 (160 bits)<br>
session.hash_function = 0<br>
<br>
; Define how many bits are stored in each character when converting<br>
; the binary hash data to something readable.<br>
;<br>
; 4 bits: 0-9, a-f<br>
; 5 bits: 0-9, a-v<br>
; 6 bits: 0-9, a-z, A-Z, "-", ","<br>
session.hash_bits_per_character = 5<br>
<br>
; The URL rewriter will look for URLs in a defined set of HTML tags.<br>
; form/fieldset are special; if you include them here, the rewriter will<br>
; add a hidden &lt;input&gt; field with the info which is otherwise
appended<br>
; to URLs.&nbsp; If you want XHTML conformity, remove the form entry.<br>
; Note that all valid entries require a "=", even if no value follows.<br>
url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=fakeentry"<br>
<br>
[MSSQL]<br>
; Allow or prevent persistent links.<br>
mssql.allow_persistent = On<br>
<br>
; Maximum number of persistent links.&nbsp; -1 means no limit.<br>
mssql.max_persistent = -1<br>
<br>
; Maximum number of links (persistent+non persistent).&nbsp; -1 means
no limit.<br>
mssql.max_links = -1<br>
<br>
; Minimum error severity to display.<br>
mssql.min_error_severity = 10<br>
<br>
; Minimum message severity to display.<br>
mssql.min_message_severity = 10<br>
<br>
; Compatibility mode with old versions of PHP 3.0.<br>
mssql.compatability_mode = Off<br>
<br>
; Connect timeout<br>
;mssql.connect_timeout = 5<br>
<br>
; Query timeout<br>
;mssql.timeout = 60<br>
<br>
; Valid range 0 - 2147483647.&nbsp; Default = 4096.<br>
;mssql.textlimit = 4096<br>
<br>
; Valid range 0 - 2147483647.&nbsp; Default = 4096.<br>
;mssql.textsize = 4096<br>
<br>
; Limits the number of records in each batch.&nbsp; 0 = all records in
one batch.<br>
;mssql.batchsize = 0<br>
<br>
; Specify how datetime and datetim4 columns are returned<br>
; On =&gt; Returns data converted to SQL server settings<br>
; Off =&gt; Returns values as YYYY-MM-DD hh:mm:ss<br>
;mssql.datetimeconvert = On<br>
<br>
; Use NT authentication when connecting to the server<br>
mssql.secure_connection = Off<br>
<br>
; Specify max number of processes. -1 = library default<br>
; msdlib defaults to 25<br>
; FreeTDS defaults to 4096<br>
;mssql.max_procs = -1<br>
<br>
; Specify client character set. <br>
; If empty or not set the client charset from freetds.comf is used<br>
; This is only used when compiled with FreeTDS<br>
;mssql.charset = "ISO-8859-1"<br>
<br>
[Assertion]<br>
; Assert(expr); active by default.<br>
;assert.active = On<br>
<br>
; Issue a PHP warning for each failed assertion.<br>
;assert.warning = On<br>
<br>
; Don't bail out by default.<br>
;assert.bail = Off<br>
<br>
; User-function to be called if an assertion fails.<br>
;assert.callback = 0<br>
<br>
; Eval the expression with current error_reporting().&nbsp; Set to true
if you want<br>
; error_reporting(0) around the eval().<br>
;assert.quiet_eval = 0<br>
<br>
[COM]<br>
; path to a file containing GUIDs, IIDs or filenames of files with
TypeLibs<br>
;com.typelib_file =<br>
; allow Distributed-COM calls<br>
;com.allow_dcom = true<br>
; autoregister constants of a components typlib on com_load()<br>
;com.autoregister_typelib = true<br>
; register constants casesensitive<br>
;com.autoregister_casesensitive = false<br>
; show warnings on duplicate constant registrations<br>
;com.autoregister_verbose = true<br>
<br>
[mbstring]<br>
; language for internal character representation.<br>
mbstring.language = Japanese<br>
<br>
; internal/script encoding.<br>
; Some encoding cannot work as internal encoding.<br>
; (e.g. SJIS, BIG5, ISO-2022-*)<br>
mbstring.internal_encoding = UTF-8<br>
<br>
; http input encoding.<br>
mbstring.http_input = auto<br>
<br>
; http output encoding. mb_output_handler must be<br>
; registered as output buffer to function<br>
mbstring.http_output = UTF-8<br>
<br>
; enable automatic encoding translation according to<br>
; mbstring.internal_encoding setting. Input chars are<br>
; converted to internal encoding by setting this to On.<br>
; Note: Do _not_ use automatic encoding translation for<br>
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; portable libs/applications.<br>
mbstring.encoding_translation = Off<br>
<br>
; automatic encoding detection order.<br>
; auto means<br>
mbstring.detect_order = auto<br>
<br>
; substitute_character used when character cannot be converted<br>
; one from another<br>
mbstring.substitute_character = none;<br>
<br>
; overload(replace) single byte functions by mbstring functions.<br>
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),<br>
; etc. Possible values are 0,1,2,4 or combination of them.<br>
; For example, 7 for overload everything.<br>
; 0: No overload<br>
; 1: Overload mail() function<br>
; 2: Overload str*() functions<br>
; 4: Overload ereg*() functions<br>
;mbstring.func_overload = 0<br>
<br>
; enable strict encoding detection.<br>
;mbstring.strict_encoding = Off<br>
<br>
mbstring.script_encoding = auto<br>
<br>
[FrontBase]<br>
;fbsql.allow_persistent = On<br>
;fbsql.autocommit = On<br>
;fbsql.show_timestamp_decimals = Off<br>
;fbsql.default_database =<br>
;fbsql.default_database_password =<br>
;fbsql.default_host =<br>
;fbsql.default_password =<br>
;fbsql.default_user = "_SYSTEM"<br>
;fbsql.generate_warnings = Off<br>
;fbsql.max_connections = 128<br>
;fbsql.max_links = 128<br>
;fbsql.max_persistent = -1<br>
;fbsql.max_results = 128<br>
<br>
[gd]<br>
; Tell the jpeg decode to libjpeg warnings and try to create<br>
; a gd image. The warning will then be displayed as notices<br>
; disabled by default<br>
;gd.jpeg_ignore_warning = 0<br>
<br>
[exif]<br>
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as
JIS.<br>
; With mbstring support this will automatically be converted into the
encoding<br>
; given by corresponding encode setting. When empty
mbstring.internal_encoding<br>
; is used. For the decode settings you can distinguish between motorola
and<br>
; intel byte order. A decode setting cannot be empty.<br>
;exif.encode_unicode = ISO-8859-15<br>
;exif.decode_unicode_motorola = UCS-2BE<br>
;exif.decode_unicode_intel&nbsp;&nbsp;&nbsp; = UCS-2LE<br>
;exif.encode_jis =<br>
;exif.decode_jis_motorola = JIS<br>
;exif.decode_jis_intel&nbsp;&nbsp;&nbsp; = JIS<br>
<br>
[Tidy]<br>
; The path to a default tidy configuration file to use when using tidy<br>
;tidy.default_config = /usr/local/lib/php/default.tcfg<br>
<br>
; Should tidy clean and repair output automatically?<br>
; WARNING: Do not use this option if you are generating non-html content<br>
; such as dynamic images<br>
tidy.clean_output = Off<br>
<br>
[soap]<br>
; Enables or disables WSDL caching feature.<br>
soap.wsdl_cache_enabled=1<br>
; Sets the directory name where SOAP extension will put cache files.<br>
soap.wsdl_cache_dir="/tmp"<br>
; (time to live) Sets the number of second while cached file will be
used <br>
; instead of original one.<br>
soap.wsdl_cache_ttl=86400<br>
<br>
; Local Variables:<br>
; tab-width: 4<br>
; End:<br>
<br>
[ EOF ]<br>
------------------<br>
<br>]]>
        
    </content>
</entry>

<entry>
    <title>/usr/bin/ld: cannot find -lltdl *** Error code 1</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/unix-bsd-linux/usrbinld-cannot-find--lltdl-error-code-1.html" />
    <id>tag:community.giga-works.com,2010://3.153</id>

    <published>2010-10-21T13:40:16Z</published>
    <updated>2010-10-21T13:41:24Z</updated>

    <summary>/usr/bin/ld: cannot find -lltdl *** Erro...</summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Unix / BSD / Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<span class="highlight">/usr/bin/ld:</span> <span class="highlight">cannot</span>
<span class="highlight">find</span> -<span class="highlight">lltdl</span>
*** Error code 1<br>
<br>
PHP-5.3.3 をインストール中にエラー発生。<br>
FreeBSD7.3にて。<br>
<br>
<a href="http://d.hatena.ne.jp/akiyan/20061128/1164713205">http://d.hatena.ne.jp/akiyan/20061128/1164713205</a>
を見て解決。<br>
<br>
# cd /usr/ports/security/libmcrypt-2.5.7/libltdl<br>
# ./configure --enable-ltdl-install<br>
# make install clean
<br>
<br>
その後PHPを再度 make; make test; make install して完了。<br>
<br>]]>
        
    </content>
</entry>

<entry>
    <title>libphp5.so: Undefined symbol &quot;ap_user_id&quot;</title>
    <link rel="alternate" type="text/html" href="http://community.giga-works.com/unix-bsd-linux/libphp5so-undefined-symbol-ap-user-id.html" />
    <id>tag:community.giga-works.com,2010://3.152</id>

    <published>2010-09-19T09:30:00Z</published>
    <updated>2010-09-20T15:33:33Z</updated>

    <summary><![CDATA[ &nbsp;FreeBSD7.x, Apache1.3.x, php5.2.x...]]></summary>
    <author>
        <name>hoehoe</name>
        
    </author>
    
        <category term="Unix / BSD / Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="ja" xml:base="http://community.giga-works.com/">
        <![CDATA[<br>

&nbsp;FreeBSD7.x, Apache1.3.x, php5.2.xでソースからインストール(コンパイル)後、Apacheを起動すると<br>

<br>

[root@bsd7 ]# /usr/local/etc/rc.d/apache.sh start<br>

Starting Apache web server: Syntax error on line 205 of /usr/local/apache/conf/httpd.conf:<br>

Cannot load /usr/local/apache/libexec/libphp5.so into server:
/usr/local/apache/libexec/libphp5.so: Undefined symbol "ap_user_id"<br>

/usr/local/apache/bin/apachectl start: httpd could not be started<br>

<br>

<br>

となってApacheが起動しない...のの対処法。<br>

# つか、いい加減Apache1.3.xは使わない方向で。<br>
# 2.2.xなどの現在stableでリリースされてるものを使いましょう。<br>
<br>

<br>

【 解決法 】<br>

<br>

&nbsp;FreeBSD7.xではソースからコンパイルせず、portsを使いましょう。<br>

<br>

MySQLもしくはPostgreSQLはportsでインストール済みとする。<br>

んで、configureオプションは以下の通り。<br>

<br>

[ apache1.3.42 ]<br>

./configure --prefix=/usr/local/apache --enable-suexec
--suexec-caller=nobody --suexec-userdir=homepage --suexec-docroot=/home
--suexec-logfile=/usr/local/apache/logs/suexec_log --suexec-uidmin=1000
--suexec-gidmin=1000 --suexec-safepath="/bin:/usr/bin"
--enable-module=log_agent --enable-module=log_referer
--enable-module=so --enable-module=rewrite<br>

<br>

[ php-5.2.14 ]<br>

./configure --enable-mbstring --with-apxs=/usr/local/apache/bin/apxs
--prefix=/usr/local/php --with-pgsql=/usr/local/pgsql/
--with-mysql=/usr/local/mysql/<br>

<br>

<br>
portsからインストールするんだけど、SuExecとかも指定したいので/etc/make.confを設定し、/usr/ports/www/apache13/Makefileを書き換えます。<br>

その上で、phpをインストールするとapacheも同時にインストールしてくれる。<br>

<br>

[ /etc/make.conf ]<br>
--------<br>
# added by use.perl 2010-09-18 22:01:14<br>
PERL_VERSION=5.10.1<br>
<br>
#apache1.3<br>
WITH_APACHE_SUEXEC = yes<br>
APACHE_SUEXEC_DOCROOT = /home<br>
APACHE_SUEXEC_CALLER = nobody<br>
APACHE_SUEXEC_UIDMIN = 1000<br>
APACHE_SUEXEC_GIDMIN = 1000<br>
APACHE_SUEXEC_LOG = /var/log/httpd-suexec_log<br>
APACHE_SUEXEC_USERDIR = homepage<br>
DEFAULT_PATH = "/bin:/usr/bin"<br>
--------<br>
<br>
<br>

[ /usr/ports/www/apache13/Makefile ]<br>

<br>

&nbsp;55&nbsp; CONFIGURE_ARGS= --prefix=${PREFIX} \<br>

&nbsp;&nbsp;&nbsp;
56&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--server-uid=www \<br>

&nbsp;&nbsp;&nbsp;
57&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--server-gid=www \<br>

&nbsp;&nbsp;&nbsp;
58&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--with-perl=${PERL} \<br>

&nbsp;&nbsp;&nbsp;
59&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--with-layout=FreeBSD \<br>

&nbsp;&nbsp;&nbsp;
60&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--suexec-docroot=${PREFIX}/www/data \<br>

&nbsp;&nbsp;&nbsp;
61&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--without-confadjust \<br>

&nbsp;&nbsp;&nbsp;
62&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=most \<br>

&nbsp;&nbsp;&nbsp;
63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=auth_db \<br>

&nbsp;&nbsp;&nbsp;
64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=mmap_static \<br>

&nbsp;&nbsp;&nbsp;
65&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--disable-module=auth_dbm \<br>

&nbsp;&nbsp;&nbsp;
66&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-shared=max \<br>

&nbsp;&nbsp;&nbsp;
67&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=ssl \<br>

&nbsp;&nbsp;&nbsp;
68&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=define<br>

<br>

を修正する<br>

<br>

CONFIGURE_ARGS= --prefix=${PREFIX} \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--server-uid=www \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--server-gid=www \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--with-perl=${PERL} \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--with-layout=FreeBSD \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--suexec-docroot=${PREFIX}/www/data \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--without-confadjust \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=most \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=auth_db \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=mmap_static \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--disable-module=auth_dbm \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-shared=max \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=ssl \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=define \<br>
<br>
<span style="color: red;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=log_agent \</span><br style="color: red;">
<span style="color: red;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=log_referer \</span><br style="color: red;">
<span style="color: red;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=so \</span><br style="color: red;">
<span style="color: red;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
--enable-module=rewrite \</span><br>

<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
${SUEXEC_CONF} \<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
${EXPAT_CONF}<br>

<br>

以下操作ログ<br>

<br>

[root@bsd7 ]# vi /etc/make.conf<br>

[root@bsd7 ]# pushd /usr/ports/www/apache13<br>

<br>

# Apacheが既にインストール済みの場合、PortsからPHPをインストールしようとするとエラーになるので、一旦アンインストールする。<br>
#
インストールしていない場合は/etc/make.confを設定後、ApacheのMakefileを書き換えてPHPをインストールすれば同時に
Apacheもインストールされるので、あえて明示的にApacheをインストールせずPHPのみをインストールすれば良い。<br>

[root@bsd7 ]# make deinstall<br>

<br>

# ここで、上記の様にCONFIGURE_ARGSを指定する<br>

[root@bsd7 ]# vi Makefile<br>

<br>

[root@bsd7 ]# pushd /usr/ports/lang/php52<br>

[root@bsd7 ]# make clean<br>

<br>

# make configにてphpのconfigureオプションを指定<br>

[root@bsd7 ]# make config<br>

<br>

[root@bsd7 ]# make<br>

[root@bsd7 ]# make test<br>

[root@bsd7 ]# make install<br>

[root@bsd7 ]# make clean<br>

<br>

OSがFreeBSD7.xならports使っとけって話です。<br>

<br>

<br>
■追記<br>
OSがFreeBSD7.xの場合、<br>
1. Apache1.3.xを使う場合、Apache, PHPともportsからインストールする。<br>
2. どうしてもソースからインストールしたい場合は Apache2.2.xを使用する。<br>
<br>
3. OS(FreeBSD)は安定版を使用する - 7.x, 5.xなどの奇数Verは極力避ける -<br>
などなど。<br>
<br>
気をつけましょう。<br>
<br>]]>
        
    </content>
</entry>

</feed>

