Skip to content

Commit

Permalink
Merge branch '1.8/develop' into upstream-1.8-merge
Browse files Browse the repository at this point in the history
Conflicts:
	classes/asset/usage.html
	classes/request/curl.html
	classes/session/config.html
	general/error.html
	general/routing.html
	general/unit_testing.html
	packages/auth/ormauth/usage.html
	packages/orm/observers/included.html
	toc.html
  • Loading branch information
kenjis committed May 21, 2015
2 parents 188dd02 + b5abe53 commit c224104
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 31 deletions.
24 changes: 22 additions & 2 deletions classes/request/curl.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,34 @@ <h4 class="method" id="method_set_params">set_params($params)</h4>

// いくつかのパラメータをセット
$curl->set_params(array('userid' => 12, 'data' => $payload));

// multipart/form-data
$params = array('userid' => 12, 'data' => $payload));
$curl->set_params(array('form-data' => $params));
</code></pre>
</td>
</tr>
</tbody>
</table>
Your param array will automatically convert to the respective format when you set the Content-Type header to one of the
followng values:
<ul>
<li>application/xml</li>
<li>application/soap+xml</li>
<li>text/xml</li>
<li>application/json</li>
<li>text/json</li>
<li>text/csv</li>
<li>application/csv</li>
<li>application/vnd.php.serialized</li>
</ul>
<p class="note">
これらパラメータの使用のされ方は、生成されたリクエストによって異なります。
GET リクエストの場合はクエリ文字列に変換され、POST リクエストの場合は POST のボディになります。
The way these parameters are used depends on the request generated. For GET requests, these will be converted
to a query string. For POST requests, they will become the POST body.<br>
<br>
If you do not set the Content-Type header while sending a request body, your body will be of the type
application/x-www-form-urlencoded. If you prefer to send your request as multipart/form-data, see the
above example.
</p>
</article>

Expand Down
8 changes: 4 additions & 4 deletions classes/session/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ <h2 id="configuration">設定</h2>
</tr>
<tr>
<th>rotation_time</th>
<td>integer</td>
<td>mixed</td>
<td><pre class="php"><code>300</code></pre></td>
<td>
セッション固定によるセッションハイジャックを防ぐために、 Fuel は自動的にセッションの Cookie データを暗号化します。
また、ここで指定した間隔でセッション ID を変更します。
指定しない、または無効な値が定義されている場合、 300 秒がローテーション時間のデフォルト値。
To prevent session hijacking due to session fixation, Fuel automatically encrypts the session cookie data.
It also changes the session IDs at the interval specified here. Automatic rotation can be disabled to settings this value to <kbd>false</kbd>.
If not given, or an invalid value is defined, the rotation time defaults to 300 seconds.
</td>
</tr>
<tr>
Expand Down
27 changes: 22 additions & 5 deletions general/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,12 @@ <h4 id="catch_all">Catch all</h4>
<h4 id="throw_500">500 をスローする</h4>

<p>
アプリケーションを単純に停止し、サーバの不適切な動作エラーを表示することが必要な場合があります。
通常それは
<a href="http://ja.wikipedia.org/wiki/HTTP%E3%82%B9%E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89#5xx_Server_Error_.E3.82.B5.E3.83.BC.E3.83.90.E3.82.A8.E3.83.A9.E3.83.BC">500 Internal
Server Error</a> です。
There may be moments where your applications simply need to stop and show an error to
indicate that something has gone wrong on the server. Normally this is a
<a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_Error">500 Internal
Server Error</a>. This exception can be caught in the front controller by defining a
<kbd>_500_</kbd> route. It allows you to show a proper error message, do additional
error logging, or send a notification to an administrator to get the issue fixed.
</p>

<p>
Expand All @@ -205,7 +207,22 @@ <h4 id="throw_500">500 をスローする</h4>

<pre class="php"><code>throw new HttpServerErrorException;</code></pre>

<h3 id="cli">CLI モードでのエラー</h3>
<h4 id="throw_403">Throwing a 403</h4>

<p>
If you want centralized handling of access violations, you can choose to signal an
access violation by throwing an HttpNoAccessException. This exception can be caught
in the front controller by defining a <kbd>_403_</kbd> route. The handler could for
example store the current URI, ask for a login, and if a success, return to the stored
URI so the user can return to where the violation occured.
</p>
<p>
Similar to throwing a 404, one can throw a 403 error.
</p>

<pre class="php"><code>throw new HttpNoAccessException;</code></pre>

<h3 id="cli">Errors in CLI mode</h3>

<p>
CLI モードでエラーが起こると、oil console によるインタラクティブな場合でも、タスクを実行した場合でも、
Expand Down
19 changes: 15 additions & 4 deletions general/routing.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,25 @@ <h2>ルーティング</h2>

<h3 id="reserved">予約済みルート</h3>

<p>Fuel には 2 つの予約済みルートがあります。<kbd>_root_</kbd> および <kbd>_404_</kbd> です。</p>
<p>In Fuel there are 4 reserved routes. They are <kbd>_root_</kbd>, <kbd>_403_</kbd>, <kbd>_404_</kbd> and <kbd>_500_</kbd>.</p>

<ul>
<li><kbd>_root_</kbd> - URI が指定されていないときのデフォルトルート。</li>
<li><kbd>_404_</kbd> - コントローラ、あるいはアクションが見つからないときのルート。
キャッチオールのルートとしても使えます。</li>
<li><kbd>_root_</kbd> - The default route when no URI is specified.</li>
<li><kbd>_403_</kbd> - The route used when the application throws an HttpNoAccessException that isn't caught.</li>
<li><kbd>_404_</kbd> - The route used when the application throws an HttpNotFoundException that isn't caught.</li>
<li><kbd>_500_</kbd> - The route used when the application throws an HttpServerErrorException that isn't caught.</li>
</ul>

