fuel / core

Fuel PHP Framework - The core of the Fuel v1 framework
http://fuelphp.com
813 stars 345 forks source link

FuelPHP 1.4 - cannot extend Arr class #1224

Closed assembledadam closed 11 years ago

assembledadam commented 11 years ago

To reproduce:

(With fresh copy of 1.4).

  1. Create a new package (I called mine 'platform') in the fuel/packages dir (default packages location).
  2. Add bootstrap.php and classes/arr.php in your platform package dir
  3. Add the following to classes/arr.php
namespace Platform;

class Arr extends \Fuel\Core\Arr
{
 public static function test()
 {
  \Debug::dump('MY ARR IS ALIVE!');
 }
}
  1. Add the following to your package bootstrap:
Autoloader::add_core_namespace('Platform');

Autoloader::add_classes(array(
    'Platform\\Arr'    => __DIR__.'/classes/arr.php',
));
  1. Add 'platform' to the list of packages to autoload in config.
  2. Attempt to call a method within the extended Arr class in a controller

Result:

ErrorException [ Error ]: Call to undefined method Fuel\Core\Arr::test()

This same method works for all other classes NOT listed in the docs as being an issue, that is apart from 'profiler', when switched on - in that situation you get a big fatal error (i'll list that as a separate issue once this one is sorted most likely).

WanWizard commented 11 years ago

Documentation updated: https://github.com/fuel/docs/commit/49e904ae59a63142222ed2900d3fd6822485fece