3 * [549] AK_COMPILED_VIEWS_DIR is now set to AK_TMP_DIR/views. This means your compiled views will be generated inside the tmp folder unless you set AK_COMPILED_VIEWS_DIR to false to keep them side to side to your views.
5 * [549] On those cases where your host do not support FTP and Apache runs as nobody, you will need to set the right permissions for ./app/locales if you want new i18n text to be added automagically. Same for ./logs. Compiled views and cache will go into a temporary folder.
7 * [549] In those cases where ./tmp is not writable, Akelos will set AK_TMP_DIR to a new folder in your Operating System tmp dir.
9 This sometimes might lead to problems when Open Base forbids including files from the temporary path. In that case you'll need to chmod the ./tmp dir so Akelos knows where to put tmp files.
11 In case you want to make a portable app that needs to write/read files, you can set the AK_TMP_DIR as a base for working with those files like:
14 Ak::file_puts_contents($dir, $content, array('base_path'=>AK_TMP_DIR));
17 * [511] Action Controllers now will automatically load singular named helpers and models if the controller has the plural form.
19 * [510] Added a handy utility for modifying arrays which is useful for securing record creation/updating.
21 If you have this code on a controller
23 $this->user->setAttributes($this->params['user']);
26 and your users table has a column named is_admin. All it would take to a malicious user is to modify the page html to add the need field and gain admin privileges.
28 You could avoid it by using the new Ak::pick method which will return and array with desired keys. For deleting keys instead of selecting them you can use Ak::delete()
31 $this->user->setAttributes(Ak::pick('name,email', $this->params['user']));
34 * [509] Parameters given to url_for do not need to be urlencoded anymore. This allows using variables with slashes.
36 * [476] Adding includeAndInstatiateModels and uninstallAndInstallMigration to AkUnitTest
38 * Making it possible to include models by default by declaring in your application_controller.php
41 var $app_models = 'user,role';
44 this way you can avoid adding controller-wide models into every single controller.
46 * HTTP authentication now can have its own failure message by implementing a **access_denied** method into the application controller.
48 ----------------------
50 * Model generator now supports customizing first migration version column setting from the command line like:
52 ./generate model Video title, length double, author, is_searchable
54 * Relocated Active Record database adapters, behaviors and associations into lib/AkActiveRecord/AkDbAdapters, AkActsAsBehaviours and AkAssociations respectively.
58 ## Merging Kaste's branch with the trunk.
60 WARNING: IMPORTANT CHANGES AHEAD!
62 * [387] Refactored AkActiveRecord::find().
63 * [387] API-change: removed find('first', $id, $options) cause finding one id is always "first". Use find($id, $options); instead.
64 * [395] Deprecated AkActiveRecord::find($sql) which silently expanded to AkActiveRecord::find('first', $sql).
65 This was ambiguous because find($sql, $bind_variables*) expanded to find('all',*)
66 Use AkActiveRecord::find('first', $sql) instead.
67 * [396] Added AkDbAdapter between ADODb and the Active Record.
68 * [396] Expanded AkUnitTest so its easy to generate Models on the fly like:
70 $AkUnitTest->installAndIncludeModels(array('Article'=>'id,name,description'));
72 Creates the table 'articles' with specified columns and builds the ActiveRecord Model (class) 'Article'.
73 * [396] AkActiveRecord::toYaml now handles ActiveRecord collections.
75 User::toYaml($found_users);
77 * [407] Fixed typos on the Active Record like $asssociated_ids....
78 * [407] Improved and refactored Active Record unit tests.
79 * [405] Fixed AkHasAndBelongsToMany/AkHasMany::getAssociatedModelInstance which Singleton was badly implemented.
80 * [416] Avoided unsetting database profiles.
81 * [416] Added support for extra database profiles you can quickly test with different db-adapters like:
83 ActiveRecord::establishConnection('super_user');
84 ./test _some_test_case.php sqlite_test_profile
86 * [417] Changed NewDataDictionary(db->connection) to db->getDictionary();
87 * [418] AkHasAndBelongsToMany now uses AkInstaller to create the join table. Because of that it creates the sequence_table for sqlite straight away.
88 * [419] Fixed singleton implementation of Ak::getLogger()
89 * [425] AkInstaller: Added magic 'lock_version' column.
91 'lock_version' => 'lock_version int default=1'
93 * [427] Refactored the Active Record "callback"-chain. Fixes #95 and #94.
94 * [427] Added create, update and execute methods to AkDbAdapter.
95 * [428] Adding support for late bindings on AkDbAdapter::execute()
96 This allows you to safely sanitize parameters before adding them to your custom SQL queries.
98 AkDbAdapter::execute(array('select * from articles where id=?', 1));
100 * [429] Added addLimitAndOffset method to AkDbAdapter for delegating limits and offsets.
101 * [431] Implemented renameColumn in AkDbAdapter. Closes #47 and #96.
102 * [436] Removed AkActiveRecord::sqlSelect* (now in AkDbAdapter)
103 * [437] Moved transactions to AkDbAdapter
104 * [439] Fixed a serious issue in a TEST that could lead to data loss in the development database.
105 * [441] Replacing MetaTables() and MetaColumns() with AkDbAdapter::availableTables() and AkDbAdapter::getColumnDetails($table).
106 * [446] Improved the MenuHeper
107 * [446] Changed default options for AkPluginManager::updatePlugin(). Disables externals and checkout.
108 * [448] AkActiveRecord::findBySql now uses AkDbAdapter::select
109 * [450] AkActiveRecord::incrementCounter() and decrementCounter() now are pseudo-static.
110 * [450] AkActiveRecord::updateAttribute() now validates when saving by default. Pass 'false' as third argument to bypass validation.
111 * [451] AkInstaller automatically sets '*_count'-columns => 'columnname int default 0'
112 * [458] Fixed #103, quoting strings on PostgreSQL.
113 * [459] Adding decimal-type support on Active Records.
114 * [459] Datatypes for PostgreSQL changed. You need to update/change your table schemas! Run migrations!
115 Before this, we kinda hacked Mysql-behavior into PostgreSQL. Thus we didnt used features of Postgre on one side.
117 In the long run we had to fix - better now than later - since the design problems only "multiply" when time goes by.
119 At this point we wanted to implement the decimal/numeric datatype. And so we had to decide whether to hack further or to solve the underlying issue. This means we HAD to correct a wrong implementation.
121 (simplified type>) Akelos Postgre (<Actual Type)
125 boolean => numeric(1)
126 integer => numeric(X,0)
130 integer => integer (int4)
133 To guide you through this we'll have a test at test/unit/lib/AkActiveRecord/_PostgreSQL_datatype_migration.php.
135 First make you comfortably with this test and make it pass. This is a test against a dummy-table of course.
136 (When you're on Postgre 7 you have to modify this test. But you'll see that.)
138 Next write appropriate migrations/installers for your real tables. (Again: You should always begin with a test.)
140 Keep in mind that we typecast TINYINT as boolean on MySQL. So you cannot use tinyint for other things.
141 * [459] Boolean columns now actually have three possible states: true, false and null. Before that null=>false!
142 * [461] ActiveRecordHelper::error_messages_for and error_message_on now translate the error messages.
143 * [467] NULL values can be saved on boolean and decimal columns. Fixes #114 and #113.
145 #### End of Kaste merge
149 * AkInstaller::createTable() will now add created_at and updated_at columns automatically unless you have one of
150 them in your table declaration or set the option 'timestamp' => false
153 $this->createTable('user', 'id, first_name, last_name, email'); // will add created_at, and updated_at
159 $this->createTable('user', 'id, first_name, last_name, email', array('timestamp'=>false)); // nothing extra
165 $this->createTable('user', 'id, first_name, last_name, email, updated_at'); // nothing extra
168 * Simplifying unit test calls for models and core tests. Updated generators to reflect this new way of calling tests.
169 If you stick with the convention of prefixing your test cases with TestCase you will no longer need to call ak__test('testcaseclass')
171 Running models test can now be done with simply
172 ./script/test model User
174 Core tests can be called without the full path like
175 ./script/test AkActiveRecord
177 * Rearranged scripts to include as little code as possible in the application space. This should make updates easier.
179 * Removed AkInflector::modulize as it had a misleading name, use AkInflector::classify instead [420]
181 * Added support for HTTP Authentication [412]. Example:
185 class PostController extends ApplicationController
187 var $_authorized_users = array('bermi' => 'secret');
189 function __construct()
191 $this->beforeFilter(array('authenticate' => array('except' => array('index'))));
196 $this->renderText("Everyone can see me!");
201 $this->renderText("I'm only accessible if you know the password");
204 function authenticate()
207 * You can either use an array like $this->_authorized_users or
208 * an Model instance that implements an authenticate method like Model::authenticate($user,$pass, $controller);
210 return $this->_authenticateOrRequestWithHttpBasic('My Blog', $this->_authorized_users);
216 * Added public/500.php and public/404.php for handling errors on production mode.
220 ----------------------
222 * First public release