Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smarty should not load when using internal API #473

Closed
mattab opened this issue Dec 9, 2008 · 3 comments
Closed

smarty should not load when using internal API #473

mattab opened this issue Dec 9, 2008 · 3 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Dec 9, 2008

I just did a fresh install of build 817 from svn and this is still an issue. I believe the real issue is this, when attempting to access the API through the internal PHP method, PIWIK is loading a lot of extra code that it should not be. I am noticing PIWIK interfering with my session’s and smarty install. It might be loading a lot of other things which should probably be removed for API but those are the only ones that really interefere.

I am using the following code in a test.php file inside the dir of the install:

```

// Default API setup
define(‘PIWIK_INCLUDE_PATH’, ‘.’);
define(‘ENABLE_DISPATCH’, false);
require_once PIWIK_INCLUDE_PATH . “/index.php”;
require_once PIWIK_INCLUDE_PATH . “/core/API/Request.php”;

Piwik_FrontController::getInstance()→init(); // Close the PIWIK Session so we can handle our own session // Why is PIWIK starting a session when all I want is access to the API? session_write_close(); session_name(“test”); session_start();
  1. This should fail because I haven’t included my smarty
    $smarty = new Smarty();
    echo ‘Done!’;
    ```
@anonymous-matomo-user
Copy link

Is there any additional testing I should do to help with this issue?

@mattab
Copy link
Member Author

mattab commented Jan 14, 2009

To fix this issue, what we should due is use autoload in Piwik http://nz2.php.net/autoload

That would increase global performances by only including required files at run time + would fix this bug.

@mattab
Copy link
Member Author

mattab commented Jan 14, 2009

actually your test.php seems to work now (ie: it fails).

I close as worksforme, please reopen if you still experience issue with latest release

@mattab mattab added this to the RobotRock milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

2 participants