kohana/core — pull request #510 by serieznyi (2014-07-01 00:03:48+00:00)
Title: feature: change kohana_find priority

Kohana::$_paths not correct ordered by priority and Kohana::find_file returns wrong files

Problem:

Step 1) Init modules
```
Kohana::modules(array(
...
'database' => MODPATH.'database', // PRIOR 0
'module_core' => MODPATH.'module_core', PRIOR 1
'module_app' => MODPATH.'module_app', // PRIOR 2, module_app dependense from module_core
...
));
```

P.S. module_core != SYSPATH, module_app != APPPATH

Structure of files:

```
module_core/
-----views
----------template.php
module_app/
-----views
----------template.php // extend view file of module_core/views/template.php
```

Step 2: Get view

```
Kohana::find_file('views', 'template');
```

Result:

```
module_core/views/template.php
```

But we need module_app/views/template.php

Why we get this result?

Step 3: Algoritm find view files

```
echo Kohana::$_paths;

// Result
```
APPPATH,
module_core,
module_app
SYSPATH
```

Step 4: Show order for view location (order than now using in core (K3.3.2)).
```
APPPATH, // 1
...,
database, // 2
module_core, // 3
module_app // 4
...,
SYSPATH // 5
```

Step 5: The order what we need for get correct view (current priority)
```
APPPATH, // 1
...,
database, // 4
module_core, // 3
module_app // 2
...,
SYSPATH // 5
```
Am I wrong?