Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How do I instantiate a class from outside of Fuel (e.g., OAuthProvider from PECL)?
  • ****
    Resolved: apache was using older version of PHP. <sigh>
    **** I'm building an OAuth provider using the built-in PECL extension (http://www.php.net/oauth). However, I'm running into a fairly serious error when trying to instantiate an OAuthProvider. Here's the simplest example I can give: public function action_index()
    {
    $provider = new OAuthProvider();
    } And the error displayed: ErrorException [ Error ]: Class 'OAuthProvider' not found This works fine outside of Fuel and I've tried both the master and develop branches but no luck. I'm fairly sure that this is due to the autoloading and that the OAuthProvider class is pre-defined outside of Fuel. I'm trying to track down the path in Autoloader::load() but was hoping someone else might be able to give pointers in the meantime. For example, is there a way to dictate the PHP/PECL namespace, e.g., PECL\OAuthProvider? -J
  • Update: From command line, the class exists >> php -r "print('x'.class_exists('OAuthProvider').'x');"
    x1x From within Fuel, it doesn't: public function action_index()
    {
    print('x'.class_exists('OAuthProvider').'x');
    } xx ****************
    Other details: >> php --version
    PHP 5.3.6 (cli) (built: Apr 19 2011 14:21:33)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies >> git log -n 1
    commit 07b332c34bb9934a83c324739c0544eea654d177
    Author: Phil Sturgeon <email@philsturgeon.co.uk>
    Date: Tue Apr 19 09:45:58 2011 +0100 Updated submodules.
  • RESOLVED: apache was using older version of PHP. <sigh>

Howdy, Stranger!

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

In this Discussion