<p class="note">
The request class throws an HttpNotFoundException when you request a URI (a route) that your application
can't resolve.
</p>
<p class="note">
If no <kbd>_404_</kbd> route is defined, the framework uses it's own error handler to display
a "page not found" message. If no <kbd>_403_</kbd> or <kbd>_500_</kbd> route is defined, these
exceptions remain uncaught, and are handled like any other exception your application might throw.
</p>

<pre class="php"><code>return array(
'_root_' => 'welcome/index',
'_404_' => 'welcome/404',
Expand Down
4 changes: 2 additions & 2 deletions general/unit_testing.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ <h3 id="prerequisite">
</h3>

<p>
FuelPHP のテストを利用したい場合や、oil コマンドで作成したテストを実行したい場合は、まず <a title="PHPUnit テストフレームワーク" href="http://www.phpunit.de/manual/current/ja/index.html">PHPUnit</a> がローカル環境にインストールされている必要があります。
もしまだ PHPUnit がインストールされていない場合は、以下の PHPUnit インストールマニュアルを参照して下さい。 <a title="PHPUnit Installation" href="http://www.phpunit.de/manual/current/ja/installation.html">http://www.phpunit.de/manual/current/ja/installation.html</a>.
You'll need to have <a title="The PHPUnit Testing Framework" href="http://www.phpunit.de/manual/current/en/index.html">PHPUnit</a> installed locally if you want to run the tests that ship with FuelPHP, and if you want to use Oil to run your tests.
If you don't already have PHPUnit installed, please refer to the PHPUnit installation documentation at: <a title="PHPUnit Installation" href="https://phpunit.de/manual/current/en/installation.html">https://phpunit.de/manual/current/en/installation.html</a>.
</p>

<p>
Expand Down
1 change: 1 addition & 0 deletions installation/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h2>外部の読み物</h2>
<li><a href="http://www.novius-labs.com/fuelphp,c,5.html">FuelPHP tutorial series</a> (Novius Labs, in French)</li>
<li><a href="http://www.phpbuilder.com/columns/FuelPHP_Gilmore_08-25-2011.php3">Getting Started with the Fuel PHP Framework</a> (Jason Gilmore)</li>
<li><a href="http://www.phpbuilder.com/columns/MySQL_Fuel/mysql-fuel-php-app.php3">Creating a Database-driven Fuel PHP Application</a> (Jason Gilmore)</li>
<li><a href="http://sebastien.drouyer.com/tutorials/tutorial-building-first-fuelphp-application.html">Building your first FuelPHP application</a> (Sébastien Drouyer)</li>
</ul>
</li>
<li id="screencasts">スクリーンキャスト
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/ormauth/usage.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ <h4 id="method_validate_user" class="method">validate_user($username_or_email =
<tr>
<th></th>
<td>
<pre class="php"><code>// ユーザ名とパスワードを検証
<pre class="php"><code>// validate the passed username and password
if ($user = Auth::validate_user($name, $pass))
{
// $name $pass との組み合わせが検証されたならユーザーの表示名を印字
// $name and $pass validated, print the username
echo $user->username;
}
</code></pre>
Expand Down
12 changes: 6 additions & 6 deletions packages/orm/observers/included.html
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ <h4 id="os_validation">Observer_Validation</h4>
$errors = array();
foreach ($e->get_fieldset()->validation()->error() as $error)
{
$errors = array(
'field' => $error->field, // エラーの原因となったフィールド
'value' => $error->value, // 誤りがある値
'message' => trim($error->get_message(false, '\t', '\t')), // エラーメッセージ
'rule' => $error->rule, // 失敗したルール
'params' => $error->params, // ルールに渡されたパラメータ
$errors[] = array(
'field' => $error->field, // the field that caused the error
'value' => $error->value, // the value that is in error
'message' => trim($error->get_message(false, '\t', '\t')), // the error message
'rule' => $error->rule, // the rule that failed
'params' => $error->params, // any parameters passed to the rule
);
}
return $errors;
Expand Down
12 changes: 6 additions & 6 deletions toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ <h3>概要</h3>

<h3>サードパーティ</h3>
<ul class="toc">
<li><a href="vendor/intro.html">はじめに</a> - 使用されているベンダーパッケージの概要とライセンス情報</li>
<li><a href="vendor/htmlawed.html">htmLawed</a> - 投稿されたデータのフィルタリングとスクリーニング</li>
<li><a href="vendor/markdown.html">Markdown</a> - Markdown テキストのためのパーサ</li>
<li><a href="vendor/phpquickprofiler.html">PHPQuickProfiler</a> - FuelPHP のプロファイラの基盤</li>
<li><a href="vendor/phpseclib.html">PHPSecLib</a> - 暗号化と安全な通信に関連したすべて</li>
<li><a href="vendor/spyc.html">spyc</a> - HAML パーサ</li>
<li><a href="vendor/intro.html">Introduction</a> - An overview of the vendor packages used, and their license information</li>
<li><a href="vendor/htmlawed.html">htmLawed</a> - Filtering and screening of posted data</li>
<li><a href="vendor/markdown.html">Markdown</a> - A parser for Markdown text</li>
<li><a href="vendor/phpquickprofiler.html">PHPQuickProfiler</a> - The basis of the FuelPHP profiler</li>
<li><a href="vendor/phpseclib.html">PHPSecLib</a> - Everything related to encryption and secure communication</li>
<li><a href="vendor/spyc.html">spyc</a> - A YAML parser</li>
</ul>

<h2>FuelPHP Core</h2>
Expand Down

0 comments on commit c224104

Please sign in to comment.