emacs-symfony-cli

Check-in [56a5d89fdf]
Login
Overview
Comment:Add symfony-cli and basic download functionality. Fix [c6a1e7a05e2fd42630be5b34e95f044267fc3c68]
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 56a5d89fdf8fa393c3cf6aa3cef8d0370a16d2c27ecf6f291569201d1761c3f3
User & Date: w96k on 2025-08-03 23:54:24
Original Comment: Add symfony-cli and basic download functionality
Other Links: manifest | tags | edit
Context
2025-08-03
23:58
Rename emacs-symfony.el to symfony.el check-in: 1f6c7a0391 user: w96k tags: trunk
23:54
Add symfony-cli and basic download functionality. Fix [c6a1e7a05e2fd42630be5b34e95f044267fc3c68] check-in: 56a5d89fdf user: w96k tags: trunk
18:10
Edit starter template check-in: a105a2f2dd user: w96k tags: trunk
Changes

Added symfony-cli.el version [13af67b7be].










































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
;;  -*- lexical-binding: t -*-

;; emacs-symfony - emacs support for symfony framework
;; Copyright (C) 2025 Mikhail Kirillov <@w96k>

;; This file is not part of GNU Emacs

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

(defvar symfony-cli-binary "symfony"
  "Symfony binary file name")

(defvar symfony-cli-path "~/.emacs.d/"
  "Symfony cli path")

(defvar symfony-cli-repo "https://github.com/symfony-cli/symfony-cli"
  "Symfony cli git repository")

(defvar symfony-cli-version "v5.12.0"
  "Symfony cli version")

(defvar symfony-cli-arch "amd64"
  "Symfony cli cpu architecture")

(defvar symfony-cli-platform "linux"
  "Symfony cli cpu architecture")

(defvar symfony-cli-download-format ".tar.gz"
  "Symfony cli cpu architecture")

(defun symfony-cli--get-download-url ()
  (concat symfony-cli-repo "/releases/download/" symfony-cli-version
	  "/symfony-cli_" symfony-cli-platform
	  "_" symfony-cli-arch symfony-cli-download-format))

(defun symfony-cli--get-archive-filename ()
  (concat symfony-cli-binary symfony-cli-download-format))

(defun symfony-cli--get-archive-path ()
  (concat symfony-cli-path (symfony-cli--get-archive-filename)))

(defun symfony-cli--unpack-archive (archive-path unpack-path)
  (shell-command (concat "tar -xzf " archive-path " --directory " unpack-path "/ " symfony-cli-binary)))

(concat "tar -xzvf " (symfony-cli--get-archive-path) " " symfony-cli-binary " --directory " symfony-cli-path)

(defun symfony-cli-download ()
  "Download ready to use symfony-cli binary"
  (interactive)

  (let ((symfony-cli-url (symfony-cli--get-download-url)))
    (url-retrieve
     symfony-cli-url
     #'eww-download-callback
     (list (symfony-cli--get-archive-path) "/tmp/")))

  (symfony-cli--unpack-archive (symfony-cli--get-archive-path) symfony-cli-path))

(defun symfony-cli-compile ()
  "Download symfony-cli source and compile it"
  (interactive)
  (message "TODO"))