Making it possible to install plugins from local directories in order to simplify...
[akelos.git] / CHANGELOG.txt
blob9efabb73a2439ce694e11fc6cb75997dd2aa2314
1 SVN
3 * [556] Adding a new HTTP client for performing REST requests at lib/AkHttpClient. See unit tests for details.
5 * [556] Adding support for accepting PUT HTTP requests.
7 * [556] Changing Ak::DeprecateWarning to Ak::deprecateWarning in order to match coding conventions.
9 * [556] Adding support for reporting unknown actions using a public/405.php file when working on production mode. 404.php remains the file for controller not found errors.
11 * [556] Logging invalid controller/action requests.
13 * [556] Modifying Ak::url_get_contents. It does not require curl anymore. 
15 Now it works like 
17 {{{
18 $Client = new AkHttpClient();
19 $Client->get('url', array('params'=>.....));
20 }}}
22 * [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.
24 * [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.
26 * [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. 
28 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.
30 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:
32 {{{
33 Ak::file_puts_contents($dir, $content, array('base_path'=>AK_TMP_DIR));
34 }}}
36 * [511] Action Controllers now will automatically load singular named helpers and models if the controller has the plural form.
38 * [510] Added a handy utility for modifying arrays which is useful for securing record creation/updating.
40 If you have this code on a controller
41 {{{
42   $this->user->setAttributes($this->params['user']);
43 }}}
45 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.
47 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()
49 {{{
50   $this->user->setAttributes(Ak::pick('name,email', $this->params['user']));
51 }}}
53 * [509] Parameters given to url_for do not need to be urlencoded anymore. This allows using variables with slashes.
55 * [476] Adding includeAndInstatiateModels and uninstallAndInstallMigration to AkUnitTest
57 * Making it possible to include models by default by declaring in your application_controller.php
59 {{{
60   var $app_models = 'user,role';
61 }}}
63 this way you can avoid adding controller-wide models into every single controller.
65 * HTTP authentication now can have its own failure message by implementing a **access_denied** method into the application controller.
67 ----------------------
69 * Model generator now supports customizing first migration version column setting from the command line like:
71     ./generate model Video title, length double, author, is_searchable
73 * Relocated Active Record database adapters, behaviors and associations into lib/AkActiveRecord/AkDbAdapters, AkActsAsBehaviours and AkAssociations respectively.
75 ----------
77 ## Merging Kaste's branch with the trunk.
79     WARNING: IMPORTANT CHANGES AHEAD!
81 * [387] Refactored AkActiveRecord::find(). 
82 * [387] API-change: removed find('first', $id, $options) cause finding one id is always "first". Use find($id, $options); instead.
83 * [395] Deprecated AkActiveRecord::find($sql) which silently expanded to AkActiveRecord::find('first', $sql).
84 This was ambiguous because find($sql, $bind_variables*) expanded to find('all',*)
85 Use AkActiveRecord::find('first', $sql) instead.
86 * [396] Added AkDbAdapter between ADODb and the Active Record.
87 * [396] Expanded AkUnitTest so its easy to generate Models on the fly like: 
89     $AkUnitTest->installAndIncludeModels(array('Article'=>'id,name,description'));
91 Creates the table 'articles' with specified columns and builds the ActiveRecord Model (class) 'Article'.
92 * [396] AkActiveRecord::toYaml now handles ActiveRecord collections.
94     User::toYaml($found_users);
96 * [407] Fixed typos on the Active Record like $asssociated_ids....
97 * [407] Improved and refactored Active Record unit tests.
98 * [405] Fixed AkHasAndBelongsToMany/AkHasMany::getAssociatedModelInstance which Singleton was badly implemented.
99 * [416] Avoided unsetting database profiles.
100 * [416] Added support for extra database profiles you can quickly test with different db-adapters like:
102     ActiveRecord::establishConnection('super_user');
103     ./test _some_test_case.php sqlite_test_profile 
105 * [417] Changed NewDataDictionary(db->connection) to db->getDictionary();
106 * [418] AkHasAndBelongsToMany now uses AkInstaller to create the join table. Because of that it creates the sequence_table for sqlite straight away.
107 * [419] Fixed singleton implementation of Ak::getLogger() 
108 * [425] AkInstaller: Added magic 'lock_version' column.
110     'lock_version' => 'lock_version int default=1'
112 * [427] Refactored the Active Record "callback"-chain. Fixes #95 and #94.
113 * [427] Added create, update and execute methods to AkDbAdapter.
114 * [428] Adding support for late bindings on AkDbAdapter::execute()
115 This allows you to safely sanitize parameters before adding them to your custom SQL queries.
117     AkDbAdapter::execute(array('select * from articles where id=?', 1));
119 * [429] Added addLimitAndOffset method to AkDbAdapter for delegating limits and offsets.
120 * [431] Implemented renameColumn in AkDbAdapter. Closes #47 and #96.
121 * [436] Removed AkActiveRecord::sqlSelect* (now in AkDbAdapter)
122 * [437] Moved transactions to AkDbAdapter
123 * [439] Fixed a serious issue in a TEST that could lead to data loss in the development database. 
124 * [441] Replacing MetaTables() and MetaColumns() with  AkDbAdapter::availableTables() and AkDbAdapter::getColumnDetails($table). 
125 * [446] Improved the MenuHeper
126 * [446] Changed default options for AkPluginManager::updatePlugin(). Disables externals and checkout.
127 * [448] AkActiveRecord::findBySql now uses AkDbAdapter::select
128 * [450] AkActiveRecord::incrementCounter() and decrementCounter() now are pseudo-static.
129 * [450] AkActiveRecord::updateAttribute() now validates when saving by default. Pass 'false' as third argument to bypass validation.
130 * [451] AkInstaller automatically sets '*_count'-columns => 'columnname int default 0'
131 * [458] Fixed #103, quoting strings on PostgreSQL.
132 * [459] Adding decimal-type support on Active Records.
133 * [459] Datatypes for PostgreSQL changed. You need to update/change your table schemas! Run migrations!
134 Before this, we kinda hacked Mysql-behavior into PostgreSQL. Thus we didnt used features of Postgre on one side. 
136 In the long run we had to fix - better now than later - since the design problems only "multiply" when time goes by.  
138 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.  
140     (simplified type>) Akelos      Postgre (<Actual Type) 
142 Until now we had:
144     boolean  => numeric(1) 
145     integer  => numeric(X,0) 
146                        
147 From now on we have:
148     boolean  => bool 
149     integer  => integer  (int4) 
150     decimal  => numeric 
151                                    
152 To guide you through this we'll have a test at test/unit/lib/AkActiveRecord/_PostgreSQL_datatype_migration.php. 
154 First make you comfortably with this test and make it pass. This is a test against a dummy-table of course. 
155 (When you're on Postgre 7 you have to modify this test. But you'll see that.)  
157 Next write appropriate migrations/installers for your real tables. (Again: You should always begin with a test.) 
159 Keep in mind that we typecast TINYINT as boolean on MySQL. So you cannot use tinyint for other things.                                              
160 * [459] Boolean columns now actually have three possible states: true, false and null. Before that null=>false!
161 * [461] ActiveRecordHelper::error_messages_for and error_message_on now translate the error messages.
162 * [467] NULL values can be saved on boolean and decimal columns. Fixes #114 and #113.
164 #### End of Kaste merge
166 -----------
168 * AkInstaller::createTable() will now add created_at and updated_at columns automatically unless you have one of 
169   them in your table declaration or set the option 'timestamp' => false
170     
171     function up_1(){
172         $this->createTable('user', 'id, first_name, last_name, email'); // will add created_at, and updated_at
173     }
175   to avoid it
177     function up_1(){
178           $this->createTable('user', 'id, first_name, last_name, email', array('timestamp'=>false)); // nothing extra
179     }   
180   
181   or
182   
183     function up_1(){
184           $this->createTable('user', 'id, first_name, last_name, email, updated_at'); // nothing extra
185     }   
186       
187 * Simplifying unit test calls for models and core tests. Updated generators to reflect this new way of calling tests.
188   If you stick with the convention of prefixing your test cases with TestCase you will no longer need to call ak__test('testcaseclass')
189   
190   Running models test can now be done with simply
191     ./script/test model User
192     
193   Core tests can be called without the full path like
194     ./script/test AkActiveRecord
196 * Rearranged scripts to include as little code as possible in the application space. This should make updates easier.
198 * Removed AkInflector::modulize as it had a misleading name, use AkInflector::classify instead [420]
200 * Added support for HTTP Authentication [412]. Example:
202     <?php
203     
204     class PostController extends ApplicationController
205     {
206         var $_authorized_users = array('bermi' => 'secret');
207         
208         function __construct()
209         {
210             $this->beforeFilter(array('authenticate' => array('except' => array('index'))));
211         }
212     
213         function index() 
214         {
215             $this->renderText("Everyone can see me!");
216         }
217     
218         function edit()
219         {
220             $this->renderText("I'm only accessible if you know the password");
221         }
222     
223         function authenticate()
224         {
225             /**
226             * You can either use an array like $this->_authorized_users or
227             * an Model instance that implements an authenticate method like Model::authenticate($user,$pass, $controller);
228             */
229             return $this->_authenticateOrRequestWithHttpBasic('My Blog', $this->_authorized_users);
230         }
231     }
232     
233     ?>
235 * Added public/500.php and public/404.php for handling errors on production mode.
239 ----------------------
241  * First public release