<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>上善若水 &#187; kohana</title>
	<atom:link href="http://iiiorz.net/category/kohana/feed/" rel="self" type="application/rss+xml" />
	<link>http://iiiorz.net</link>
	<description>如果我不能死在一万个敌人的包围中，那就让我死在一万个美女的怀抱中吧</description>
	<lastBuildDate>Fri, 19 Nov 2010 04:05:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>kohana中使用PHPRPC</title>
		<link>http://iiiorz.net/2009/11/kohana%e4%b8%ad%e4%bd%bf%e7%94%a8phprpc/</link>
		<comments>http://iiiorz.net/2009/11/kohana%e4%b8%ad%e4%bd%bf%e7%94%a8phprpc/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 08:09:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[kohana]]></category>
		<category><![CDATA[PHPRPC]]></category>

		<guid isPermaLink="false">http://iiiorz.net/?p=78</guid>
		<description><![CDATA[kohana版本: 2.34 PHPRPC介绍： PHPRPC 以下是实现kohana 使用 PHPRPC的具体实例，已经应用在一具体的项目中。功能不算强大，算是抛砖引玉吧。 Library 中 Rpc.php 服务器上Controllers中的 server.php 服务器端事物处理文件 Library 中 As_user.php 客户端测试Controllers 代码]]></description>
			<content:encoded><![CDATA[<p>kohana版本: 2.34<br />
PHPRPC介绍： PHPRPC</p>
<p>以下是实现kohana 使用 PHPRPC的具体实例，已经应用在一具体的项目中。功能不算强大，算是抛砖引玉吧。</p>
<p>Library 中 Rpc.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php defined('SYSPATH') OR die('No direct access allowed.');

class RPC_Core {

private static $instance;

private static $data;

private static $server;

private $phprpc;

public static function instance()
{
if (!isset(self::$instance))
{
$class = __CLASS__;
self::$instance = new $class;
}
return self::$instance;
}

public function __construct()
{
//self::$server = &quot;http://172.16.7.5&quot;;
$this-&gt;phprpc = TRUE;
$this-&gt;phprpc = FALSE;
self::$server = &quot;http://site.fj&quot;;
}

public function __call($name, $args){

$class = $name;

$method = $args[0];

$args = array_slice($args,1);

if($this-&gt;phprpc)
{
require_once(MODPATH.'phprpc/phprpc_client.php');
$client = new PHPRPC_Client(self::$server.'/server/data/'.$class.'/'.$method);
return $client-&gt;{$method}($args);
}else{
$class = 'As_'.$class;
$class = new $class;
return $class-&gt;{$method}($args);
}
}
}
</pre>
<p>服务器上Controllers中的 server.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php defined('SYSPATH') OR die('No direct access allowed.');

class Server_Controller extends Controller {

public function data($class)
{
$method = $this-&gt;uri-&gt;segment(4);
require_once(MODPATH.'phprpc/phprpc_server.php');

$server = new PHPRPC_Server();
$class = 'As_'.$class;
$server-&gt;add($method , new $class);
$server-&gt;start();
}
}
</pre>
<p>服务器端事物处理文件 Library 中 As_user.php</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php defined('SYSPATH') OR die('No direct access allowed.');
class As_user_Core {
public function hello($name)
{
return 'hello world '.kohana::debug($name);
}

public function test()
{
return '-m-';
}
}
</pre>
<p>客户端测试Controllers 代码</p>
<pre class="brush: php; title: ; notranslate">
public function test()
{
echo 'rpc test ...................................&lt;br/&gt;';
$rpc = Rpc::instance();
echo $rpc-&gt;user('hello',$class='class',$name='1');
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://iiiorz.net/2009/11/kohana%e4%b8%ad%e4%bd%bf%e7%94%a8phprpc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>kohana3 tips: profiler</title>
		<link>http://iiiorz.net/2009/10/kohana3-tips-profiler/</link>
		<comments>http://iiiorz.net/2009/10/kohana3-tips-profiler/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 01:21:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[kohana]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://iiiorz.net/?p=61</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: php; title: ; notranslate">
echo View::factory('profiler/stats');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://iiiorz.net/2009/10/kohana3-tips-profiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>kohana3 tips: current uri</title>
		<link>http://iiiorz.net/2009/10/kohana3-tips-current-uri/</link>
		<comments>http://iiiorz.net/2009/10/kohana3-tips-current-uri/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 01:17:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[kohana]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://iiiorz.net/?p=59</guid>
		<description><![CDATA[完全版本(带GET参数)： 干净版本：]]></description>
			<content:encoded><![CDATA[<p>完全版本(带GET参数)：</p>
<pre class="brush: php; title: ; notranslate">
$current_uri = URL::site($this-&gt;request-&gt;uri).'?'.http_build_query($_GET, '&amp;');
</pre>
<p>干净版本：</p>
<pre class="brush: php; title: ; notranslate">
$current_uri = URL::site($this-&gt;request-&gt;uri);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://iiiorz.net/2009/10/kohana3-tips-current-uri/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>kohana2开发环境简单部署</title>
		<link>http://iiiorz.net/2009/04/initial_kohana_develop_environment/</link>
		<comments>http://iiiorz.net/2009/04/initial_kohana_develop_environment/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 07:07:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[kohana]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://iiiorz.net/?p=4</guid>
		<description><![CDATA[在这我将介绍下用kohana框架开发前一些准备工作，已经如何部署kohana到你的开发环境中。 步骤如下： 搭建 lamp环境 设置mod rewrite 模块 设置虚拟主机 设置kohana框架 我的环境如下： os: windows xp sp2 lamp：wampserver 2.o konana:  v2.3   步骤如下： 1.安装 wampserver （安装文档请查看官方文档，不详细介绍） 2.设置mod rewrite 使用wampserver相对比较简单： 启动wamp server 点击系统小托盘中的wamp server 图标 选择apache-&#62;apache modules 将rewrite_module打钩（也可以自行选择自己需要的相关modules） 重新启动wamp server中的所有服务，使改动生效 3.设置自己的虚拟主机 1.点击系统托盘中的wamp server 图标 选择apache http.conf 这个文件，用编辑器打开 在文件底部添加： NameVirtualHost *:80 ServerName www.kohana.fj DocumentRoot D:wampwwwkohana 创建wampwwwkohana这个文件夹，重启apache生效  2.在系统hosts文件中添加 www.kohana.fj hosts文件路径：C:WINDOWSsystem32driversetchosts 在hosts最后一行添加 127.0.0.1 [...]]]></description>
			<content:encoded><![CDATA[<p>在这我将介绍下用kohana框架开发前一些准备工作，已经如何部署kohana到你的开发环境中。</p>
<p>步骤如下：</p>
<ol>
<li>搭建 lamp环境</li>
<li>设置mod rewrite 模块</li>
<li>设置虚拟主机</li>
<li>设置kohana框架</li>
</ol>
<p>我的环境如下：</p>
<ul>
<li>os: windows xp sp2</li>
<li>lamp：wampserver 2.o</li>
<li>konana:  v2.3 </li>
</ul>
<p> 步骤如下：</p>
<p>1.<strong>安装 wampserver</strong></p>
<p><strong><span style="font-weight: normal;">（安装文档请查看官方文档，不详细介绍）</span></strong></p>
<p><strong>2.设置mod rewrite</strong></p>
<p>使用wampserver相对比较简单：</p>
<ol>
<li>启动wamp server</li>
<li>点击系统小托盘中的wamp server 图标 选择apache-&gt;apache modules</li>
<li>将rewrite_module打钩（也可以自行选择自己需要的相关modules）</li>
<li>重新启动wamp server中的所有服务，使改动生效</li>
</ol>
<p><strong>3.设置自己的虚拟主机</strong></p>
<p>1.点击系统托盘中的wamp server 图标 选择apache http.conf 这个文件，用编辑器打开</p>
<p>在文件底部添加：<br />
NameVirtualHost *:80</p>
<p>ServerName www.kohana.fj</p>
<p>DocumentRoot D:wampwwwkohana</p>
<p>创建wampwwwkohana这个文件夹，重启apache生效 </p>
<p>2.在系统hosts文件中添加 www.kohana.fj</p>
<p>hosts文件路径：C:WINDOWSsystem32driversetchosts</p>
<p>在hosts最后一行添加</p>
<p>127.0.0.1    www.kohana.fj</p>
<p>重现打开一个浏览器测试www.kohana.fj是否生效</p>
<p><strong>4.设置kohana框架</strong></p>
<p>1.解压kohana框架的所有文件到kohana这个文件夹中，目录结构如下：</p>
<p>kohana</p>
<p>&#8212;-appliaction</p>
<p>&#8212;-system</p>
<p>&#8212;-modules</p>
<p>&#8212;-index.php</p>
<p>&#8212;-.htaccess</p>
<p>2.修改kohana中的一些设置</p>
<p>2.1 .htaccess中修改为：</p>
<p># Installation directory</p>
<p>RewriteBase /</p>
<p>2.2 application/config/config.php中修改为</p>
<p> 
<pre class="brush: php; title: ; notranslate">
$config['index_page'] = '';
</pre>
<p> </p>
<p>这样，在你的开发环境中就可以用</p>
<p>http://www.kohana.fj/control/method/来访问你的kohana项目,url中不用添加index.php。</p>
<p>至此，kohana的简单开发环境部署完成。</p>
]]></content:encoded>
			<wfw:commentRss>http://iiiorz.net/2009/04/initial_kohana_develop_environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

