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/response.html
	classes/theme/methods.html
  • Loading branch information
kenjis committed Nov 12, 2015
2 parents a5e5bb2 + 954d1a8 commit abbcbc2
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 6 deletions.
60 changes: 59 additions & 1 deletion classes/response.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ <h4 class="method" id="method_set_header">set_header($name, $value, $replace)</h
</tr>
<tr>
<th>返り値</th>
<td>void</td>
<td>Response</td>
</tr>
<tr>
<th></th>
Expand Down Expand Up @@ -346,6 +346,64 @@ <h4 class="method" id="method_set_header">set_header($name, $value, $replace)</h
<p class="note">名前はユニークであることに注意してください。同じ名前が使用された場合、上書きされます。</p>
</article>

<article>
<h4 class="method" id="method_set_headers">set_header($headers, $replace)</h4>
<p>The <strong>set_header</strong> method allows set multiple custom HTTP headers at once.</p>
<table class="method">
<tbody>
<tr>
<th class="legend">Static</th>
<td>No</td>
</tr>
<tr>
<th>Parameters</th>
<td>
<table class="parameters">
<tr>
<th>Param</th>
<th>Default</th>
<th class="description">Description</th>
</tr>
<tr>
<th><kbd>$headers</kbd></th>
<td><i>Required</i></td>
<td>Assoc array of header name/value combinations.</td>
</tr>
<tr>
<th><kbd>$replace</kbd></th>
<td><pre class="php"><code>true</code></pre></td>
<td>All headers will replace any previous value for the same name by default. If you set
this parameter to <kbd>false</kbd> the header won't overwrite and can't be overwritten.</td>
</tr>
</table>
</td>
</tr>
<tr>
<th>Returns</th>
<td>Response</td>
</tr>
<tr>
<th>Example</th>
<td>
<pre class="php"><code>$response = new Response();

// We'll be outputting a PDF called called downloaded.pdf with no caching
$response->set_headers(array
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="downloaded.pdf"',
'Cache-Control' => 'no-cache, no-store, max-age=0, must-revalidate',
'Expires' => 'Mon, 26 Jul 1997 05:00:00 GMT');
'Pragma' => 'no-cache',
));

return $response;</code></pre>
</td>
</tr>
</tbody>
</table>
<p class="note"> Note that names are unique, and will overwrite each other if an existing name is used.</p>
</article>

<article>
<h4 class="method" id="method_get_header">get_header($name = null)</h4>
<p><strong>get_header</strong> メソッドは、セットされたカスタムHTTPヘッダを取得します。</p>
Expand Down
9 changes: 9 additions & 0 deletions classes/security.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ <h3 id="configuration">設定</h3>
CRSF トークンクッキーの有効期限。デフォルトでは、ブラウザセッション終了時まで有効。
</td>
</tr>
<tr>
<th>csrf_bad_request_on_fail</th>
<td>boolean</td>
<td><pre class="php"><code>false</code></pre></td>
<td>
If <strong>true</strong>, a HttpBadRequestException will be thrown when csrf token validation fails. If <strong>false</strong>, a
generic SecurityException will be thrown. Defaults to <strong>false</strong> for B/C reasons.
</td>
</tr>
<tr>
<th>uri_filter</th>
<td>array</td>
Expand Down
11 changes: 6 additions & 5 deletions classes/theme/methods.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,12 @@ <h4 class="method" id="method_presenter">presenter($presenter, $method = 'view',
<td><pre class="php"><code>null</code></pre></td>
<td class="description">自動エンコーディングの設定をするために <em>true</em> または <em>false</em> に設定、メイン設定 (app/config/config.php) がデフォルト。</td>
</tr>
<tr>
<th><kbd>$view</kbd></th>
<td><pre class="php"><code>null</code></pre></td>
<td class="description">カスタムビュー名、プレゼンタ名から判別できないビューがロードされる場合に利用されます。</td>
</tr>
<tr>
<th><kbd>$view</kbd></th>
<td><em>string</em></td>
<td><pre class="php"><code>null</code></pre></td>
<td class="description">カスタムビュー名、プレゼンタ名から判別できないビューがロードされる場合に利用されます。</td>
</tr>
</table>
</td>
</tr>
Expand Down
21 changes: 21 additions & 0 deletions general/migrations.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,31 @@ <h3 id="skip_migrations">マイグレーションのスキップ</h3>
これは、マイグレーションが外部に依存している、例えば、別のマイグレーションによって作成されたテーブルがある場合などに
便利です。
</p>

<p class="note">
これは、現在処理されているマイグレーションスタック、アプリケーションマイグレーションまたは 1つのモジュールやパッケージのマイグレーションのみを中断します。
他のスタックのマイグレーションはすべて通常どおり処理されます。
</p>

<h3 id="prep_migration">Prepping a migration</h3>

<p>
Optionally, a migration class can contain <kbd>before()</kbd> and/or <kbd>after()</kbd> methods, that can be used for prepping, validation
or cleanup functionality. If you have generic functionality, you could create a migration base class for your migrations containing these
methods, so you don't have to duplicate code in every migration.
</p>

<p>
Like with the <kbd>up()</kbd> method, the <kbd>before()</kbd> and <kbd>after()</kbd> methods can return <kbd>false</kbd> to signal a failure.
This can be useful if your migration has generic external dependencies, or perhaps additional validation steps. When it does, the migration will
be skipped, and ultimately aborted if a retry fails too. In the case of the <kbd>after()</kbd> method returning <kbd>false</kbd>, the migration
will be reverted by calling the reverse migration method (i.e. calling down() when on an up() migration, and vice-versa).
</p>

<p class="note">
The <kbd>after()</kbd> method will only be called if the migration itself was succesful. If the migration method returns <kbd>false</kbd>, it
will not be called.
</p>
</div>

<footer>
Expand Down

0 comments on commit abbcbc2

Please sign in to comment.