update packages
This commit is contained in:
@@ -5,7 +5,6 @@
|
||||
|
||||
;; Author: USAMI Kenta <tadsan@zonu.me>
|
||||
;; Created: 5 Dec 2018
|
||||
;; Version: 1.26.1
|
||||
;; Keywords: languages, php
|
||||
;; Homepage: https://github.com/emacs-php/php-mode
|
||||
;; License: GPL-3.0-or-later
|
||||
@@ -49,12 +48,24 @@
|
||||
:link '(url-link :tag "Official Site" "https://github.com/emacs-php/php-mode")
|
||||
:link '(url-link :tag "PHP Mode Wiki" "https://github.com/emacs-php/php-mode/wiki"))
|
||||
|
||||
(defcustom php-executable (or (executable-find "php") "/usr/bin/php")
|
||||
(defcustom php-executable (or (executable-find "php") "php")
|
||||
"The location of the PHP executable."
|
||||
:group 'php
|
||||
:tag "PHP Executable"
|
||||
:type 'string)
|
||||
|
||||
(defcustom php-phpdbg-executable (list "phpdbg")
|
||||
"The location of the PHPDBG executable."
|
||||
:group 'php
|
||||
:tag "PHP PHPDBG Executable"
|
||||
:type '(repeat string))
|
||||
|
||||
(defcustom php-php-parse-executabe nil
|
||||
"The location of the php-parse executable."
|
||||
:group 'php
|
||||
:tag "PHP php-parse Executable"
|
||||
:type '(repeat string))
|
||||
|
||||
(defcustom php-site-url "https://www.php.net/"
|
||||
"Default PHP.net site URL.
|
||||
|
||||
@@ -325,12 +336,18 @@ can be used to match against definitions for that classlike."
|
||||
;; First see if 'abstract' or 'final' appear, although really these
|
||||
;; are not valid for all values of `type' that the function
|
||||
;; accepts.
|
||||
"^\\s-*\\(?:\\(?:abstract\\|final\\)\\s-+\\)?"
|
||||
(eval-when-compile
|
||||
(rx line-start
|
||||
(* (syntax whitespace))
|
||||
(? (or "abstract" "final" "readonly")
|
||||
(+ (syntax whitespace)))))
|
||||
;; The classlike type
|
||||
type
|
||||
;; Its name, which is the first captured group in the regexp. We
|
||||
;; allow backslashes in the name to handle namespaces, but again
|
||||
;; this is not necessarily correct for all values of `type'.
|
||||
;; (rx (+ (syntax whitespace))
|
||||
;; (group (+ (or (syntax word) "\\" (syntax symbol)))))
|
||||
"\\s-+\\(\\(?:\\sw\\|\\\\\\|\\s_\\)+\\)")))
|
||||
|
||||
(defconst php-imenu-generic-expression-default
|
||||
@@ -465,7 +482,7 @@ can be used to match against definitions for that classlike."
|
||||
|
||||
(defconst php--re-classlike-pattern
|
||||
(eval-when-compile
|
||||
(php-create-regexp-for-classlike (regexp-opt '("class" "interface" "trait")))))
|
||||
(php-create-regexp-for-classlike (regexp-opt '("class" "interface" "trait" "enum")))))
|
||||
|
||||
(defvar php--analysis-syntax-table
|
||||
(eval-when-compile
|
||||
@@ -798,5 +815,29 @@ When `DOCUMENT-ROOT' is NIL, the document root is obtained from `ROUTER-OR-DIR'.
|
||||
#'file-exists-p))))
|
||||
(find-file file))
|
||||
|
||||
|
||||
(defun php-phpdbg-disassemble-file (file)
|
||||
"Read PHP FILE and print opcodes."
|
||||
(interactive (list (if (or buffer-file-name (zerop (prefix-numeric-value current-prefix-arg)))
|
||||
buffer-file-name
|
||||
(expand-file-name
|
||||
(read-file-name "Select PHP file: " default-directory buffer-file-name)))))
|
||||
(let ((args `(,@php-phpdbg-executable "-dopcache.enable_cli=1" "-p*" ,file)))
|
||||
(compile (mapconcat #'shell-quote-argument args " "))))
|
||||
|
||||
(defun php-parse-file (file)
|
||||
"Parse PHP FILE and print node tree."
|
||||
(interactive (list (if (or buffer-file-name (zerop (prefix-numeric-value current-prefix-arg)))
|
||||
buffer-file-name
|
||||
(expand-file-name
|
||||
(read-file-name "Select PHP file: " default-directory buffer-file-name)))))
|
||||
(let* ((project-dir (php-project-get-root-dir))
|
||||
(executable (or php-php-parse-executabe
|
||||
(file-executable-p (expand-file-name "vendor/bin/php-parse" project-dir))
|
||||
(executable-find "php-parse")
|
||||
(user-error "`php-parse' command not found")))
|
||||
(args `(,@(if (listp executable) executable (list executable)) ,file)))
|
||||
(compile (mapconcat #'shell-quote-argument args " "))))
|
||||
|
||||
(provide 'php)
|
||||
;;; php.el ends here
|
||||
|
||||
Reference in New Issue
Block a user