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

Automated Installer? #781

Closed
anonymous-matomo-user opened this issue Jun 10, 2009 · 12 comments
Closed

Automated Installer? #781

anonymous-matomo-user opened this issue Jun 10, 2009 · 12 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.

Comments

@anonymous-matomo-user
Copy link

I don't know where to post my question so i do it here ;)

I currently develop a full integration of Piwik into TYPO3.

TYPO3 Supports table creation during installation. To use this feature, i need the table structere as create statement.

How does Piwik create them (they must be created during installation?!), perhaps you can point me to the correct lines of code ;), so that the plugin will work with the api.

Regards Kay

@robocoder
Copy link
Contributor

Take a look at the GeoIP plugin's SQL queries.

@anonymous-matomo-user
Copy link
Author

in GeoIP.php there is a function that handles the updates during the plugin installation. -> cool but not what I meant.

What i mean, is a API-Call or something aquivalent where i can ask piwik core for the complete database scheme to write it in the typo3 extension files.

Create Table ... ...

I want to do that to avoid the installation process, because all the data is known, and piwik should be installed automatically.

The other way around would be to set an option in the config file, that the installer has to create all the table on first startup (db-accessinformation is set already).

Regards

Kay

@robocoder
Copy link
Contributor

getTablesCreateSql() in core/Piwik.php

@mattab
Copy link
Member

mattab commented Jun 10, 2009

Important note: vipsoft is right, this is where the core tables are created.

There is something that we could do, and maybe should consider as it would be extremely powerful: provide an API to install Piwik remotely. This is a bit unusual idea, but basically in the Installation plugin, we could provide API methods that other softwares (typo3, wordpress, etc.) could call to remotely setup Piwik entirely.

The installation has 8 steps and each (approximately) could be matched into an API call.

If we do this properly, this would open a new very interesting idea: Piwik could be a real "plugin" to any software out there, and during, for example, the typo3 plugin installation (that would bundle piwik in it), typo3 would have the power to completely install Piwik.

This is somewhat a subtask of: #161

I have been suggested a few times that a very interesting direction to take for Piwik could be to allow such functionnality, as Piwik is a tool that people use aside of other tools, and it would make sense to be able to completely install Piwik remotely; let me know if this is what you are looking for.

The Installation code currently sits in the Installation Controller: https://github.com/piwik/piwik/blob/master/plugins/Installation/Controller.php and the logic could, I think, pretty easily be moved to an API.

@anonymous-matomo-user
Copy link
Author

yep, that's what i'm currently building from outside piwik ;) using some of the piwik functions.

There should be one addtional option to install plugins remotly during the installprocess. (e.g. for SingleSignOn Plugins etc.).

Additionally it should be possible to run a function directly after the configuration is read (before database initialization) so that the database setting can be directly obtained from other projects settings, without writing it into the piwik configuration file.
All this will make it very easy to integrate piwik into other projects.
I think this will make piwik more popular. ;))

Regards Kay

@mattab
Copy link
Member

mattab commented Jun 11, 2009

Kay, would you like to work on these core improvements for Piwik? we would love to have your help and you could use typo3 integration as the use case to drive the changes.

In piwik, we strive to make all these things available in APIs that you can http-request.

  • we could move logic from the Installation/Controller.php to Installation/API.php
  • we could add the hook that you request, ie. after init reading and before DB initialization

please have a look at piwik core, how other plugins are built, and let us know what you think - even better, a patch that we can review and help you with!

@anonymous-matomo-user
Copy link
Author

I would do it.
I've thought quite a while about http installation.
I think we do not need it really.
I think it can be solved easily with the hook after loading the configuration, before connecting to the database.

At this point it should be possible to paste the required data into the configuration and connect to the database and create the required tables.

All user-mapping and syncing function can be done in a Auth-Plugin. -> I've done that already in TYPO3Login.

Please tell me your opinion.

//-Reminder for me-
Solved getting the create SQL for Piwik Core.
Opened getting the create SQL for Piwik extensions (only direct modification via install) -> perhaps it would be better to do it like TYPO3 with ext_tables.sql where only create table definitions are allowed, which are parsed and compared to existing pages, than modifications are executed.

@mattab
Copy link
Member

mattab commented Jun 11, 2009

if you think this can be done with hooks, we can do it this way it is more simple: please provide a patch with the new hooks and we will consider.

However for more modularity, and because doing it with hooks still requires to write a piwik plugin - which is not trivial - it would be better to have it via http. Softwares written in python/asp/etc. could also install it very easily.

@anonymous-matomo-user
Copy link
Author

yep thats right.
typical, many pros and cons.

for single sign on i will need a plugin already (pro hook).

I think installation with a hook will be the common case for integration with php applications.
I think http installation will not be used for commonly -> but interesting for hosters and companies.

I will send the patch after this weekend.

Regards Kay

@anonymous-matomo-user
Copy link
Author

what do you think on the following way of implementation:

  1. precreate the configfile
    whith [install] section in it
  2. run piwik -> hook found install section and install flag in config.ini
  3. check things that need to be done (filesystem, database, etc.)
  4. install, remove install flag from install section
  5. run piwik

???

@mattab
Copy link
Member

mattab commented Jun 15, 2015

We have implemented this plugin, please get in touch if you are interested.

@mattab mattab reopened this Jul 22, 2016
@mattab mattab removed the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Jul 22, 2016
@mattab mattab added this to the Mid term milestone Nov 11, 2016
@mattab
Copy link
Member

mattab commented Nov 11, 2016

Please see and follow up in this duplicate feature request: #10257

@mattab mattab closed this as completed Nov 11, 2016
@mattab mattab added the duplicate For issues that already existed in our issue tracker and were reported previously. label Nov 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants