Skip to main content
Topic: Themes servers/download (Read 6303 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Themes servers/download

I was looking at the ManageThemes.controller.php to remove the last couple of queries around, when I noticed there is still a (quite hard) reference to sm.org for downloading themes.
So I started thinking what could be the best option.

Since we have a git repo for themes I started exploring the possibility to download them directly from github, but is not easy (it could be possible but we'd have to use the API to recursively retrieve all the files one by one in the directory and then create the package on-the-fly).

The second options (that actually was the first) is to simply create an interface to add servers (I'm not really interested in bind the code to a single central one, even considering all the security implications) and then retrieve some javascript with a js object (or array, not sure, not a JSON because we still support php 5.1) and then populate the page with the results. I think we can use the admin_info_files table to store and fetch the code. Any proposal on the js side to build it "properly"?
Looking at what SMF does I was thinking some kind of structure like:
Code: [Select]
var something = {
1: {
name: 'Name of the theme',
desc: 'plain text description',
author: 'emanuele', // I can dream! :P
url: 'http://www.url.to/the/download/package.zip',
},
No clear idea of what "something" should and would be for the best result.

The third option (that I thought while writing) is to use the themes github repo to provide a file with the list of available themes (stored on other servers).

The fourth option is: drop it entirely.

The fifth is to re-use the "package server" somehow...but that may take some time...dunno.

Opinions?

The use of github may be a barrier for some contributors and anyway would put us "in control" of the distribution (that is something I would personally avoid).
Of course we could use github for our themes and add others' themes if they want/don't have another place where store them/don't know how to store them/etc.

The same questions/considerations can apply to the packages.
Bugs creator.
Features destroyer.
Template killer.

Re: Themes servers/download

Reply #1

Oh, wait I remember Spuds was working on some download from github few days ago... I lost track of that... :-[
We may reorganize the code around that too.
Bugs creator.
Features destroyer.
Template killer.

Re: Themes servers/download

Reply #2

If I were you, I wouldn't spend a lot of time working on the package manager. At some point, when you get a PSR compliant structure setup, use Composer to handle the server/file management. For editing files and Elkarte specific tasks, maybe a Composer plugin or post-install script.

Re: Themes servers/download

Reply #3

 Spuds does not know a thing about composer !

The only thing I did for packman in this regard, was handle the downloading of master.zip files.  Now it simply renames them to the github/bitbucket repo name so they don't overwrite one another and really mess things up.  It also just adds a _1 _2 etc to them so again no overwriting since it really does not know the level of the addon if from master[1]
, well it does but there were some differences between github and bitbucket and in the end this was just a thing to protect the user anyway