-
Notifications
You must be signed in to change notification settings - Fork 296
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
Use Composer to manage all 3rd-party PHP libraries #613
Comments
We need to make sure that we're compatible with RainTPL 3. |
A quick question, but for sure a tricky one! I've kept rewriting this post over and over for the last hour-or-so, as there are actually very few resources on the Web that address the matter in a structured, argumented way. So instead of directly answering it, I'll give some pointers to interesting articles and posts I've stumbled upon while digging into the topic :) |
Having read all of that, you could still auto-update the dependencies with a git commit hook, also running the test suite to make sure everything's OK. There remains the problem of licensing, but you're probably not using such library. |
Hi @alexisju you can still install shaarli on shared hosting; but not from git master. You will have to download a prebuilt ZIP at https://github.com/shaarli/Shaarli/releases (it's not there yet). THere will be 2 ways to install:
|
@Marsup for what it's worth I don't see the point of pulling the 3rd party libs and commiting them to the repo, now that we have proper dependency management. It would make the git repository larger, etc. As I said above, if you don't want to run composer, use a prebuilt ZIP release (not released yet). If you download Shaarli from git you will have to run composer. |
I'll go with composer then. For me it's a much smoother upgrade process to let git manage the file deletion and renames. Using the zip means a much more manual and complex upgrade process. |
I also use git to upgrade and manage versions and find it smoother than manual operations with ZIP files. Fortunately working with ZIPs can also be automated, and I intend to do that on my own setup soon. I currently use this ansible task to deploy Shaarli, I will do the required changes and post them here if anyone is interested. (basically it will backup the data/ directory, remove the whole shaarli install, download and extract the most recent zip, and restore data/). There are some disadvantages with the new composer requirement (no more updates via git as @alexisju summarized here - unless you also have composer). I used to oppose this change when Shaarli was a total mess since git was convenient, but IMHO the advantages of having a cleaner codebase (thanks to the fantastic work of @virtualtam and @ArthurHoaro) outweighs this. After all Shaarli used to only be downloadable via ZIP archive on sebsauvage's site. Let me know if you'd like something to be documented more. |
What are the advised options for a production server ? --no-dev ? |
I believe yes @virtualtam can you update
with the latest changes regarding the installation procedure? I still think these pages should be condensed in a single one, and the server config examples moved to separate linked pages. It would be nice to have a Makefile target for installation so that users don't need to figure out composer commands. |
@virtualtam Ok I just merged the download and installation pages in the wiki, and updated the README to point to the correct page. https://github.com/shaarli/Shaarli/wiki/Download-and-Installation |
Thanks @nodiscc ;-) |
I'm currently working on bumping RainTPL from 2.7 to 3.1, as it's only available from Composer/Packagist starting with 3.0 - https://packagist.org/packages/rain/raintpl In doing so, I stumbled upon what seems to be an inconsistency in the current templates:
There are two syntaxes used when looping:
Though RainTPL 2.7 doesn't seem to be too picky about it, this leads to RainTPL 3.1 generating erroneous PHP code from templates. @nodiscc @ArthurHoaro @alexisju @kalvn, did you notice similar issues while working on templates? I'll do further tests to see if it's possible to get templates that work with both RainTPL versions before actually upgrading to 3.1. |
Relates to shaarli#613 Before: {loop="someVariable"} After: {loop="$someVariable"} Signed-off-by: VirtualTam <virtualtam@flibidi.net>
It's quite funny, I noticed the same thing today while working on templates. I switched to |
|
Relates to shaarli#613 Modifications: - update Rain\Tpl initialization code: - autoload with Composer - update configuration - set 'auto_escape' to false - [template] reference static resources relatively to the index page, not to the template file anymore, e.g. '../inc/script.js' becomes 'inc/script.js' - [template] linklist: move "link updated date" processing to PHP code RainTPL 3.1 specificities: - no complex variable processing in templates: - `{$var1=$var2}` works - `{$var1=$condition ? 'Value1' : 'Value2'}` does not WIP: - check PHP compatibility - check all pages work properly Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Relates to shaarli#613 Modifications: - update `Rain\Tpl` initialization code: - autoload with Composer - update configuration - set 'auto_escape' to false - [template] reference static resources relatively to the index page - [template] linklist: move "link updated date" processing to PHP code RainTPL 3.1 specificities: - no complex variable processing in templates: - `{$var1=$var2}` works - `{$var1=$condition ? 'Value1' : 'Value2'}` does not - static resources are now referenced relatively to the index page, not to the template file, e.g. '../inc/script.js' becomes 'inc/script.js' WIP: - check PHP compatibility - check all pages work properly Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Relates to #613 Before: {loop="someVariable"} After: {loop="$someVariable"} Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Relates to shaarli#613 Modifications: - update `Rain\Tpl` initialization code: - autoload with Composer - update configuration - set 'auto_escape' to false - [template] reference static resources relatively to the index page - [template] linklist: move "link updated date" processing to PHP code RainTPL 3.1 specificities: - no complex variable processing in templates: - `{$var1=$var2}` works - `{$var1=$condition ? 'Value1' : 'Value2'}` does not - static resources are now referenced relatively to the index page, not to the template file, e.g. '../inc/script.js' becomes 'inc/script.js' WIP: - check PHP compatibility - check all pages work properly Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Relates to shaarli#613 Modifications: - update `Rain\Tpl` initialization code: - autoload with Composer - update configuration - set 'auto_escape' to false - [template] reference static resources relatively to the index page - [template] linklist: move "link updated date" processing to PHP code RainTPL 3.1 specificities: - no complex variable processing in templates: - `{$var1=$var2}` works - `{$var1=$condition ? 'Value1' : 'Value2'}` does not - static resources are now referenced relatively to the index page, not to the template file, e.g. '../inc/script.js' becomes 'inc/script.js' WIP: - check PHP compatibility - check all pages work properly Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Relates to shaarli#613 Modifications: - update `Rain\Tpl` initialization code: - autoload with Composer - update configuration - set 'auto_escape' to false - [template] reference static resources relatively to the index page - [template] linklist: move "link updated date" processing to PHP code RainTPL 3.1 specificities: - no complex variable processing in templates: - `{$var1=$var2}` works - `{$var1=$condition ? 'Value1' : 'Value2'}` does not - static resources are now referenced relatively to the index page, not to the template file, e.g. '../inc/script.js' becomes 'inc/script.js' WIP: - check PHP compatibility - check all pages work properly Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Relates to shaarli#613 Before: {loop="someVariable"} After: {loop="$someVariable"} Signed-off-by: VirtualTam <virtualtam@flibidi.net>
3rd-party libs shouldn't be part of Shaarli's codebase, but managed and pinned using Composer, and referenced by autoloading (see #607, #608, #612):
RainTPL: upgrade to 3.1.0, install through Composer #669 - https://packagist.org/packages/rain/raintpl(WONTFIX)The text was updated successfully, but these errors were encountered: