-
Notifications
You must be signed in to change notification settings - Fork 346
Changelog v1.1
jschreuder edited this page Nov 1, 2011
·
61 revisions
Important changes that need extra attention when releasing v1.1.
- The
$request->controllerproperty no longer holds just the lowercase controller segment(s) but the full classname of the Controller. - Deprication of
Request::show_404(), replaced withthrow new HttpNotFoundExceptionthat has a handle method to show the 404 - Support for
handle()method that is run when an exception isn't caught beforeError::exception_handler()catches it. - Support for special
_404_route now inpublic/index.phpthus no longer part of the core but still supported as a 'official default' - Closures are now also supported in routes, thus routing to a Closure instead of a controler/method uri. Also added support for any type of callable in Route extensions you write yourself.
- Closure support in all getters & setters: if you get a value and also input a default the default can also be a Closure and you'll get the result of that. For setters the input can also be a closure and the result of the Closure will be set. (except for
View::set()as one might want to pass a closure to the View) - Moved the Environment setting from the
app/config/config.phpfile to theapp/bootstrap.phpfile. - All
factory()methods have been renamed toforge(). This name better states the method's function. Thefactory()methods are still there for backwards compatibility, but are deprecated and will log warning messages when used. - The
$this->responseResponse object is now deprecated. Your action methods should return either a string, View object, ViewModel object or a Response object. - Added the
fuel/app/vendordirectory to the default install. - You can now have an unlimited number of sub-directories for your controllers. (e.g.
classes/controller/admin/users/groups.phpwith a class name ofController_Admin_Users_Groupswould be atsite.com/admin/users/groups) - There is no longer a default controller for directories. It used to be that going to something like
site.com/adminwould bring upController_Admin_Admininclasses/controller/admin/admin.php. Now you must place that controller at it's expected locationclasses/controller/admin.phpwith a name ofController_Admin. - A
Controller::after()method now gets passed the response of the controller, it must return that response (or modified) as well. - Added new function
get_real_class()to which you can pass a classname and it will return the actual class, to be used on classes of which you're not sure whether it is an alias or not. - Module routes are prepended to the routes array when Fuel detects the fist URI segment as a module, therefor parsing them before an
(:any)route in the app config. - Config is now environment aware and allows partial/full overwriting of the base config from subdirectories in the config dir named after the environment.
- Added a new
Themeclass. It allows you to easily add Theme support to your applications. -
Fuel_Exceptionhas been renamed toFuelException -
Fuel::find_file()and related methods are now deprecated. Use theFinderclass instead (e.g.Finder::search()). - Migrations are now supported in Modules and Packages
- Routing has 3 new shortcuts:
-
:almunmatches all utf-8 alphabetical and numeric characters -
:nummatches all numeric characters. -
:alphamatches all utf-8 alphabetical characters
-
- Put the
Autoloaderclass intoFuel\Coreto allow extending it, it must now be required in the app bootstrap file which is also the location where you must require your own extension.
- Added Fuel's own response object class
Fuel\Core\Responseto default whitelist inapp/config/config.phpof objects that aren't encoded on output by the View when passed. - The
security.auto_encode_view_dataconfig option inapp/config/config.phphas been renamed tosecurity.auto_filter_output. -
stdClasswas part of the default whitelisted classes from output encoding, this was a bug and it has been removed.
-
Arr: Added methods
Arr::get(),Arr::set()andArr::prepend(). -
Arr:
Arr::element()andArr::elements()have been deprecated. Use the newArr::get()instead. -
Database: Using transactions will no longer prevent exceptions, exceptions are thrown and should be handled by the dev. The
Database_Transactionclass has been deprecated as it has little use because of this change. -
File:
File::read_dir()(and related methods on Area and Directory handler) now return dirnames with directory separator suffix -
Fieldset_Field: Parsing of validation rules has been moved from
Fieldset_Field::add_rule()toValidaton::_find_fule(), from the outside the method still works the same but notices for inactive rules are now only shown when running the validation. -
Fieldset_Field: You can now set the type to
falseto prevent a field from being rendered. -
Form: Added inline error reporting, which must first be switched on in config and will replace an
{error_msg}tag - Form: New default form template which puts it inside a table.
-
Fuel: Added
Fuel::value()which checks if the given value is a Closure, and returns the result of the Closure if it is, otherwise, simply the value. -
Image: No longer throws
Fuel_Exceptionfor any type of exception but insteadRuntimeException,InvalidArguementExceptionandOutOfBoundsExceptionwhere appropriate. -
Input:
Input::post(null)doesn't work to get full post array anymore, justInput::post()without params - same for all other Input methods -
Input:
Input::get_post()has been deprecated and replaced byInput::param(). It now also includes PUT and DELETE variables. -
Input / Uri:
Uri::detect()moved toInput::uri()as it is part of the input and thus should be part of the input class -
Request: You can now also do external requests through the Request class, for now only a curl driver:
Request::forge('http//url', 'curl')orRequest::forge('http//url', array('driver' => 'curl', 'method' => 'post', 'params' => array()). -
Validation:
Validation::errors()is depricated and replaced by singular formValidation::error()to be more in line with other class methods -
Validation: New 3rd parameter added to
Validation::run()that allows adding callables for the duration of the run. - View: The view class has been refactored and works much better now. Output filtering is vastly improved.
-
View:
View::capture()has been split into two protected instance methods:process_file()andget_data(). You will need to update your View class extensions. -
View:
View::$auto_encodehas been removed. It has been replaced but auto_filter, which is per-view instance. -
ViewModel: Refactored the class internals to work more transparently with the
View. -
ViewModel: Deprecated
$this->_templateand renamed it to$this->_view. -
ViewModel: Updated to work with the refactored
Viewclass. Added$this->bind(). -
ViewModel: Deprecated
$this->set_template()and renamed it to$this->set_view(). -
Html: Removed (not deprecated) the following methods:
Html::h(),Html::br(),Html::hr(),Html::nbs(),Html::title(),Html::header(). You should simply write the HTML yourself. -
Config: Added Config file drivers for PHP, INI, JSON and Yaml. They are detected by file extension (e.g.
Config::load('foo.yml')will load and parse the Yaml).
-
Auth: Renamed default table name from
simpleuserstousers. - Auth: Added config options for DB connection and table columns used for fetching the user.
-
Auth: Removed default config for groups & roles in
simpleauth.phpconfig file, only commented out examples left. -
Auth: Added new
created_atcolumn to SimpleAuth users table which will keep the UNIX timestamp for when the user was created, suggested SQL to update:ALTER TABLE `users` ADD `created_at` INT( 11 ) UNSIGNED NOT NULL -
Auth: Added new
reset_password($username)method to SimpleAuth which sets a new 8 character alpha-numeric random password for the given user and returns it as a string. It won't email it to the user though, the way this is handled is up how you implement it. -
Orm: Lots of tweaks to
Observer_Validationrelated to changes toValidation&Fieldset_Fieldclasses. Also changed it to only save properties that are actually changed. -
Orm: The
ValidationFailedthrown when theObserver_Validationfails now includes a reference to the Fieldset instance that failed:$valfailed->get_fieldset(); -
Orm: Added support for changing the type of join used when fetching relations, example:
Model_Example::query()->related('something', array('join_type' => 'inner'))->get(); - Orm: Observers are no longer singleton but one instance per model with per model settings, check docs for more info.
- Orm: Added support for using a database view instead of the normal table for fetching objects, this allows you to define a view with additional fields which can be fetched by the ORM.
-
Orm: Default where conditions for a relation are now put in the
ON()part of a join. -
Orm: The
Observer_Validationand form generation with theFieldsetclass will ignore the primary key(s). (as theObserver_Typingalready did) - Parser: Added Parser package to the default install.
- Parser: Mustache is now part of the Parser package by default. Version 0.7.1.
- Email: The Email package is added.