Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Namespace \Fuel\Tasks detected as Undefined constant
  • Error - 2011-01-29 21:35:50 --> Error - Undefined constant 'Fuel\Tasks' in /Sites/aduit/fuel/app/tasks/aduit.php on line 3 Here my code snippet:
    <?php
    
    Namespace \Fuel\Tasks;
    
    class Aduit {
     public static function upgrade() {
      new Upgrader();
     }
    }
    

    And here my PHP version:
    Mior-Muhammad-Zakis-MacBook-Pro:aduit crynobone$ php -v
    PHP 5.3.3 (cli) (built: Aug 16 2010 14:09:31) 
    Copyright (c) 1997-2010 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
        with Zend Extension Manager v5.1, Copyright (c) 2003-2010, by Zend Technologies
        - with Zend Data Cache v4.0, Copyright (c) 2004-2010, by Zend Technologies [loaded] [licensed] [disabled]
        - with Zend Utils v1.0, Copyright (c) 2004-2010, by Zend Technologies [loaded] [licensed] [enabled]
        - with Zend Optimizer+ v4.1, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [disabled]
        - with Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [enabled]
    
  • In the namespace decleration you shouldn't prefix with a backslash. It is always defined from the root so the backslash has no meaning and actually confuses the parser.
  • Thank you, that really solve the problem.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion