Results 1 to 4 of 4

Thread: Extension Installation - Run Once?

  1. #1
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Extension Installation - Run Once?

    Hi

    Is it possible to create an update of an extension, e.g. Gallery, where the new version will perform database modifications only once, like TL's liveupdate tool. Is there a script or some hook that can be run once, and then removed. I'm trying to comply to the new Comments system for the Gallery, but this means that when you just straight upgrade, TL will simply remove the tl_gallery_comments table, removing all existing comments. I'd like to convert them to entries in tl_comments before the database update is run to remove the table tl_gallery_comments

    Any ideas? Leo, Peter, Fred?

  2. #2
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: Extension Installation - Run Once?

    If you create a file system/runonce.php, it will be executed once and then deleted automatically.

  3. #3
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: Extension Installation - Run Once?

    hey leo

    Thanks for taking the time to answer this. Does this file get executed after file install and before the DB update in the Extension Manager install process?

    PS. What happens if there are dependencies and they also have the file runonce.php. something will get overwritten here, right? This is especially true if you change the way a hierarchy of apps work together and/or your extension is dependant on another and that person puts in a runonce as well (without your knowledge).

  4. #4
    Core developer
    Official Contao Team
    leo's Avatar
    Join Date
    06-04-09.
    Location
    Wuppertal, Germany
    Posts
    201

    Default Re: Extension Installation - Run Once?

    If the file exists, it is being executed upon the next request = right after the extension files have been extracted.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •