Hi Alex,

as far as I know oxid plans to improve the metadata.php to manage
install sql-files.

Triggering the processes via hook-functions sounds like a good idea so
updating and clean removal should be possible.

But especially if you think about updating you need to support near all
update scenarios ( version a to version c, version b to version c etc. ).

So if we are talking about sql files on the one hand, we also need to
talk about a way for being able to patch files on the other hand ( as
seen in the debian package management for example ) .

Cheers

André

On 21.09.2012 15:03, Alexander Kludt wrote:
> Hi Danny,
>
> First of all thanks for your feedback, let me follow up your concerns:
>
> 1. Every developer should be responsible for deleting/updating/dropping data 
> as 
> needed for the module, this is why my idea was to go for custom functions
>      You can check the needed dependencies there - it would be even cooler if 
> we 
> could precapture some data before doing any hook.
>
> 2. The events should only run as needed, maybe there should be extra buttons 
> "install/uninstall/update" => Means adding an onUpdate handler
>
> 3. What does happen right now if a module file gets broken in some way? I 
> think 
> this is a different thing to think about.
>
> 4. This is what I know from Joomla, they have both ways - custom 
> install/uninstall function and custom install.sql/uninstall.sql which is run 
> automatically
>      I always found myself using the custom function, just because of updates 
> and keeping data in some cases or showing warnings etc.
>
> Having these optional hooks would be a broad approach that could care about 
> all 
> caveats - at least I think so.
>
>
> -- 
>
> mit freundlichen Grüßen
> Alexander Kludt
>
>
> __________________________
> Phone: 09283-5925453
> Fax: 09283-592671
> Skype: kingschnulli
> Email: [email protected]
> Website: www.aggrosoft.de
>
> __________________________
> Aggrosoft it intelligence GbR
> Tannstrasse 12
> 95111 Rehau
> GERMANY
>
> Sitz Rehau, Amtsgericht Hof
> Steuernummer: 223/165/54508
> Ust.-Id. Nr. gemäß § 27 a Umsatzsteuergesetz: DE260722773
>
> ___________________________
> Diese Nachricht ist nur für den Empfänger () bestimmt, sollten
> Sie nicht der Empfänger sein löschen Sie diese Nachricht
> umgehend und geben Sie uns bitte per Email ([email protected]) Bescheid
> über den fälschlichen Erhalt.
>
>
>
> > --------------------------------------------------------------------------------
> >
> >     Danny Althoff <mailto:[email protected]>
> > 21. September 2012 14:47
> >
> >
> > Hi Alexander,
> >
> > I have thought about a solution like that too, but here come some problems:
> >
> > 1.plz do not kill already existing data from the database.
> >
> > 2.Running automated events makes it hard to predict performance, and what 
> > if 
> > you install an update by just copying over the existing files?
> >
> > 3.What should happen, if the plugin gets broken (e.g. hard-drive failure, 
> > wrong upload, etc…)?
> >
> > Another thought: what about making something like giving the responsability 
> > of 
> > the database-management to the shop itself?
> >
> > Something like this (in the metadata.php):
> >
> > 'db' => array(
> >
> >                 'tables' => array(
> >
> > "extend" => array(
> >
> > 'oxarticles' => array(
> >
> > array(
> >
> > "name" => "smi_something",
> >
> > "type" => "double"
> >
> > // ... and other options to make it easy
> >
> > ),
> >
> > ),
> >
> > 'oxuser' => array(
> >
> > ),
> >
> > ),
> >
> > "create" => array(
> >
> > 'smi_table1' => array(
> >
> > array(
> >
> > "name" => "oxid",
> >
> > "type" => "oxid" // for generating oxids automaticly
> >
> > // ... and other options to make it easy
> >
> > ),
> >
> > ),
> >
> > 'smi_table2' => array(
> >
> > ),
> >
> > ),
> >
> > "needed" => array(
> >
> > "smi_table3", // created by own special dedicated sql-file
> >
> > "smi_table4", // created by own special dedicated sql-file
> >
> > "smi_table5", // created by own special dedicated sql-file
> >
> > ),
> >
> >                 ),
> >
> >                 'views' => array(
> >
> > // ... like tables
> >
> >                 )
> >
> > )
> >
> > So we all can create nifty sql-files additionally if really needed, but can 
> > have automatics managed by oxid itself. It’s just a quick thought, maybe 
> > this 
> > is overpowered for just having sql-files removed J
> >
> > Mit freundlichen Grüßen
> >
> > Danny Althoff
> >
> > _____________________________________
> >
> > *Danny Althoff*
> > Software Developer
> >
> > Die SHOPtimisten,-
> > Robertstr. 2
> > 51105 Köln
> > Germany
> >
> > fon +49 (0) 221 913999 – 17
> > fax +49 (0) 221 913999 – 98
> >
> > [email protected] <mailto:[email protected]>
> > www.die-shoptimisten.de <http://www.die-shoptimisten.de/>
> >
> > Die Shoptimisten UG (haftungsbeschränkt), Geschäftsführer: Jörg Scholtz
> > Sitz der Gesellschaft ist Köln, eingetragen beim Amtsgericht Köln, HRB 67004
> >
> > Wichtiger Hinweis:
> > Diese E-Mail (inklusive etwaiger Anhänge) ist vertraulich und nur für den 
> > Adressaten bestimmt. Wenn Sie diese E-Mail irrtümlich erhalten haben, 
> > machen 
> > wir Sie darauf aufmerksam, dass Ihnen eine Kenntnisnahme, eine 
> > Vervielfältigung oder Weitergabe nicht gestattet ist. Bitte informieren Sie 
> > uns umgehend, löschen Sie die E-Mail und vernichten Sie etwaige Ausdrucke.
> >
> > Important Note:
> > This e-mail (including any attachments) is confidential and intended only 
> > for 
> > the use of the address(es) named herein. If you have received this e-mail 
> > in 
> > error, you are hereby notified that any review, copying or distribution of 
> > it 
> > is strictly prohibited. Please inform us immediately and destroy the 
> > original 
> > e-mail and any printouts.
> >
> > PSave a tree...please don't print this e-mail unless you really need to
> >
> > *Von:*[email protected] 
> > <mailto:[email protected]> 
> > [mailto:[email protected]] 
> > <mailto:[mailto:[email protected]]> *Im Auftrag von 
> > *Alexander Kludt
> > *Gesendet:* Freitag, 21. September 2012 14:18
> > *An:* [email protected] 
> > <mailto:[email protected]>
> > *Betreff:* [oxid-dev-general] Improving metadata.php
> >
> > Hi guys,
> >
> > I was developing a new module today, and the metadata.php already makes a 
> > lot 
> > of things possible,
> > but I still need a way to do some initial things - like executing sql, 
> > maybe 
> > check some things, capture some
> > use input or just to show some warnings. So my idea is to add a way to 
> > execute 
> > code "onInstall", "onUninstall", "onActivate", "onDeactivate" .
> >
> > I don't know the mechanics of includinig metadata.php but maybe it could be 
> > done like this:
> >
> > /<?php
> >
> > $sMetadataVersion = '1.1';
> >
> > $aModule = array(
> >     'id'           => 'mymodule',
> >     'title'        => 'Some Module',
> >     'description'  => 'Does something',
> >     'thumbnail'    => 'module.png',
> >     'version'      => '1.0',
> >     'author'       => 'Aggrosoft',
> >     'extend'      => array(
> >          ...
> >     ),
> >     'blocks' => array(
> >         ...
> >     ),
> >     ...
> > *'onInstall' => 'myModulOnInstall',
> >     'onUninstall' => 'myModulOnUninstall',
> >     'onActivate' => 'myModulOnActivate',
> >     'onDeactive' => 'myModulOnDeactivate', *
> >
> > );
> >
> >
> > *function myModulOnInstall ($aSomeInfosAboutTheShop?Module?State?){
> >   //Write down code to execute on install, return true on success, false if 
> > it 
> > fails
> > }
> >
> > function myModulOnUninstall ($aSomeInfosAboutTheShop?Module?State?){
> >   //Write down code to execute on deinstallation, return true on success, 
> > false if it fails
> > }* *
> >
> > function myModulOnActivate ($aSomeInfosAboutTheShop?Module?State?){
> >   //Write down code to execute on activation, return true on success, false 
> > if 
> > it fails
> > }* *
> >
> > function myModulOnDeactivate ($aSomeInfosAboutTheShop?Module?State?){
> >   //Write down code to execute on deactivation, return true on success, 
> > false 
> > if it fails
> > }*
> >
> > ?>/
> >
> > Maybe wrapping an inner class maybe better which follows some kind of 
> > interface - so names will not conflict, or come up with some kind of naming 
> > sheme.
> > What do you think? Would this make your day easier? I think many modules 
> > can 
> > be improved with this.
> >
> > -- 
> >
> > mit freundlichen Grüßen
> > Alexander Kludt
> >
> >
> > __________________________
> > Phone: 09283-5925453
> > Fax: 09283-592671
> > Skype: kingschnulli
> > Email: [email protected] <mailto:[email protected]>
> > Website: www.aggrosoft.de <http://www.aggrosoft.de>
> >
> > __________________________
> > Aggrosoft it intelligence GbR
> > Tannstrasse 12
> > 95111 Rehau
> > GERMANY
> >
> > Sitz Rehau, Amtsgericht Hof
> > Steuernummer: 223/165/54508
> > Ust.-Id. Nr. gemäß § 27 a Umsatzsteuergesetz: DE260722773
> >
> > ___________________________
> > Diese Nachricht ist nur für den Empfänger () bestimmt, sollten
> > Sie nicht der Empfänger sein löschen Sie diese Nachricht
> > umgehend und geben Sie uns bitte per Email ([email protected] 
> > <mailto:[email protected]>) Bescheid
> > über den fälschlichen Erhalt.
> >
> > _______________________________________________
> > dev-general mailing list
> > [email protected]
> > http://dir.gmane.org/gmane.comp.php.oxid.general


-- 

André Gregor-Herrmann
Entwicklung, Administration, Projektmanagement

mail  [ [email protected] ]

web  [ www.fatchip.de ]

FATCHIP [ GmbH ]  |  sitz  [ Helmholtzstrasse 2-9 | 10587 Berlin ]  |  fon  [ 
030.39 88 93 51 ]  |  fax  [ 030.39 88 93 52 ]  |  mail  [ [email protected] ] 
 |  Ust-Id.  [ DE 265567757 ]  |  Amtsgericht  [ Berlin-Charlottenburg ] | HRB 
[120567 B] | Geschäftsführung [ Dipl.-Ing. Hendrik Bahr ]

Be Smart, Go Green. Don’t print this email unless you really need to.

_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to