Created
June 24, 2012 23:31
-
-
Save kenjis/2985485 to your computer and use it in GitHub Desktop.
diff between FuelPHP 1.2 and 1.2.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -urN fuelphp-1.2/docs/classes/arr.html fuelphp-1.2.1/docs/classes/arr.html | |
--- fuelphp-1.2/docs/classes/arr.html 2012-05-07 03:55:16.000000000 +0900 | |
+++ fuelphp-1.2.1/docs/classes/arr.html 2012-06-25 05:36:50.000000000 +0900 | |
@@ -108,7 +108,7 @@ | |
<article> | |
<h4 class="method" id="method_to_assoc">to_assoc($arr)</h4> | |
- <p>The <strong>to_assoc</strong> method turns a non-associative array into an associative array if it has an even number of segments. If it has an odd number of segments it returns <kbd>null</kbd>.</p> | |
+ <p>The <strong>to_assoc</strong> method turns a non-associative array into an associative array if it has an even number of segments.</p> | |
<table class="method"> | |
<tbody> | |
<tr> | |
@@ -488,7 +488,7 @@ | |
[name] => James | |
[age] => 24 | |
) | |
- | |
+ | |
[1] => Array | |
( | |
[name] => John | |
diff -urN fuelphp-1.2/docs/classes/database/dbutil.html fuelphp-1.2.1/docs/classes/database/dbutil.html | |
--- fuelphp-1.2/docs/classes/database/dbutil.html 2012-05-07 03:55:16.000000000 +0900 | |
+++ fuelphp-1.2.1/docs/classes/database/dbutil.html 2012-06-25 05:36:50.000000000 +0900 | |
@@ -283,15 +283,14 @@ | |
<tr> | |
<th>Example</th> | |
<td> | |
- <pre class="php"> | |
- <code> | |
- // Check if table named 'my_table' exists | |
- if(\DBUtil::table_exists('my_table')){ | |
- // Table exists | |
- } else { | |
- // Table does NOT exist, create it! | |
- } | |
- </code> | |
+ <pre class="php"><code>// Check if table named 'my_table' exists | |
+if(DBUtil::table_exists('my_table')) | |
+{ | |
+ // Table exists | |
+} else | |
+{ | |
+ // Table does NOT exist, create it! | |
+}</code> | |
</pre> | |
</td> | |
</tr> | |
@@ -649,14 +648,15 @@ | |
<tr> | |
<th>Example</th> | |
<td> | |
- <pre class="php"> | |
- <code> | |
- if(\DBUtil::field_exists('my_table', array('my_field_or_column'))){ | |
- // Fields exist | |
- } else { | |
- // Fields are not available on the table | |
- } | |
- </code> | |
+ <pre class="php"><code> | |
+if(DBUtil::field_exists('my_table', array('my_field_or_column'))) | |
+{ | |
+ // Fields exist | |
+} | |
+else | |
+{ | |
+ // Fields are not available on the table | |
+}</code> | |
</pre> | |
</td> | |
</tr> | |
@@ -1004,21 +1004,16 @@ | |
<tr> | |
<th>Example</th> | |
<td> | |
- <pre class="php"><code>\DBUtil::add_foreign_key( | |
- 'users', | |
- array( | |
- 'constraint' => 'constraintA', | |
- 'key' => 'keyA', | |
- 'reference' => array( | |
- 'table' => 'table', | |
- 'column' => 'field', | |
- ), | |
- 'on_update' => 'CASCADE', | |
- 'on_delete' => 'RESTRICT' | |
- ) | |
- ); | |
- | |
- </code></pre> | |
+ <pre class="php"><code>\DBUtil::add_foreign_key('users', array( | |
+ 'constraint' => 'constraintA', | |
+ 'key' => 'keyA', | |
+ 'reference' => array( | |
+ 'table' => 'table', | |
+ 'column' => 'field', | |
+ ), | |
+ 'on_update' => 'CASCADE', | |
+ 'on_delete' => 'RESTRICT' | |
+));</code></pre> | |
</td> | |
</tr> | |
</tbody> | |
diff -urN fuelphp-1.2/docs/classes/ftp.html fuelphp-1.2.1/docs/classes/ftp.html | |
--- fuelphp-1.2/docs/classes/ftp.html 2012-05-07 03:55:16.000000000 +0900 | |
+++ fuelphp-1.2.1/docs/classes/ftp.html 2012-06-25 05:36:50.000000000 +0900 | |
@@ -124,7 +124,7 @@ | |
<article> | |
- <h4 class="method" id="method_forge">forge()</h4> | |
+ <h4 class="method" id="method_forge">forge($config = 'default', $connect = true)</h4> | |
<p>The <strong>forge</strong> method is used to create a new instance of the FTP class and can either reference a different config group | |
or be passed an array of <a href="config.html">configuration options</a>.</p> | |
<table class="method"> | |
@@ -194,6 +194,52 @@ | |
</article> | |
<article> | |
+ <h4 class="method" id="method_connect">connect()</h4> | |
+ <p> | |
+ The <strong>connect</strong> method allows you to manually connect to an FTP resource. | |
+ You only use this method if you didn't automatically connect when you forge()'d the ftp object. | |
+ </p> | |
+ <table class="method"> | |
+ <tbody> | |
+ <tr> | |
+ <th class="legend">Static</th> | |
+ <td>No</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Parameters</th> | |
+ <td> | |
+ None | |
+ </td> | |
+ </tr> | |
+ <tr> | |
+ <th>Returns</th> | |
+ <td>the current FTP object, for chaining</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Example</th> | |
+ <td> | |
+ <pre class="php"><code>// create an ftp object, but don't connect | |
+$ftp = Ftp::forge(array( | |
+ 'hostname' => 'ftp.example.com', | |
+ 'username' => '', | |
+ 'password' => '', | |
+ 'port' => 21, | |
+ 'passive' => true, | |
+ 'ssl_mode' => false, | |
+ 'debug' => false | |
+), false); | |
+ | |
+// do some stuff here | |
+ | |
+// now connect to the server | |
+$ftp->connect();</code></pre> | |
+ </td> | |
+ </tr> | |
+ </tbody> | |
+ </table> | |
+ </article> | |
+ | |
+ <article> | |
<h4 class="method" id="method_change_dir">change_dir($path = '')</h4> | |
<p>The <strong>change_dir</strong> changes the "current directory".</p> | |
<table class="method"> | |
@@ -300,12 +346,12 @@ | |
</tr> | |
<tr> | |
<th><kbd>$local_path</kbd></th> | |
- <td><pre class="php"><code>'default'</code></pre></td> | |
+ <td><i>Required</i></td> | |
<td>Local server path.</td> | |
</tr> | |
<tr> | |
<th><kbd>$remote_path</kbd></th> | |
- <td><pre class="php"><code>true</code></pre></td> | |
+ <td><i>Required</i></td> | |
<td>Remote server path.</td> | |
</tr> | |
<tr> | |
@@ -358,12 +404,12 @@ | |
</tr> | |
<tr> | |
<th><kbd>$remote_path</kbd></th> | |
- <td><pre class="php"><code>true</code></pre></td> | |
+ <td><i>Required</i></td> | |
<td>Remote server path.</td> | |
</tr> | |
<tr> | |
<th><kbd>$local_path</kbd></th> | |
- <td><pre class="php"><code>'default'</code></pre></td> | |
+ <td><i>Required</i></td> | |
<td>Local server path.</td> | |
</tr> | |
<tr> | |
@@ -393,6 +439,304 @@ | |
</article> | |
<article> | |
+ <h4 class="method" id="method_rename">rename($old_file, $new_file, $move = false)</h4> | |
+ <p> | |
+ Move or rename a file on the remote server. | |
+ </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>$old_file</kbd></th> | |
+ <td><i>Required</i></td> | |
+ <td>File to be renamed or moved.</td> | |
+ </tr> | |
+ <tr> | |
+ <th><kbd>$new_file</kbd></th> | |
+ <td><i>Required</i></td> | |
+ <td>File to move or rename to.</td> | |
+ </tr> | |
+ <tr> | |
+ <th><kbd>$move</kbd></th> | |
+ <td><pre class="php"><code>false</code></pre></td> | |
+ <td> | |
+ 'true' if this is move, 'false' if it is a rename. | |
+ This flag is used for debug error messages only. | |
+ </td> | |
+ </tr> | |
+ </table> | |
+ </td> | |
+ </tr> | |
+ <tr> | |
+ <th>Returns</th> | |
+ <td>boolean</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Example</th> | |
+ <td> | |
+ <pre class="php"><code>// connect to an FTP server | |
+$ftp = Ftp::forge($config); | |
+ | |
+// rename the file | |
+$ftp->rename('/path/to/oldfile.txt', '/path/to/newfile.txt', false); | |
+ | |
+// close the connection | |
+$ftp->close();</code></pre> | |
+ </td> | |
+ </tr> | |
+ </tbody> | |
+ </table> | |
+ </article> | |
+ | |
+ <article> | |
+ <h4 class="method" id="method_move">move($old_file, $new_file)</h4> | |
+ <p> | |
+ Alias for <a href="#method_rename">rename()</a>, with the $move flag set to <var>true</var>. | |
+ </p> | |
+ </article> | |
+ | |
+ <article> | |
+ <h4 class="method" id="method_delete_file">delete_file($filepath)</h4> | |
+ <p> | |
+ Deletes a file from the remote server. | |
+ </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>$filepath</kbd></th> | |
+ <td><i>Required</i></td> | |
+ <td>File to be deleted.</td> | |
+ </tr> | |
+ </table> | |
+ </td> | |
+ </tr> | |
+ <tr> | |
+ <th>Returns</th> | |
+ <td>boolean</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Example</th> | |
+ <td> | |
+ <pre class="php"><code>// connect to an FTP server | |
+$ftp = Ftp::forge($config); | |
+ | |
+// delete a file | |
+if ( ! $ftp->delete_file('/path/to/file.txt')) | |
+{ | |
+ // delete failed | |
+} | |
+ | |
+// close the connection | |
+$ftp->close();</code></pre> | |
+ </td> | |
+ </tr> | |
+ </tbody> | |
+ </table> | |
+ </article> | |
+ | |
+ <article> | |
+ <h4 class="method" id="method_delete">delete_dir($filepath)</h4> | |
+ <p> | |
+ Deletes a folder and recursively anything in it from the remote server. | |
+ </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>$filepath</kbd></th> | |
+ <td><i>Required</i></td> | |
+ <td>File to be deleted.</td> | |
+ </tr> | |
+ </table> | |
+ </td> | |
+ </tr> | |
+ <tr> | |
+ <th>Returns</th> | |
+ <td>boolean</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Example</th> | |
+ <td> | |
+ <pre class="php"><code>// connect to an FTP server | |
+$ftp = Ftp::forge($config); | |
+ | |
+// delete a folder with all it's contents | |
+if ( ! $ftp->delete_dir('/path/to/folder')) | |
+{ | |
+ // delete failed | |
+} | |
+ | |
+// close the connection | |
+$ftp->close();</code></pre> | |
+ </td> | |
+ </tr> | |
+ </tbody> | |
+ </table> | |
+ </article> | |
+ | |
+ <article> | |
+ <h4 class="method" id="method_chmod">chmod($path, $perm)</h4> | |
+ <p> | |
+ Change the permissions of a file on the remote server. | |
+ </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>$path</kbd></th> | |
+ <td><i>Required</i></td> | |
+ <td>File to change the permissions on.</td> | |
+ </tr> | |
+ <tr> | |
+ <th><kbd>$perm</kbd></th> | |
+ <td><i>Required</i></td> | |
+ <td>Permissions, defined unix style, as an octal value.</td> | |
+ </tr> | |
+ </table> | |
+ </td> | |
+ </tr> | |
+ <tr> | |
+ <th>Returns</th> | |
+ <td>boolean</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Example</th> | |
+ <td> | |
+ <pre class="php"><code>// connect to an FTP server | |
+$ftp = Ftp::forge($config); | |
+ | |
+// make the file writeable for all | |
+if ( ! $ftp->chmod('/path/to/file.txt', 0666)) | |
+{ | |
+ // changing permissions failed | |
+} | |
+ | |
+// close the connection | |
+$ftp->close();</code></pre> | |
+ </td> | |
+ </tr> | |
+ </tbody> | |
+ </table> | |
+ </article> | |
+ | |
+ <article> | |
+ <h4 class="method" id="method_list_files">list_files($path = '.')</h4> | |
+ <p> | |
+ Lists all files in the given path on the remote server. | |
+ </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>$path</kbd></th> | |
+ <td><pre class="php"><code>'.'</code></pre></td> | |
+ <td>Remote server path. Defaults to <var>current directory</var>.</td> | |
+ </tr> | |
+ </table> | |
+ </td> | |
+ </tr> | |
+ <tr> | |
+ <th>Returns</th> | |
+ <td>array</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Example</th> | |
+ <td> | |
+ <pre class="php"><code>// connect to an FTP server | |
+$ftp = Ftp::forge($config); | |
+ | |
+// make the file writeable for all | |
+if ( $files = $ftp->list_files('/path/to/files') === false) | |
+{ | |
+ // listing failed | |
+} | |
+else | |
+{ | |
+ /* might return something like | |
+ $files = array(3) { | |
+ [0]=> | |
+ string(11) "public_html" | |
+ [1]=> | |
+ string(10) "public_ftp" | |
+ [2]=> | |
+ string(3) "www" | |
+ */ | |
+ } | |
+ | |
+// close the connection | |
+$ftp->close();</code></pre> | |
+ </td> | |
+ </tr> | |
+ </tbody> | |
+ </table> | |
+ </article> | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ <article> | |
<h4 class="method" id="method_mirror">mirror($local_path, $remote_path)</h4> | |
<p> | |
Recursively reads a local folder and everything it contains (including sub-folders) and creates a mirror via FTP based on it. Whatever the | |
@@ -443,6 +787,41 @@ | |
</td> | |
</tr> | |
</tbody> | |
+ </table> | |
+ </article> | |
+ | |
+ <article> | |
+ <h4 class="method" id="method_close">close()</h4> | |
+ <p> | |
+ The <strong>close</strong> method closes an open ftp connection to a remote server created by <var>forge()</var> or <var>connect()</var>. | |
+ </p> | |
+ <table class="method"> | |
+ <tbody> | |
+ <tr> | |
+ <th class="legend">Static</th> | |
+ <td>No</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Parameters</th> | |
+ <td> | |
+ None | |
+ </td> | |
+ </tr> | |
+ <tr> | |
+ <th>Returns</th> | |
+ <td>boolean</td> | |
+ </tr> | |
+ <tr> | |
+ <th>Example</th> | |
+ <td> | |
+ <pre class="php"><code>// close a connection | |
+if ( ! $ftp->close()) | |
+{ | |
+ // connection wasn't open | |
+}</code></pre> | |
+ </td> | |
+ </tr> | |
+ </tbody> | |
</table> | |
</article> | |
diff -urN fuelphp-1.2/docs/classes/security.html fuelphp-1.2.1/docs/classes/security.html | |
--- fuelphp-1.2/docs/classes/security.html 2012-05-07 03:55:16.000000000 +0900 | |
+++ fuelphp-1.2.1/docs/classes/security.html 2012-06-25 05:36:50.000000000 +0900 | |
@@ -105,6 +105,15 @@ | |
</td> | |
</tr> | |
<tr> | |
+ <th>output_filter</th> | |
+ <td>array</td> | |
+ <td><pre class="php"><code>array('Security::htmlentities')</code></pre></td> | |
+ <td> | |
+ Array of callable items (PHP functions, object methods, static class methods) used to filter variables send to a View or Viewmodel. | |
+ For security reasons, you are <strong>required</strong> to define an output filter. | |
+ </td> | |
+ </tr> | |
+ <tr> | |
<th>htmlentities_flags</th> | |
<td>integer</td> | |
<td><pre class="php"><code>null</code></pre></td> | |
diff -urN fuelphp-1.2/docs/general/coding_standards.html fuelphp-1.2.1/docs/general/coding_standards.html | |
--- fuelphp-1.2/docs/general/coding_standards.html 2012-05-07 03:55:16.000000000 +0900 | |
+++ fuelphp-1.2.1/docs/general/coding_standards.html 2012-06-25 05:36:50.000000000 +0900 | |
@@ -189,18 +189,28 @@ | |
{ | |
//catch all do something here | |
} | |
+ | |
foreach ($array as $key => $value) | |
{ | |
//loop here | |
} | |
-for ($i = 0; $i < $max; $i++) | |
+ | |
+for ($i = 0; $i < $max; $i++) | |
{ | |
//loop here | |
} | |
-while ($i < $max) | |
+ | |
+while ($i < $max) | |
{ | |
//loop here | |
} | |
+ | |
+do | |
+{ | |
+ //loop here | |
+} | |
+while ($i < $max) | |
+ | |
switch ($var) | |
{ | |
case 'value1': | |
diff -urN fuelphp-1.2/docs/general/routing.html fuelphp-1.2.1/docs/general/routing.html | |
--- fuelphp-1.2/docs/general/routing.html 2012-05-07 03:55:16.000000000 +0900 | |
+++ fuelphp-1.2.1/docs/general/routing.html 2012-06-25 05:36:50.000000000 +0900 | |
@@ -167,7 +167,11 @@ | |
<h3 id="inline_routes">Inline routes</h3> | |
- <p>A route does not have to resolve to a controller method. FuelPHP also supports inline routes, which are defined as a Closure that replaces the controller method.</p> | |
+ <p> | |
+ A route does not have to resolve to a controller method. FuelPHP also supports inline routes, which are defined as a Closure | |
+ that replaces the controller method. Like controller methods, inline routes MUST return a Response object, either by forging | |
+ one manually, or as the result of executing a forged Request. | |
+ </p> | |
<p>Example route:</p> | |
@@ -176,7 +180,7 @@ | |
// this route only works in development | |
if (\Fuel::$env == \Fuel::DEVELOPMENT) | |
{ | |
- return \Request::forge('secret/mystuff/keepout', false); | |
+ return \Request::forge('secret/mystuff/keepout', false)->execute(); | |
} | |
else | |
{ | |
diff -urN fuelphp-1.2/docs/installation/download.html fuelphp-1.2.1/docs/installation/download.html | |
--- fuelphp-1.2/docs/installation/download.html 2012-05-07 03:55:16.000000000 +0900 | |
+++ fuelphp-1.2.1/docs/installation/download.html 2012-06-25 05:36:50.000000000 +0900 | |
@@ -46,12 +46,13 @@ | |
<h2>Download Fuel</h2> | |
- <p>Fuel is now at v1.2. You can download Fuel using the links below:</p> | |
+ <p>Fuel is now at v1.2.1. You can download Fuel using the links below:</p> | |
<ul> | |
<li id="releases">Releases | |
<ul> | |
- <li><a href="https://github.com/downloads/fuel/fuel/fuelphp-v1.2.zip">Download 1.2</a></li> | |
+ <li><a href="https://github.com/downloads/fuel/fuel/fuelphp-1.2.1.zip">Download 1.2.1</a></li> | |
+ <li><a href="https://github.com/downloads/fuel/fuel/fuelphp-1.2.zip">Download 1.2</a></li> | |
<li><a href="https://github.com/downloads/fuel/fuel/fuelphp-v1.1.zip">Download 1.1</a></li> | |
<li><a href="https://github.com/downloads/fuel/fuel/fuel-1.0.1.zip">Download 1.0.1</a></li> | |
<li><a href="https://github.com/downloads/fuel/fuel/fuel-1.0.zip">Download 1.0</a></li> | |
diff -urN fuelphp-1.2/fuel/core/.gitignore fuelphp-1.2.1/fuel/core/.gitignore | |
--- fuelphp-1.2/fuel/core/.gitignore 1970-01-01 09:00:00.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/.gitignore 2012-06-25 05:42:50.000000000 +0900 | |
@@ -0,0 +1,15 @@ | |
+*~ | |
+*.bak | |
+Thumbs.db | |
+desktop.ini | |
+.DS_Store | |
+.buildpath | |
+.project | |
+.settings | |
+fuel/app/logs/*/*/* | |
+fuel/app/cache/*/* | |
+nbproject/ | |
+.idea | |
+*.tmproj | |
+*.sublime-project | |
+*.sublime-workspace | |
\ No newline at end of file | |
diff -urN fuelphp-1.2/fuel/core/classes/asset/instance.php fuelphp-1.2.1/fuel/core/classes/asset/instance.php | |
--- fuelphp-1.2/fuel/core/classes/asset/instance.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/asset/instance.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -127,12 +127,12 @@ | |
foreach ($type as $key => $folder) | |
{ | |
is_numeric($key) and $key = $folder; | |
- array_unshift($this->_asset_paths[$key], str_replace('../', '', rtrim($path, '/')).'/'.rtrim($folder, '/').'/'); | |
+ array_unshift($this->_asset_paths[$key], str_replace('..'.DS, '', rtrim($path, DS)).DS.rtrim($folder, DS).DS); | |
} | |
} | |
else | |
{ | |
- array_unshift($this->_asset_paths[$type], str_replace('../', '', rtrim($path, '/')).'/'); | |
+ array_unshift($this->_asset_paths[$type], str_replace('..'.DS, '', rtrim($path, DS)).DS); | |
} | |
return $this; | |
@@ -154,7 +154,7 @@ | |
foreach ($type as $key => $folder) | |
{ | |
is_numeric($key) and $key = $folder; | |
- if (($found = array_search(str_replace('../', '', rtrim($path,'/').'/'.rtrim($folder, '/').'/'), $this->_asset_paths[$key])) !== false) | |
+ if (($found = array_search(str_replace('..'.DS, '', rtrim($path,DS).DS.rtrim($folder, DS).DS), $this->_asset_paths[$key])) !== false) | |
{ | |
unset($this->_asset_paths[$key][$found]); | |
} | |
@@ -162,7 +162,7 @@ | |
} | |
else | |
{ | |
- if (($key = array_search(str_replace('../', '', rtrim($path,'/')), $this->_asset_paths[$type])) !== false) | |
+ if (($key = array_search(str_replace('..'.DS, '', rtrim($path,DS)), $this->_asset_paths[$type])) !== false) | |
{ | |
unset($this->_asset_paths[$type][$key]); | |
} | |
@@ -396,14 +396,15 @@ | |
{ | |
foreach ($this->_asset_paths[$type] as $path) | |
{ | |
- empty($folder) or $folder = trim($folder, '/').'/'; | |
+ empty($folder) or $folder = trim($folder, DS).DS; | |
- if (is_file($path.$folder.ltrim($file, '/'))) | |
+ if (is_file($path.$folder.ltrim($file, DS))) | |
{ | |
- $file = $path.$folder.ltrim($file, '/'); | |
+ $file = $path.$folder.ltrim($file, DS); | |
strpos($file, DOCROOT) === 0 and $file = substr($file, strlen(DOCROOT)); | |
- return $file; | |
+ // return the file found, make sure it uses forward slashes on Windows | |
+ return str_replace(DS, '/', $file); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/core/classes/asset.php fuelphp-1.2.1/fuel/core/classes/asset.php | |
--- fuelphp-1.2/fuel/core/classes/asset.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/asset.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -60,6 +60,7 @@ | |
'indent_level' => 1, | |
'indent_with' => "\t", | |
'auto_render' => true, | |
+ 'fail_silently' => false, | |
); | |
/** | |
diff -urN fuelphp-1.2/fuel/core/classes/cache/storage/file.php fuelphp-1.2.1/fuel/core/classes/cache/storage/file.php | |
--- fuelphp-1.2/fuel/core/classes/cache/storage/file.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/cache/storage/file.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -245,7 +245,7 @@ | |
} | |
// wait for a lock | |
- while( ! flock($handle, LOCK_EX)); | |
+ while( ! flock($handle, LOCK_SH)); | |
// read the session data | |
$payload = fread($handle, filesize($file)); | |
diff -urN fuelphp-1.2/fuel/core/classes/database/connection.php fuelphp-1.2.1/fuel/core/classes/database/connection.php | |
--- fuelphp-1.2/fuel/core/classes/database/connection.php 2012-06-04 04:10:12.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/database/connection.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -625,6 +625,11 @@ | |
// Quote the column in FUNC("ident") identifiers | |
return preg_replace('/"(.+?)"/e', '$this->quote_identifier("$1")', $value); | |
} | |
+ elseif (preg_match("/^'(.*)?'$/", $value)) | |
+ { | |
+ // return quoted values as-is | |
+ return $value; | |
+ } | |
elseif (strpos($value, '.') !== false) | |
{ | |
// Split the identifier into the individual parts | |
diff -urN fuelphp-1.2/fuel/core/classes/database/pdo/connection.php fuelphp-1.2.1/fuel/core/classes/database/pdo/connection.php | |
--- fuelphp-1.2/fuel/core/classes/database/pdo/connection.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/database/pdo/connection.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -83,13 +83,22 @@ | |
} | |
catch (\PDOException $e) | |
{ | |
- throw new \Database_Exception($e->getMessage(), $e->getCode(), $e); | |
+ $error_code = is_numeric($e->getCode()) ? $e->getCode() : 0; | |
+ throw new \Database_Exception($e->getMessage(), $error_code, $e); | |
} | |
if ( ! empty($this->_config['charset'])) | |
{ | |
- // Set the character set | |
- $this->set_charset($this->_config['charset']); | |
+ // Set Charset for SQL Server connection | |
+ if (strtolower($this->driver_name()) == 'sqlsrv') | |
+ { | |
+ $this->_connection->setAttribute(\PDO::SQLSRV_ATTR_ENCODING, \PDO::SQLSRV_ENCODING_SYSTEM); | |
+ } | |
+ else | |
+ { | |
+ // Set the character set | |
+ $this->set_charset($this->_config['charset']); | |
+ } | |
} | |
} | |
@@ -101,6 +110,15 @@ | |
return true; | |
} | |
+ /** | |
+ * Get the current PDO Driver name | |
+ * @return string | |
+ */ | |
+ public function driver_name() | |
+ { | |
+ return $this->_connection->getAttribute(\PDO::ATTR_DRIVER_NAME); | |
+ } | |
+ | |
public function set_charset($charset) | |
{ | |
// Make sure the database is connected | |
@@ -121,30 +139,36 @@ | |
$benchmark = \Profiler::start("Database ({$this->_instance})", $sql); | |
} | |
- try | |
+ // run the query. if the connection is lost, try 3 times to reconnect | |
+ $attempts = 3; | |
+ | |
+ do | |
{ | |
try | |
{ | |
$result = $this->_connection->query($sql); | |
+ break; | |
} | |
catch (\Exception $e) | |
{ | |
- // do a reconnect first and try again, before giving up | |
- $this->connect(); | |
- $result = $this->_connection->query($sql); | |
+ if (strpos($e->getMessage(), '2006 MySQL') !== false) | |
+ { | |
+ $this->connect(); | |
+ } | |
+ else | |
+ { | |
+ if (isset($benchmark)) | |
+ { | |
+ // This benchmark is worthless | |
+ \Profiler::delete($benchmark); | |
+ } | |
+ | |
+ // Convert the exception in a database exception | |
+ throw new \Database_Exception($e->getMessage().' with query: "'.$sql.'"'); | |
+ } | |
} | |
} | |
- catch (\Exception $e) | |
- { | |
- if (isset($benchmark)) | |
- { | |
- // This benchmark is worthless | |
- \Profiler::delete($benchmark); | |
- } | |
- | |
- // Convert the exception in a database exception | |
- throw new \Database_Exception($e->getMessage().' with query: "'.$sql.'"'); | |
- } | |
+ while ($attempts-- > 0); | |
if (isset($benchmark)) | |
{ | |
@@ -206,7 +230,7 @@ | |
! is_null($like) and $like = str_replace('%', '.*', $like); | |
foreach ($result as $row) | |
{ | |
- if ( ! is_null($like) and preg_match($like, $row['Field'])) continue; | |
+ if ( ! is_null($like) and ! preg_match('#'.$like.'#', $row['Field'])) continue; | |
list($type, $length) = $this->_parse_type($row['Type']); | |
$column = $this->datatype($type); | |
diff -urN fuelphp-1.2/fuel/core/classes/file/area.php fuelphp-1.2.1/fuel/core/classes/file/area.php | |
--- fuelphp-1.2/fuel/core/classes/file/area.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/file/area.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -85,8 +85,10 @@ | |
{ | |
$info = pathinfo($path); | |
+ // deal with path names without an extension | |
+ isset($info['extension']) or $info['extension'] = ''; | |
+ | |
// check file extension | |
- $info = pathinfo($path); | |
if ( ! empty($this->extensions) && ! in_array($info['extension'], $this->extensions)) | |
{ | |
throw new \FileAccessException('File operation not allowed: disallowed file extension.'); | |
diff -urN fuelphp-1.2/fuel/core/classes/fuel.php fuelphp-1.2.1/fuel/core/classes/fuel.php | |
--- fuelphp-1.2/fuel/core/classes/fuel.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/fuel.php 2012-06-25 05:46:17.000000000 +0900 | |
@@ -29,7 +29,7 @@ | |
/** | |
* @var string The version of Fuel | |
*/ | |
- const VERSION = '1.2'; | |
+ const VERSION = '1.2.1'; | |
/** | |
* @var string constant used for when in testing mode | |
diff -urN fuelphp-1.2/fuel/core/classes/image/driver.php fuelphp-1.2.1/fuel/core/classes/image/driver.php | |
--- fuelphp-1.2/fuel/core/classes/image/driver.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/image/driver.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -332,7 +332,6 @@ | |
$sizes = $this->sizes(); | |
$width = $this->convert_number($width, true); | |
$height = $this->convert_number($height, false); | |
- $x = $y = 0; | |
if (function_exists('bcdiv')) | |
{ | |
@@ -358,8 +357,8 @@ | |
} | |
$sizes = $this->sizes(); | |
- $y = floor(($sizes->height - $height) / 2); | |
- $x = floor(($sizes->width - $width) / 2); | |
+ $y = floor(max(0, $sizes->height - $height) / 2); | |
+ $x = floor(max(0, $sizes->width - $width) / 2); | |
$this->_crop($x, $y, $x + $width, $y + $height); | |
} | |
@@ -667,7 +666,8 @@ | |
{ | |
if ( ! $this->config['debug']) | |
{ | |
- header('Content-Type: image/' . $filetype); | |
+ $mimetype = $filetype === 'jpg' ? 'jpeg' : $filetype; | |
+ header('Content-Type: image/' . $mimetype); | |
} | |
$this->new_extension = $filetype; | |
} | |
@@ -731,7 +731,7 @@ | |
$blue = hexdec(substr($hex, 2, 1).substr($hex, 2, 1)); | |
} | |
} | |
- | |
+ | |
return array( | |
'red' => $red, | |
'green' => $green, | |
diff -urN fuelphp-1.2/fuel/core/classes/image/imagemagick.php fuelphp-1.2.1/fuel/core/classes/image/imagemagick.php | |
--- fuelphp-1.2/fuel/core/classes/image/imagemagick.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/image/imagemagick.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -87,10 +87,13 @@ | |
protected function _watermark($filename, $position, $padding = 5) | |
{ | |
- extract(parent::_watermark($filename, $x, $y)); | |
+ $values = parent::_watermark($filename, $position, $padding); | |
+ if ($values == false) | |
+ { | |
+ throw new \InvalidArgumentException("Watermark image not found or invalid filetype."); | |
+ } | |
- $image = '"'.$this->image_temp.'"'; | |
- $filename = '"'.$filename.'"'; | |
+ extract($values); | |
$x >= 0 and $x = '+'.$x; | |
$y >= 0 and $y = '+'.$y; | |
@@ -98,7 +101,7 @@ | |
'composite', | |
'-compose atop -geometry '.$x.$y.' '. | |
'-dissolve '.$this->config['watermark_alpha'].'% '. | |
- $filename.' '.$image.' '.$image | |
+ '"'.$filename.'" "'.$this->image_temp.'" '.$image | |
); | |
} | |
@@ -192,11 +195,11 @@ | |
$this->run_queue(); | |
$this->add_background(); | |
- | |
+ | |
$filetype = $this->image_extension; | |
$old = '"'.$this->image_temp.'"'; | |
$new = '"'.$filename.'"'; | |
- | |
+ | |
if(($filetype == 'jpeg' or $filetype == 'jpg') and $this->config['quality'] != 100) | |
{ | |
$quality = '"'.$this->config['quality'].'%"'; | |
@@ -221,9 +224,9 @@ | |
$this->run_queue(); | |
$this->add_background(); | |
- | |
+ | |
$image = '"'.$this->image_temp.'"'; | |
- | |
+ | |
if(($filetype == 'jpeg' or $filetype == 'jpg') and $this->config['quality'] != 100) | |
{ | |
$quality = '"'.$this->config['quality'].'%"'; | |
diff -urN fuelphp-1.2/fuel/core/classes/input.php fuelphp-1.2.1/fuel/core/classes/input.php | |
--- fuelphp-1.2/fuel/core/classes/input.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/input.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -45,9 +45,19 @@ | |
protected static $put_delete = null; | |
/** | |
- * @var $content parsed request body (xml/json) | |
+ * @var $php_input Cache for the php://input stream | |
*/ | |
- protected static $content = null; | |
+ protected static $php_input = null; | |
+ | |
+ /** | |
+ * @var $json parsed request body as json | |
+ */ | |
+ protected static $json = null; | |
+ | |
+ /** | |
+ * @var $xml parsed request body as xml | |
+ */ | |
+ protected static $xml = null; | |
/** | |
* Get the request body interpreted as JSON. | |
@@ -56,12 +66,8 @@ | |
*/ | |
public static function json($index = null, $default = null) | |
{ | |
- if (static::$content === null) | |
- { | |
- static::hydrate_raw_input('json'); | |
- } | |
- | |
- return (func_num_args() === 0) ? static::$content : \Arr::get(static::$content, $index, $default); | |
+ static::$json === null and static::hydrate_raw_input('json'); | |
+ return (func_num_args() === 0) ? static::$json : \Arr::get(static::$json, $index, $default); | |
} | |
/** | |
@@ -71,12 +77,8 @@ | |
*/ | |
public static function xml($index = null, $default = null) | |
{ | |
- if (static::$content === null) | |
- { | |
- static::hydrate_raw_input('xml'); | |
- } | |
- | |
- return (func_num_args() === 0) ? static::$content : \Arr::get(static::$content, $index, $default); | |
+ static::$xml === null and static::hydrate_raw_input('xml'); | |
+ return (func_num_args() === 0) ? static::$xml : \Arr::get(static::$xml, $index, $default); | |
} | |
/** | |
@@ -86,8 +88,8 @@ | |
*/ | |
protected static function hydrate_raw_input($type) | |
{ | |
- $content = \Format::forge(file_get_contents('php://input'), $type)->to_array(); | |
- is_array($content) and static::$content = \Security::clean($content); | |
+ static::$php_input === null and static::$php_input = file_get_contents('php://input'); | |
+ static::$$type = \Security::clean(\Format::forge(static::$php_input, $type)->to_array()); | |
} | |
/** | |
@@ -256,8 +258,7 @@ | |
*/ | |
public static function protocol() | |
{ | |
- if ((static::server('HTTPS') !== null and static::server('HTTPS') != 'off') | |
- or (static::server('HTTPS') === null and static::server('SERVER_PORT') == 443)) | |
+ if (static::server('HTTPS') == 'on' or static::server('HTTPS') == 1 or static::server('SERVER_PORT') == 443) | |
{ | |
return 'https'; | |
} | |
@@ -312,11 +313,7 @@ | |
*/ | |
public static function all() | |
{ | |
- if (static::$input === null) | |
- { | |
- static::hydrate(); | |
- } | |
- | |
+ static::$input === null and static::hydrate(); | |
return static::$input; | |
} | |
@@ -353,11 +350,7 @@ | |
*/ | |
public static function put($index = null, $default = null) | |
{ | |
- if (static::$put_delete === null) | |
- { | |
- static::hydrate(); | |
- } | |
- | |
+ static::$put_delete === null and static::hydrate(); | |
return (func_num_args() === 0) ? static::$put_delete : \Arr::get(static::$put_delete, $index, $default); | |
} | |
@@ -370,11 +363,7 @@ | |
*/ | |
public static function delete($index = null, $default = null) | |
{ | |
- if (static::$put_delete === null) | |
- { | |
- static::hydrate(); | |
- } | |
- | |
+ static::$put_delete === null and static::hydrate(); | |
return (is_null($index) and func_num_args() === 0) ? static::$put_delete : \Arr::get(static::$put_delete, $index, $default); | |
} | |
@@ -399,11 +388,7 @@ | |
*/ | |
public static function param($index = null, $default = null) | |
{ | |
- if (static::$input === null) | |
- { | |
- static::hydrate(); | |
- } | |
- | |
+ static::$input === null and static::hydrate(); | |
return \Arr::get(static::$input, $index, $default); | |
} | |
@@ -442,7 +427,8 @@ | |
if (\Input::method() == 'PUT' or \Input::method() == 'DELETE') | |
{ | |
- parse_str(file_get_contents('php://input'), static::$put_delete); | |
+ static::$php_input === null and static::$php_input = file_get_contents('php://input'); | |
+ parse_str(static::$php_input, static::$put_delete); | |
static::$input = array_merge(static::$input, static::$put_delete); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/core/classes/migrate.php fuelphp-1.2.1/fuel/core/classes/migrate.php | |
--- fuelphp-1.2/fuel/core/classes/migrate.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/migrate.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -188,24 +188,20 @@ | |
// get the current version info from the config | |
$current = \Config::get('migrations.version.'.$type.'.'.$name); | |
- // any migrations defined? | |
- if ( ! empty($current)) | |
- { | |
- // get the last entry | |
- $current = end($current); | |
+ // get the last migration installed | |
+ $current = empty($current) ? null : end($current); | |
- // get the available migrations after the current one | |
- $migrations = static::find_migrations($name, $type, $current, $version); | |
+ // get the available migrations after the current one | |
+ $migrations = static::find_migrations($name, $type, $current, $version); | |
- // found any? | |
- if ( ! empty($migrations)) | |
- { | |
- // if no version was given, only install the next migration | |
- is_null($version) and $migrations = array(reset($migrations)); | |
+ // found any? | |
+ if ( ! empty($migrations)) | |
+ { | |
+ // if no version was given, only install the next migration | |
+ is_null($version) and $migrations = array(reset($migrations)); | |
- // install migrations found | |
- return static::run($migrations, $name, $type, 'up'); | |
- } | |
+ // install migrations found | |
+ return static::run($migrations, $name, $type, 'up'); | |
} | |
// nothing to migrate | |
@@ -433,7 +429,7 @@ | |
} | |
// and that it contains an "up" and "down" method | |
- if ( ! is_callable(array($class, 'up')) || ! is_callable(array($class, 'down'))) | |
+ if ( ! is_callable(array($class, 'up')) or ! is_callable(array($class, 'down'))) | |
{ | |
throw new FuelException(sprintf('Migration class "%s" must include public methods "up" and "down"', $name)); | |
} | |
@@ -564,7 +560,7 @@ | |
foreach ($current as $migration) | |
{ | |
// find the migrations for this entry | |
- $migrations = static::find_migrations($migration['name'], $migration['type'], 0, $migration['version']); | |
+ $migrations = static::find_migrations($migration['name'], $migration['type'], null, $migration['version']); | |
// array to keep track of the migrations already run | |
$config = array(); | |
@@ -595,5 +591,8 @@ | |
\Config::save(\Fuel::$env.DS.'migrations', 'migrations'); | |
} | |
} | |
+ | |
+ // delete any old migration config file that may exist | |
+ file_exists(APPPATH.'config'.DS.'migrations.php') and unlink(APPPATH.'config'.DS.'migrations.php'); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/core/classes/request/curl.php fuelphp-1.2.1/fuel/core/classes/request/curl.php | |
--- fuelphp-1.2/fuel/core/classes/request/curl.php 2012-06-04 04:10:12.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/request/curl.php 2012-06-25 07:49:48.000000000 +0900 | |
@@ -34,9 +34,6 @@ | |
$this->http_login($options['user'], $options['pass'], $options['auth']); | |
} | |
- // we want to handle failure ourselves | |
- $this->set_option('failonerror', false); | |
- | |
parent::__construct($resource, $options, $method); | |
} | |
diff -urN fuelphp-1.2/fuel/core/classes/request/driver.php fuelphp-1.2.1/fuel/core/classes/request/driver.php | |
--- fuelphp-1.2/fuel/core/classes/request/driver.php 2012-06-04 04:10:12.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/request/driver.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -148,7 +148,7 @@ | |
* Sets options on the driver | |
* | |
* @param array $options | |
- * @return Request_Curl | |
+ * @return Request_Driver | |
*/ | |
public function set_options(array $options) | |
{ | |
@@ -161,11 +161,13 @@ | |
* | |
* @param int|string $option | |
* @param mixed $value | |
- * @return Request_Curl | |
+ * @return Request_Driver | |
*/ | |
public function set_option($option, $value) | |
{ | |
- return $this->set_options(array($option => $value)); | |
+ $this->options[$option] = $value; | |
+ | |
+ return $this; | |
} | |
/** | |
@@ -267,7 +269,7 @@ | |
/** | |
* Reset before doing another request | |
* | |
- * @return Request_Curl | |
+ * @return Request_Driver | |
*/ | |
protected function set_defaults() | |
{ | |
diff -urN fuelphp-1.2/fuel/core/classes/session/db.php fuelphp-1.2.1/fuel/core/classes/session/db.php | |
--- fuelphp-1.2/fuel/core/classes/session/db.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/session/db.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -60,14 +60,16 @@ | |
$this->keys['user_agent'] = \Input::user_agent(); | |
$this->keys['created'] = $this->time->get_timestamp(); | |
$this->keys['updated'] = $this->keys['created']; | |
- $this->keys['payload'] = $payload; | |
+ | |
+ // set the session cookie | |
+ $this->_set_cookie(); | |
+ | |
+ // add the payload | |
+ $this->keys['payload'] = $payload; | |
// create the session record | |
$result = \DB::insert($this->config['table'], array_keys($this->keys))->values($this->keys)->execute($this->config['database']); | |
- // and set the session cookie | |
- $this->_set_cookie(); | |
- | |
return $this; | |
} | |
diff -urN fuelphp-1.2/fuel/core/classes/session/file.php fuelphp-1.2.1/fuel/core/classes/session/file.php | |
--- fuelphp-1.2/fuel/core/classes/session/file.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/session/file.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -273,7 +273,7 @@ | |
if ($handle) | |
{ | |
// wait for a lock | |
- while(!flock($handle, LOCK_EX)); | |
+ while(!flock($handle, LOCK_SH)); | |
// read the session data | |
$payload = fread($handle, filesize($file)); | |
diff -urN fuelphp-1.2/fuel/core/classes/validation/error.php fuelphp-1.2.1/fuel/core/classes/validation/error.php | |
--- fuelphp-1.2/fuel/core/classes/validation/error.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/validation/error.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -128,10 +128,31 @@ | |
// add the params to the find & replace arrays | |
foreach($this->params as $key => $val) | |
{ | |
- // Convert array to just a string "(array)", can't reliably implode as contents might be arrays/objects | |
+ // Convert array (as far as possible) | |
if (is_array($val)) | |
{ | |
- $val = '(array)'; | |
+ $result = ''; | |
+ foreach ($val as $v) | |
+ { | |
+ if (is_array($v)) | |
+ { | |
+ $v = '(array)'; | |
+ } | |
+ elseif (is_object($v)) | |
+ { | |
+ $v = '(object)'; | |
+ } | |
+ elseif (is_bool($v)) | |
+ { | |
+ $v = $v ? 'true' : 'false'; | |
+ } | |
+ $result .= empty($result) ? $v : (', '.$v); | |
+ } | |
+ $val = $result; | |
+ } | |
+ elseif (is_bool($val)) | |
+ { | |
+ $val = $val ? 'true' : 'false'; | |
} | |
// Convert object with __toString or just the classname | |
elseif (is_object($val)) | |
diff -urN fuelphp-1.2/fuel/core/classes/viewmodel.php fuelphp-1.2.1/fuel/core/classes/viewmodel.php | |
--- fuelphp-1.2/fuel/core/classes/viewmodel.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/classes/viewmodel.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -30,8 +30,12 @@ | |
* @param string Method to execute | |
* @return ViewModel | |
*/ | |
- public static function forge($viewmodel, $method = 'view', $auto_filter = null) | |
+ public static function forge($view, $method = 'view', $auto_filter = null) | |
{ | |
+ // strip any extensions from the view name to determine the viewmodel to load | |
+ $viewmodel = strpos($view, '.') === false ? $view : substr($view, 0, -strlen(strrchr($view, '.'))) ; | |
+ | |
+ // determine the viewmodel namespace and classname | |
$namespace = \Request::active() ? ucfirst(\Request::active()->module) : ''; | |
$class = $namespace.'\\View_'.ucfirst(str_replace(array('/', DS), '_', $viewmodel)); | |
@@ -43,7 +47,7 @@ | |
} | |
} | |
- return new $class($method, $auto_filter); | |
+ return new $class($method, $auto_filter, $view); | |
} | |
/** | |
@@ -66,9 +70,10 @@ | |
*/ | |
protected $_active_request; | |
- protected function __construct($method, $auto_filter = null) | |
+ protected function __construct($method, $auto_filter = null, $view = null) | |
{ | |
$this->_auto_filter = $auto_filter; | |
+ $this->_view === null and $this->_view = $view; | |
class_exists('Request', false) and $this->_active_request = \Request::active(); | |
if (empty($this->_view)) | |
diff -urN fuelphp-1.2/fuel/core/lang/en/validation.php fuelphp-1.2.1/fuel/core/lang/en/validation.php | |
--- fuelphp-1.2/fuel/core/lang/en/validation.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/lang/en/validation.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -14,5 +14,5 @@ | |
'valid_ip' => 'The field :label must contain a valid IP address.', | |
'numeric_min' => 'The minimum numeric value of :label must be :param:1', | |
'numeric_max' => 'The maximum numeric value of :label must be :param:1', | |
- 'valid_string' => 'The valid string rule :rule failed for field :label', | |
+ 'valid_string' => 'The valid string rule :rule(:param:1) failed for field :label', | |
); | |
diff -urN fuelphp-1.2/fuel/core/tasks/migrate.php fuelphp-1.2.1/fuel/core/tasks/migrate.php | |
--- fuelphp-1.2/fuel/core/tasks/migrate.php 2012-05-07 03:55:20.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/core/tasks/migrate.php 2012-06-25 05:42:50.000000000 +0900 | |
@@ -322,7 +322,7 @@ | |
else | |
{ | |
// there is no 'down'... | |
- \Cli::write('You are already on the first migration for '.$type.':'.$name.'.'); | |
+ \Cli::write('There are no migrations installed to revert for '.$type.':'.$name.'.'); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/packages/email/classes/email/driver/smtp.php fuelphp-1.2.1/fuel/packages/email/classes/email/driver/smtp.php | |
--- fuelphp-1.2/fuel/packages/email/classes/email/driver/smtp.php 2012-05-07 03:55:23.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/email/classes/email/driver/smtp.php 2012-06-25 05:48:25.000000000 +0900 | |
@@ -109,7 +109,11 @@ | |
$this->smtp_get_response(); | |
// Just say hello! | |
- if($this->smtp_send('EHLO'.' '.\Input::server('SERVER_NAME', 'localhost.local'), 250, true) !== 250) | |
+ try | |
+ { | |
+ $this->smtp_send('EHLO'.' '.\Input::server('SERVER_NAME', 'localhost.local'), 250); | |
+ } | |
+ catch(\SmtpCommandFailureException $e) | |
{ | |
// Didn't work? Try HELO | |
$this->smtp_send('HELO'.' '.\Input::server('SERVER_NAME', 'localhost.local'), 250); | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/crud/actions/create.php fuelphp-1.2.1/fuel/packages/oil/views/admin/crud/actions/create.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/crud/actions/create.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/crud/actions/create.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -1,7 +1,7 @@ | |
if (Input::method() == 'POST') | |
{ | |
$val = Model_<?php echo $model_name; ?>::validate('create'); | |
- | |
+ | |
if ($val->run()) | |
{ | |
$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::forge(array( | |
@@ -12,17 +12,17 @@ | |
if ($<?php echo $singular_name; ?> and $<?php echo $singular_name; ?>->save()) | |
{ | |
- Session::set_flash('success', 'Added <?php echo $singular_name; ?> #'.$<?php echo $singular_name; ?>->id.'.'); | |
+ Session::set_flash('success', e('Added <?php echo $singular_name; ?> #'.$<?php echo $singular_name; ?>->id.'.')); | |
Response::redirect('<?php echo $uri; ?>'); | |
} | |
else | |
{ | |
- Session::set_flash('error', 'Could not save <?php echo $singular_name; ?>.'); | |
+ Session::set_flash('error', e('Could not save <?php echo $singular_name; ?>.')); | |
} | |
} | |
else | |
{ | |
- Session::set_flash('error', $val->show_errors()); | |
+ Session::set_flash('error', $val->error()); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/crud/actions/delete.php fuelphp-1.2.1/fuel/packages/oil/views/admin/crud/actions/delete.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/crud/actions/delete.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/crud/actions/delete.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -2,12 +2,12 @@ | |
{ | |
$<?php echo $singular_name; ?>->delete(); | |
- Session::set_flash('success', 'Deleted <?php echo $singular_name; ?> #'.$id); | |
+ Session::set_flash('success', e('Deleted <?php echo $singular_name; ?> #'.$id)); | |
} | |
else | |
{ | |
- Session::set_flash('error', 'Could not delete <?php echo $singular_name; ?> #'.$id); | |
+ Session::set_flash('error', e('Could not delete <?php echo $singular_name; ?> #'.$id)); | |
} | |
Response::redirect('<?php echo $uri; ?>'); | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/crud/actions/edit.php fuelphp-1.2.1/fuel/packages/oil/views/admin/crud/actions/edit.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/crud/actions/edit.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/crud/actions/edit.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -12,7 +12,7 @@ | |
if ($<?php echo $singular_name; ?>->save()) | |
{ | |
- Session::set_flash('success', 'Updated <?php echo $singular_name; ?> #'.$id); | |
+ Session::set_flash('success', e('Updated <?php echo $singular_name; ?> #'.$id)); | |
Response::redirect('<?php echo $uri; ?>'); | |
} | |
else | |
@@ -22,7 +22,7 @@ | |
} | |
else | |
{ | |
- Session::set_flash('error', $val->show_errors()); | |
+ Session::set_flash('error', $val->error()); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/crud/controllers/admin.php fuelphp-1.2.1/fuel/packages/oil/views/admin/crud/controllers/admin.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/crud/controllers/admin.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/crud/controllers/admin.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -39,7 +39,7 @@ | |
{ | |
// credentials ok, go right in | |
$current_user = Model_User::find_by_username(Auth::get_screen_name()); | |
- Session::set_flash('success', 'Welcome, '.$current_user->username); | |
+ Session::set_flash('success', e('Welcome, '.$current_user->username)); | |
Response::redirect('admin'); | |
} | |
else | |
@@ -79,4 +79,4 @@ | |
} | |
-/* End of file app.php */ | |
\ No newline at end of file | |
+/* End of file app.php */ | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/orm/actions/create.php fuelphp-1.2.1/fuel/packages/oil/views/admin/orm/actions/create.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/orm/actions/create.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/orm/actions/create.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -1,7 +1,7 @@ | |
if (Input::method() == 'POST') | |
{ | |
$val = Model_<?php echo $model_name; ?>::validate('create'); | |
- | |
+ | |
if ($val->run()) | |
{ | |
$<?php echo $singular_name; ?> = Model_<?php echo $model_name; ?>::forge(array( | |
@@ -12,19 +12,19 @@ | |
if ($<?php echo $singular_name; ?> and $<?php echo $singular_name; ?>->save()) | |
{ | |
- Session::set_flash('success', 'Added <?php echo $singular_name; ?> #'.$<?php echo $singular_name; ?>->id.'.'); | |
+ Session::set_flash('success', e('Added <?php echo $singular_name; ?> #'.$<?php echo $singular_name; ?>->id.'.')); | |
Response::redirect('<?php echo $uri; ?>'); | |
} | |
else | |
{ | |
- Session::set_flash('error', 'Could not save <?php echo $singular_name; ?>.'); | |
+ Session::set_flash('error', e('Could not save <?php echo $singular_name; ?>.')); | |
} | |
} | |
else | |
{ | |
- Session::set_flash('error', $val->show_errors()); | |
+ Session::set_flash('error', $val->error()); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/orm/actions/delete.php fuelphp-1.2.1/fuel/packages/oil/views/admin/orm/actions/delete.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/orm/actions/delete.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/orm/actions/delete.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -2,12 +2,12 @@ | |
{ | |
$<?php echo $singular_name; ?>->delete(); | |
- Session::set_flash('success', 'Deleted <?php echo $singular_name; ?> #'.$id); | |
+ Session::set_flash('success', e('Deleted <?php echo $singular_name; ?> #'.$id)); | |
} | |
else | |
{ | |
- Session::set_flash('error', 'Could not delete <?php echo $singular_name; ?> #'.$id); | |
+ Session::set_flash('error', e('Could not delete <?php echo $singular_name; ?> #'.$id)); | |
} | |
Response::redirect('<?php echo $uri; ?>'); | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/orm/actions/edit.php fuelphp-1.2.1/fuel/packages/oil/views/admin/orm/actions/edit.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/orm/actions/edit.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/orm/actions/edit.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -9,14 +9,14 @@ | |
if ($<?php echo $singular_name; ?>->save()) | |
{ | |
- Session::set_flash('success', 'Updated <?php echo $singular_name; ?> #' . $id); | |
+ Session::set_flash('success', e('Updated <?php echo $singular_name; ?> #' . $id)); | |
Response::redirect('<?php echo $uri; ?>'); | |
} | |
else | |
{ | |
- Session::set_flash('error', 'Could not update <?php echo $singular_name; ?> #' . $id); | |
+ Session::set_flash('error', e('Could not update <?php echo $singular_name; ?> #' . $id)); | |
} | |
} | |
@@ -28,9 +28,9 @@ | |
$<?php echo $singular_name; ?>-><?php echo $field['name']; ?> = $val->validated('<?php echo $field['name']; ?>'); | |
<?php endforeach; ?> | |
- Session::set_flash('error', $val->show_errors()); | |
+ Session::set_flash('error', $val->error()); | |
} | |
- | |
+ | |
$this->template->set_global('<?php echo $singular_name; ?>', $<?php echo $singular_name; ?>, false); | |
} | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/orm/controllers/admin.php fuelphp-1.2.1/fuel/packages/oil/views/admin/orm/controllers/admin.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/orm/controllers/admin.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/orm/controllers/admin.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -37,7 +37,7 @@ | |
{ | |
// credentials ok, go right in | |
$current_user = Model_User::find_by_username(Auth::get_screen_name()); | |
- Session::set_flash('success', 'Welcome, '.$current_user->username); | |
+ Session::set_flash('success', e('Welcome, '.$current_user->username)); | |
Response::redirect('admin'); | |
} | |
else | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/admin/template.php fuelphp-1.2.1/fuel/packages/oil/views/admin/template.php | |
--- fuelphp-1.2/fuel/packages/oil/views/admin/template.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/admin/template.php 2012-06-25 05:54:13.000000000 +0900 | |
@@ -16,67 +16,67 @@ | |
</script> | |
</head> | |
<body> | |
- | |
+ | |
<?php if ($current_user): ?> | |
- <div class="topbar"> | |
- <div class="fill"> | |
+ <div class="navbar navbar-fixed-top"> | |
+ <div class="navbar-inner"> | |
<div class="container"> | |
- <h3><a href="#">My Site</a></h3> | |
- <ul> | |
+ <a href="#" class="brand">My Site</a> | |
+ <ul class="nav"> | |
<li class="<?php echo Uri::segment(2) == '' ? 'active' : '' ?>"> | |
<?php echo Html::anchor('admin', 'Dashboard') ?> | |
</li> | |
- | |
+ | |
<?php foreach (glob(APPPATH.'classes/controller/admin/*.php') as $controller): ?> | |
- | |
+ | |
<?php | |
$section_segment = basename($controller, '.php'); | |
$section_title = Inflector::humanize($section_segment); | |
?> | |
- | |
+ | |
<li class="<?php echo Uri::segment(2) == $section_segment ? 'active' : '' ?>"> | |
<?php echo Html::anchor('admin/'.$section_segment, $section_title) ?> | |
</li> | |
<?php endforeach; ?> | |
</ul> | |
- <ul class="nav secondary-nav"> | |
- <li class="menu"> | |
- <a href="#" class="menu"><?php echo $current_user->username ?></a> | |
- <ul class="menu-dropdown"> | |
- <li><?php echo Html::anchor('admin/logout', 'Logout') ?></li> | |
- </ul> | |
+ <ul class="nav pull-right"> | |
+ | |
+ <li class="dropdown"> | |
+ <a data-toggle="dropdown" class="dropdown-toggle" href="#"><?php echo $current_user->username ?> <b class="caret"></b></a> | |
+ <ul class="dropdown-menu"> | |
+ <li><?php echo Html::anchor('admin/logout', 'Logout') ?></li> | |
+ </ul> | |
</li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<?php endif; ?> | |
- | |
+ | |
<div class="container"> | |
<div class="row"> | |
- <div class="span16"> | |
+ <div class="span12"> | |
<h1><?php echo $title; ?></h1> | |
<hr> | |
<?php if (Session::get_flash('success')): ?> | |
- <div class="alert-message success"> | |
- <p> | |
- <?php echo implode('</p><p>', e((array) Session::get_flash('success'))); ?> | |
- </p> | |
+ <div class="alert alert-success"> | |
+ <button class="close" data-dismiss="alert">×</button> | |
+ <p><?php echo implode('</p><p>', (array) Session::get_flash('success')); ?></p> | |
</div> | |
<?php endif; ?> | |
<?php if (Session::get_flash('error')): ?> | |
- <div class="alert-message error"> | |
- <p> | |
- <?php echo implode('</p><p>', e((array) Session::get_flash('error'))); ?> | |
- </p> | |
+ <div class="alert alert-error"> | |
+ <button class="close" data-dismiss="alert">×</button> | |
+ <p><?php echo implode('</p><p>', (array) Session::get_flash('success')); ?></p> | |
</div> | |
<?php endif; ?> | |
</div> | |
- <div class="span16"> | |
+ <div class="span12"> | |
<?php echo $content; ?> | |
</div> | |
</div> | |
+ <hr/> | |
<footer> | |
<p class="pull-right">Page rendered in {exec_time}s using {mem_usage}mb of memory.</p> | |
<p> | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/scaffolding/crud/actions/create.php fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/crud/actions/create.php | |
--- fuelphp-1.2/fuel/packages/oil/views/scaffolding/crud/actions/create.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/crud/actions/create.php 2012-06-25 05:49:38.000000000 +0900 | |
@@ -22,7 +22,7 @@ | |
} | |
else | |
{ | |
- Session::set_flash('error', $val->show_errors()); | |
+ Session::set_flash('error', $val->error()); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/scaffolding/crud/actions/edit.php fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/crud/actions/edit.php | |
--- fuelphp-1.2/fuel/packages/oil/views/scaffolding/crud/actions/edit.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/crud/actions/edit.php 2012-06-25 05:49:38.000000000 +0900 | |
@@ -24,7 +24,7 @@ | |
} | |
else | |
{ | |
- Session::set_flash('error', $val->show_errors()); | |
+ Session::set_flash('error', $val->error()); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/scaffolding/orm/actions/create.php fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/orm/actions/create.php | |
--- fuelphp-1.2/fuel/packages/oil/views/scaffolding/orm/actions/create.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/orm/actions/create.php 2012-06-25 05:49:38.000000000 +0900 | |
@@ -24,7 +24,7 @@ | |
} | |
else | |
{ | |
- Session::set_flash('error', $val->show_errors()); | |
+ Session::set_flash('error', $val->error()); | |
} | |
} | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/scaffolding/orm/actions/edit.php fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/orm/actions/edit.php | |
--- fuelphp-1.2/fuel/packages/oil/views/scaffolding/orm/actions/edit.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/orm/actions/edit.php 2012-06-25 05:49:38.000000000 +0900 | |
@@ -31,7 +31,7 @@ | |
$<?php echo $singular_name; ?>-><?php echo $field['name']; ?> = $val->validated('<?php echo $field['name']; ?>'); | |
<?php endforeach; ?> | |
- Session::set_flash('error', $val->show_errors()); | |
+ Session::set_flash('error', $val->error()); | |
} | |
$this->template->set_global('<?php echo $singular_name; ?>', $<?php echo $singular_name; ?>, false); | |
diff -urN fuelphp-1.2/fuel/packages/oil/views/scaffolding/template.php fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/template.php | |
--- fuelphp-1.2/fuel/packages/oil/views/scaffolding/template.php 2012-05-07 03:55:24.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/oil/views/scaffolding/template.php 2012-06-25 05:49:38.000000000 +0900 | |
@@ -17,14 +17,14 @@ | |
<?php if (Session::get_flash('success')): ?> | |
<div class="alert-message success"> | |
<p> | |
- <?php echo implode('</p><p>', (array) Session::get_flash('success')); ?> | |
+ <?php echo implode('</p><p>', e((array) Session::get_flash('success'))); ?> | |
</p> | |
</div> | |
<?php endif; ?> | |
<?php if (Session::get_flash('error')): ?> | |
<div class="alert-message error"> | |
<p> | |
- <?php echo implode('</p><p>', (array) Session::get_flash('error')); ?> | |
+ <?php echo implode('</p><p>', e((array) Session::get_flash('error'))); ?> | |
</p> | |
</div> | |
<?php endif; ?> | |
diff -urN fuelphp-1.2/fuel/packages/orm/classes/belongsto.php fuelphp-1.2.1/fuel/packages/orm/classes/belongsto.php | |
--- fuelphp-1.2/fuel/packages/orm/classes/belongsto.php 2012-05-07 03:55:28.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/orm/classes/belongsto.php 2012-06-25 05:54:59.000000000 +0900 | |
@@ -54,6 +54,14 @@ | |
$query->where(current($this->key_to), $from->{$key}); | |
next($this->key_to); | |
} | |
+ if ($where = \Arr::get($this->conditions, 'where')) | |
+ { | |
+ $query->where($where); | |
+ } | |
+ if ($order_by = \Arr::get($this->conditions, 'order_by')) | |
+ { | |
+ $query->order_by($order_by); | |
+ } | |
return $query->get_one(); | |
} | |
diff -urN fuelphp-1.2/fuel/packages/orm/classes/hasmany.php fuelphp-1.2.1/fuel/packages/orm/classes/hasmany.php | |
--- fuelphp-1.2/fuel/packages/orm/classes/hasmany.php 2012-05-07 03:55:28.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/orm/classes/hasmany.php 2012-06-25 05:54:59.000000000 +0900 | |
@@ -48,6 +48,14 @@ | |
$query->where(current($this->key_to), $from->{$key}); | |
next($this->key_to); | |
} | |
+ if ($where = \Arr::get($this->conditions, 'where')) | |
+ { | |
+ $query->where($where); | |
+ } | |
+ if ($order_by = \Arr::get($this->conditions, 'order_by')) | |
+ { | |
+ $query->order_by($order_by); | |
+ } | |
return $query->get(); | |
} | |
diff -urN fuelphp-1.2/fuel/packages/orm/classes/hasone.php fuelphp-1.2.1/fuel/packages/orm/classes/hasone.php | |
--- fuelphp-1.2/fuel/packages/orm/classes/hasone.php 2012-05-07 03:55:28.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/orm/classes/hasone.php 2012-06-25 05:54:59.000000000 +0900 | |
@@ -50,6 +50,14 @@ | |
$query->where(current($this->key_to), $from->{$key}); | |
next($this->key_to); | |
} | |
+ if ($where = \Arr::get($this->conditions, 'where')) | |
+ { | |
+ $query->where($where); | |
+ } | |
+ if ($order_by = \Arr::get($this->conditions, 'order_by')) | |
+ { | |
+ $query->order_by($order_by); | |
+ } | |
return $query->get_one(); | |
} | |
diff -urN fuelphp-1.2/fuel/packages/orm/classes/manymany.php fuelphp-1.2.1/fuel/packages/orm/classes/manymany.php | |
--- fuelphp-1.2/fuel/packages/orm/classes/manymany.php 2012-05-07 03:55:28.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/orm/classes/manymany.php 2012-06-25 05:54:59.000000000 +0900 | |
@@ -108,6 +108,15 @@ | |
$query->_join($join); | |
+ if ($where = \Arr::get($this->conditions, 'where')) | |
+ { | |
+ $query->where($where); | |
+ } | |
+ if ($order_by = \Arr::get($this->conditions, 'order_by')) | |
+ { | |
+ $query->order_by($order_by); | |
+ } | |
+ | |
return $query->get(); | |
} | |
diff -urN fuelphp-1.2/fuel/packages/orm/classes/model.php fuelphp-1.2.1/fuel/packages/orm/classes/model.php | |
--- fuelphp-1.2/fuel/packages/orm/classes/model.php 2012-06-04 04:10:06.000000000 +0900 | |
+++ fuelphp-1.2.1/fuel/packages/orm/classes/model.php 2012-06-25 05:54:59.000000000 +0900 | |
@@ -1441,7 +1441,7 @@ | |
public static function set_form_fields($form, $instance = null) | |
{ | |
Observer_Validation::set_fields($instance instanceof static ? $instance : get_called_class(), $form); | |
- $instance and $form->repopulate($instance); | |
+ $instance and $form->populate($instance, true); | |
} | |
/** | |
diff -urN fuelphp-1.2/public/assets/css/bootstrap-LICENSE fuelphp-1.2.1/public/assets/css/bootstrap-LICENSE | |
--- fuelphp-1.2/public/assets/css/bootstrap-LICENSE 1970-01-01 09:00:00.000000000 +0900 | |
+++ fuelphp-1.2.1/public/assets/css/bootstrap-LICENSE 2012-06-25 05:33:41.000000000 +0900 | |
@@ -0,0 +1,176 @@ | |
+ Apache License | |
+ Version 2.0, January 2004 | |
+ http://www.apache.org/licenses/ | |
+ | |
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
+ | |
+ 1. Definitions. | |
+ | |
+ "License" shall mean the terms and conditions for use, reproduction, | |
+ and distribution as defined by Sections 1 through 9 of this document. | |
+ | |
+ "Licensor" shall mean the copyright owner or entity authorized by | |
+ the copyright owner that is granting the License. | |
+ | |
+ "Legal Entity" shall mean the union of the acting entity and all | |
+ other entities that control, are controlled by, or are under common | |
+ control with that entity. For the purposes of this definition, | |
+ "control" means (i) the power, direct or indirect, to cause the | |
+ direction or management of such entity, whether by contract or | |
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the | |
+ outstanding shares, or (iii) beneficial ownership of such entity. | |
+ | |
+ "You" (or "Your") shall mean an individual or Legal Entity | |
+ exercising permissions granted by this License. | |
+ | |
+ "Source" form shall mean the preferred form for making modifications, | |
+ including but not limited to software source code, documentation | |
+ source, and configuration files. | |
+ | |
+ "Object" form shall mean any form resulting from mechanical | |
+ transformation or translation of a Source form, including but | |
+ not limited to compiled object code, generated documentation, | |
+ and conversions to other media types. | |
+ | |
+ "Work" shall mean the work of authorship, whether in Source or | |
+ Object form, made available under the License, as indicated by a | |
+ copyright notice that is included in or attached to the work | |
+ (an example is provided in the Appendix below). | |
+ | |
+ "Derivative Works" shall mean any work, whether in Source or Object | |
+ form, that is based on (or derived from) the Work and for which the | |
+ editorial revisions, annotations, elaborations, or other modifications | |
+ represent, as a whole, an original work of authorship. For the purposes | |
+ of this License, Derivative Works shall not include works that remain | |
+ separable from, or merely link (or bind by name) to the interfaces of, | |
+ the Work and Derivative Works thereof. | |
+ | |
+ "Contribution" shall mean any work of authorship, including | |
+ the original version of the Work and any modifications or additions | |
+ to that Work or Derivative Works thereof, that is intentionally | |
+ submitted to Licensor for inclusion in the Work by the copyright owner | |
+ or by an individual or Legal Entity authorized to submit on behalf of | |
+ the copyright owner. For the purposes of this definition, "submitted" | |
+ means any form of electronic, verbal, or written communication sent | |
+ to the Licensor or its representatives, including but not limited to | |
+ communication on electronic mailing lists, source code control systems, | |
+ and issue tracking systems that are managed by, or on behalf of, the | |
+ Licensor for the purpose of discussing and improving the Work, but | |
+ excluding communication that is conspicuously marked or otherwise | |
+ designated in writing by the copyright owner as "Not a Contribution." | |
+ | |
+ "Contributor" shall mean Licensor and any individual or Legal Entity | |
+ on behalf of whom a Contribution has been received by Licensor and | |
+ subsequently incorporated within the Work. | |
+ | |
+ 2. Grant of Copyright License. Subject to the terms and conditions of | |
+ this License, each Contributor hereby grants to You a perpetual, | |
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |
+ copyright license to reproduce, prepare Derivative Works of, | |
+ publicly display, publicly perform, sublicense, and distribute the | |
+ Work and such Derivative Works in Source or Object form. | |
+ | |
+ 3. Grant of Patent License. Subject to the terms and conditions of | |
+ this License, each Contributor hereby grants to You a perpetual, | |
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable | |
+ (except as stated in this section) patent license to make, have made, | |
+ use, offer to sell, sell, import, and otherwise transfer the Work, | |
+ where such license applies only to those patent claims licensable | |
+ by such Contributor that are necessarily infringed by their | |
+ Contribution(s) alone or by combination of their Contribution(s) | |
+ with the Work to which such Contribution(s) was submitted. If You | |
+ institute patent litigation against any entity (including a | |
+ cross-claim or counterclaim in a lawsuit) alleging that the Work | |
+ or a Contribution incorporated within the Work constitutes direct | |
+ or contributory patent infringement, then any patent licenses | |
+ granted to You under this License for that Work shall terminate | |
+ as of the date such litigation is filed. | |
+ | |
+ 4. Redistribution. You may reproduce and distribute copies of the | |
+ Work or Derivative Works thereof in any medium, with or without | |
+ modifications, and in Source or Object form, provided that You | |
+ meet the following conditions: | |
+ | |
+ (a) You must give any other recipients of the Work or | |
+ Derivative Works a copy of this License; and | |
+ | |
+ (b) You must cause any modified files to carry prominent notices | |
+ stating that You changed the files; and | |
+ | |
+ (c) You must retain, in the Source form of any Derivative Works | |
+ that You distribute, all copyright, patent, trademark, and | |
+ attribution notices from the Source form of the Work, | |
+ excluding those notices that do not pertain to any part of | |
+ the Derivative Works; and | |
+ | |
+ (d) If the Work includes a "NOTICE" text file as part of its | |
+ distribution, then any Derivative Works that You distribute must | |
+ include a readable copy of the attribution notices contained | |
+ within such NOTICE file, excluding those notices that do not | |
+ pertain to any part of the Derivative Works, in at least one | |
+ of the following places: within a NOTICE text file distributed | |
+ as part of the Derivative Works; within the Source form or | |
+ documentation, if provided along with the Derivative Works; or, | |
+ within a display generated by the Derivative Works, if and | |
+ wherever such third-party notices normally appear. The contents | |
+ of the NOTICE file are for informational purposes only and | |
+ do not modify the License. You may add Your own attribution | |
+ notices within Derivative Works that You distribute, alongside | |
+ or as an addendum to the NOTICE text from the Work, provided | |
+ that such additional attribution notices cannot be construed | |
+ as modifying the License. | |
+ | |
+ You may add Your own copyright statement to Your modifications and | |
+ may provide additional or different license terms and conditions | |
+ for use, reproduction, or distribution of Your modifications, or | |
+ for any such Derivative Works as a whole, provided Your use, | |
+ reproduction, and distribution of the Work otherwise complies with | |
+ the conditions stated in this License. | |
+ | |
+ 5. Submission of Contributions. Unless You explicitly state otherwise, | |
+ any Contribution intentionally submitted for inclusion in the Work | |
+ by You to the Licensor shall be under the terms and conditions of | |
+ this License, without any additional terms or conditions. | |
+ Notwithstanding the above, nothing herein shall supersede or modify | |
+ the terms of any separate license agreement you may have executed | |
+ with Licensor regarding such Contributions. | |
+ | |
+ 6. Trademarks. This License does not grant permission to use the trade | |
+ names, trademarks, service marks, or product names of the Licensor, | |
+ except as required for reasonable and customary use in describing the | |
+ origin of the Work and reproducing the content of the NOTICE file. | |
+ | |
+ 7. Disclaimer of Warranty. Unless required by applicable law or | |
+ agreed to in writing, Licensor provides the Work (and each | |
+ Contributor provides its Contributions) on an "AS IS" BASIS, | |
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | |
+ implied, including, without limitation, any warranties or conditions | |
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | |
+ PARTICULAR PURPOSE. You are solely responsible for determining the | |
+ appropriateness of using or redistributing the Work and assume any | |
+ risks associated with Your exercise of permissions under this License. | |
+ | |
+ 8. Limitation of Liability. In no event and under no legal theory, | |
+ whether in tort (including negligence), contract, or otherwise, | |
+ unless required by applicable law (such as deliberate and grossly | |
+ negligent acts) or agreed to in writing, shall any Contributor be | |
+ liable to You for damages, including any direct, indirect, special, | |
+ incidental, or consequential damages of any character arising as a | |
+ result of this License or out of the use or inability to use the | |
+ Work (including but not limited to damages for loss of goodwill, | |
+ work stoppage, computer failure or malfunction, or any and all | |
+ other commercial damages or losses), even if such Contributor | |
+ has been advised of the possibility of such damages. | |
+ | |
+ 9. Accepting Warranty or Additional Liability. While redistributing | |
+ the Work or Derivative Works thereof, You may choose to offer, | |
+ and charge a fee for, acceptance of support, warranty, indemnity, | |
+ or other liability obligations and/or rights consistent with this | |
+ License. However, in accepting such obligations, You may act only | |
+ on Your own behalf and on Your sole responsibility, not on behalf | |
+ of any other Contributor, and only if You agree to indemnify, | |
+ defend, and hold each Contributor harmless for any liability | |
+ incurred by, or claims asserted against, such Contributor by reason | |
+ of your accepting any such warranty or additional liability. | |
+ | |
+ END OF TERMS AND CONDITIONS | |
\ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment