Skip to content

Releases: volter9/mini_framework

Routing fix

24 Aug 17:53
Compare
Choose a tag to compare

There was a bug that I discovered while playing with URLs. There was a problem with removing the base_url from URL in the get_url function. This patch is fixing this bug.

2.0.0

06 Aug 15:54
Compare
Choose a tag to compare

There's a lot of changes happened to the mini_framework. The brief list of these changes:

  • Namespaces for each module (almost every module) were added.
  • Global refactoring (code readability improvement).
  • Each API module can be initiated via loader\api($module_name, $array_arguments).
  • Most of modules covered by unit-tests

Router module changes:

  • Router now only accepts callable's as second parameter.
  • Actions were added (helpers for routing)
  • Function route was renamed to router\map

View module changes:

  • Views now can be rendered from view.directory instead of view.directory/template_name/html if view.template is not specified in config
  • Function view\capture was added

Other modules changes:

  • Validation returns only error codes instead of localized messages (validation\validate_field now can be used to validate only one value).
  • Pagination was improved (bug were fixed)
  • Events' function events was removed, the function events\bind now is the container
  • i18n function was renamed to i18n\get
  • load_language function was renamed to i18n\load
  • load_model function was renamed to loader\model and works differently (because of namespaces)

Config specification changes:

  • templates key in config is renamed to view
  • database key is renamed to db
  • routing key was removed (therefore base_url and symbols keys were removed)

Finally, in detail review of changes:

Namespaces

Namespaces were introduced to the 2.0.0. Now each module, controller and models should be contained in the namespace. Most of the API changed due to the namespace introduction (actions, loader\model).

Module API

API modules are the core modules of mini_framework. Before 2.0, modules were loaded by function load_system and initialized in system_load function. Now, modules are loaded and initialized inside of loader\system and to every init function of every module (if init function exists) passed an array of settings from config on app\boot.

If you need to initialize module manually, by invoking loader\api, you should also provide an array with expected keys and values.

Router changes

Because of namespaces it became harder to parse file:action second argument to route function. Instead of parsing, I introduced "actions".

Actions are basically functions which returns a closure which lazy-loads controller actions (functions in separate files). There's brief example:

router\map('GET page /page/:num', actions\controller(
    'view', '\actions\page',
    'app/actions/page'
));

If this route would be found and executed, actions\controller would lazy load app/actions/page.php, and invoke \actions\page\init (if it exists) and \actions\page\view.

1.2.3

26 Jul 03:55
Compare
Choose a tag to compare
  • Internal modification of router therefore allowing to write different response processors
  • auto_dispatching fix
  • autoload.files config key fix (which resulted to error if the key is missing in array)
  • autoload.modules config key was added – now you can pass modules names (in mini_framework) which you want to load instead of predefined ones
  • In each module there was added @require's to identify which other modules are dependencies of current module (most of them are dependent upon storage and array)

1.2.2

22 May 02:29
Compare
Choose a tag to compare
  • Pagination was fixed and broken
  • view_path now also accepts absolute path (it means that you can use any file, and not only views in templates)
  • prepare renamed to db_prepare
  • DB now can accept raw DSN or DSN attributes ('key' => 'value' turns into 'key=value;' in DSN)
  • New DB function db_query, which just performs a database query and returns PDOStatement
  • Loader isn't dependent on repo or any other component (however, functions load_app_file and load_api need corresponding constants: MF_APP_DIR and MF_API_DIR)

1.2.1

30 Apr 19:25
Compare
Choose a tag to compare
  • db_insert fix
  • Framework refactoring
  • route now supports closure as second argument instead of controller
  • "Auto-dispatch" routing available
  • New array function: array_numerify
  • New string functions: before and contains

1.2

23 Apr 21:14
Compare
Choose a tag to compare
1.2
  • Array helpers: array_extract, array_exclude, array_pluck, array_join, array_transfer
  • String helpers: starts_with, ends_with, after, deduplicate, exclude
  • Change internal database API, db_aggregate removed
  • Change to view API
  • New path and URL functions

1.1

17 Apr 23:09
Compare
Choose a tag to compare
1.1

Some API changes

1.0.3

15 Apr 17:32
Compare
Choose a tag to compare

Some changes to validation API and migration from PHP5.4 to 5.3

1.0.2

03 Apr 02:07
Compare
Choose a tag to compare
Version number was changed

1.0.1

02 Apr 17:07
Compare
Choose a tag to compare
  • Changed name. From FFFramework (to avoid association with fat free framework) to mini_framework
  • In config, you may specify autoload.files array to load required files