-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Split frontend- and backend files #656
Comments
I totally agree! http://framework.zend.com/docs/quickstart/set-up-the-project-structure |
Replying to [klando](comment:1): yes, but be careful that using this commonly used but static structure may not fit the needs of every project. I would suggest a config-variable of the path to the “rest” (say non public part) of piwik. This may be after the zend suggestion by default, but should be easy to change, if my directory is not named library but Libraries and I do not want to change this in my basic project. |
Replying to [kaspar](comment:2): > Replying to [klando](comment:1): This is adjusted in the bootsrap file (from memory, I didn’t check carefully), I wanted to point the ‘public/’ versus the other dirs of the app. |
I also like the idea of separation as it would not require web server-specific .htaccess files (which also impact the web server’s performance). However, I don’t think the aforementioned ZF project structure would be an easy (or even desirable) re-fit for Piwik. The good news is index.php and piwik.php already perform the bootstrapping and funnel-access-through functionality needed to make much of this separation possible. The head-scratcher is resolving paths so that Piwik can find itself (e.g., plugins are problematic because of mixed content in each plugin folder). On top of this: |
- auto-update |
because of the reasons you mention vipsoft, I’d mark this “wontfix” as |
If you don't mind losing one-click updates, I think this is doable:
Disclaimer: untested; use a snapshot from svn (or wait for 0.4.2) We probably won't change the build/release script, but if you come up with a patch for the Updater, we'll consider it. (You might start with defining PIWIK_DOCUMENT_ROOT, and reading a bootstrap.ini.php file, if present, to override PIWIK_INCLUDE_PATH.) |
(In [1342]) refs #656 - add $excludePhp flag to Piwik::copyRecursive() to exclude PHP files copied to PIWIK_DOCUMENT_ROOT |
The last two check-ins should satisfy the requirement of being able to relocate ("hide") backend files outside of the document root. The task of splitting front- and backend files is described in comment:8. |
p.s. a copy of the root directory files (bootstrap.php, index.php, and piwik.php) would have to exist in both PIWIK_DOCUMENT_ROOT and PIWIK_INCLUDE_PATH directories for things tests/all_tests.php and misc/generateVisits.php to work. |
It would be great to have an easy possibility to hide the files that are not needed to be public from the view and place them somewhere outside the DocumentRoot of the webserver.
This is kind of best practice and I would appreciate this highly! The way it is at the moment is way easier to install, but also way more insecure. Perhaps you could provide some alternative way for paranoid sysadmins :-)
Thanks for your effort
The text was updated successfully, but these errors were encountered: