Error after upgrade to 2


#1

Hello

i just made the upgrade. everything’s been fine and piwik is up and working, but all my personnal scripts are not working any more. i have this kind of message:

i’ve double checked path and files, and everything is fine…any help would be appreciated

using PHP Version 5.4.6-1ubuntu1.3

thank you


(Matthieu Aubry) #2

if you are using the PHP classes of Piwik then there are few small changes to make your code compatible with the new piwik 2. (eg. we are now using namespaces features), let us know if you have some question


#3

hello
thank you for your reply. can you be more specific ? i tryed a few things i found in the doc without success. for example what should become this code:

[quote="define(‘PIWIK_INCLUDE_PATH’, realpath(’…/piwik’));
define(‘PIWIK_USER_PATH’, realpath(’…/piwik’));
define(‘PIWIK_ENABLE_DISPATCH’, false);
define(‘PIWIK_ENABLE_ERROR_HANDLER’, false);
define(‘PIWIK_ENABLE_SESSION_START’, false);

require_once PIWIK_INCLUDE_PATH . “/index.php”;
require_once PIWIK_INCLUDE_PATH . “/core/API/Request.php”;

Piwik_FrontController::getInstance()->init();

$request = new Piwik_API_Request(’"…]

[/quote]

for example with this code, i have an error on the line Piwik_FrontController::getInstance()->init();

thank you for your help


(Matthieu Aubry) #4

Please see updated code at Querying the Reporting API: Integrate - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3


#5

thank you, i was misplacing the “use” part. put it on top and now it’s fine

thank you for your help