pax_global_header00006660000000000000000000000064147310426110014511gustar00rootroot0000000000000052 comment=c3fa4e020cdb631743dbb7b6007ea546a8db1f34 php-mode-1.27.0/000077500000000000000000000000001473104261100133115ustar00rootroot00000000000000php-mode-1.27.0/.dir-locals.el000066400000000000000000000000751473104261100157440ustar00rootroot00000000000000((emacs-lisp-mode (package-lint-main-file . "php-mode.el"))) php-mode-1.27.0/.github/000077500000000000000000000000001473104261100146515ustar00rootroot00000000000000php-mode-1.27.0/.github/dependabot.yml000066400000000000000000000001571473104261100175040ustar00rootroot00000000000000version: 2 updates: - package-ecosystem: github-actions directory: / schedule: interval: daily php-mode-1.27.0/.github/workflows/000077500000000000000000000000001473104261100167065ustar00rootroot00000000000000php-mode-1.27.0/.github/workflows/test.yml000066400000000000000000000024741473104261100204170ustar00rootroot00000000000000name: CI on: push: paths-ignore: - '**/*.md' - 'etc/*' workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build: runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] emacs-version: - "27.2" - "28.2" - "29.4" experimental: [false] include: - os: ubuntu-latest emacs-version: snapshot experimental: true - os: macos-latest emacs-version: snapshot experimental: true - os: windows-latest emacs-version: snapshot experimental: true exclude: - os: macos-latest emacs-version: "27.2" steps: - uses: actions/setup-python@v5 with: python-version: '3.11' architecture: 'x64' - uses: jcs090218/setup-emacs@master with: version: ${{ matrix.emacs-version }} - uses: emacs-eask/setup-eask@master with: version: 'snapshot' - uses: actions/checkout@v4 - name: Run tests run: 'make .eask test' - name: Run tests (allow failure) run: 'make .eask test || true' php-mode-1.27.0/.gitignore000066400000000000000000000001701473104261100152770ustar00rootroot00000000000000*.elc *~ .dir-locals-2.el /.cask/* /.eask/* /.keg/* /dist /.php-cs-fixer.cache php-mode-autoloads.el php_manual_en.json php-mode-1.27.0/.mailmap000066400000000000000000000007551473104261100147410ustar00rootroot00000000000000Elis Axelsson Elis David Arroyo Menéndez David Arroyo7 Jen-Chieh Shen JenChieh Joe Wreschnig Joe Jon Dufresne Jon Dufrense Syohei YOSHIDA Shohei YOSHIDA Syohei YOSHIDA Syohei Yoshida php-mode-1.27.0/AUTHORS.md000066400000000000000000000046501473104261100147650ustar00rootroot00000000000000# Authors ## Author - [Turadg Aleahmad](https://github.com/turadg) (Original Author) - [Daniel Hackney](https://github.com/haxney) (Integrated with CC Mode) ## Maintainer - [USAMI Kenta (@zonuexe)](https://github.com/zonuexe) ## Retired Maintainers - [Aaron S. Hawley](https://users.ninthfloor.org/~ashawley/) - [Lennart Borgman](https://www.emacswiki.org/emacs/LennartBorgman) - [Eric James Michael Ritz](https://github.com/ejmr) - [Syohei Yoshida](https://syohex.org/) ## Contributors All contributors listed below improved PHP Mode as well. Names Sorted Alphabetically: - Aaron S. Hawley - Alan Pearce - Alex Figl-Brick - Andreas Röhler - Andrei Chițu - Antoine Brand - Bence Kalmar - Bill Lovett - Bob W. Hogg - Boris Folgmann - Carl Groner - Charlie McMackin - Chris Morris - Christian Albrecht - Christian Weiske - Craig Andrews - Daniel Hackney - David Arroyo Menéndez - David House - David Maus - Demis Balbach - Dias Badekas - Doug Marcey - Elis Axelsson - Emanuele Tomasi - Engelke Eschner - Eric James Michael Ritz - Eric Mc Sween - François-Xavier Bois - Fred Yankowski - Gerrit Riessen - Giacomo Tesio - Gregory Stark - Gu Weigang - Herbert Jones - Hernawan Fa'iz Abdillah - Ian Eure - Jacek Wysocki - Jakub Jankiewicz - James Laver - Jeff Beeman - Jen-Chieh Shen - Joe Wreschnig - John Keller - Jon Dufresne - Joris Steyn - Juanjo - Kevin Blake - Lennart Borgman - Marcin Antczak - Mark A. Hershberger - Mathias Meyer - Maël Nison - Michael Dwyer - Michael Stolovitzsky - Michele Bini - Nate Eagleson - Nicholas D Steeves - Nils Rennebarth - Norio Suzuki - Olaf The Viking - Peter Oliver - Phil Sainty - Philippe Ivaldi - Piotr Kwiecinski - Rex McMaster - Roland - Rosenfeld - Ryan - Sammartino - Sean Champ - Sebastian Wiesner - Serghei Iakovlev - Shohei YOSHIDA - Stefan Monnier - Stig Bakken - Syohei YOSHIDA - Tim Landscheidt - Tom Willemsen - Torsten Martinsen - U-CPT\deb - USAMI Kenta - Valentin Funk - Ville Skytta - Vinai Kopp - fabacino - fallchildren - flack - l3msh0 - phil-s - ppercot - take - takeokunn - tangxinfa - tetsujin - tijsmallaerts - zapad - 顾伟刚 A chronological list of pre-2019 contributors can be found at [wiki/Authors](https://github.com/emacs-php/php-mode/wiki/Authors). Contributors since 2011, where this project was hosted, can also be found at [graphs/contributors](https://github.com/emacs-php/php-mode/graphs/contributors), except for accounts that have been withdrawn from GitHub. php-mode-1.27.0/CHANGELOG.md000066400000000000000000000637331473104261100151360ustar00rootroot00000000000000# Changes for PHP Mode by Version All notable changes of the PHP Mode 1.19.1 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. ## [1.27.0] - 2024-12-20 ### Added * Support PHP 8.4 property-hooks ([#797]) ### Changed * Improve `php-syntax-propertize-extend-region` efficiency ([#789], thanks [@phil-s]!) * Update `php-phpdoc-type-names` to support [PHPStan 2.0.4] ([#795]) ### Fixed * Fix Emacs 30 byte-compile errors ([#792]) * Use `when-let*` instead of `when-let` to enhance Emacs 30 compatibility ([#796]) ### Removed * Drop support for Emacs 26 ([#788]) [@phil-s]: https://github.com/phil-s [PHPStan 2.0.4]: https://github.com/phpstan/phpstan/releases/tag/2.0.4 [#788]: https://github.com/emacs-php/php-mode/pull/788 [#789]: https://github.com/emacs-php/php-mode/pull/789 [#792]: https://github.com/emacs-php/php-mode/pull/792 [#795]: https://github.com/emacs-php/php-mode/pull/795 [#796]: https://github.com/emacs-php/php-mode/pull/796 [#797]: https://github.com/emacs-php/php-mode/pull/797 ## [1.26.1] - 2024-09-13 ### Added * Add `php-base-mode` which is the base of php related modes ([#772]) * `php-base-mode` is designed as a common parent mode for `php-mode` ~~and [`php-ts-mode`](https://github.com/emacs-php/php-ts-mode)~~. ### Changed * Make `php-mode` inherit from `php-base-mode` instead of `c-mode` ([#772]) * Modify indentation of [PEAR Coding Standards] ([#774], [#777]) * No longer overindent it by default, since we don't see any mention in the coding style that it should hang `.`. (refs [#227] and [#229]) * **If you have any feedback on PEAR style, please let us know in [the discussion #776][#776].** * Remove `$` from face names for interoperability with treesit ([#780], [emacs-php/php-ts-mode#68]) * `php-$this` → `php-this` * `php-$this-sigil` → `php-this-sigil` * Add `php-function-call-standard` face inherit `font-lock-function-call-face` on Emacs 29.1 and above ([#782], thanks [@bricka]!) * Add `-tranditional` suffix to the `php-*-call` faces. * `php-function-call` → `php-function-call-traditional` * `php-method-call` → `php-method-call-traditional` * `php-static-method-call` → `php-static-method-call-traditional` * Add variables for the `php-function-call`, `php-method-call`, and `php-static-method-call` faces, defaulting to the `-traditional` face. * Changes how php-syntax-propertize-rules are applied for the first time. ([#785] and [#786]) * This change is expected to make heredoc and attribute coloring more stable and reduce flicker. ### Removed * Remove `php-mode-disable-c-mode-hook` custom variable and `php-mode-neutralize-cc-mode-effect` function ([#775]) * `php-mode` no longer inherits `c-mode`, so this variable won't work. [#227]: https://github.com/emacs-php/php-mode/pull/227 [#229]: https://github.com/emacs-php/php-mode/pull/229 [#772]: https://github.com/emacs-php/php-mode/pull/772 [#774]: https://github.com/emacs-php/php-mode/issues/774 [#775]: https://github.com/emacs-php/php-mode/pull/775 [#776]: https://github.com/emacs-php/php-mode/discussions/776 [#777]: https://github.com/emacs-php/php-mode/pull/777 [#780]: https://github.com/emacs-php/php-mode/issues/780 [#782]: https://github.com/emacs-php/php-mode/issues/782 [#785]: https://github.com/emacs-php/php-mode/issues/785 [#786]: https://github.com/emacs-php/php-mode/pull/786 [@bricka]: https://github.com/bricka [emacs-php/php-ts-mode#68]: https://github.com/emacs-php/php-ts-mode/pull/68 [PEAR Coding Standards]: https://pear.php.net/manual/en/standards.php ## [1.26.0] - 2024-09-13 > [!NOTE] > This version was cancelled due to a release error. ## [1.25.1] - 2023-11-24 ### Added * Add `php-topsy-beginning-of-defun-with-class` to display classname with function signature. ([#766]) * Add missing `__DIR__` to `php-magical-constants` ([#756], thanks [@piotrkwiecinski]) ### Changed * Make developer build task in Makefile now depends on Eask. ([#762], thanks [@jcs090218]) * This change does not affect package installation users * Read [CONTRIBUTING.md] if you prefer to build it yourself from zip or tar ball ### Fixed * Fixed build failure in Emacs on master branch ([#764], [#765], [#767], thanks [@takeokunn]) ### Removed * Removed Phan-specific features from `php-project` ([#754]) * Removed [Cask](https://cask.readthedocs.io/) and [Keg](https://github.com/conao3/keg.el) metadata files for building ([#770]) [#754]: https://github.com/emacs-php/php-mode/pull/754 [#756]: https://github.com/emacs-php/php-mode/pull/756 [#762]: https://github.com/emacs-php/php-mode/pull/762 [#764]: https://github.com/emacs-php/php-mode/issues/764 [#765]: https://github.com/emacs-php/php-mode/pull/765 [#766]: https://github.com/emacs-php/php-mode/pull/766 [#767]: https://github.com/emacs-php/php-mode/pull/767 [#770]: https://github.com/emacs-php/php-mode/pull/770 [@jcs090218]: https://github.com/jcs090218 [@piotrkwiecinski]: https://github.com/piotrkwiecinski [@takeokunn]: https://github.com/takeokunn [CONTRIBUTING.md]: https://github.com/emacs-php/php-mode/blob/master/CONTRIBUTING.md ## [1.25.0] - 2023-07-24 ### Added * **Support Emacs 29.1** ([#743], [#750]) ### Fixed * Fixed many byte compilation errors on Emacs 29 and 30 by multiple patches contributed by [Stefan Monnier] ([#737], [#739] and [#740], thanks Stefan!) * Fixed PEAR method chaining wrong indentation ([#745] and [#746], thanks [@cweiske]!) * Fixed `php-mode-debug-reinstall` command ([#747], [#748]) ### Removed * Drop Emacs 25 support ([#729], [736]) [Stefan Monnier]: https://www.iro.umontreal.ca/~monnier/ [#729]: https://github.com/emacs-php/php-mode/pull/729 [#736]: https://github.com/emacs-php/php-mode/pull/736 [#737]: https://github.com/emacs-php/php-mode/pull/737 [#739]: https://github.com/emacs-php/php-mode/pull/739 [#740]: https://github.com/emacs-php/php-mode/pull/740 [#741]: https://github.com/emacs-php/php-mode/pull/741 [#743]: https://github.com/emacs-php/php-mode/pull/743 [#745]: https://github.com/emacs-php/php-mode/pull/745 [#746]: https://github.com/emacs-php/php-mode/pull/746 [#747]: https://github.com/emacs-php/php-mode/pull/747 [#748]: https://github.com/emacs-php/php-mode/pull/748 [#750]: https://github.com/emacs-php/php-mode/pull/750 ## [1.24.3] - 2023-03-19 ### Added * **Net feature**: `php-format` ([#731]) * Add `php-format-project` and `php-format-this-buffer-file` commands * Add `php-format-auto-mode` minor mode * **Experimental feature: `php-ide`** ([#709]) * Add `php-ide-phpactor` as simple IDE feature without LSP clients * Add `php-ide-mode` minor mode for binding IDE-like features ### Fixed * Fix array indentation broken by commenting out ([#726], [#732]) ### Removed * No longer highlights `'link` in PHPDoc ([#724]) * Please use `goto-address-prog-mode` minor mode [#709]: https://github.com/emacs-php/php-mode/pull/709 [#724]: https://github.com/emacs-php/php-mode/pull/724 [#726]: https://github.com/emacs-php/php-mode/pull/726 [#731]: https://github.com/emacs-php/php-mode/pull/731 [#732]: https://github.com/emacs-php/php-mode/pull/732 ## [1.24.2] - 2022-11-13 ### Added * **New feature: `php-complete`** * Add `php-complete-complete-function` to autocomplete function names ([#708]) * **New feature: `php-flymake`** * Add `php-flymake` as a flymake backend compatible with Emacs 26 and above ([#718]) * Supports PHPDoc tags and types for static analysis tools ([#710], [#715], [#716], [#717], thanks to [@takeokunn]) * Please refer to the article below * PHPStan: [PHPDoc Types](https://phpstan.org/writing-php-code/phpdoc-types) * PHPStan: [PHPDocs Basics](https://phpstan.org/writing-php-code/phpdocs-basics) * Psalm: [Atomic Type Reference](https://psalm.dev/docs/annotating_code/type_syntax/atomic_types/) * Psalm: [Supported Annotations](https://psalm.dev/docs/annotating_code/supported_annotations/) * Psalm: [Template Annotations](https://psalm.dev/docs/annotating_code/templated_annotations/) * Add `php-mode-replace-flymake-diag-function` custom variable and default activated it ([#718]) * Add `php-mode-debug-reinstall` command to help users who update Emacs themselves ([#721]) ### Changed * Make continued expressions inside lists (arguments and arrays, etc.) have the same indent width as outside the list ([#703]) * (internal) Improved readability of test failures about indentation ([#707]) * `php-doc-annotation-tag` inherits `font-lock-doc-markup-face` if defined in Emacs 28 ([#711]) * Make `php-mode-version` function include a Git tag and revision ([#713]) * Like `"1.23.4-56-xxxxxx"` for example. * Change `php-phpdoc-type-keywords` to `php-phpdoc-type-names` to avoid confusion ([#717]) * Make `php-flymake-php-init` append to `flymake-allowed-file-name-masks` only in legacy Flymake ([#718]) ### Deprecated * Make obsolete `php-mode-version-number` contstant variable ([#712]) * `(php-mode-version :as-number t)` is provided for use cases comparing as versions, but generally SHOULD NOT be dependent on the PHP Mode version. * Make obsolete `php-mode-disable-c-mode-hook` customize variable ([#718]) ### Removed * Remove `php-mode-disable-c-auto-align-backslashes` as it doesn't make sense and is always disabled ### Fixed * Removed invalid definitions that caused errors in some expressions ([#704]) [#703]: https://github.com/emacs-php/php-mode/pull/703 [#704]: https://github.com/emacs-php/php-mode/pull/704 [#707]: https://github.com/emacs-php/php-mode/pull/707 [#708]: https://github.com/emacs-php/php-mode/pull/708 [#710]: https://github.com/emacs-php/php-mode/pull/710 [#711]: https://github.com/emacs-php/php-mode/pull/711 [#713]: https://github.com/emacs-php/php-mode/pull/713 [#715]: https://github.com/emacs-php/php-mode/pull/715 [#716]: https://github.com/emacs-php/php-mode/pull/716 [#717]: https://github.com/emacs-php/php-mode/pull/717 [#718]: https://github.com/emacs-php/php-mode/pull/718 [#719]: https://github.com/emacs-php/php-mode/pull/719 [#721]: https://github.com/emacs-php/php-mode/pull/721 ## [1.24.1] - 2022-10-08 ### Added * Support new PHP 8.0 and 8.1 syntax highlighting and indentation * [8.0] `#[Attributes]` * [8.1] `readonly` property ([#680]) * Add `php-imenu-generic-expression-default` for default value or `php-imenu-generic-expression` * Add `php-imenu-generic-expression-legacy` for compatibility * Add `php-imenu-generic-expression-simple` for simple display * Add `php-project-project-find-function` compatible with `project-find-functions` ([#693]) ### Changed * Optimized propertize process ([#669]) * Reimoplement `php-syntax-propertize-function` using `syntax-propertize-rules` * Make propertize PHP 8 `#[Attribute]` always enabled * Changed grouping of `php-heredoc-start-re` * Re-organized `php-imenu-generic-expression` * Added `Import`, `Constants` and `Properties` * Removed `Anonymous Functions` * Renamed `Named Functions` to `Functions` * Renamed `All Methods` to `Methods` * Removed `Public Methods`, `Protected Methods` and `Provate Methods` * Unified `Classes`, `Traits`, `Interfaces` into `Classes` * Modified regexp patterns ([#681]) * Suppress compile-time warnings ([#683], [#690], [#697]) ### Fixed * Fix `php-run-builtin-web-server` to expand root path (#699) [#669]: https://github.com/emacs-php/php-mode/pull/669 [#680]: https://github.com/emacs-php/php-mode/pull/680 [#681]: https://github.com/emacs-php/php-mode/pull/681 [#683]: https://github.com/emacs-php/php-mode/pull/683 [#690]: https://github.com/emacs-php/php-mode/pull/690 [#693]: https://github.com/emacs-php/php-mode/pull/693 [#697]: https://github.com/emacs-php/php-mode/pull/697 [#699]: https://github.com/emacs-php/php-mode/pull/699 ## [1.24.0] - 2021-03-07 ### Added * Support new PHP 8.0 and 8.1 syntax hilighting and indentation * [8.0] `match` expression ([#632]) * [8.0] `mixed` pseudo type declaration ([#633]) * [8.1] `enum` statement ([#653]) ### Changed * Drop support for Emacs 24 and 25.1 ([#654]) * Raises an error when the byte-compiled Cc Mode version does not match that version at runtime. * You will need to recompile php-mode after the GNU Emacs version changes. ## Removed * Remove `(require 'add-log)` ### Fixed * Fix font-lock highlighting * `!=` ([#630]) * Fix Heredoc and Nowdoc highlighting ([#651] thanks [@antoineB]) * Fix documentation mistake * `php-mode-lineup-cascaded-calls` in README.md ([#644] thanks [@cweiske]!) [#630]: https://github.com/emacs-php/php-mode/pull/630 [#632]: https://github.com/emacs-php/php-mode/pull/632 [#633]: https://github.com/emacs-php/php-mode/pull/633 [#644]: https://github.com/emacs-php/php-mode/pull/644 [#651]: https://github.com/emacs-php/php-mode/pull/651 [#653]: https://github.com/emacs-php/php-mode/pull/653 [#654]: https://github.com/emacs-php/php-mode/pull/654 [@antoineB]: https://github.com/antoineB [@cweiske]: https://github.com/cweiske ## [1.23.0] - 2020-05-06 Initial support for PHP 8 has been added. PHP Mode has some issues for compatibility with Emacs 27.0. The list of all past contributors has been moved to [`AUTHORS.md`](/AUTHORS.md). This release is positioned as the last minor version of the PHP Mode 1.x series. ### Added * Add `php-project-use-projectile-to-detect-root` ([#608]) * Add PHP file extensions to `auto-mode-alist` ([#609]) * `.php.inc` is file extension for [Rector](https://github.com/rectorphp/rector)'s test code. * `.stub` is file extension for [PHPStan](https://github.com/phpstan/phpstan)'s stub file. * Add `php-mode-disable-c-auto-align-backslashes` ([#621]) * Add PHP 8.0 Attribute syntax as vsemi ([#626]) * Add feature `php-align` from [tetsujin/emacs-php-align] ([#615], [melpa/melpa#6759]) ### Changed * Disable `c-auto-align-backslashes` by default. ([#621]) * Add new faces and font locking ([#611], [#614]) ### Removed * Remove `php-mode-extra-constants` variable and function. ([#605]) * This mechanism is for synchronizing the added user-defined constants with WebMode, but it hasn't worked since 2014. ### Fixed * Fix indentation of object operator (->) at the beginning of line ([#623], [#624]) [#605]: https://github.com/emacs-php/php-mode/pull/605 [#608]: https://github.com/emacs-php/php-mode/pull/608 [#609]: https://github.com/emacs-php/php-mode/pull/609 [#611]: https://github.com/emacs-php/php-mode/pull/611 [#614]: https://github.com/emacs-php/php-mode/pull/614 [#615]: https://github.com/emacs-php/php-mode/pull/615 [#621]: https://github.com/emacs-php/php-mode/pull/621 [#623]: https://github.com/emacs-php/php-mode/issues/623 [#624]: https://github.com/emacs-php/php-mode/pull/624 [melpa/melpa#6759]: https://github.com/melpa/melpa/pull/6759 [tetsujin/emacs-php-align]: https://github.com/tetsujin/emacs-php-align ## [1.22.2] - 2019-12-23 A face has been added for coloring PHP syntax. Thank you [@minikN]! This release is a minor modified version of the 1.22.x series. PHP Mode 2.0 is planned to be released in January 2020. ### Added * Add `php-project-etags-file` and `php-project-apply-local-variables` ([#591]) * Add `php-find-system-php-ini-file` and `php-ini` command ([#593]) ### Changed * Improve PHP syntax highlighting (by [@minikN]) * Add support for multiple operators ([#594]) * Add `=>` to assignment operators ([#602], [#603]) * Plain faces no longer inherit `default` ([#597]) ### Removed * Remove `php-mode-modified` variable ([#590]) ### Fixed * Fix anonymous class indentation ([#598]) [@minikN]: https://github.com/minikN [#590]: https://github.com/emacs-php/php-mode/pull/590 [#591]: https://github.com/emacs-php/php-mode/pull/591 [#593]: https://github.com/emacs-php/php-mode/pull/593 [#594]: https://github.com/emacs-php/php-mode/pull/594 [#597]: https://github.com/emacs-php/php-mode/pull/597 [#598]: https://github.com/emacs-php/php-mode/pull/598 [#602]: https://github.com/emacs-php/php-mode/pull/602 [#603]: https://github.com/emacs-php/php-mode/pull/603 ## [1.22.1] - 2019-11-10 This release is a minor modified version of the 1.22.x series. PHP Mode 2.0 is planned to be released in January 2020. ### Fixed * Fix usas of `rx-form` ([#580], thank you [@cmack]) * Fix `php-mode-coding-style` custom variable ([#581]) * Fix unexpected indentation of (return typed) closures written in arguments ([#585]) [@cmack]: https://github.com/cmack [#580]: https://github.com/emacs-php/php-mode/pull/580 [#581]: https://github.com/emacs-php/php-mode/pull/581 [#585]: https://github.com/emacs-php/php-mode/pull/585 ## [1.22.0] - 2019-09-27 ~~This release is positioned as the last minor version of the PHP Mode 1.x series.~~ PHP Mode 2.0 is planned to be released in January 2020. ### Added * Improve PHP 7 and PHPDoc support * Highlighting typed property ([#545]) * Highlighting `{@inheritdoc}` tag ([#566]) * Highlighting multiple `catch` ([#567]) * Add new `php-class` face ([#545]) * Add new `php-run-builtin-web-server` command for invoke `php -S` buitin server ([#548]) * Add new `php-copyit-fqsen` command for kill current method FQSEN ([#561]) * Apply lineup cascaded call (method chain separated by new line) for all styles ([#563], [#572]) ### Changed * Loose HTML template detection algorithm ([#558]) * Move php-mode-test.el into tests directory ([#559]) * `php-mode-autoloads.el` no longer includes `php-mode-test` * Modify syntax-entry `$` to `"_"` from `"'"` ([#565]) * Make `php-set-style` display only styles that inherited "php" ([#573]) ### Fixed * Fix default major mode for `*.phpt` file as `php-default-major-mode` ([#542]) * prevent recursion in `php-syntax-propertize-extend-region` ([$556], thanks [Herbert Jones][@herbertjones]) * Fix call `run-hooks` in `set-style` ([#571]) [#542]: https://github.com/emacs-php/php-mode/pull/542 [#545]: https://github.com/emacs-php/php-mode/pull/545 [#548]: https://github.com/emacs-php/php-mode/pull/548 [#556]: https://github.com/emacs-php/php-mode/pull/556 [#558]: https://github.com/emacs-php/php-mode/pull/558 [#559]: https://github.com/emacs-php/php-mode/pull/559 [#561]: https://github.com/emacs-php/php-mode/pull/561 [#563]: https://github.com/emacs-php/php-mode/issues/563 [#565]: https://github.com/emacs-php/php-mode/pull/565 [#566]: https://github.com/emacs-php/php-mode/pull/566 [#567]: https://github.com/emacs-php/php-mode/pull/567 [#571]: https://github.com/emacs-php/php-mode/pull/571 [#572]: https://github.com/emacs-php/php-mode/pull/572 [#572]: https://github.com/emacs-php/php-mode/pull/572 [#573]: https://github.com/emacs-php/php-mode/pull/573 [#556]: https://github.com/emacs-php/php-mode/pull/556 [@herbertjones]: https://github.com/herbertjones ## [1.21.4] - 2019-05-29 This version contains unobtrusive changes for future compatibility. Also, `forward-page` /` backward-page` may improve your operation. Thank you [@takeokunn]. ### Added * A new command `php-mode-maybe` has been added to improve the compatibility of Blade templates and HTML templates with Web Mode. ([#532]) * A new custom variable php-mode-page-delimiter is added, which is assigned to page-delimiter in PHP-Mode. It allows you to move smoothly to the previous and subsequent definition statements with `forward-page` (C-x C-[) and `backward-page` (C-x C-]). ([#540] by [@takeokunn]) ### Changed * `php-maybe-mode` and `.php` files are associated with `auto-mode-alist` instead of `php-mode` ([#532]) * Compatibility with [poly-php] has been improved. This has not yet been officially released. ### Deprecated * PHP Mode does not support phpt files . Consider installing the [phpt-mode] package. This mode is a wrapper around Polymode based PHP-Mode. [#532]: https://github.com/emacs-php/php-mode/pull/532 [#539]: https://github.com/emacs-php/php-mode/pull/539 [#540]: https://github.com/emacs-php/php-mode/pull/540 [@takeokunn]: https://github.com/takeokunn ## [1.21.3] - 2019-05-25 This version includes both PHP syntax support enhancements and performance improvements. See https://github.com/emacs-php/php-mode/projects/1 for all issues for this release. Also, [@mallt] has helped me improve it with a number of issues. thank you very much. ### Added * Added new Faces to display PHP syntax * `php-constant-assign` * `php-magical-constant` * `php-errorcontrol-op` * Some funtions have been split into features such as `php.el`, `php-face.el` and `php-mode-debug.el`. ### Fixed * Improved performance when opening large files ([#491], [#531]) [#491]: https://github.com/emacs-php/php-mode/issues/491 [#531]: https://github.com/emacs-php/php-mode/pull/531 ### Changed * Syntax highlighting has been adjusted ### Removed * `php-ext` and Skeleton templates have been split into [php-skeleton] ([#534]) [php-skeleton]: https://github.com/emacs-php/php-skeleton [#534]: https://github.com/emacs-php/php-mode/pull/534 ## [1.21.2] - 2019-05-11 It officially supports **PHP 7.3** and **Emacs 26.2**. Many improvements have been received from [@sergeyklay], thank you! ### Added * Highlighting added `fn` keyword supported by [PHP 7.2 arrow function] ([#506]) ### Fixed * Function `php-beginning-of-defun` should return non-nil on success ([#503]) * Fixed an error that occurred in some heredoc/nowdoc ([#496]) ### Changed * Support PHP 7.3 heredoc/nowdoc ([#496]) * Minor optimization of font-lock regular expression ([#510]) ## [1.21.1] - 2019-04-01 ### Changed * Fixed an error that occurred in Emacs 27 * Modify URL of PHP web site * Fix highlighting of static method calls ## [1.21.0] - 2019-01-09 A minor change from the previous version, but this version has BC brake about `c-mode-hook`. ### Added * Add `php` customize group. * This group is positioned above `php-mode`. * This group was originally planned to be included in v1.20.0. * Add `php-mode-disable-c-mode-hook` custom variable. * Setting this variable to `nil` will restore the behavior of `c-mode-hook` up to the previous version. ### Changed * `php-mode` initialization no longer executes hooks for `c-mode`. * If you want to return to the same behavior as the conventional PHP-Mode, set `nil` to `php-mode-disable-c-mode-hook`. ## [1.20.0] - 2018-12-07 Start preparing for major refactoring in major mode. ### Added * Add php-project variables for workflow ([#488](https://github.com/emacs-php/php-mode/pull/488)) * The following variables are reserved as file/directory local variables. * `php-project-repl` * `php-project-unit-test` * `php-project-deploy` * `php-project-build` * `php-project-server-start` ### Changed * Improve code highlight * Fix highlighting of callable keyword ([#471](https://github.com/emacs-php/php-mode/pull/471) by [@fabacino]) * Highlight the `?` character for nullable type hints and return types ([#482](https://github.com/emacs-php/php-mode/pull/482) by [@fabacino]) * Modify "customize group" and variable names * Add php-mode group and some variables belong to new group ([#486](https://github.com/emacs-php/php-mode/pull/486)) * `php-default-face` → `php-mode-default-face` * `php-speedbar-config` → `'php-mode-speedbar-config` * `php-template-compatibility` → `php-mode-template-compatibility` * `php-lineup-cascaded-calls` → `php-mode-lineup-cascaded-calls` * `php-extra-constants` → `php-mode-extra-constants` * `php-do-not-use-semantic-imenu` → `php-mode-do-not-use-semantic-imenu` * Modify documents and copyright * Move the URL of Website to https://github.com/emacs-php/php-mode * Add copyright notation about [Friends of Emacs-PHP development](https://github.com/emacs-php) * Add a "Hall of Fame" to the contributors list ([#481](https://github.com/emacs-php/php-mode/pull/481) by [@ejmr] and thanks [@sergey48k](https://github.com/sergey48k) and [@sourcerer-io](https://github.com/sourcerer-io) project) * Some refactors * Fix style and suppress warning in compile [#485](https://github.com/emacs-php/php-mode/pull/485) ## [1.19.1] - 2018-05-12 ### Added * Add some functions/variables in `php-project` package * `php-project-get-php-executable` ([#436](https://github.com/emacs-php/php-mode/pull/436)) * `php-project-get-phan-executable` ([#436](https://github.com/emacs-php/php-mode/pull/436)) * Add `php-debug` command for reporting a bug ### Changed * Add highlighting of return types for abstract functions ([#461](https://github.com/emacs-php/php-mode/pull/461) by [@fabacino](https://github.com/fabacino)) ### Fixed * Fix `c-anchored-cpp-prefix` in Emacs 26 ([#453](https://github.com/emacs-php/php-mode/pull/453)) * Fix (re-implemteed) `php-complete-function` ([#454](https://github.com/emacs-php/php-mode/pull/454)) * Fix some problem of `php-set-style` *(disabled on default)* * Fix lazy evaluation of php-set-style ([#444](https://github.com/emacs-php/php-mode/pull/444)) * Do not use `php-mode-enable-backup-style-variables` in initialize ([#452](https://github.com/emacs-php/php-mode/pull/452)) * Temporarily disable `php-mode-enable-project-coding-style` ([#450](https://github.com/emacs-php/php-mode/pull/450)) * Fix heredoc/nowdoc syntax problem ([#440](https://github.com/emacs-php/php-mode/pull/440)) * Delete duplicate font locks with keywords not related to PHP language ([#432](https://github.com/emacs-php/php-mode/pull/432)) * Make `php-project-root` variable accept a string ([#458](https://github.com/emacs-php/php-mode/pull/458)) ## Before 1.19.0 See [Changelog · emacs-php/php-mode Wiki](https://github.com/emacs-php/php-mode/wiki/Changelog). [#496]: https://github.com/emacs-php/php-mode/pull/496 [#503]: https://github.com/emacs-php/php-mode/issues/503 [#506]: https://github.com/emacs-php/php-mode/issues/506 [#510]: https://github.com/emacs-php/php-mode/pull/510 [@ejmr]: https://github.com/ejmr [@fabacino]: https://github.com/fabacino [@mallt]: https://github.com/mallt [@sergeyklay]: https://github.com/sergeyklay [PHP 7.2 arrow function]: https://wiki.php.net/rfc/arrow_functions_v2 [poly-php]: https://github.com/emacs-php/poly-php [phpt-mode]: https://github.com/emacs-php/phpt-mode php-mode-1.27.0/CONTRIBUTING.md000066400000000000000000000116251473104261100155470ustar00rootroot00000000000000# How to Contribute This project accepts contributions in various languages. Not only development but also documentation and translation are important contributions. * [English](#english) `[en]` * [简体中文](#simplified-chinese) `[zh-Hans]` * [繁体中文](#traditional-chinese) `[zh-Hant]` * [日本語](#japanese) `[ja]` ---------- ## English ### Setup (en) [Eask] is required to build the package. You need to install it using node.js and npm, or [download a prebuilt executable][eask-releases]. See [Eask Introduction][eask-introduction] and [Install Eask][eask-install] for more details. You can run the tests using the following command: ```sh make test ``` ### Guideline (en) All contributions to PHP Mode are welcome. But please try to do the following when submitting enhancements or bug fixes: 1. Open `php-mode-test.el` and run all the tests to make sure they pass as expected. You can also check this by running `make test` from the terminal. 2. Please commit with a concise and clear message that effectively achieves a simple purpose. 3. Submit a pull request here on GitHub. If you are fixing a bug related to a GitHub issue, then first of all, thank you for helping to improve PHP Mode. Second, there is a `tests/` directory that contains PHP scripts for issues (though not all). Please consider adding a test script to that directory that documents the expected behavior and provides code that allows others to see if that behavior works properly. Then create a unit test within `php-mode-test.el' using [ERT]. Try to follow the format of the existing tests. ### Regression test for Face (en) In this project, the regression test of [Font Lock] is realized by creating a `foo.php.face` file to be paired with the` foo.php` file. Add the `: faces t` option to the` with-php-mode-test` argument to activate this test. Please refer to [How to generate face file] for how to generate `.face` file required for this test. ---------- ## Simplified Chinese I am seeking a contribution on Chinese. We also lack a README written in Simplified Chinese. ### Guideline (zh-Hans) Please contribute. ---------- ## Traditional Chinese I am seeking a contribution on Chinese. We also lack a README written in Traditional Chinese. ### Guideline (zh-Hant) Please contribute. ---------- ## Japanese ### Setup (ja) パッケージをビルドするにはEaskが必要です。node.jsとnpmからインストールするか、ビルド済み実行ファイルをダウンロードする必要があります。Easkの詳細は[Eask Introduction][eask-introduction]と[Install Eask][eask-install]をお読みください。 以下のコマンドでテストを実行できます。 ```sh make test ``` ### Guideline (ja) **Emacs PHP Mode**はどなたからの貢献も歓迎です。改善やバグ修正を行う前に以下の手順を行ってください。 1. `php-mode-test.el`を開いて[すべてのテストを実行][run all of the tests]し、期待通りにテストを通過することを確認します。端末から`make test`で確認することもできます。 2. 簡潔でシンプルな目的を達成するための、明示的なメッセージでコミットしてください。 3. GitHubからプルリクエストを送信してください。 **GitHubのissueに関連するバグを修正する場合**: PHPモードの改善に協力いただきありがとうございます! `tests/`ディレクトリには(すべてではありませんが)issueに関連のあるPHPスクリプトが配置されています。そこに予期される挙動と他のひとが動作を適切に確認できるテストコードを追加することを検討してください。そして`php-mode-test.el`に既存のテストと同じように[ERT]を使ったテストコードを追加してください。 ### Regression test for Face (ja) このプロジェクトでは `foo.php` ファイルに対応した `foo.php.face` ファイルを作成することで[Font Lock]の回帰テストを実現しています。このテストを有効化するには`with-php-mode-test`の引数に`:faces t`オプションを追加してください。 このテストに必要な`.face`ファイルの生成方法は[How to generate face file]を参考にしてください。 [run all of the tests]: http://www.gnu.org/software/emacs/manual/html_node/ert/Running-Tests-Interactively.html#Running-Tests-Interactively [Eask]: https://emacs-eask.github.io/ [eask-introduction]: https://emacs-eask.github.io/Getting-Started/Introduction/ [eask-install]: https://emacs-eask.github.io/Getting-Started/Install-Eask/ [eask-releases]: https://github.com/emacs-eask/cli/releases [ERT]: http://www.gnu.org/software/emacs/manual/html_node/ert/index.html [Font Lock]: https://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Mode.html [How to generate face file]: https://github.com/emacs-php/php-mode/issues/509#issuecomment-491528968 php-mode-1.27.0/Eask000066400000000000000000000014741473104261100141250ustar00rootroot00000000000000(package "php-mode" "1.26.1" "Major mode for editing PHP code") (website-url "https://github.com/emacs-php/php-mode") (keywords "languages" "php") (package-file "lisp/php-mode.el") (files "lisp/php.el" "lisp/php-complete.el" "lisp/php-defs.el" "lisp/php-face.el" "lisp/php-format.el" "lisp/php-project.el" "lisp/php-local-manual.el" "lisp/php-ide-phpactor.el" "lisp/php-ide.el" "lisp/php-mode-debug.el") (script "test" "echo \"Error: no test specified\" && exit 1") (source 'melpa) (source 'gnu) (depends-on "emacs" "26.1") (development (depends-on "phpactor") (depends-on "pkg-info") (depends-on "projectile") (depends-on "smart-jump") (depends-on "shut-up") ) (setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 php-mode-1.27.0/LICENSE000066400000000000000000001045151473104261100143240ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . php-mode-1.27.0/Makefile000066400000000000000000000025221473104261100147520ustar00rootroot00000000000000EMACS ?= emacs CASK ?= cask EASK ?= eask compile: $(EASK) compile all: autoloads $(ELCS) authors authors: AUTHORS.md .PHONY: AUTHORS.md AUTHORS.md: etc/git/AUTHORS.md.in .mailmap @printf "Generating AUTHORS.md file..." @test -d .git \ && (cat $< > $@ \ && git log --pretty=format:'- %aN' \ | cat etc/git/former-contributors - \ | grep -v dependabot \ | LANG=C sort -u >> $@ \ && cat etc/git/AUTHORS2.md.in >> $@ \ && printf "FINISHED\n" ; ) \ || printf "FAILED (non-fatal)\n" autoloads: $(EASK) generate autoloads .eask: Eask $(EASK) install clean: $(EASK) clean all # Perform any operations that will be useful for developers # who contribute to PHP Mode. dev: cp etc/git/prepare-commit-msg .git/hooks/prepare-commit-msg chmod u+x .git/hooks/prepare-commit-msg # Runs all unit tests from php-mode-test.el and shows the results. The # script will exit with the status code zero if all tests pass. If any # test fails the script exits with a non-zero status and shows # diagnostics on standard output. # # You can use this script with git-bisect. See the documentation at # # http://git-scm.com/book/en/Git-Tools-Debugging-with-Git # # for an example of using a script like this with the 'git bisect run' # command. test: clean all $(EASK) test ert ./tests/php-mode-test.el .PHONY: all authors autoloads clean test php-mode-1.27.0/README.ja.md000066400000000000000000000145171473104261100151710ustar00rootroot00000000000000

Emacs PHP Mode

[![Emacs: 30.0](https://img.shields.io/badge/Emacs-30.0-blue.svg)](https://www.gnu.org/software/emacs/) [![lang: PHP 8.4](https://img.shields.io/badge/lang-PHP%208.4-brightgreen.svg)](https://www.php.net/releases/8.4/) [![Build Status](https://github.com/emacs-php/php-mode/workflows/CI/badge.svg)](https://github.com/emacs-php/php-mode/actions) [![GPL v3](https://img.shields.io/badge/license-GPL_v3-green.svg)][gpl-v3]
[![NonGNU ELPA][nongnu-elpa-badge]][nongnu-elpa] [![melpa badge][melpa-badge]][melpa-link] A powerful and flexible Emacs major mode for editing PHP scripts [English](README.md)   |   日本語
[GitHubプロジェクト][php-mode]にissueを作成してバグ報告や機能リクエストを送ってください。 > [!NOTE] > [最新版][releases]のPHP ModeはEmacs 30をサポートしています。
アップグレードに伴うトラブルは[Discussions][disscussions-emacs30]に気軽に書き込んでください。 > [!WARNING] > Emacsをアップグレードした直後に初めてPHPファイルを開いたときに、CC Mode関連のエラーが発生する可能性があります。これは以前のバージョンのEmacsでバイトコンパイルされたPHP Modeがディスクにキャッシュされているために起こるので、PHP Modeの再インストールによって解決します。 > > **`M-x php-mode-debug-reinstall`** または **`M-x package-reinstall php-mode`** コマンドをお試しください。 [releases]: https://github.com/emacs-php/php-mode/releases [disscussions-emacs30]: https://github.com/emacs-php/php-mode/discussions/798 ## インストール **PHP ModeはEmacs 27.1以降で動作します**。対応バージョンの詳細は[Supported Version]をお読みください。Emacs 28以降では単に以下のコマンドを実行するだけでインストールできます。 ``` M-x package-install php-mode ``` [`package-archives`にMELPAを追加][melpa-getting-started]することで、Web上の多くのパッケージでEmacsを強化できます。 パッケージマネージャへの依存なしでインストールしたい場合は、Lispファイルを直接配置する伝統的な方法も可能です。詳しくは[Manual installation][wiki-manual-installation]をお読みください。 ## 設定 ### 個人設定 .emacsファイル(`~/.emacs.d/init.el`)にPHPモードの設定を記述できます。 ```lisp (defun my-php-mode-init () (subword-mode 1) (setq-local show-trailing-whitespace t) (setq-local ac-disable-faces '(font-lock-comment-face font-lock-string-face)) (add-hook 'hack-local-variables-hook 'php-ide-turn-on nil t)) (with-eval-after-load 'php-mode (add-hook 'php-mode-hook #'my-php-mode-init) (custom-set-variables '(php-mode-coding-style 'psr2) '(php-mode-template-compatibility nil) '(php-imenu-generic-expression 'php-imenu-generic-expression-simple)) ;; If you find phpcs to be bothersome, you can disable it. (when (require 'flycheck nil) (add-to-list 'flycheck-disabled-checkers 'php-phpmd) (add-to-list 'flycheck-disabled-checkers 'php-phpcs))) ``` ### プロジェクトローカル設定 プロジェクトのトップディレクトリに`.dir-locals.el`または`.dir-locals-2.el`を記述すると、プロジェクト単位の設定を追加することができます。このファイルはユーザー自身のEmacsにインストールされたパッケージに依存するため、バージョン管理の対象に含めないことを推奨します。 ```lisp ((nil (php-project-root . git) (php-project-coding-style . psr2))) ``` ## 不具合を報告する バグ報告の際には `M-x php-mode-debug` の出力を含めてください。この情報は問題の再現に役立ちます。 貢献するには ----------------- [CONTRIBUTING.md](CONTRIBUTING.md#japanese)をご覧ください。 ## 著作権 PHP Modeは[GNU General Public License Version 3][gpl-v3] (GPLv3) でライセンスされています。 このプロジェクトは1999年に[Turadg Aleahmad][@turadg]が書いた`php-mode.el`に起源を持ちます。2013年に[Daniel Hackney][@haxney]がEmacs組み込みのCC Modeをもとに書き直し始めました。PHPモードの改善に協力した貢献者のリストは[Authors]と[Contributors]に掲載されています。 このプロジェクトは2017年まで[Eric James Michael Ritz][@ejmr]によりメンテナンスされていました。現在は[Friends of Emacs-PHP Development][@emacs-php]コミュニティが引き継いで開発しています。 > ``` > Copyright (C) 2023 Friends of Emacs-PHP development > Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad > 2008 Aaron S. Hawley > 2011, 2012, 2013, 2014, 2015, 2016, 2017 Eric James Michael Ritz > ``` > > 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 . [@ejmr]: https://github.com/ejmr [@emacs-php]: https://github.com/emacs-php [@haxney]: https://github.com/haxney [@turadg]: https://github.com/turadg [Authors]: https://github.com/emacs-php/php-mode/wiki/Authors [Contributors]: https://github.com/emacs-php/php-mode/graphs/contributors [Supported Version]: https://github.com/emacs-php/php-mode/wiki/Supported-Version [gpl-v3]: https://www.gnu.org/licenses/gpl-3.0 [nongnu-elpa-badge]: https://elpa.nongnu.org/nongnu/php-mode.svg [nongnu-elpa]: https://elpa.nongnu.org/nongnu/php-mode.html [melpa-badge]: http://melpa.org/packages/php-mode-badge.svg [melpa-getting-started]: https://melpa.org/#/getting-started [melpa-link]: http://melpa.org/#/php-mode [php-mode]: https://github.com/emacs-php/php-mode [wiki]: https://github.com/emacs-php/php-mode/wiki [wiki-manual-installation]: https://github.com/emacs-php/php-mode/wiki/Manual-installation-ja php-mode-1.27.0/README.md000066400000000000000000000133401473104261100145710ustar00rootroot00000000000000

Emacs PHP Mode

[![Emacs: 30.0](https://img.shields.io/badge/Emacs-30.0-blue.svg)](https://www.gnu.org/software/emacs/) [![lang: PHP 8.4](https://img.shields.io/badge/lang-PHP%208.4-brightgreen.svg)](https://www.php.net/releases/8.4/) [![Build Status](https://github.com/emacs-php/php-mode/workflows/CI/badge.svg)](https://github.com/emacs-php/php-mode/actions) [![GPL v3](https://img.shields.io/badge/license-GPL_v3-green.svg)][gpl-v3]
[![NonGNU ELPA][nongnu-elpa-badge]][nongnu-elpa] [![melpa badge][melpa-badge]][melpa-link] A powerful and flexible Emacs major mode for editing PHP scripts English   |   [日本語](README.ja.md)
Please submit any bug reports or feature requests by creating issues on [the GitHub page for PHP Mode][php-mode]. > [!NOTE] > The [latest version][releases] of PHP Mode supports Emacs 30.
Please feel free to [write to disucuss][disscussions-emacs30] if you have problems upgrading to Emacs 29. > [!WARNING] > After upgrading Emacs, when you open a PHP file for the first time, you may encounter errors related to CC Mode. These errors occur because a previously byte-compiled version of PHP Mode, cached on your disk, differs from the newly installed one. Reinstalling PHP Mode should resolve the issue. > > Try running **`M-x php-mode-debug-reinstall`** or **`M-x package-reinstall php-mode`**. [releases]: https://github.com/emacs-php/php-mode/releases [disscussions-emacs30]: https://github.com/emacs-php/php-mode/discussions/798 ## Installation **PHP Mode works with Emacs 27.1 or later**. For details on supported versions, see [Supported Version]. Emacs 28 or later can be installed simply by running the following command. ``` M-x package-install php-mode ``` By [adding MELPA to `package-archives`][melpa-getting-started], you can extend Emacs with many packages from the web. If you don't want to depend on a package manager, you can install Lisp files directly in the traditional way. See [Manual installation][wiki-manual-installation] for our recommended setup method. ## Configuration ### Personal Settings You can add configurations for PHP mode in the .emacs file (`~/.emacs.d/init.el`): ```lisp (defun my-php-mode-init () (subword-mode 1) (setq-local show-trailing-whitespace t) (setq-local ac-disable-faces '(font-lock-comment-face font-lock-string-face)) (add-hook 'hack-local-variables-hook 'php-ide-turn-on nil t)) (with-eval-after-load 'php-mode (add-hook 'php-mode-hook #'my-php-mode-init) (custom-set-variables '(php-mode-coding-style 'psr2) '(php-mode-template-compatibility nil) '(php-imenu-generic-expression 'php-imenu-generic-expression-simple)) ;; If you find phpcs to be bothersome, you can disable it. (when (require 'flycheck nil) (add-to-list 'flycheck-disabled-checkers 'php-phpmd) (add-to-list 'flycheck-disabled-checkers 'php-phpcs))) ``` ### Project Setting You can add project-specific settings by creating a `.dir-locals.el` or `.dir-locals-2.el` file in the project's root directory. It is recommended not to put these files under version control, as they depend on the packages installed in each user's Emacs. ```lisp ((nil (php-project-root . git) (php-project-coding-style . psr2))) ``` ## Reporting Bugs When reporting a bug please run the function `M-x php-mode-debug` and include its output in your bug report. This helps up reproduce any problem you may have. ## How to Contribute Please see [CONTRIBUTING.md](CONTRIBUTING.md#english). ## Copyright PHP Mode is licensed under [GNU General Public License Version 3][gpl-v3] (GPLv3). This project originated in `php-mode.el` written by [Turadg Aleahmad][@turadg] in 1999. In 2013 [Daniel Hackney][@haxney] began rewriting parts of PHP Mode in terms of Emacs' built-in CC Mode. Other contributors are listed in [Authors] and [Contributors]. This project was maintained by [Eric James Michael Ritz][@ejmr] until 2017. Currently, the [Friends of Emacs-PHP Development][@emacs-php] community inherits PHP Mode. > ``` > Copyright (C) 2022 Friends of Emacs-PHP development > Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad > 2008 Aaron S. Hawley > 2011, 2012, 2013, 2014, 2015, 2016, 2017 Eric James Michael Ritz > ``` > > 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 . [@ejmr]: https://github.com/ejmr [@emacs-php]: https://github.com/emacs-php [@haxney]: https://github.com/haxney [@turadg]: https://github.com/turadg [Authors]: https://github.com/emacs-php/php-mode/wiki/Authors [Contributors]: https://github.com/emacs-php/php-mode/graphs/contributors [Supported Version]: https://github.com/emacs-php/php-mode/wiki/Supported-Version [gpl-v3]: https://www.gnu.org/licenses/gpl-3.0 [nongnu-elpa-badge]: https://elpa.nongnu.org/nongnu/php-mode.svg [nongnu-elpa]: https://elpa.nongnu.org/nongnu/php-mode.html [melpa-badge]: http://melpa.org/packages/php-mode-badge.svg [melpa-getting-started]: https://melpa.org/#/getting-started [melpa-link]: http://melpa.org/#/php-mode [php-mode]: https://github.com/emacs-php/php-mode [wiki]: https://github.com/emacs-php/php-mode/wiki [wiki-manual-installation]: https://github.com/emacs-php/php-mode/wiki/Manual-installation php-mode-1.27.0/docs/000077500000000000000000000000001473104261100142415ustar00rootroot00000000000000php-mode-1.27.0/docs/php-align/000077500000000000000000000000001473104261100161205ustar00rootroot00000000000000php-mode-1.27.0/docs/php-align/README.md000066400000000000000000000022351473104261100174010ustar00rootroot00000000000000# php-align.el CAUTION!! this is still experimental. Support alignment (e.g. `align`, `align-current`) for PHP. Put this file into your load-path.and the following code into your ~/.emacs ```el (add-hook 'php-mode-hook #'php-align-setup) ``` ## Examples ### 1. #### before ```php $foo = "string"; // M-x align-current $looooooooong = 1; // ``` #### after ```php $foo = "string"; // M-x align-current $looooooooong = 1; // ``` ### 2. #### before ```php "$foo = 1"; $foo = "string"; // M-x align-current $looooooooong = 1; // $bar = 2; // ``` #### after ```php "$foo = 1"; $foo = "string"; // M-x align-current $looooooooong = 1; // $bar = 2; // ``` ### 3. #### before ```php $variable = 1; $vars = array(); // M-x align-current if ($variable == $vars) { } ``` #### after ```php $variable = 1; $vars = array(); // M-x align-current if ($variable == $vars) { } ``` ### 4. #### before ```php $vars = array( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, // C-u M-x align-current ); ``` #### after ```php $vars = array( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, // C-u M-x align-current ); ``` php-mode-1.27.0/etc/000077500000000000000000000000001473104261100140645ustar00rootroot00000000000000php-mode-1.27.0/etc/git/000077500000000000000000000000001473104261100146475ustar00rootroot00000000000000php-mode-1.27.0/etc/git/AUTHORS.md.in000066400000000000000000000011301473104261100167160ustar00rootroot00000000000000# Authors ## Author - [Turadg Aleahmad](https://github.com/turadg) (Original Author) - [Daniel Hackney](https://github.com/haxney) (Integrated with CC Mode) ## Maintainer - [USAMI Kenta (@zonuexe)](https://github.com/zonuexe) ## Retired Maintainers - [Aaron S. Hawley](https://users.ninthfloor.org/~ashawley/) - [Lennart Borgman](https://www.emacswiki.org/emacs/LennartBorgman) - [Eric James Michael Ritz](https://github.com/ejmr) - [Syohei Yoshida](https://syohex.org/) ## Contributors All contributors listed below improved PHP Mode as well. Names Sorted Alphabetically: php-mode-1.27.0/etc/git/AUTHORS2.md.in000066400000000000000000000005351473104261100170100ustar00rootroot00000000000000 A chronological list of pre-2019 contributors can be found at [wiki/Authors](https://github.com/emacs-php/php-mode/wiki/Authors). Contributors since 2011, where this project was hosted, can also be found at [graphs/contributors](https://github.com/emacs-php/php-mode/graphs/contributors), except for accounts that have been withdrawn from GitHub. php-mode-1.27.0/etc/git/commit-template.txt000066400000000000000000000003611473104261100205110ustar00rootroot00000000000000# SUBJECT, 50 Characters, No Period # "If applied, this commit will..." # BODY, 72 Characters # Answers the question, "Why?", not, "How?" # METADATA # GitHub-Issue: # Resolves: # See-also: # Reviewed-by: # Special-thanks: # HANGING INDENT php-mode-1.27.0/etc/git/former-contributors000066400000000000000000000007371473104261100206260ustar00rootroot00000000000000- Aaron S. Hawley - Bill Lovett - Boris Folgmann - Chris Morris - Craig Andrews - David House - Dias Badekas - Doug Marcey - Eric Mc Sween - Fred Yankowski - Gerrit Riessen - Giacomo Tesio - Gregory Stark - Ian Eure - John Keller - Juanjo - Kevin Blake - Lennart Borgman - Mathias Meyer - Nils Rennebarth - Rex McMaster - Roland - Rosenfeld - Ryan - Sammartino - Sean Champ - Stefan Monnier - Stig Bakken - Torsten Martinsen - Valentin Funk - Ville Skytta - Vinai Kopp - ppercot php-mode-1.27.0/etc/git/prepare-commit-msg000077500000000000000000000022431473104261100203060ustar00rootroot00000000000000#!/bin/sh # # prepare-commit-msg # ================== # # ## SYNOPSIS # # This hook fills the user's editor with a pre-written commit message # template, intended to help contributors adhere to good style and # practices when it comes to writing Git commit messages. # ######################################################################## # This hook will always recieve three arguments. We only care about the # first for our purposes, but still assign useful names to the others # in case we need them in the future. COMMIT_MESSAGE=$1 COMMIT_SOURCE=$2 COMMIT_SHA1=$3 # If the commit message already contains content then the developer # is probably using his or her own template. In which case we do not # trample over it. We test for a pre-existing template by reading # the first line of the commit message this hook recieved, and check # so see if it is an empty string (apply our template) or not (leave # the message alone). TITLE_LINE=$(head -n1 $COMMIT_MESSAGE) if [ -z "$TITLE_LINE" ]; then project_dir=$(git rev-parse --show-toplevel) template="$project_dir/etc/git/commit-template.txt" echo "$(cat $template)\n$(cat $COMMIT_MESSAGE)" > $COMMIT_MESSAGE fi exit 0 php-mode-1.27.0/lisp/000077500000000000000000000000001473104261100142605ustar00rootroot00000000000000php-mode-1.27.0/lisp/.editorconfig000066400000000000000000000003661473104261100167420ustar00rootroot00000000000000# EditorConfig is awesome: http://EditorConfig.org # top-most EditorConfig file root = true # Unix-style newlines with a newline ending every file [*] end_of_line = lf charset = utf-8 [*.el] indent_style = space [Makefile] indent_style = tab php-mode-1.27.0/lisp/php-align.el000066400000000000000000000102231473104261100164570ustar00rootroot00000000000000;;; php-align.el --- Alignment configuration for PHP -*- lexical-binding: t; -*- ;; Copyright (C) 2011 tetsujin (Yusuke Segawa) ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: tetsujin (Yusuke Segawa) ;; Maintainer: USAMI Kenta ;; Keywords: php languages convenience align ;; Homepage: https://github.com/emacs-php/php-mode ;; Version: 1.26.1 ;; License: GPL-3.0-or-later ;; 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 . ;;; Commentary: ;; This extension provides alignment for PHP. ;; Note that you must have Font Lock mode enabled. ;; ;; Put this file into your load-path.and the following code into your ~/.emacs ;; ;; (add-hook 'php-mode-hook #'php-align-setup) ;;; TODO: ;; - Add test codes using el-expectations. ;;; Code: (require 'align) (require 'regexp-opt) (require 'php-project) (defvar php-align-rules-list `((php-comma-delimiter (regexp . ",\\(\\s-*\\)[^/ \t\n]") (repeat . t) (modes . '(php-mode)) (run-if . ,(function (lambda () current-prefix-arg)))) (php-assignment (regexp . ,(concat "[^=!^&*-+<>/.| \t\n]\\(\\s-*[=!^&%*-+<>/.|]*\\)=>?" "\\(\\s-*\\)\\([^= \t\n]\\|$\\)")) (group . (1 2)) (modes . '(php-mode)) (justify . t) (tab-stop . nil)) (php-comment (regexp . "\\(\\s-*\\)\\(//.*\\|/\\*.*\\*/\\s-*\\)$") (modes . (php-mode)) (column . comment-column) (valid . ,(function (lambda () (save-excursion (goto-char (match-beginning 1)) (not (bolp))))))) (php-chain-logic (regexp . "\\(\\s-*\\)\\(&&\\|||\\|\\\\|\\\\)") (modes . (php-mode)) (valid . ,(function (lambda () (save-excursion (goto-char (match-end 2)) (looking-at "\\s-*\\(/[*/]\\|$\\)")))))))) (defvar php-align-region-separate (eval-when-compile (concat ;; blank line "\\(?:" "^\\s-*$" "\\)" "\\|" ;; comment start or end line "\\(?:" "^\\s-*\\(?:/[/*]\\|\\*/\\)" "\\)" "\\|" ;; end of line are '[', '(', '{', '}', '/*' "\\(?:" "\\(?:[[({}]\\|/\\*+\\)\\s-*$" "\\)" "\\|" ;; beginning of line are ')', '}', ']' and trailing character are ',', ';' "\\(?:" "^\\s-*[)}]][ \t,;]?\\s-*$" "\\)" "\\|" ;; beginning of line are some PHP keywrods "\\(?:" "^\\s-*" (regexp-opt '("for" "foreach" "while" "if" "else" "switch" "case" "break" "continue" "try" "catch" "declare" "do" "return" "namespace" "use")) "[ ;]" "\\)" "\\|" ;; function or method call "\\(?:" "^\\s-*" "\\(?:" "\\w\\|[->\\: \t]" "\\)+" "(" "\\)")) "Regexp of a section of PHP for alignment.") ;;;###autoload (defun php-align-setup () "Setup alignment configuration for PHP code." (when php-project-align-lines (php-align-mode 1))) (defvar php-align-mode-lighter " PHP-Align") ;;;###autoload (define-minor-mode php-align-mode "Alignment lines for PHP script." :lighter php-align-mode-lighter (add-to-list 'align-open-comment-modes 'php-mode) (add-to-list 'align-dq-string-modes 'php-mode) (add-to-list 'align-sq-string-modes 'php-mode) (if php-align-mode (progn (setq-local align-mode-rules-list php-align-rules-list) (setq-local align-region-separate php-align-region-separate)) (setq-local align-mode-rules-list nil) (setq-local align-region-separate nil))) (provide 'php-align) ;;; php-align.el ends here php-mode-1.27.0/lisp/php-complete.el000066400000000000000000000110141473104261100171740ustar00rootroot00000000000000;;; php-complete.el --- PHP auto-compiletion functions -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Copyright (C) 2021, 2022 Free Software Foundation, Inc. ;; Author: USAMI Kenta ;; Created: 18 Sep 2022 ;; Version: 1.26.1 ;; Keywords: languages, php ;; 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 . ;;; Commentary: ;; Provide auto-compiletion functions. ;; These functions are copied function from GNU ELPA. ;; ;; - cape--table-with-properties (cape.el) ;; - cape--bounds (cape.el) ;; - cape--interactive (cape.el) ;;; Code: (eval-when-compile (require 'cl-lib)) (require 'php) (require 'php-defs) ;;;###autoload (defgroup php-complete nil "Auto completion for PHP edition." :tag "PHP Completion" :group 'php-mode) ;;;###autoload (defcustom php-complete-function-modules '(bcmath core gmp libxml intl mbstring pcntl posix sodium xml xmlwriter) "Module names for function names completion." :tag "PHP Complete Function Modules" :type (eval-when-compile `(set ,@(mapcar (lambda (elm) (list 'const (car elm))) php-defs-functions-alist))) :safe (lambda (value) (and (listp value) (cl-loop for v in values always (assq v php-defs-functions-alist)))) :group 'php-complete) ;;; Cape functions: ;; These functions are copied from cape.el package. https://github.com/minad/cape ;; Thanks to original author Daniel Mendler (@minad) (cl-defun php-complete--cape-table-with-properties (table &key category (sort t) &allow-other-keys) "Create completion TABLE with properties. CATEGORY is the optional completion category. SORT should be nil to disable sorting." (if (or (not table) (and (not category) sort)) table (let ((metadata `(metadata ,@(and category `((category . ,category))) ,@(and (not sort) '((display-sort-function . identity) (cycle-sort-function . identity)))))) (lambda (str pred action) (if (eq action 'metadata) metadata (complete-with-action action table str pred)))))) (defun php-complete--cape-bounds (thing) "Return bounds of THING." (or (bounds-of-thing-at-point thing) (cons (point) (point)))) (defun php-complete--cape-interactive (capf) "Complete with CAPF." (let ((completion-at-point-functions (list capf))) (or (completion-at-point) (user-error "%s: No completions" capf)))) ;;; Variables: (defvar php-complete--functions-cache (make-hash-table :test #'equal)) ;;; Data source functions: (defun php-complete--functions () "Return PHP function names." (let* ((modules (sort php-complete-function-modules #'string<)) (functions (gethash modules php-complete--functions-cache))) (unless functions (setq functions (sort (cl-loop for module in modules append (assq module php-defs-functions-alist)) #'string<)) (puthash modules functions php-complete--functions-cache)) functions)) ;;; Compiletion function: ;;;###autoload (defun php-complete-complete-function (&optional interactive) "Complete PHP keyword at point. If INTERACTIVE is nil the function acts like a capf." (interactive (list t)) (if interactive (php-complete--cape-interactive #'php-complete-complete-function) (let ((bounds (php-complete--cape-bounds 'symbol)) (tokens (nreverse (php-leading-tokens 2)))) `(,(car bounds) ,(cdr bounds) ,(php-complete--cape-table-with-properties (unless (or (member (nth 0 tokens) '("->" "::")) (string-prefix-p "$" (nth 1 tokens))) (php-complete--functions)) :category 'cape-keyword) :annotation-function (lambda (_) " PHP functions") :company-kind (lambda (_) 'keyword) :exclusive 'no)))) (provide 'php-complete) ;;; php-complete.el ends here php-mode-1.27.0/lisp/php-defs.el000066400000000000000000002642011473104261100163150ustar00rootroot00000000000000;;; php-defs.el --- Provide PHP keyword definitions -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: USAMI Kenta ;; Created: 5 Mar 2022 ;; Version: 1.26.1 ;; Keywords: languages, php ;; 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 . ;;; Commentary: ;; This file provides common functions for PHP codes. ;;; Code: (defvar php-defs-functions-alist '((apache "apache_child_terminate" "apache_get_modules" "apache_get_version" "apache_getenv" "apache_lookup_uri" "apache_note" "apache_request_headers" "apache_response_headers" "apache_setenv" "virtual") (apcu "apcu_add" "apcu_cache_info" "apcu_cas" "apcu_clear_cache" "apcu_dec" "apcu_delete" "apcu_enabled" "apcu_entry" "apcu_exists" "apcu_fetch" "apcu_inc" "apcu_key_info" "apcu_sma_info" "apcu_store") (bcmath "bcadd" "bccomp" "bcdiv" "bcmod" "bcmul" "bcpow" "bcpowmod" "bcscale" "bcsqrt" "bcsub") (bzip2 "bzclose" "bzcompress" "bzdecompress" "bzerrno" "bzerror" "bzerrstr" "bzflush" "bzopen" "bzread" "bzwrite") (calendar "cal_days_in_month" "cal_from_jd" "cal_info" "cal_to_jd" "easter_date" "easter_days" "frenchtojd" "gregoriantojd" "jddayofweek" "jdmonthname" "jdtofrench" "jdtogregorian" "jdtojewish" "jdtojulian" "jdtounix" "jewishtojd" "unixtojd") (com_dotnet "com_create_guid" "com_event_sink" "com_get_active_object" "com_load_typelib" "com_message_pump" "com_print_typeinfo" "variant_abs" "variant_add" "variant_and" "variant_cast" "variant_cat" "variant_cmp" "variant_date_from_timestamp" "variant_date_to_timestamp" "variant_div" "variant_eqv" "variant_fix" "variant_get_type" "variant_idiv" "variant_imp" "variant_int" "variant_mod" "variant_mul" "variant_neg" "variant_not" "variant_or" "variant_pow" "variant_round" "variant_set" "variant_set_type" "variant_sub" "variant_xor") (commonmark "CommonMark\\Parse" "CommonMark\\Render" "CommonMark\\Render\\HTML" "CommonMark\\Render\\Latex" "CommonMark\\Render\\Man" "CommonMark\\Render\\XML") (componere "Componere\\cast" "Componere\\cast_by_ref") (core "abs" "acos" "acosh" "addcslashes" "addslashes" "array_change_key_case" "array_chunk" "array_column" "array_combine" "array_count_values" "array_diff" "array_diff_assoc" "array_diff_key" "array_diff_uassoc" "array_diff_ukey" "array_fill" "array_fill_keys" "array_filter" "array_flip" "array_intersect" "array_intersect_assoc" "array_intersect_key" "array_intersect_uassoc" "array_intersect_ukey" "array_is_list" "array_key_exists" "array_key_first" "array_key_last" "array_keys" "array_map" "array_merge" "array_merge_recursive" "array_multisort" "array_pad" "array_pop" "array_product" "array_push" "array_rand" "array_reduce" "array_replace" "array_replace_recursive" "array_reverse" "array_search" "array_shift" "array_slice" "array_splice" "array_sum" "array_udiff" "array_udiff_assoc" "array_udiff_uassoc" "array_uintersect" "array_uintersect_assoc" "array_uintersect_uassoc" "array_unique" "array_unshift" "array_values" "array_walk" "array_walk_recursive" "arsort" "asin" "asinh" "asort" "assert_options" "atan" "atan2" "atanh" "base64_decode" "base64_encode" "base_convert" "basename" "bin2hex" "bindec" "boolval" "call_user_func" "call_user_func_array" "ceil" "chdir" "checkdate" "checkdnsrr" "chgrp" "chmod" "chop" "chown" "chr" "chroot" "chunk_split" "class_alias" "class_exists" "class_implements" "class_parents" "class_uses" "clearstatcache" "cli_get_process_title" "cli_set_process_title" "closedir" "closelog" "compact" "connection_aborted" "connection_status" "constant" "convert_cyr_string" "convert_uudecode" "convert_uuencode" "copy" "cos" "cosh" "count" "count_chars" "crc32" "create_function" "crypt" "ctype_alnum" "ctype_alpha" "ctype_cntrl" "ctype_digit" "ctype_graph" "ctype_lower" "ctype_print" "ctype_punct" "ctype_space" "ctype_upper" "ctype_xdigit" "current" "date" "date_add" "date_create" "date_create_from_format" "date_create_immutable" "date_create_immutable_from_format" "date_date_set" "date_default_timezone_get" "date_default_timezone_set" "date_diff" "date_format" "date_get_last_errors" "date_interval_create_from_date_string" "date_interval_format" "date_isodate_set" "date_modify" "date_offset_get" "date_parse" "date_parse_from_format" "date_sub" "date_sun_info" "date_sunrise" "date_sunset" "date_time_set" "date_timestamp_get" "date_timestamp_set" "date_timezone_get" "date_timezone_set" "debug_backtrace" "debug_print_backtrace" "debug_zval_dump" "decbin" "dechex" "decoct" "define" "defined" "deg2rad" "delete" "die" "dir" "dirname" "disk_free_space" "disk_total_space" "diskfreespace" "dl" "dns_check_record" "dns_get_mx" "dns_get_record" "doubleval" "each" "enum_exists" "error_clear_last" "error_get_last" "error_log" "error_reporting" "escapeshellarg" "escapeshellcmd" "eval" "exec" "exit" "exp" "explode" "expm1" "extension_loaded" "extract" "fastcgi_finish_request" "fclose" "fdatasync" "fdiv" "feof" "fflush" "fgetc" "fgetcsv" "fgets" "fgetss" "file" "file_exists" "file_get_contents" "file_put_contents" "fileatime" "filectime" "filegroup" "fileinode" "filemtime" "fileowner" "fileperms" "filesize" "filetype" "filter_has_var" "filter_id" "filter_input" "filter_input_array" "filter_list" "filter_var" "filter_var_array" "finfo_buffer" "finfo_close" "finfo_file" "finfo_open" "finfo_set_flags" "floatval" "flock" "floor" "flush" "fmod" "fnmatch" "fopen" "forward_static_call" "forward_static_call_array" "fpassthru" "fprintf" "fputcsv" "fputs" "fread" "fscanf" "fseek" "fsockopen" "fstat" "fsync" "ftell" "ftruncate" "func_get_arg" "func_get_args" "func_num_args" "function_exists" "fwrite" "gc_collect_cycles" "gc_disable" "gc_enable" "gc_enabled" "gc_mem_caches" "gc_status" "get_browser" "get_called_class" "get_cfg_var" "get_class" "get_class_methods" "get_class_vars" "get_current_user" "get_debug_type" "get_declared_classes" "get_declared_interfaces" "get_declared_traits" "get_defined_constants" "get_defined_functions" "get_defined_vars" "get_extension_funcs" "get_headers" "get_html_translation_table" "get_include_path" "get_included_files" "get_loaded_extensions" "get_magic_quotes_gpc" "get_magic_quotes_runtime" "get_mangled_object_vars" "get_meta_tags" "get_object_vars" "get_parent_class" "get_required_files" "get_resource_id" "get_resource_type" "get_resources" "getallheaders" "getcwd" "getdate" "getenv" "gethostbyaddr" "gethostbyname" "gethostbynamel" "gethostname" "getlastmod" "getmxrr" "getmygid" "getmyinode" "getmypid" "getmyuid" "getopt" "getprotobyname" "getprotobynumber" "getrandmax" "getrusage" "getservbyname" "getservbyport" "gettimeofday" "gettype" "glob" "gmdate" "gmmktime" "gmstrftime" "hash" "hash_algos" "hash_copy" "hash_equals" "hash_file" "hash_final" "hash_hkdf" "hash_hmac" "hash_hmac_algos" "hash_hmac_file" "hash_init" "hash_pbkdf2" "hash_update" "hash_update_file" "hash_update_stream" "header" "header_register_callback" "header_remove" "headers_list" "headers_sent" "hebrev" "hebrevc" "hex2bin" "hexdec" "highlight_file" "highlight_string" "hrtime" "html_entity_decode" "htmlentities" "htmlspecialchars" "htmlspecialchars_decode" "http_build_query" "http_response_code" "hypot" "idate" "ignore_user_abort" "implode" "in_array" "inet_ntop" "inet_pton" "ini_alter" "ini_get" "ini_get_all" "ini_restore" "ini_set" "intdiv" "interface_exists" "intval" "ip2long" "is_a" "is_array" "is_bool" "is_callable" "is_countable" "is_dir" "is_double" "is_executable" "is_file" "is_finite" "is_float" "is_infinite" "is_int" "is_integer" "is_iterable" "is_link" "is_long" "is_nan" "is_null" "is_numeric" "is_object" "is_readable" "is_resource" "is_scalar" "is_string" "is_subclass_of" "is_uploaded_file" "is_writable" "is_writeable" "iterator_apply" "iterator_count" "iterator_to_array" "join" "json_decode" "json_encode" "json_last_error" "json_last_error_msg" "juliantojd" "key" "key_exists" "krsort" "ksort" "lcfirst" "lcg_value" "lchgrp" "lchown" "levenshtein" "link" "linkinfo" "list" "localeconv" "localtime" "log" "log10" "log1p" "long2ip" "lstat" "ltrim" "mail" "max" "md5" "md5_file" "memory_get_peak_usage" "memory_get_usage" "metaphone" "method_exists" "microtime" "mime_content_type" "min" "mkdir" "mktime" "money_format" "move_uploaded_file" "mt_getrandmax" "mt_rand" "mt_srand" "natcasesort" "natsort" "net_get_interfaces" "next" "nl2br" "nl_langinfo" "number_format" "ob_clean" "ob_end_clean" "ob_end_flush" "ob_flush" "ob_get_clean" "ob_get_contents" "ob_get_flush" "ob_get_length" "ob_get_level" "ob_get_status" "ob_gzhandler" "ob_iconv_handler" "ob_implicit_flush" "ob_list_handlers" "ob_start" "ob_tidyhandler" "octdec" "opcache_compile_file" "opcache_get_configuration" "opcache_get_status" "opcache_invalidate" "opcache_is_script_cached" "opcache_reset" "opendir" "openlog" "ord" "output_add_rewrite_var" "output_reset_rewrite_vars" "pack" "parse_ini_file" "parse_ini_string" "parse_str" "parse_url" "passthru" "password_algos" "password_get_info" "password_hash" "password_needs_rehash" "password_verify" "pathinfo" "pclose" "pdo_drivers" "pfsockopen" "php_ini_loaded_file" "php_ini_scanned_files" "php_sapi_name" "php_strip_whitespace" "php_uname" "phpcredits" "phpdbg_break_file" "phpdbg_break_function" "phpdbg_break_method" "phpdbg_break_next" "phpdbg_clear" "phpdbg_color" "phpdbg_end_oplog" "phpdbg_exec" "phpdbg_get_executable" "phpdbg_prompt" "phpdbg_start_oplog" "phpinfo" "phpversion" "pi" "popen" "pos" "pow" "preg_filter" "preg_grep" "preg_last_error" "preg_last_error_msg" "preg_match" "preg_match_all" "preg_quote" "preg_replace" "preg_replace_callback" "preg_replace_callback_array" "preg_split" "prev" "print_r" "printf" "proc_close" "proc_get_status" "proc_nice" "proc_open" "proc_terminate" "property_exists" "putenv" "quoted_printable_decode" "quoted_printable_encode" "quotemeta" "rad2deg" "rand" "random_bytes" "random_int" "range" "rawurldecode" "rawurlencode" "readdir" "readfile" "readlink" "realpath" "realpath_cache_get" "realpath_cache_size" "register_shutdown_function" "register_tick_function" "rename" "reset" "restore_error_handler" "restore_exception_handler" "restore_include_path" "rewind" "rewinddir" "rmdir" "round" "rsort" "rtrim" "sapi_windows_cp_conv" "sapi_windows_cp_get" "sapi_windows_cp_is_utf8" "sapi_windows_cp_set" "sapi_windows_generate_ctrl_event" "sapi_windows_set_ctrl_handler" "sapi_windows_vt100_support" "scandir" "seaslog_get_author" "seaslog_get_version" "serialize" "session_abort" "session_cache_expire" "session_cache_limiter" "session_commit" "session_create_id" "session_decode" "session_destroy" "session_encode" "session_gc" "session_get_cookie_params" "session_id" "session_module_name" "session_name" "session_regenerate_id" "session_register_shutdown" "session_reset" "session_save_path" "session_set_cookie_params" "session_set_save_handler" "session_start" "session_status" "session_unset" "session_write_close" "set_error_handler" "set_exception_handler" "set_file_buffer" "set_include_path" "set_time_limit" "setcookie" "setlocale" "setrawcookie" "settype" "sha1" "sha1_file" "shell_exec" "show_source" "shuffle" "similar_text" "sin" "sinh" "sizeof" "sleep" "sort" "soundex" "spl_autoload" "spl_autoload_call" "spl_autoload_extensions" "spl_autoload_functions" "spl_autoload_register" "spl_autoload_unregister" "spl_classes" "spl_object_hash" "spl_object_id" "sprintf" "sqrt" "srand" "sscanf" "stat" "str_contains" "str_ends_with" "str_getcsv" "str_ireplace" "str_pad" "str_repeat" "str_replace" "str_rot13" "str_shuffle" "str_split" "str_starts_with" "str_word_count" "strcasecmp" "strchr" "strcmp" "strcoll" "strcspn" "stream_bucket_append" "stream_bucket_make_writeable" "stream_bucket_new" "stream_bucket_prepend" "stream_context_create" "stream_context_get_default" "stream_context_get_options" "stream_context_get_params" "stream_context_set_default" "stream_context_set_option" "stream_context_set_params" "stream_copy_to_stream" "stream_filter_append" "stream_filter_prepend" "stream_filter_register" "stream_filter_remove" "stream_get_contents" "stream_get_filters" "stream_get_line" "stream_get_meta_data" "stream_get_transports" "stream_get_wrappers" "stream_is_local" "stream_isatty" "stream_notification_callback" "stream_register_wrapper" "stream_resolve_include_path" "stream_select" "stream_set_blocking" "stream_set_chunk_size" "stream_set_read_buffer" "stream_set_timeout" "stream_set_write_buffer" "stream_socket_accept" "stream_socket_client" "stream_socket_enable_crypto" "stream_socket_get_name" "stream_socket_pair" "stream_socket_recvfrom" "stream_socket_sendto" "stream_socket_server" "stream_socket_shutdown" "stream_supports_lock" "stream_wrapper_register" "stream_wrapper_restore" "stream_wrapper_unregister" "strftime" "strip_tags" "stripcslashes" "stripos" "stripslashes" "stristr" "strlen" "strnatcasecmp" "strnatcmp" "strncasecmp" "strncmp" "strpbrk" "strpos" "strptime" "strrchr" "strrev" "strripos" "strrpos" "strspn" "strstr" "strtok" "strtolower" "strtotime" "strtoupper" "strtr" "strval" "substr" "substr_compare" "substr_count" "substr_replace" "symlink" "sys_get_temp_dir" "sys_getloadavg" "syslog" "system" "tan" "tanh" "tempnam" "time" "time_nanosleep" "time_sleep_until" "timezone_abbreviations_list" "timezone_identifiers_list" "timezone_location_get" "timezone_name_from_abbr" "timezone_name_get" "timezone_offset_get" "timezone_open" "timezone_transitions_get" "timezone_version_get" "tmpfile" "token_get_all" "token_name" "touch" "trait_exists" "trigger_error" "trim" "uasort" "ucfirst" "ucwords" "uksort" "umask" "uniqid" "unlink" "unpack" "unregister_tick_function" "unserialize" "unset" "urldecode" "urlencode" "user_error" "usleep" "usort" "var_dump" "var_export" "version_compare" "vfprintf" "vprintf" "vsprintf" "wordwrap" "zend_thread_id" "zend_version") (cubrid "cubrid_affected_rows" "cubrid_bind" "cubrid_client_encoding" "cubrid_close" "cubrid_close_prepare" "cubrid_close_request" "cubrid_col_get" "cubrid_col_size" "cubrid_column_names" "cubrid_column_types" "cubrid_commit" "cubrid_connect" "cubrid_connect_with_url" "cubrid_current_oid" "cubrid_data_seek" "cubrid_db_name" "cubrid_disconnect" "cubrid_drop" "cubrid_errno" "cubrid_error" "cubrid_error_code" "cubrid_error_code_facility" "cubrid_error_msg" "cubrid_execute" "cubrid_fetch" "cubrid_fetch_array" "cubrid_fetch_assoc" "cubrid_fetch_field" "cubrid_fetch_lengths" "cubrid_fetch_object" "cubrid_fetch_row" "cubrid_field_flags" "cubrid_field_len" "cubrid_field_name" "cubrid_field_seek" "cubrid_field_table" "cubrid_field_type" "cubrid_free_result" "cubrid_get" "cubrid_get_autocommit" "cubrid_get_charset" "cubrid_get_class_name" "cubrid_get_client_info" "cubrid_get_db_parameter" "cubrid_get_query_timeout" "cubrid_get_server_info" "cubrid_insert_id" "cubrid_is_instance" "cubrid_list_dbs" "cubrid_load_from_glo" "cubrid_lob2_bind" "cubrid_lob2_close" "cubrid_lob2_export" "cubrid_lob2_import" "cubrid_lob2_new" "cubrid_lob2_read" "cubrid_lob2_seek" "cubrid_lob2_seek64" "cubrid_lob2_size" "cubrid_lob2_size64" "cubrid_lob2_tell" "cubrid_lob2_tell64" "cubrid_lob2_write" "cubrid_lob_close" "cubrid_lob_export" "cubrid_lob_get" "cubrid_lob_send" "cubrid_lob_size" "cubrid_lock_read" "cubrid_lock_write" "cubrid_move_cursor" "cubrid_new_glo" "cubrid_next_result" "cubrid_num_cols" "cubrid_num_fields" "cubrid_num_rows" "cubrid_pconnect" "cubrid_pconnect_with_url" "cubrid_ping" "cubrid_prepare" "cubrid_put" "cubrid_query" "cubrid_real_escape_string" "cubrid_result" "cubrid_rollback" "cubrid_save_to_glo" "cubrid_schema" "cubrid_send_glo" "cubrid_seq_drop" "cubrid_seq_insert" "cubrid_seq_put" "cubrid_set_add" "cubrid_set_autocommit" "cubrid_set_db_parameter" "cubrid_set_drop" "cubrid_set_query_timeout" "cubrid_unbuffered_query" "cubrid_version") (curl "curl_close" "curl_copy_handle" "curl_errno" "curl_error" "curl_escape" "curl_exec" "curl_file_create" "curl_getinfo" "curl_init" "curl_multi_add_handle" "curl_multi_close" "curl_multi_errno" "curl_multi_exec" "curl_multi_getcontent" "curl_multi_info_read" "curl_multi_init" "curl_multi_remove_handle" "curl_multi_select" "curl_multi_setopt" "curl_multi_strerror" "curl_pause" "curl_reset" "curl_setopt" "curl_setopt_array" "curl_share_close" "curl_share_errno" "curl_share_init" "curl_share_setopt" "curl_share_strerror" "curl_strerror" "curl_unescape" "curl_version") (dba "dba_close" "dba_delete" "dba_exists" "dba_fetch" "dba_firstkey" "dba_handlers" "dba_insert" "dba_key_split" "dba_list" "dba_nextkey" "dba_open" "dba_optimize" "dba_popen" "dba_replace" "dba_sync") (dbase "dbase_add_record" "dbase_close" "dbase_create" "dbase_delete_record" "dbase_get_header_info" "dbase_get_record" "dbase_get_record_with_names" "dbase_numfields" "dbase_numrecords" "dbase_open" "dbase_pack" "dbase_replace_record") (dio "dio_close" "dio_fcntl" "dio_open" "dio_read" "dio_seek" "dio_stat" "dio_tcsetattr" "dio_truncate" "dio_write") (eio "eio_busy" "eio_cancel" "eio_chmod" "eio_chown" "eio_close" "eio_custom" "eio_dup2" "eio_event_loop" "eio_fallocate" "eio_fchmod" "eio_fchown" "eio_fdatasync" "eio_fstat" "eio_fstatvfs" "eio_fsync" "eio_ftruncate" "eio_futime" "eio_get_event_stream" "eio_get_last_error" "eio_grp" "eio_grp_add" "eio_grp_cancel" "eio_grp_limit" "eio_init" "eio_link" "eio_lstat" "eio_mkdir" "eio_mknod" "eio_nop" "eio_npending" "eio_nready" "eio_nreqs" "eio_nthreads" "eio_open" "eio_poll" "eio_read" "eio_readahead" "eio_readdir" "eio_readlink" "eio_realpath" "eio_rename" "eio_rmdir" "eio_seek" "eio_sendfile" "eio_set_max_idle" "eio_set_max_parallel" "eio_set_max_poll_reqs" "eio_set_max_poll_time" "eio_set_min_parallel" "eio_stat" "eio_statvfs" "eio_symlink" "eio_sync" "eio_sync_file_range" "eio_syncfs" "eio_truncate" "eio_unlink" "eio_utime" "eio_write") (enchant "enchant_broker_describe" "enchant_broker_dict_exists" "enchant_broker_free" "enchant_broker_free_dict" "enchant_broker_get_dict_path" "enchant_broker_get_error" "enchant_broker_init" "enchant_broker_list_dicts" "enchant_broker_request_dict" "enchant_broker_request_pwl_dict" "enchant_broker_set_dict_path" "enchant_broker_set_ordering" "enchant_dict_add" "enchant_dict_add_to_personal" "enchant_dict_add_to_session" "enchant_dict_check" "enchant_dict_describe" "enchant_dict_get_error" "enchant_dict_is_added" "enchant_dict_is_in_session" "enchant_dict_quick_check" "enchant_dict_store_replacement" "enchant_dict_suggest") (exif "exif_imagetype" "exif_read_data" "exif_tagname" "exif_thumbnail" "read_exif_data") (expect "expect_expectl" "expect_popen") (fann "fann_cascadetrain_on_data" "fann_cascadetrain_on_file" "fann_clear_scaling_params" "fann_copy" "fann_create_from_file" "fann_create_shortcut" "fann_create_shortcut_array" "fann_create_sparse" "fann_create_sparse_array" "fann_create_standard" "fann_create_standard_array" "fann_create_train" "fann_create_train_from_callback" "fann_descale_input" "fann_descale_output" "fann_descale_train" "fann_destroy" "fann_destroy_train" "fann_duplicate_train_data" "fann_get_MSE" "fann_get_activation_function" "fann_get_activation_steepness" "fann_get_bias_array" "fann_get_bit_fail" "fann_get_bit_fail_limit" "fann_get_cascade_activation_functions" "fann_get_cascade_activation_functions_count" "fann_get_cascade_activation_steepnesses" "fann_get_cascade_activation_steepnesses_count" "fann_get_cascade_candidate_change_fraction" "fann_get_cascade_candidate_limit" "fann_get_cascade_candidate_stagnation_epochs" "fann_get_cascade_max_cand_epochs" "fann_get_cascade_max_out_epochs" "fann_get_cascade_min_cand_epochs" "fann_get_cascade_min_out_epochs" "fann_get_cascade_num_candidate_groups" "fann_get_cascade_num_candidates" "fann_get_cascade_output_change_fraction" "fann_get_cascade_output_stagnation_epochs" "fann_get_cascade_weight_multiplier" "fann_get_connection_array" "fann_get_connection_rate" "fann_get_errno" "fann_get_errstr" "fann_get_layer_array" "fann_get_learning_momentum" "fann_get_learning_rate" "fann_get_network_type" "fann_get_num_input" "fann_get_num_layers" "fann_get_num_output" "fann_get_quickprop_decay" "fann_get_quickprop_mu" "fann_get_rprop_decrease_factor" "fann_get_rprop_delta_max" "fann_get_rprop_delta_min" "fann_get_rprop_delta_zero" "fann_get_rprop_increase_factor" "fann_get_sarprop_step_error_shift" "fann_get_sarprop_step_error_threshold_factor" "fann_get_sarprop_temperature" "fann_get_sarprop_weight_decay_shift" "fann_get_total_connections" "fann_get_total_neurons" "fann_get_train_error_function" "fann_get_train_stop_function" "fann_get_training_algorithm" "fann_init_weights" "fann_length_train_data" "fann_merge_train_data" "fann_num_input_train_data" "fann_num_output_train_data" "fann_print_error" "fann_randomize_weights" "fann_read_train_from_file" "fann_reset_MSE" "fann_reset_errno" "fann_reset_errstr" "fann_run" "fann_save" "fann_save_train" "fann_scale_input" "fann_scale_input_train_data" "fann_scale_output" "fann_scale_output_train_data" "fann_scale_train" "fann_scale_train_data" "fann_set_activation_function" "fann_set_activation_function_hidden" "fann_set_activation_function_layer" "fann_set_activation_function_output" "fann_set_activation_steepness" "fann_set_activation_steepness_hidden" "fann_set_activation_steepness_layer" "fann_set_activation_steepness_output" "fann_set_bit_fail_limit" "fann_set_callback" "fann_set_cascade_activation_functions" "fann_set_cascade_activation_steepnesses" "fann_set_cascade_candidate_change_fraction" "fann_set_cascade_candidate_limit" "fann_set_cascade_candidate_stagnation_epochs" "fann_set_cascade_max_cand_epochs" "fann_set_cascade_max_out_epochs" "fann_set_cascade_min_cand_epochs" "fann_set_cascade_min_out_epochs" "fann_set_cascade_num_candidate_groups" "fann_set_cascade_output_change_fraction" "fann_set_cascade_output_stagnation_epochs" "fann_set_cascade_weight_multiplier" "fann_set_error_log" "fann_set_input_scaling_params" "fann_set_learning_momentum" "fann_set_learning_rate" "fann_set_output_scaling_params" "fann_set_quickprop_decay" "fann_set_quickprop_mu" "fann_set_rprop_decrease_factor" "fann_set_rprop_delta_max" "fann_set_rprop_delta_min" "fann_set_rprop_delta_zero" "fann_set_rprop_increase_factor" "fann_set_sarprop_step_error_shift" "fann_set_sarprop_step_error_threshold_factor" "fann_set_sarprop_temperature" "fann_set_sarprop_weight_decay_shift" "fann_set_scaling_params" "fann_set_train_error_function" "fann_set_train_stop_function" "fann_set_training_algorithm" "fann_set_weight" "fann_set_weight_array" "fann_shuffle_train_data" "fann_subset_train_data" "fann_test" "fann_test_data" "fann_train" "fann_train_epoch" "fann_train_on_data" "fann_train_on_file") (fdf "fdf_add_doc_javascript" "fdf_add_template" "fdf_close" "fdf_create" "fdf_enum_values" "fdf_errno" "fdf_error" "fdf_get_ap" "fdf_get_attachment" "fdf_get_encoding" "fdf_get_file" "fdf_get_flags" "fdf_get_opt" "fdf_get_status" "fdf_get_value" "fdf_get_version" "fdf_header" "fdf_next_field_name" "fdf_open" "fdf_open_string" "fdf_remove_item" "fdf_save" "fdf_save_string" "fdf_set_ap" "fdf_set_encoding" "fdf_set_file" "fdf_set_flags" "fdf_set_javascript_action" "fdf_set_on_import_javascript" "fdf_set_opt" "fdf_set_status" "fdf_set_submit_form_action" "fdf_set_target_frame" "fdf_set_value" "fdf_set_version") (fpm "fpm_get_status") (ftp "ftp_alloc" "ftp_append" "ftp_cdup" "ftp_chdir" "ftp_chmod" "ftp_close" "ftp_connect" "ftp_delete" "ftp_exec" "ftp_fget" "ftp_fput" "ftp_get" "ftp_get_option" "ftp_login" "ftp_mdtm" "ftp_mkdir" "ftp_mlsd" "ftp_nb_continue" "ftp_nb_fget" "ftp_nb_fput" "ftp_nb_get" "ftp_nb_put" "ftp_nlist" "ftp_pasv" "ftp_put" "ftp_pwd" "ftp_quit" "ftp_raw" "ftp_rawlist" "ftp_rename" "ftp_rmdir" "ftp_set_option" "ftp_site" "ftp_size" "ftp_ssl_connect" "ftp_systype") (gd "gd_info" "getimagesize" "getimagesizefromstring" "image2wbmp" "image_type_to_extension" "image_type_to_mime_type" "imageaffine" "imageaffinematrixconcat" "imageaffinematrixget" "imagealphablending" "imageantialias" "imagearc" "imageavif" "imagebmp" "imagechar" "imagecharup" "imagecolorallocate" "imagecolorallocatealpha" "imagecolorat" "imagecolorclosest" "imagecolorclosestalpha" "imagecolorclosesthwb" "imagecolordeallocate" "imagecolorexact" "imagecolorexactalpha" "imagecolormatch" "imagecolorresolve" "imagecolorresolvealpha" "imagecolorset" "imagecolorsforindex" "imagecolorstotal" "imagecolortransparent" "imageconvolution" "imagecopy" "imagecopymerge" "imagecopymergegray" "imagecopyresampled" "imagecopyresized" "imagecreate" "imagecreatefromavif" "imagecreatefrombmp" "imagecreatefromgd" "imagecreatefromgd2" "imagecreatefromgd2part" "imagecreatefromgif" "imagecreatefromjpeg" "imagecreatefrompng" "imagecreatefromstring" "imagecreatefromtga" "imagecreatefromwbmp" "imagecreatefromwebp" "imagecreatefromxbm" "imagecreatefromxpm" "imagecreatetruecolor" "imagecrop" "imagecropauto" "imagedashedline" "imagedestroy" "imageellipse" "imagefill" "imagefilledarc" "imagefilledellipse" "imagefilledpolygon" "imagefilledrectangle" "imagefilltoborder" "imagefilter" "imageflip" "imagefontheight" "imagefontwidth" "imageftbbox" "imagefttext" "imagegammacorrect" "imagegd" "imagegd2" "imagegetclip" "imagegetinterpolation" "imagegif" "imagegrabscreen" "imagegrabwindow" "imageinterlace" "imageistruecolor" "imagejpeg" "imagelayereffect" "imageline" "imageloadfont" "imageopenpolygon" "imagepalettecopy" "imagepalettetotruecolor" "imagepng" "imagepolygon" "imagerectangle" "imageresolution" "imagerotate" "imagesavealpha" "imagescale" "imagesetbrush" "imagesetclip" "imagesetinterpolation" "imagesetpixel" "imagesetstyle" "imagesetthickness" "imagesettile" "imagestring" "imagestringup" "imagesx" "imagesy" "imagetruecolortopalette" "imagettfbbox" "imagettftext" "imagetypes" "imagewbmp" "imagewebp" "imagexbm" "iptcembed" "iptcparse") (gearman "gearman_job_handle" "gearman_job_status") (geoip "geoip_asnum_by_name" "geoip_continent_code_by_name" "geoip_country_code3_by_name" "geoip_country_code_by_name" "geoip_country_name_by_name" "geoip_database_info" "geoip_db_avail" "geoip_db_filename" "geoip_db_get_all_info" "geoip_domain_by_name" "geoip_id_by_name" "geoip_isp_by_name" "geoip_netspeedcell_by_name" "geoip_org_by_name" "geoip_record_by_name" "geoip_region_by_name" "geoip_region_name_by_code" "geoip_setup_custom_directory" "geoip_time_zone_by_country_and_region") (gettext "bind_textdomain_codeset" "bindtextdomain" "dcgettext" "dcngettext" "dgettext" "dngettext" "gettext" "ngettext" "textdomain") (gmp "gmp_abs" "gmp_add" "gmp_and" "gmp_binomial" "gmp_clrbit" "gmp_cmp" "gmp_com" "gmp_div" "gmp_div_q" "gmp_div_qr" "gmp_div_r" "gmp_divexact" "gmp_export" "gmp_fact" "gmp_gcd" "gmp_gcdext" "gmp_hamdist" "gmp_import" "gmp_init" "gmp_intval" "gmp_invert" "gmp_jacobi" "gmp_kronecker" "gmp_lcm" "gmp_legendre" "gmp_mod" "gmp_mul" "gmp_neg" "gmp_nextprime" "gmp_or" "gmp_perfect_power" "gmp_perfect_square" "gmp_popcount" "gmp_pow" "gmp_powm" "gmp_prob_prime" "gmp_random" "gmp_random_bits" "gmp_random_range" "gmp_random_seed" "gmp_root" "gmp_rootrem" "gmp_scan0" "gmp_scan1" "gmp_setbit" "gmp_sign" "gmp_sqrt" "gmp_sqrtrem" "gmp_strval" "gmp_sub" "gmp_testbit" "gmp_xor") (gnupg "gnupg_adddecryptkey" "gnupg_addencryptkey" "gnupg_addsignkey" "gnupg_cleardecryptkeys" "gnupg_clearencryptkeys" "gnupg_clearsignkeys" "gnupg_decrypt" "gnupg_decryptverify" "gnupg_deletekey" "gnupg_encrypt" "gnupg_encryptsign" "gnupg_export" "gnupg_getengineinfo" "gnupg_geterror" "gnupg_geterrorinfo" "gnupg_getprotocol" "gnupg_gettrustlist" "gnupg_import" "gnupg_init" "gnupg_keyinfo" "gnupg_listsignatures" "gnupg_setarmor" "gnupg_seterrormode" "gnupg_setsignmode" "gnupg_sign" "gnupg_verify") (ibase "fbird_add_user" "fbird_affected_rows" "fbird_backup" "fbird_blob_add" "fbird_blob_cancel" "fbird_blob_close" "fbird_blob_create" "fbird_blob_echo" "fbird_blob_get" "fbird_blob_import" "fbird_blob_info" "fbird_blob_open" "fbird_close" "fbird_commit" "fbird_commit_ret" "fbird_connect" "fbird_db_info" "fbird_delete_user" "fbird_drop_db" "fbird_errcode" "fbird_errmsg" "fbird_execute" "fbird_fetch_assoc" "fbird_fetch_object" "fbird_fetch_row" "fbird_field_info" "fbird_free_event_handler" "fbird_free_query" "fbird_free_result" "fbird_gen_id" "fbird_maintain_db" "fbird_modify_user" "fbird_name_result" "fbird_num_fields" "fbird_num_params" "fbird_param_info" "fbird_pconnect" "fbird_prepare" "fbird_query" "fbird_restore" "fbird_rollback" "fbird_rollback_ret" "fbird_server_info" "fbird_service_attach" "fbird_service_detach" "fbird_set_event_handler" "fbird_trans" "fbird_wait_event" "ibase_add_user" "ibase_affected_rows" "ibase_backup" "ibase_blob_add" "ibase_blob_cancel" "ibase_blob_close" "ibase_blob_create" "ibase_blob_echo" "ibase_blob_get" "ibase_blob_import" "ibase_blob_info" "ibase_blob_open" "ibase_close" "ibase_commit" "ibase_commit_ret" "ibase_connect" "ibase_db_info" "ibase_delete_user" "ibase_drop_db" "ibase_errcode" "ibase_errmsg" "ibase_execute" "ibase_fetch_assoc" "ibase_fetch_object" "ibase_fetch_row" "ibase_field_info" "ibase_free_event_handler" "ibase_free_query" "ibase_free_result" "ibase_gen_id" "ibase_maintain_db" "ibase_modify_user" "ibase_name_result" "ibase_num_fields" "ibase_num_params" "ibase_param_info" "ibase_pconnect" "ibase_prepare" "ibase_query" "ibase_restore" "ibase_rollback" "ibase_rollback_ret" "ibase_server_info" "ibase_service_attach" "ibase_service_detach" "ibase_set_event_handler" "ibase_trans" "ibase_wait_event") (ibm_db2 "db2_autocommit" "db2_bind_param" "db2_client_info" "db2_close" "db2_column_privileges" "db2_columns" "db2_commit" "db2_conn_error" "db2_conn_errormsg" "db2_connect" "db2_cursor_type" "db2_escape_string" "db2_exec" "db2_execute" "db2_fetch_array" "db2_fetch_assoc" "db2_fetch_both" "db2_fetch_object" "db2_fetch_row" "db2_field_display_size" "db2_field_name" "db2_field_num" "db2_field_precision" "db2_field_scale" "db2_field_type" "db2_field_width" "db2_foreign_keys" "db2_free_result" "db2_free_stmt" "db2_get_option" "db2_last_insert_id" "db2_lob_read" "db2_next_result" "db2_num_fields" "db2_num_rows" "db2_pclose" "db2_pconnect" "db2_prepare" "db2_primary_keys" "db2_procedure_columns" "db2_procedures" "db2_result" "db2_rollback" "db2_server_info" "db2_set_option" "db2_special_columns" "db2_statistics" "db2_stmt_error" "db2_stmt_errormsg" "db2_table_privileges" "db2_tables") (iconv "iconv" "iconv_get_encoding" "iconv_mime_decode" "iconv_mime_decode_headers" "iconv_mime_encode" "iconv_set_encoding" "iconv_strlen" "iconv_strpos" "iconv_strrpos" "iconv_substr") (igbinary "igbinary_serialize" "igbinary_unserialize") (imap "imap_8bit" "imap_alerts" "imap_append" "imap_base64" "imap_binary" "imap_body" "imap_bodystruct" "imap_check" "imap_clearflag_full" "imap_close" "imap_create" "imap_createmailbox" "imap_delete" "imap_deletemailbox" "imap_errors" "imap_expunge" "imap_fetch_overview" "imap_fetchbody" "imap_fetchheader" "imap_fetchmime" "imap_fetchstructure" "imap_fetchtext" "imap_gc" "imap_get_quota" "imap_get_quotaroot" "imap_getacl" "imap_getmailboxes" "imap_getsubscribed" "imap_header" "imap_headerinfo" "imap_headers" "imap_last_error" "imap_list" "imap_listmailbox" "imap_listscan" "imap_listsubscribed" "imap_lsub" "imap_mail" "imap_mail_compose" "imap_mail_copy" "imap_mail_move" "imap_mailboxmsginfo" "imap_mime_header_decode" "imap_msgno" "imap_mutf7_to_utf8" "imap_num_msg" "imap_num_recent" "imap_open" "imap_ping" "imap_qprint" "imap_rename" "imap_renamemailbox" "imap_reopen" "imap_rfc822_parse_adrlist" "imap_rfc822_parse_headers" "imap_rfc822_write_address" "imap_savebody" "imap_scan" "imap_scanmailbox" "imap_search" "imap_set_quota" "imap_setacl" "imap_setflag_full" "imap_sort" "imap_status" "imap_subscribe" "imap_thread" "imap_timeout" "imap_uid" "imap_undelete" "imap_unsubscribe" "imap_utf7_decode" "imap_utf7_encode" "imap_utf8" "imap_utf8_to_mutf7") (inotify "inotify_add_watch" "inotify_init" "inotify_queue_len" "inotify_read" "inotify_rm_watch") (intl "collator_asort" "collator_compare" "collator_create" "collator_get_attribute" "collator_get_error_code" "collator_get_error_message" "collator_get_locale" "collator_get_sort_key" "collator_get_strength" "collator_set_attribute" "collator_set_strength" "collator_sort" "collator_sort_with_sort_keys" "datefmt_create" "datefmt_format" "datefmt_format_object" "datefmt_get_calendar" "datefmt_get_calendar_object" "datefmt_get_datetype" "datefmt_get_error_code" "datefmt_get_error_message" "datefmt_get_locale" "datefmt_get_pattern" "datefmt_get_timetype" "datefmt_get_timezone" "datefmt_get_timezone_id" "datefmt_is_lenient" "datefmt_localtime" "datefmt_parse" "datefmt_set_calendar" "datefmt_set_lenient" "datefmt_set_pattern" "datefmt_set_timezone" "grapheme_extract" "grapheme_stripos" "grapheme_stristr" "grapheme_strlen" "grapheme_strpos" "grapheme_strripos" "grapheme_strrpos" "grapheme_strstr" "grapheme_substr" "idn_to_ascii" "idn_to_utf8" "intl_error_name" "intl_get_error_code" "intl_get_error_message" "intl_is_failure" "intlcal_get_error_code" "intlcal_get_error_message" "intltz_count_equivalent_ids" "intltz_create_default" "intltz_create_enumeration" "intltz_create_time_zone" "intltz_create_time_zone_id_enumeration" "intltz_from_date_time_zone" "intltz_get_canonical_id" "intltz_get_display_name" "intltz_get_dst_savings" "intltz_get_equivalent_id" "intltz_get_error_code" "intltz_get_error_message" "intltz_get_gmt" "intltz_get_id" "intltz_get_id_for_windows_id" "intltz_get_offset" "intltz_get_raw_offset" "intltz_get_region" "intltz_get_tz_data_version" "intltz_get_unknown" "intltz_get_windows_id" "intltz_has_same_rules" "intltz_to_date_time_zone" "intltz_use_daylight_time" "locale_accept_from_http" "locale_canonicalize" "locale_compose" "locale_filter_matches" "locale_get_all_variants" "locale_get_default" "locale_get_display_language" "locale_get_display_name" "locale_get_display_region" "locale_get_display_script" "locale_get_display_variant" "locale_get_keywords" "locale_get_primary_language" "locale_get_region" "locale_get_script" "locale_lookup" "locale_parse" "locale_set_default" "msgfmt_create" "msgfmt_format" "msgfmt_format_message" "msgfmt_get_error_code" "msgfmt_get_error_message" "msgfmt_get_locale" "msgfmt_get_pattern" "msgfmt_parse" "msgfmt_parse_message" "msgfmt_set_pattern" "normalizer_get_raw_decomposition" "normalizer_is_normalized" "normalizer_normalize" "numfmt_create" "numfmt_format" "numfmt_format_currency" "numfmt_get_attribute" "numfmt_get_error_code" "numfmt_get_error_message" "numfmt_get_locale" "numfmt_get_pattern" "numfmt_get_symbol" "numfmt_get_text_attribute" "numfmt_parse" "numfmt_parse_currency" "numfmt_set_attribute" "numfmt_set_pattern" "numfmt_set_symbol" "numfmt_set_text_attribute" "resourcebundle_count" "resourcebundle_create" "resourcebundle_get" "resourcebundle_get_error_code" "resourcebundle_get_error_message" "resourcebundle_locales" "transliterator_create" "transliterator_create_from_rules" "transliterator_create_inverse" "transliterator_get_error_code" "transliterator_get_error_message" "transliterator_list_ids" "transliterator_transliterate") (language "__halt_compiler" "array" "assert" "echo" "empty" "isset" "print") (ldap "ldap_8859_to_t61" "ldap_add" "ldap_add_ext" "ldap_bind" "ldap_bind_ext" "ldap_close" "ldap_compare" "ldap_connect" "ldap_control_paged_result" "ldap_control_paged_result_response" "ldap_count_entries" "ldap_count_references" "ldap_delete" "ldap_delete_ext" "ldap_dn2ufn" "ldap_err2str" "ldap_errno" "ldap_error" "ldap_escape" "ldap_exop" "ldap_exop_passwd" "ldap_exop_refresh" "ldap_exop_whoami" "ldap_explode_dn" "ldap_first_attribute" "ldap_first_entry" "ldap_first_reference" "ldap_free_result" "ldap_get_attributes" "ldap_get_dn" "ldap_get_entries" "ldap_get_option" "ldap_get_values" "ldap_get_values_len" "ldap_list" "ldap_mod_add" "ldap_mod_add_ext" "ldap_mod_del" "ldap_mod_del_ext" "ldap_mod_replace" "ldap_mod_replace_ext" "ldap_modify" "ldap_modify_batch" "ldap_next_attribute" "ldap_next_entry" "ldap_next_reference" "ldap_parse_exop" "ldap_parse_reference" "ldap_parse_result" "ldap_read" "ldap_rename" "ldap_rename_ext" "ldap_sasl_bind" "ldap_search" "ldap_set_option" "ldap_set_rebind_proc" "ldap_sort" "ldap_start_tls" "ldap_t61_to_8859" "ldap_unbind") (libxml "libxml_clear_errors" "libxml_disable_entity_loader" "libxml_get_errors" "libxml_get_last_error" "libxml_set_external_entity_loader" "libxml_set_streams_context" "libxml_use_internal_errors") (lzf "lzf_compress" "lzf_decompress" "lzf_optimized_for") (mailparse "mailparse_determine_best_xfer_encoding" "mailparse_msg_create" "mailparse_msg_extract_part" "mailparse_msg_extract_part_file" "mailparse_msg_extract_whole_part_file" "mailparse_msg_free" "mailparse_msg_get_part" "mailparse_msg_get_part_data" "mailparse_msg_get_structure" "mailparse_msg_parse" "mailparse_msg_parse_file" "mailparse_rfc822_parse_addresses" "mailparse_stream_encode" "mailparse_uudecode_all") (mbstring "mb_check_encoding" "mb_chr" "mb_convert_case" "mb_convert_encoding" "mb_convert_kana" "mb_convert_variables" "mb_decode_mimeheader" "mb_decode_numericentity" "mb_detect_encoding" "mb_detect_order" "mb_encode_mimeheader" "mb_encode_numericentity" "mb_encoding_aliases" "mb_ereg" "mb_ereg_match" "mb_ereg_replace" "mb_ereg_replace_callback" "mb_ereg_search" "mb_ereg_search_getpos" "mb_ereg_search_getregs" "mb_ereg_search_init" "mb_ereg_search_pos" "mb_ereg_search_regs" "mb_ereg_search_setpos" "mb_eregi" "mb_eregi_replace" "mb_get_info" "mb_http_input" "mb_http_output" "mb_internal_encoding" "mb_language" "mb_list_encodings" "mb_ord" "mb_output_handler" "mb_parse_str" "mb_preferred_mime_name" "mb_regex_encoding" "mb_regex_set_options" "mb_scrub" "mb_send_mail" "mb_split" "mb_str_split" "mb_strcut" "mb_strimwidth" "mb_stripos" "mb_stristr" "mb_strlen" "mb_strpos" "mb_strrchr" "mb_strrichr" "mb_strripos" "mb_strrpos" "mb_strstr" "mb_strtolower" "mb_strtoupper" "mb_strwidth" "mb_substitute_character" "mb_substr" "mb_substr_count") (memcache "memcache_debug") (mongodb "MongoDB\\BSON\\fromJSON" "MongoDB\\BSON\\fromPHP" "MongoDB\\BSON\\toCanonicalExtendedJSON" "MongoDB\\BSON\\toJSON" "MongoDB\\BSON\\toPHP" "MongoDB\\BSON\\toRelaxedExtendedJSON" "MongoDB\\Driver\\Monitoring\\addSubscriber" "MongoDB\\Driver\\Monitoring\\removeSubscriber") (mqseries "mqseries_back" "mqseries_begin" "mqseries_close" "mqseries_cmit" "mqseries_conn" "mqseries_connx" "mqseries_disc" "mqseries_get" "mqseries_inq" "mqseries_open" "mqseries_put" "mqseries_put1" "mqseries_set" "mqseries_strerror") (mysql-obsolete "expression" "getSession" "mysql_affected_rows" "mysql_client_encoding" "mysql_close" "mysql_connect" "mysql_create_db" "mysql_data_seek" "mysql_db_name" "mysql_db_query" "mysql_drop_db" "mysql_errno" "mysql_error" "mysql_escape_string" "mysql_fetch_array" "mysql_fetch_assoc" "mysql_fetch_field" "mysql_fetch_lengths" "mysql_fetch_object" "mysql_fetch_row" "mysql_field_flags" "mysql_field_len" "mysql_field_name" "mysql_field_seek" "mysql_field_table" "mysql_field_type" "mysql_free_result" "mysql_get_client_info" "mysql_get_host_info" "mysql_get_proto_info" "mysql_get_server_info" "mysql_info" "mysql_insert_id" "mysql_list_dbs" "mysql_list_fields" "mysql_list_processes" "mysql_list_tables" "mysql_num_fields" "mysql_num_rows" "mysql_pconnect" "mysql_ping" "mysql_query" "mysql_real_escape_string" "mysql_result" "mysql_select_db" "mysql_set_charset" "mysql_stat" "mysql_tablename" "mysql_thread_id" "mysql_unbuffered_query") (mysqli "mysqli_affected_rows" "mysqli_autocommit" "mysqli_begin_transaction" "mysqli_change_user" "mysqli_character_set_name" "mysqli_close" "mysqli_commit" "mysqli_connect" "mysqli_connect_errno" "mysqli_connect_error" "mysqli_data_seek" "mysqli_debug" "mysqli_dump_debug_info" "mysqli_embedded_server_end" "mysqli_embedded_server_start" "mysqli_errno" "mysqli_error" "mysqli_error_list" "mysqli_escape_string" "mysqli_execute" "mysqli_fetch_all" "mysqli_fetch_array" "mysqli_fetch_assoc" "mysqli_fetch_column" "mysqli_fetch_field" "mysqli_fetch_field_direct" "mysqli_fetch_fields" "mysqli_fetch_lengths" "mysqli_fetch_object" "mysqli_fetch_row" "mysqli_field_count" "mysqli_field_seek" "mysqli_field_tell" "mysqli_free_result" "mysqli_get_charset" "mysqli_get_client_info" "mysqli_get_client_stats" "mysqli_get_client_version" "mysqli_get_connection_stats" "mysqli_get_host_info" "mysqli_get_links_stats" "mysqli_get_proto_info" "mysqli_get_server_info" "mysqli_get_server_version" "mysqli_get_warnings" "mysqli_info" "mysqli_init" "mysqli_insert_id" "mysqli_kill" "mysqli_more_results" "mysqli_multi_query" "mysqli_next_result" "mysqli_num_fields" "mysqli_num_rows" "mysqli_options" "mysqli_ping" "mysqli_poll" "mysqli_prepare" "mysqli_query" "mysqli_real_connect" "mysqli_real_escape_string" "mysqli_real_query" "mysqli_reap_async_query" "mysqli_refresh" "mysqli_release_savepoint" "mysqli_report" "mysqli_rollback" "mysqli_savepoint" "mysqli_select_db" "mysqli_set_charset" "mysqli_set_opt" "mysqli_sqlstate" "mysqli_ssl_set" "mysqli_stat" "mysqli_stmt_affected_rows" "mysqli_stmt_attr_get" "mysqli_stmt_attr_set" "mysqli_stmt_bind_param" "mysqli_stmt_bind_result" "mysqli_stmt_close" "mysqli_stmt_data_seek" "mysqli_stmt_errno" "mysqli_stmt_error" "mysqli_stmt_error_list" "mysqli_stmt_execute" "mysqli_stmt_fetch" "mysqli_stmt_field_count" "mysqli_stmt_free_result" "mysqli_stmt_get_result" "mysqli_stmt_get_warnings" "mysqli_stmt_init" "mysqli_stmt_insert_id" "mysqli_stmt_more_results" "mysqli_stmt_next_result" "mysqli_stmt_num_rows" "mysqli_stmt_param_count" "mysqli_stmt_prepare" "mysqli_stmt_reset" "mysqli_stmt_result_metadata" "mysqli_stmt_send_long_data" "mysqli_stmt_sqlstate" "mysqli_stmt_store_result" "mysqli_store_result" "mysqli_thread_id" "mysqli_thread_safe" "mysqli_use_result" "mysqli_warning_count") (oauth "oauth_get_sbs" "oauth_urlencode") (obsolete_7 "__autoload" "end" "ezmlm_hash" "is_real" "jpeg2wbmp" "mcrypt_create_iv" "mcrypt_decrypt" "mcrypt_enc_get_algorithms_name" "mcrypt_enc_get_block_size" "mcrypt_enc_get_iv_size" "mcrypt_enc_get_key_size" "mcrypt_enc_get_modes_name" "mcrypt_enc_get_supported_key_sizes" "mcrypt_enc_is_block_algorithm" "mcrypt_enc_is_block_algorithm_mode" "mcrypt_enc_is_block_mode" "mcrypt_enc_self_test" "mcrypt_encrypt" "mcrypt_generic" "mcrypt_generic_deinit" "mcrypt_generic_init" "mcrypt_get_block_size" "mcrypt_get_cipher_name" "mcrypt_get_iv_size" "mcrypt_get_key_size" "mcrypt_list_algorithms" "mcrypt_list_modes" "mcrypt_module_close" "mcrypt_module_get_algo_block_size" "mcrypt_module_get_algo_key_size" "mcrypt_module_get_supported_key_sizes" "mcrypt_module_is_block_algorithm" "mcrypt_module_is_block_algorithm_mode" "mcrypt_module_is_block_mode" "mcrypt_module_open" "mcrypt_module_self_test" "mdecrypt_generic" "png2wbmp" "wddx_add_vars" "wddx_deserialize" "wddx_packet_end" "wddx_packet_start" "wddx_serialize_value" "wddx_serialize_vars") (obsolete_8 "mhash" "mhash_count" "mhash_get_block_size" "mhash_get_hash_name" "mhash_keygen_s2k" "utf8_decode" "utf8_encode" "zip_close" "zip_entry_close" "zip_entry_compressedsize" "zip_entry_compressionmethod" "zip_entry_filesize" "zip_entry_name" "zip_entry_open" "zip_entry_read" "zip_open" "zip_read") (oci8 "oci_bind_array_by_name" "oci_bind_by_name" "oci_cancel" "oci_client_version" "oci_close" "oci_commit" "oci_connect" "oci_define_by_name" "oci_error" "oci_execute" "oci_fetch" "oci_fetch_all" "oci_fetch_array" "oci_fetch_assoc" "oci_fetch_object" "oci_fetch_row" "oci_field_is_null" "oci_field_name" "oci_field_precision" "oci_field_scale" "oci_field_size" "oci_field_type" "oci_field_type_raw" "oci_free_descriptor" "oci_free_statement" "oci_get_implicit_resultset" "oci_internal_debug" "oci_lob_copy" "oci_lob_is_equal" "oci_new_collection" "oci_new_connect" "oci_new_cursor" "oci_new_descriptor" "oci_num_fields" "oci_num_rows" "oci_parse" "oci_password_change" "oci_pconnect" "oci_register_taf_callback" "oci_result" "oci_rollback" "oci_server_version" "oci_set_action" "oci_set_call_timeout" "oci_set_client_identifier" "oci_set_client_info" "oci_set_db_operation" "oci_set_edition" "oci_set_module_name" "oci_set_prefetch" "oci_set_prefetch_lob" "oci_statement_type" "oci_unregister_taf_callback" "ocibindbyname" "ocicancel" "ocicloselob" "ocicollappend" "ocicollassign" "ocicollassignelem" "ocicollgetelem" "ocicollmax" "ocicollsize" "ocicolltrim" "ocicolumnisnull" "ocicolumnname" "ocicolumnprecision" "ocicolumnscale" "ocicolumnsize" "ocicolumntype" "ocicolumntyperaw" "ocicommit" "ocidefinebyname" "ocierror" "ociexecute" "ocifetch" "ocifetchinto" "ocifetchstatement" "ocifreecollection" "ocifreecursor" "ocifreedesc" "ocifreestatement" "ociinternaldebug" "ociloadlob" "ocilogoff" "ocilogon" "ocinewcollection" "ocinewcursor" "ocinewdescriptor" "ocinlogon" "ocinumcols" "ociparse" "ociplogon" "ociresult" "ocirollback" "ocirowcount" "ocisavelob" "ocisavelobfile" "ociserverversion" "ocisetprefetch" "ocistatementtype" "ociwritelobtofile" "ociwritetemporarylob") (odbc "odbc_autocommit" "odbc_binmode" "odbc_close" "odbc_close_all" "odbc_columnprivileges" "odbc_columns" "odbc_commit" "odbc_connect" "odbc_cursor" "odbc_data_source" "odbc_do" "odbc_error" "odbc_errormsg" "odbc_exec" "odbc_execute" "odbc_fetch_array" "odbc_fetch_into" "odbc_fetch_object" "odbc_fetch_row" "odbc_field_len" "odbc_field_name" "odbc_field_num" "odbc_field_precision" "odbc_field_scale" "odbc_field_type" "odbc_foreignkeys" "odbc_free_result" "odbc_gettypeinfo" "odbc_longreadlen" "odbc_next_result" "odbc_num_fields" "odbc_num_rows" "odbc_pconnect" "odbc_prepare" "odbc_primarykeys" "odbc_procedurecolumns" "odbc_procedures" "odbc_result" "odbc_result_all" "odbc_rollback" "odbc_setoption" "odbc_specialcolumns" "odbc_statistics" "odbc_tableprivileges" "odbc_tables") (openal "openal_buffer_create" "openal_buffer_data" "openal_buffer_destroy" "openal_buffer_get" "openal_buffer_loadwav" "openal_context_create" "openal_context_current" "openal_context_destroy" "openal_context_process" "openal_context_suspend" "openal_device_close" "openal_device_open" "openal_listener_get" "openal_listener_set" "openal_source_create" "openal_source_destroy" "openal_source_get" "openal_source_pause" "openal_source_play" "openal_source_rewind" "openal_source_set" "openal_source_stop" "openal_stream") (openssl "openssl_cipher_iv_length" "openssl_cms_decrypt" "openssl_cms_encrypt" "openssl_cms_read" "openssl_cms_sign" "openssl_cms_verify" "openssl_csr_export" "openssl_csr_export_to_file" "openssl_csr_get_public_key" "openssl_csr_get_subject" "openssl_csr_new" "openssl_csr_sign" "openssl_decrypt" "openssl_dh_compute_key" "openssl_digest" "openssl_encrypt" "openssl_error_string" "openssl_free_key" "openssl_get_cert_locations" "openssl_get_cipher_methods" "openssl_get_curve_names" "openssl_get_md_methods" "openssl_get_privatekey" "openssl_get_publickey" "openssl_open" "openssl_pbkdf2" "openssl_pkcs12_export" "openssl_pkcs12_export_to_file" "openssl_pkcs12_read" "openssl_pkcs7_decrypt" "openssl_pkcs7_encrypt" "openssl_pkcs7_read" "openssl_pkcs7_sign" "openssl_pkcs7_verify" "openssl_pkey_derive" "openssl_pkey_export" "openssl_pkey_export_to_file" "openssl_pkey_free" "openssl_pkey_get_details" "openssl_pkey_get_private" "openssl_pkey_get_public" "openssl_pkey_new" "openssl_private_decrypt" "openssl_private_encrypt" "openssl_public_decrypt" "openssl_public_encrypt" "openssl_random_pseudo_bytes" "openssl_seal" "openssl_sign" "openssl_spki_export" "openssl_spki_export_challenge" "openssl_spki_new" "openssl_spki_verify" "openssl_verify" "openssl_x509_check_private_key" "openssl_x509_checkpurpose" "openssl_x509_export" "openssl_x509_export_to_file" "openssl_x509_fingerprint" "openssl_x509_free" "openssl_x509_parse" "openssl_x509_read" "openssl_x509_verify") (parallel "parallel\\bootstrap" "parallel\\run") (pcntl "pcntl_alarm" "pcntl_async_signals" "pcntl_errno" "pcntl_exec" "pcntl_fork" "pcntl_get_last_error" "pcntl_getpriority" "pcntl_rfork" "pcntl_setpriority" "pcntl_signal" "pcntl_signal_dispatch" "pcntl_signal_get_handler" "pcntl_sigprocmask" "pcntl_sigtimedwait" "pcntl_sigwaitinfo" "pcntl_strerror" "pcntl_unshare" "pcntl_wait" "pcntl_waitpid" "pcntl_wexitstatus" "pcntl_wifexited" "pcntl_wifsignaled" "pcntl_wifstopped" "pcntl_wstopsig" "pcntl_wtermsig") (pgsql "pg_affected_rows" "pg_cancel_query" "pg_client_encoding" "pg_close" "pg_connect" "pg_connect_poll" "pg_connection_busy" "pg_connection_reset" "pg_connection_status" "pg_consume_input" "pg_convert" "pg_copy_from" "pg_copy_to" "pg_dbname" "pg_delete" "pg_end_copy" "pg_escape_bytea" "pg_escape_identifier" "pg_escape_literal" "pg_escape_string" "pg_execute" "pg_fetch_all" "pg_fetch_all_columns" "pg_fetch_array" "pg_fetch_assoc" "pg_fetch_object" "pg_fetch_result" "pg_fetch_row" "pg_field_is_null" "pg_field_name" "pg_field_num" "pg_field_prtlen" "pg_field_size" "pg_field_table" "pg_field_type" "pg_field_type_oid" "pg_flush" "pg_free_result" "pg_get_notify" "pg_get_pid" "pg_get_result" "pg_host" "pg_insert" "pg_last_error" "pg_last_notice" "pg_last_oid" "pg_lo_close" "pg_lo_create" "pg_lo_export" "pg_lo_import" "pg_lo_open" "pg_lo_read" "pg_lo_read_all" "pg_lo_seek" "pg_lo_tell" "pg_lo_truncate" "pg_lo_unlink" "pg_lo_write" "pg_meta_data" "pg_num_fields" "pg_num_rows" "pg_options" "pg_parameter_status" "pg_pconnect" "pg_ping" "pg_port" "pg_prepare" "pg_put_line" "pg_query" "pg_query_params" "pg_result_error" "pg_result_error_field" "pg_result_seek" "pg_result_status" "pg_select" "pg_send_execute" "pg_send_prepare" "pg_send_query" "pg_send_query_params" "pg_set_client_encoding" "pg_set_error_verbosity" "pg_socket" "pg_trace" "pg_transaction_status" "pg_tty" "pg_unescape_bytea" "pg_untrace" "pg_update" "pg_version") (posix "posix_access" "posix_ctermid" "posix_errno" "posix_get_last_error" "posix_getcwd" "posix_getegid" "posix_geteuid" "posix_getgid" "posix_getgrgid" "posix_getgrnam" "posix_getgroups" "posix_getlogin" "posix_getpgid" "posix_getpgrp" "posix_getpid" "posix_getppid" "posix_getpwnam" "posix_getpwuid" "posix_getrlimit" "posix_getsid" "posix_getuid" "posix_initgroups" "posix_isatty" "posix_kill" "posix_mkfifo" "posix_mknod" "posix_setegid" "posix_seteuid" "posix_setgid" "posix_setpgid" "posix_setrlimit" "posix_setsid" "posix_setuid" "posix_strerror" "posix_times" "posix_ttyname" "posix_uname") (ps "ps_add_bookmark" "ps_add_launchlink" "ps_add_locallink" "ps_add_note" "ps_add_pdflink" "ps_add_weblink" "ps_arc" "ps_arcn" "ps_begin_page" "ps_begin_pattern" "ps_begin_template" "ps_circle" "ps_clip" "ps_close" "ps_close_image" "ps_closepath" "ps_closepath_stroke" "ps_continue_text" "ps_curveto" "ps_delete" "ps_end_page" "ps_end_pattern" "ps_end_template" "ps_fill" "ps_fill_stroke" "ps_findfont" "ps_get_buffer" "ps_get_parameter" "ps_get_value" "ps_hyphenate" "ps_include_file" "ps_lineto" "ps_makespotcolor" "ps_moveto" "ps_new" "ps_open_file" "ps_open_image" "ps_open_image_file" "ps_open_memory_image" "ps_place_image" "ps_rect" "ps_restore" "ps_rotate" "ps_save" "ps_scale" "ps_set_border_color" "ps_set_border_dash" "ps_set_border_style" "ps_set_info" "ps_set_parameter" "ps_set_text_pos" "ps_set_value" "ps_setcolor" "ps_setdash" "ps_setflat" "ps_setfont" "ps_setgray" "ps_setlinecap" "ps_setlinejoin" "ps_setlinewidth" "ps_setmiterlimit" "ps_setoverprintmode" "ps_setpolydash" "ps_shading" "ps_shading_pattern" "ps_shfill" "ps_show" "ps_show2" "ps_show_boxed" "ps_show_xy" "ps_show_xy2" "ps_string_geometry" "ps_stringwidth" "ps_stroke" "ps_symbol" "ps_symbol_name" "ps_symbol_width" "ps_translate") (pspell "pspell_add_to_personal" "pspell_add_to_session" "pspell_check" "pspell_clear_session" "pspell_config_create" "pspell_config_data_dir" "pspell_config_dict_dir" "pspell_config_ignore" "pspell_config_mode" "pspell_config_personal" "pspell_config_repl" "pspell_config_runtogether" "pspell_config_save_repl" "pspell_new" "pspell_new_config" "pspell_new_personal" "pspell_save_wordlist" "pspell_store_replacement" "pspell_suggest") (radius "radius_acct_open" "radius_add_server" "radius_auth_open" "radius_close" "radius_config" "radius_create_request" "radius_cvt_addr" "radius_cvt_int" "radius_cvt_string" "radius_demangle" "radius_demangle_mppe_key" "radius_get_attr" "radius_get_tagged_attr_data" "radius_get_tagged_attr_tag" "radius_get_vendor_attr" "radius_put_addr" "radius_put_attr" "radius_put_int" "radius_put_string" "radius_put_vendor_addr" "radius_put_vendor_attr" "radius_put_vendor_int" "radius_put_vendor_string" "radius_request_authenticator" "radius_salt_encrypt_attr" "radius_send_request" "radius_server_secret" "radius_strerror") (rar "rar_broken_is" "rar_close" "rar_comment_get" "rar_entry_get" "rar_list" "rar_open" "rar_solid_is" "rar_wrapper_cache_stats") (readline "readline" "readline_add_history" "readline_callback_handler_install" "readline_callback_handler_remove" "readline_callback_read_char" "readline_clear_history" "readline_completion_function" "readline_info" "readline_list_history" "readline_on_new_line" "readline_read_history" "readline_redisplay" "readline_write_history") (recode "recode" "recode_file" "recode_string") (rpminfo "rpmaddtag" "rpmdbinfo" "rpmdbsearch" "rpminfo" "rpmvercmp") (rrd "rrd_create" "rrd_error" "rrd_fetch" "rrd_first" "rrd_graph" "rrd_info" "rrd_last" "rrd_lastupdate" "rrd_restore" "rrd_tune" "rrd_update" "rrd_version" "rrd_xport" "rrdc_disconnect") (runkit7 "runkit7_constant_add" "runkit7_constant_redefine" "runkit7_constant_remove" "runkit7_function_add" "runkit7_function_copy" "runkit7_function_redefine" "runkit7_function_remove" "runkit7_function_rename" "runkit7_import" "runkit7_method_add" "runkit7_method_copy" "runkit7_method_redefine" "runkit7_method_remove" "runkit7_method_rename" "runkit7_object_id" "runkit7_superglobals" "runkit7_zval_inspect") (scoutapm "scoutapm_get_calls" "scoutapm_list_instrumented_functions") (shmop "shmop_close" "shmop_delete" "shmop_open" "shmop_read" "shmop_size" "shmop_write") (simplexml "dom_import_simplexml" "simplexml_import_dom" "simplexml_load_file" "simplexml_load_string") (smnp "snmp2_get" "snmp2_getnext" "snmp2_real_walk" "snmp2_set" "snmp2_walk" "snmp3_get" "snmp3_getnext" "snmp3_real_walk" "snmp3_set" "snmp3_walk" "snmp_get_quick_print" "snmp_get_valueretrieval" "snmp_read_mib" "snmp_set_enum_print" "snmp_set_oid_numeric_print" "snmp_set_oid_output_format" "snmp_set_quick_print" "snmp_set_valueretrieval" "snmpget" "snmpgetnext" "snmprealwalk" "snmpset" "snmpwalk" "snmpwalkoid") (soap "is_soap_fault" "use_soap_error_handler") (socket "socket_accept" "socket_addrinfo_bind" "socket_addrinfo_connect" "socket_addrinfo_explain" "socket_addrinfo_lookup" "socket_bind" "socket_clear_error" "socket_close" "socket_cmsg_space" "socket_connect" "socket_create" "socket_create_listen" "socket_create_pair" "socket_export_stream" "socket_get_option" "socket_get_status" "socket_getopt" "socket_getpeername" "socket_getsockname" "socket_import_stream" "socket_last_error" "socket_listen" "socket_read" "socket_recv" "socket_recvfrom" "socket_recvmsg" "socket_select" "socket_send" "socket_sendmsg" "socket_sendto" "socket_set_block" "socket_set_blocking" "socket_set_nonblock" "socket_set_option" "socket_set_timeout" "socket_setopt" "socket_shutdown" "socket_strerror" "socket_write" "socket_wsaprotocol_info_export" "socket_wsaprotocol_info_import" "socket_wsaprotocol_info_release") (sodium "sodium_add" "sodium_base642bin" "sodium_bin2base64" "sodium_bin2hex" "sodium_compare" "sodium_crypto_aead_aes256gcm_decrypt" "sodium_crypto_aead_aes256gcm_encrypt" "sodium_crypto_aead_aes256gcm_is_available" "sodium_crypto_aead_aes256gcm_keygen" "sodium_crypto_aead_chacha20poly1305_decrypt" "sodium_crypto_aead_chacha20poly1305_encrypt" "sodium_crypto_aead_chacha20poly1305_ietf_decrypt" "sodium_crypto_aead_chacha20poly1305_ietf_encrypt" "sodium_crypto_aead_chacha20poly1305_ietf_keygen" "sodium_crypto_aead_chacha20poly1305_keygen" "sodium_crypto_aead_xchacha20poly1305_ietf_decrypt" "sodium_crypto_aead_xchacha20poly1305_ietf_encrypt" "sodium_crypto_aead_xchacha20poly1305_ietf_keygen" "sodium_crypto_auth" "sodium_crypto_auth_keygen" "sodium_crypto_auth_verify" "sodium_crypto_box" "sodium_crypto_box_keypair" "sodium_crypto_box_keypair_from_secretkey_and_publickey" "sodium_crypto_box_open" "sodium_crypto_box_publickey" "sodium_crypto_box_publickey_from_secretkey" "sodium_crypto_box_seal" "sodium_crypto_box_seal_open" "sodium_crypto_box_secretkey" "sodium_crypto_box_seed_keypair" "sodium_crypto_core_ristretto255_add" "sodium_crypto_core_ristretto255_from_hash" "sodium_crypto_core_ristretto255_is_valid_point" "sodium_crypto_core_ristretto255_random" "sodium_crypto_core_ristretto255_scalar_add" "sodium_crypto_core_ristretto255_scalar_complement" "sodium_crypto_core_ristretto255_scalar_invert" "sodium_crypto_core_ristretto255_scalar_mul" "sodium_crypto_core_ristretto255_scalar_negate" "sodium_crypto_core_ristretto255_scalar_random" "sodium_crypto_core_ristretto255_scalar_reduce" "sodium_crypto_core_ristretto255_scalar_sub" "sodium_crypto_core_ristretto255_sub" "sodium_crypto_generichash" "sodium_crypto_generichash_final" "sodium_crypto_generichash_init" "sodium_crypto_generichash_keygen" "sodium_crypto_generichash_update" "sodium_crypto_kdf_derive_from_key" "sodium_crypto_kdf_keygen" "sodium_crypto_kx_client_session_keys" "sodium_crypto_kx_keypair" "sodium_crypto_kx_publickey" "sodium_crypto_kx_secretkey" "sodium_crypto_kx_seed_keypair" "sodium_crypto_kx_server_session_keys" "sodium_crypto_pwhash" "sodium_crypto_pwhash_scryptsalsa208sha256" "sodium_crypto_pwhash_scryptsalsa208sha256_str" "sodium_crypto_pwhash_scryptsalsa208sha256_str_verify" "sodium_crypto_pwhash_str" "sodium_crypto_pwhash_str_needs_rehash" "sodium_crypto_pwhash_str_verify" "sodium_crypto_scalarmult" "sodium_crypto_scalarmult_base" "sodium_crypto_scalarmult_ristretto255" "sodium_crypto_scalarmult_ristretto255_base" "sodium_crypto_secretbox" "sodium_crypto_secretbox_keygen" "sodium_crypto_secretbox_open" "sodium_crypto_secretstream_xchacha20poly1305_init_pull" "sodium_crypto_secretstream_xchacha20poly1305_init_push" "sodium_crypto_secretstream_xchacha20poly1305_keygen" "sodium_crypto_secretstream_xchacha20poly1305_pull" "sodium_crypto_secretstream_xchacha20poly1305_push" "sodium_crypto_secretstream_xchacha20poly1305_rekey" "sodium_crypto_shorthash" "sodium_crypto_shorthash_keygen" "sodium_crypto_sign" "sodium_crypto_sign_detached" "sodium_crypto_sign_ed25519_pk_to_curve25519" "sodium_crypto_sign_ed25519_sk_to_curve25519" "sodium_crypto_sign_keypair" "sodium_crypto_sign_keypair_from_secretkey_and_publickey" "sodium_crypto_sign_open" "sodium_crypto_sign_publickey" "sodium_crypto_sign_publickey_from_secretkey" "sodium_crypto_sign_secretkey" "sodium_crypto_sign_seed_keypair" "sodium_crypto_sign_verify_detached" "sodium_crypto_stream" "sodium_crypto_stream_keygen" "sodium_crypto_stream_xchacha20" "sodium_crypto_stream_xchacha20_keygen" "sodium_crypto_stream_xchacha20_xor" "sodium_crypto_stream_xchacha20_xor_ic" "sodium_crypto_stream_xor" "sodium_hex2bin" "sodium_increment" "sodium_memcmp" "sodium_memzero" "sodium_pad" "sodium_unpad") (solr "solr_get_version") (sqlsrv "sqlsrv_begin_transaction" "sqlsrv_cancel" "sqlsrv_client_info" "sqlsrv_close" "sqlsrv_commit" "sqlsrv_configure" "sqlsrv_connect" "sqlsrv_errors" "sqlsrv_execute" "sqlsrv_fetch" "sqlsrv_fetch_array" "sqlsrv_fetch_object" "sqlsrv_field_metadata" "sqlsrv_free_stmt" "sqlsrv_get_config" "sqlsrv_get_field" "sqlsrv_has_rows" "sqlsrv_next_result" "sqlsrv_num_fields" "sqlsrv_num_rows" "sqlsrv_prepare" "sqlsrv_query" "sqlsrv_rollback" "sqlsrv_rows_affected" "sqlsrv_send_stream_data" "sqlsrv_server_info") (ssdeep "ssdeep_fuzzy_compare" "ssdeep_fuzzy_hash" "ssdeep_fuzzy_hash_filename") (ssh2 "ssh2_auth_agent" "ssh2_auth_hostbased_file" "ssh2_auth_none" "ssh2_auth_password" "ssh2_auth_pubkey_file" "ssh2_connect" "ssh2_disconnect" "ssh2_exec" "ssh2_fetch_stream" "ssh2_fingerprint" "ssh2_forward_accept" "ssh2_forward_listen" "ssh2_methods_negotiated" "ssh2_poll" "ssh2_publickey_add" "ssh2_publickey_init" "ssh2_publickey_list" "ssh2_publickey_remove" "ssh2_scp_recv" "ssh2_scp_send" "ssh2_send_eof" "ssh2_sftp" "ssh2_sftp_chmod" "ssh2_sftp_lstat" "ssh2_sftp_mkdir" "ssh2_sftp_readlink" "ssh2_sftp_realpath" "ssh2_sftp_rename" "ssh2_sftp_rmdir" "ssh2_sftp_stat" "ssh2_sftp_symlink" "ssh2_sftp_unlink" "ssh2_shell" "ssh2_tunnel") (stats "stats_absolute_deviation" "stats_cdf_beta" "stats_cdf_binomial" "stats_cdf_cauchy" "stats_cdf_chisquare" "stats_cdf_exponential" "stats_cdf_f" "stats_cdf_gamma" "stats_cdf_laplace" "stats_cdf_logistic" "stats_cdf_negative_binomial" "stats_cdf_noncentral_chisquare" "stats_cdf_noncentral_f" "stats_cdf_noncentral_t" "stats_cdf_normal" "stats_cdf_poisson" "stats_cdf_t" "stats_cdf_uniform" "stats_cdf_weibull" "stats_covariance" "stats_dens_beta" "stats_dens_cauchy" "stats_dens_chisquare" "stats_dens_exponential" "stats_dens_f" "stats_dens_gamma" "stats_dens_laplace" "stats_dens_logistic" "stats_dens_normal" "stats_dens_pmf_binomial" "stats_dens_pmf_hypergeometric" "stats_dens_pmf_negative_binomial" "stats_dens_pmf_poisson" "stats_dens_t" "stats_dens_uniform" "stats_dens_weibull" "stats_harmonic_mean" "stats_kurtosis" "stats_rand_gen_beta" "stats_rand_gen_chisquare" "stats_rand_gen_exponential" "stats_rand_gen_f" "stats_rand_gen_funiform" "stats_rand_gen_gamma" "stats_rand_gen_ibinomial" "stats_rand_gen_ibinomial_negative" "stats_rand_gen_int" "stats_rand_gen_ipoisson" "stats_rand_gen_iuniform" "stats_rand_gen_noncentral_chisquare" "stats_rand_gen_noncentral_f" "stats_rand_gen_noncentral_t" "stats_rand_gen_normal" "stats_rand_gen_t" "stats_rand_get_seeds" "stats_rand_phrase_to_seeds" "stats_rand_ranf" "stats_rand_setall" "stats_skew" "stats_standard_deviation" "stats_stat_binomial_coef" "stats_stat_correlation" "stats_stat_factorial" "stats_stat_independent_t" "stats_stat_innerproduct" "stats_stat_paired_t" "stats_stat_percentile" "stats_stat_powersum" "stats_variance") (stomp "stomp_abort" "stomp_ack" "stomp_begin" "stomp_close" "stomp_commit" "stomp_connect" "stomp_connect_error" "stomp_error" "stomp_get_read_timeout" "stomp_get_session_id" "stomp_has_frame" "stomp_read_frame" "stomp_send" "stomp_set_read_timeout" "stomp_subscribe" "stomp_unsubscribe" "stomp_version") (svn "svn_add" "svn_auth_get_parameter" "svn_auth_set_parameter" "svn_blame" "svn_cat" "svn_checkout" "svn_cleanup" "svn_client_version" "svn_commit" "svn_delete" "svn_diff" "svn_export" "svn_fs_abort_txn" "svn_fs_apply_text" "svn_fs_begin_txn2" "svn_fs_change_node_prop" "svn_fs_check_path" "svn_fs_contents_changed" "svn_fs_copy" "svn_fs_delete" "svn_fs_dir_entries" "svn_fs_file_contents" "svn_fs_file_length" "svn_fs_is_dir" "svn_fs_is_file" "svn_fs_make_dir" "svn_fs_make_file" "svn_fs_node_created_rev" "svn_fs_node_prop" "svn_fs_props_changed" "svn_fs_revision_prop" "svn_fs_revision_root" "svn_fs_txn_root" "svn_fs_youngest_rev" "svn_import" "svn_log" "svn_ls" "svn_mkdir" "svn_repos_create" "svn_repos_fs" "svn_repos_fs_begin_txn_for_commit" "svn_repos_fs_commit_txn" "svn_repos_hotcopy" "svn_repos_open" "svn_repos_recover" "svn_revert" "svn_status" "svn_update") (swoole "swoole_async_dns_lookup" "swoole_async_read" "swoole_async_readfile" "swoole_async_set" "swoole_async_write" "swoole_async_writefile" "swoole_clear_error" "swoole_client_select" "swoole_cpu_num" "swoole_errno" "swoole_error_log" "swoole_event_add" "swoole_event_defer" "swoole_event_del" "swoole_event_exit" "swoole_event_set" "swoole_event_wait" "swoole_event_write" "swoole_get_local_ip" "swoole_last_error" "swoole_load_module" "swoole_select" "swoole_set_process_name" "swoole_strerror" "swoole_timer_after" "swoole_timer_clear" "swoole_timer_exists" "swoole_timer_tick" "swoole_version") (sysvshm "ftok" "msg_get_queue" "msg_queue_exists" "msg_receive" "msg_remove_queue" "msg_send" "msg_set_queue" "msg_stat_queue" "sem_acquire" "sem_get" "sem_release" "sem_remove" "shm_attach" "shm_detach" "shm_get_var" "shm_has_var" "shm_put_var" "shm_remove" "shm_remove_var") (taint "is_tainted" "taint" "untaint") (tcpwrap "tcpwrap_check") (tidy "tidy_access_count" "tidy_clean_repair" "tidy_config_count" "tidy_diagnose" "tidy_error_count" "tidy_get_body" "tidy_get_config" "tidy_get_error_buffer" "tidy_get_head" "tidy_get_html" "tidy_get_html_ver" "tidy_get_opt_doc" "tidy_get_output" "tidy_get_release" "tidy_get_root" "tidy_get_status" "tidy_getopt" "tidy_is_xhtml" "tidy_is_xml" "tidy_parse_file" "tidy_parse_string" "tidy_repair_file" "tidy_repair_string" "tidy_warning_count") (trader "trader_acos" "trader_ad" "trader_add" "trader_adosc" "trader_adx" "trader_adxr" "trader_apo" "trader_aroon" "trader_aroonosc" "trader_asin" "trader_atan" "trader_atr" "trader_avgprice" "trader_bbands" "trader_beta" "trader_bop" "trader_cci" "trader_cdl2crows" "trader_cdl3blackcrows" "trader_cdl3inside" "trader_cdl3linestrike" "trader_cdl3outside" "trader_cdl3starsinsouth" "trader_cdl3whitesoldiers" "trader_cdlabandonedbaby" "trader_cdladvanceblock" "trader_cdlbelthold" "trader_cdlbreakaway" "trader_cdlclosingmarubozu" "trader_cdlconcealbabyswall" "trader_cdlcounterattack" "trader_cdldarkcloudcover" "trader_cdldoji" "trader_cdldojistar" "trader_cdldragonflydoji" "trader_cdlengulfing" "trader_cdleveningdojistar" "trader_cdleveningstar" "trader_cdlgapsidesidewhite" "trader_cdlgravestonedoji" "trader_cdlhammer" "trader_cdlhangingman" "trader_cdlharami" "trader_cdlharamicross" "trader_cdlhighwave" "trader_cdlhikkake" "trader_cdlhikkakemod" "trader_cdlhomingpigeon" "trader_cdlidentical3crows" "trader_cdlinneck" "trader_cdlinvertedhammer" "trader_cdlkicking" "trader_cdlkickingbylength" "trader_cdlladderbottom" "trader_cdllongleggeddoji" "trader_cdllongline" "trader_cdlmarubozu" "trader_cdlmatchinglow" "trader_cdlmathold" "trader_cdlmorningdojistar" "trader_cdlmorningstar" "trader_cdlonneck" "trader_cdlpiercing" "trader_cdlrickshawman" "trader_cdlrisefall3methods" "trader_cdlseparatinglines" "trader_cdlshootingstar" "trader_cdlshortline" "trader_cdlspinningtop" "trader_cdlstalledpattern" "trader_cdlsticksandwich" "trader_cdltakuri" "trader_cdltasukigap" "trader_cdlthrusting" "trader_cdltristar" "trader_cdlunique3river" "trader_cdlupsidegap2crows" "trader_cdlxsidegap3methods" "trader_ceil" "trader_cmo" "trader_correl" "trader_cos" "trader_cosh" "trader_dema" "trader_div" "trader_dx" "trader_ema" "trader_errno" "trader_exp" "trader_floor" "trader_get_compat" "trader_get_unstable_period" "trader_ht_dcperiod" "trader_ht_dcphase" "trader_ht_phasor" "trader_ht_sine" "trader_ht_trendline" "trader_ht_trendmode" "trader_kama" "trader_linearreg" "trader_linearreg_angle" "trader_linearreg_intercept" "trader_linearreg_slope" "trader_ln" "trader_log10" "trader_ma" "trader_macd" "trader_macdext" "trader_macdfix" "trader_mama" "trader_mavp" "trader_max" "trader_maxindex" "trader_medprice" "trader_mfi" "trader_midpoint" "trader_midprice" "trader_min" "trader_minindex" "trader_minmax" "trader_minmaxindex" "trader_minus_di" "trader_minus_dm" "trader_mom" "trader_mult" "trader_natr" "trader_obv" "trader_plus_di" "trader_plus_dm" "trader_ppo" "trader_roc" "trader_rocp" "trader_rocr" "trader_rocr100" "trader_rsi" "trader_sar" "trader_sarext" "trader_set_compat" "trader_set_unstable_period" "trader_sin" "trader_sinh" "trader_sma" "trader_sqrt" "trader_stddev" "trader_stoch" "trader_stochf" "trader_stochrsi" "trader_sub" "trader_sum" "trader_t3" "trader_tan" "trader_tanh" "trader_tema" "trader_trange" "trader_trima" "trader_trix" "trader_tsf" "trader_typprice" "trader_ultosc" "trader_var" "trader_wclprice" "trader_willr" "trader_wma") (ui "UI\\Draw\\Text\\Font\\fontFamilies" "UI\\quit" "UI\\run") (uopz "uopz_add_function" "uopz_allow_exit" "uopz_backup" "uopz_compose" "uopz_copy" "uopz_del_function" "uopz_delete" "uopz_extend" "uopz_flags" "uopz_function" "uopz_get_exit_status" "uopz_get_hook" "uopz_get_mock" "uopz_get_property" "uopz_get_return" "uopz_get_static" "uopz_implement" "uopz_overload" "uopz_redefine" "uopz_rename" "uopz_restore" "uopz_set_hook" "uopz_set_mock" "uopz_set_property" "uopz_set_return" "uopz_set_static" "uopz_undefine" "uopz_unset_hook" "uopz_unset_mock" "uopz_unset_return") (var_representation "var_representation") (win32service "win32_continue_service" "win32_create_service" "win32_delete_service" "win32_get_last_control_message" "win32_pause_service" "win32_query_service_status" "win32_send_custom_control" "win32_set_service_exit_code" "win32_set_service_exit_mode" "win32_set_service_status" "win32_start_service" "win32_start_service_ctrl_dispatcher" "win32_stop_service") (wincache "wincache_fcache_fileinfo" "wincache_fcache_meminfo" "wincache_lock" "wincache_ocache_fileinfo" "wincache_ocache_meminfo" "wincache_refresh_if_changed" "wincache_rplist_fileinfo" "wincache_rplist_meminfo" "wincache_scache_info" "wincache_scache_meminfo" "wincache_ucache_add" "wincache_ucache_cas" "wincache_ucache_clear" "wincache_ucache_dec" "wincache_ucache_delete" "wincache_ucache_exists" "wincache_ucache_get" "wincache_ucache_inc" "wincache_ucache_info" "wincache_ucache_meminfo" "wincache_ucache_set" "wincache_unlock") (xattr "xattr_get" "xattr_list" "xattr_remove" "xattr_set" "xattr_supported") (xdiff "xdiff_file_bdiff" "xdiff_file_bdiff_size" "xdiff_file_bpatch" "xdiff_file_diff" "xdiff_file_diff_binary" "xdiff_file_merge3" "xdiff_file_patch" "xdiff_file_patch_binary" "xdiff_file_rabdiff" "xdiff_string_bdiff" "xdiff_string_bdiff_size" "xdiff_string_bpatch" "xdiff_string_diff" "xdiff_string_diff_binary" "xdiff_string_merge3" "xdiff_string_patch" "xdiff_string_patch_binary" "xdiff_string_rabdiff") (xhprof "xhprof_disable" "xhprof_enable" "xhprof_sample_disable" "xhprof_sample_enable") (xml "xml_error_string" "xml_get_current_byte_index" "xml_get_current_column_number" "xml_get_current_line_number" "xml_get_error_code" "xml_parse" "xml_parse_into_struct" "xml_parser_create" "xml_parser_create_ns" "xml_parser_free" "xml_parser_get_option" "xml_parser_set_option" "xml_set_character_data_handler" "xml_set_default_handler" "xml_set_element_handler" "xml_set_end_namespace_decl_handler" "xml_set_external_entity_ref_handler" "xml_set_notation_decl_handler" "xml_set_object" "xml_set_processing_instruction_handler" "xml_set_start_namespace_decl_handler" "xml_set_unparsed_entity_decl_handler") (xmlrpc "xmlrpc_decode" "xmlrpc_decode_request" "xmlrpc_encode" "xmlrpc_encode_request" "xmlrpc_get_type" "xmlrpc_is_fault" "xmlrpc_parse_method_descriptions" "xmlrpc_server_add_introspection_data" "xmlrpc_server_call_method" "xmlrpc_server_create" "xmlrpc_server_destroy" "xmlrpc_server_register_introspection_callback" "xmlrpc_server_register_method" "xmlrpc_set_type") (xmlwriter "xmlwriter_end_attribute" "xmlwriter_end_cdata" "xmlwriter_end_comment" "xmlwriter_end_document" "xmlwriter_end_dtd" "xmlwriter_end_dtd_attlist" "xmlwriter_end_dtd_element" "xmlwriter_end_dtd_entity" "xmlwriter_end_element" "xmlwriter_end_pi" "xmlwriter_flush" "xmlwriter_full_end_element" "xmlwriter_open_memory" "xmlwriter_open_uri" "xmlwriter_output_memory" "xmlwriter_set_indent" "xmlwriter_set_indent_string" "xmlwriter_start_attribute" "xmlwriter_start_attribute_ns" "xmlwriter_start_cdata" "xmlwriter_start_comment" "xmlwriter_start_document" "xmlwriter_start_dtd" "xmlwriter_start_dtd_attlist" "xmlwriter_start_dtd_element" "xmlwriter_start_dtd_entity" "xmlwriter_start_element" "xmlwriter_start_element_ns" "xmlwriter_start_pi" "xmlwriter_text" "xmlwriter_write_attribute" "xmlwriter_write_attribute_ns" "xmlwriter_write_cdata" "xmlwriter_write_comment" "xmlwriter_write_dtd" "xmlwriter_write_dtd_attlist" "xmlwriter_write_dtd_element" "xmlwriter_write_dtd_entity" "xmlwriter_write_element" "xmlwriter_write_element_ns" "xmlwriter_write_pi" "xmlwriter_write_raw") (yaml "yaml_emit" "yaml_emit_file" "yaml_parse" "yaml_parse_file" "yaml_parse_url") (yaz "yaz_addinfo" "yaz_ccl_conf" "yaz_ccl_parse" "yaz_close" "yaz_connect" "yaz_database" "yaz_element" "yaz_errno" "yaz_error" "yaz_es" "yaz_es_result" "yaz_get_option" "yaz_hits" "yaz_itemorder" "yaz_present" "yaz_range" "yaz_record" "yaz_scan" "yaz_scan_result" "yaz_schema" "yaz_search" "yaz_set_option" "yaz_sort" "yaz_syntax" "yaz_wait") (zlib "deflate_add" "deflate_init" "gzclose" "gzcompress" "gzdecode" "gzdeflate" "gzencode" "gzeof" "gzfile" "gzgetc" "gzgets" "gzgetss" "gzinflate" "gzopen" "gzpassthru" "gzputs" "gzread" "gzrewind" "gzseek" "gztell" "gzuncompress" "gzwrite" "inflate_add" "inflate_get_read_len" "inflate_get_status" "inflate_init" "readgzfile" "zlib_decode" "zlib_encode" "zlib_get_coding_type") (zookeeper "zookeeper_dispatch"))) (provide 'php-defs) ;;; php-defs.el ends here php-mode-1.27.0/lisp/php-face.el000066400000000000000000000231011473104261100162620ustar00rootroot00000000000000;;; php-face.el --- Face definitions for PHP script -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: USAMI Kenta ;; Created: 5 May 2019 ;; Version: 1.26.1 ;; Keywords: faces, php ;; Homepage: https://github.com/emacs-php/php-mode ;; License: GPL-3.0-or-later ;; 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 . ;;; Commentary: ;; Face definitions for PHP script. ;;; Code: ;;;###autoload (defgroup php-faces nil "Faces used in PHP Mode." :tag "PHP Faces" :group 'php-mode :group 'faces) (defface php-string '((t (:inherit font-lock-string-face))) "PHP Mode face used to highlight string literals." :group 'php-faces :tag "PHP String") (defface php-keyword '((t (:inherit font-lock-keyword-face))) "PHP Mode face used to highlight keywords." :group 'php-faces :tag "PHP Keyword") (defface php-builtin '((t (:inherit font-lock-builtin-face))) "PHP Mode face used to highlight builtins." :group 'php-faces :tag "PHP Built-in") (defface php-function-name '((t (:inherit font-lock-function-name-face))) "PHP Mode face used to highlight function names." :group 'php-faces :tag "PHP Function Name") (defface php-function-call-standard `((t ,(when (eval-when-compile (get 'font-lock-function-call-face 'face-defface-spec)) '(:inherit font-lock-function-call-face)))) "PHP Mode face used to highlight function names in calles." :group 'php-faces :tag "PHP Function Call Standard") (defface php-function-call-traditional '((t ())) "PHP Mode face used to highlight function names in calles." :group 'php-faces :tag "PHP Function Call Traditional") (define-obsolete-face-alias 'php-function-call 'php-function-call-traditional "1.26.0") (defface php-method-call-standard '((t (:inherit php-function-call-standard))) "PHP Mode face used to highlight method names in calles." :group 'php-faces :tag "PHP Method Call Standard") (defface php-method-call-traditional '((t (:inherit php-function-call-traditional))) "PHP Mode face used to highlight method names in calles." :group 'php-faces :tag "PHP Method Call Traditional") (define-obsolete-face-alias 'php-method-call 'php-method-call-traditional "1.26.0") (defface php-static-method-call-standard '((t (:inherit php-method-call-standard))) "PHP Mode face used to highlight static method names in calles." :group 'php-faces :tag "PHP Static Method Call Standard") (defface php-static-method-call-traditional '((t (:inherit php-method-call-traditional))) "PHP Mode face used to highlight static method names in calles." :group 'php-faces :tag "PHP Static Method Call Traditional") (define-obsolete-face-alias 'php-static-method-call 'php-static-method-call-traditional "1.26.0") (defface php-variable-name '((t (:inherit font-lock-variable-name-face))) "PHP Mode face used to highlight variable names." :group 'php-faces :tag "PHP Variable Name") (defface php-property-name '((t (:inherit php-variable-name))) "PHP Mode face used to highlight property names." :group 'php-faces :tag "PHP Property Name") (defface php-variable-sigil '((t ())) "PHP Mode face used to highlight variable sigils ($)." :group 'php-faces :tag "PHP Variable Sigil") (defface php-operator '((t ())) "PHP Mode face used to operators." :group 'php-faces :tag "PHP Operator") (defface php-assignment-op '((t (:inherit php-operator))) "PHP Mode face used to assignment operators (=, +=, ...)." :group 'php-faces :tag "PHP Object Op") (defface php-comparison-op '((t (:inherit php-operator))) "PHP Mode face used to comparison operators (==, !=, ===, ...)." :group 'php-faces :tag "PHP Comparison Op") (defface php-logical-op '((t (:inherit php-operator))) "PHP Mode face used to logical operators (&&, ||, ?:)." :group 'php-faces :tag "PHP Logical Op") (defface php-arithmetic-op '((t (:inherit php-operator))) "PHP Mode face used to arithmetic operators (+, -, %, ...)." :group 'php-faces :tag "PHP Arithmetic Op") (defface php-inc-dec-op '((t (:inherit php-operator))) "PHP Mode face used to increment and decremt operators (--, ++)." :group 'php-faces :tag "PHP Increment/Decrement Op") (defface php-string-op '((t (:inherit php-operator))) "PHP Mode face used to logical operators (.)." :group 'php-faces :tag "PHP String Op") (defface php-object-op '((t (:inherit php-operator))) "PHP Mode face used to object operators (->)." :group 'php-faces :tag "PHP Object Op") (defface php-paamayim-nekudotayim '((t ())) "PHP Mode face used to highlight scope resolution operators (::). The operator is also knows as \"Paamayim Nekudotayim\"." :group 'php-faces :tag "PHP Paamayim Nekudotayim") (defface php-type '((t (:inherit font-lock-type-face))) "PHP Mode face used to highlight types." :group 'php-faces :tag "PHP Type") (defface php-class '((t (:inherit font-lock-type-face))) "PHP Mode face used to highlight class." :group 'php-faces :tag "PHP Class") (defface php-constant '((t (:inherit font-lock-constant-face))) "PHP Mode face used to highlight constants." :group 'php-faces :tag "PHP Constant") (defface php-constant-assign '((t (:inherit php-constant))) "PHP Mode face used to highlight constant assigning (\"const\" statement)." :group 'php-faces :tag "PHP Constant Assign") (defface php-magical-constant '((t (:inherit font-lock-builtin-face))) "PHP Mode face used to highlight magical constants." :group 'php-faces :tag "PHP Magical Constant") (defface php-this '((t (:inherit php-constant))) "PHP Mode face used to highlight $this variables." :group 'php-faces :tag "PHP $this") (defface php-this-sigil '((t (:inherit php-constant))) "PHP Mode face used to highlight sigils($) of $this variable." :group 'php-faces :tag "PHP $this Sigil") (define-obsolete-face-alias 'php-$this 'php-this "1.26.0") (define-obsolete-face-alias 'php-$this-sigil 'php-this-sigil "1.26.0") (defface php-errorcontrol-op '((t (:inherit font-lock-type-face))) "PHP Mode face used to highlight errorcontrol operators (@).." :group 'php-faces :tag "PHP ErrorControl Op") (defface php-php-tag '((t (:inherit font-lock-preprocessor-face))) "PHP Mode face used to highlight PHP tags." :group 'php-faces :tag "PHP php Tag") (defface php-doc-annotation-tag (eval-when-compile (if (eval-when-compile (boundp 'font-lock-doc-markup-face)) '((t . (:inherit font-lock-doc-markup-face))) '((t . (:inherit font-lock-constant-face))))) "Face used to highlight annotation tags in doc-comment." :group 'php-faces :tag "PHPDoc Annotation Tag") (defface php-doc-variable-sigil '((t (:inherit font-lock-variable-name-face))) "PHP Mode face used to highlight variable sigils($)." :group 'php-faces :tag "PHPDoc Variable Sigil") (defface php-doc-$this '((t (:inherit php-type))) "PHP Mode face used to highlight $this variable in doc-comment." :group 'php-faces :tag "PHPDoc $this") (defface php-doc-$this-sigil '((t (:inherit php-type))) "PHP Mode face used to highlight sigil of $this variable in doc-comment." :group 'php-faces :tag "PHPDoc $this Sigil") (defface php-doc-class-name '((t (:inherit php-string))) "PHP Mode Face used to class names in doc-comment." :group 'php-faces :tag "PHPDoc Class Name") (defface php-class-declaration '((t (:inherit php-keyword))) "PHP Mode Face used to class declarations." :group 'php-faces :tag "PHP Class Declaration") (defface php-class-declaration-spec '((t (:inherit php-keyword))) "PHP Mode Face used to highlight class declaration specification keywords. The keywords include: implements, extends." :group 'php-faces :tag "PHP Class Declaration Specification") (defface php-namespace-declaration '((t (:inherit php-keyword))) "PHP Mode Face used to highlight namespace declaration keyword." :group 'php-faces :tag "PHP Namespace Declaration") (defface php-import-declaration '((t (:inherit php-keyword))) "PHP Mode Face used to highlight import statements (use ... as ...)." :group 'php-faces :tag "PHP Import Statement") (defface php-class-modifier '((t (:inherit php-keyword))) "PHP Mode Face used to highlight class modifiers (final, abstract)." :group 'php-faces :tag "PHP Class Modifier") (defface php-method-modifier '((t (:inherit php-keyword))) "PHP Mode Face used to highlight method modifiers (final, abstract)." :group 'php-faces :tag "PHP Method Modifier") (defface php-visibility-modifier '((t (:inherit php-keyword))) "PHP Mode Face used to highlight access keywords (public, protected, private)." :group 'php-faces :tag "PHP Visibility Modifier") (defface php-control-structure '((t (:inherit php-keyword))) "PHP Mode Face used to highlight control structures. The control structures include: if, foreach, while, switch, catch." :group 'php-faces :tag "PHP Control Structure") (define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0") (provide 'php-face) ;;; php-face.el ends here php-mode-1.27.0/lisp/php-flymake.el000066400000000000000000000125631473104261100170260ustar00rootroot00000000000000;;; php-flymake.el --- Flymake backend for PHP -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: USAMI Kenta ;; Created: 5 Mar 2022 ;; Version: 1.26.1 ;; Keywords: tools, languages, php ;; 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 . ;;; Commentary: ;; Flymake backend for PHP. ;;; Code: (require 'flymake) (require 'cl-lib) (eval-and-compile (require 'flymake-proc)) (eval-when-compile (require 'pcase) (require 'rx)) (defgroup php-flymake nil "Flymake backend for PHP." :tag "PHP Flymake" :group 'php) (defcustom php-flymake-executable-command-args nil "List of command and arguments for `php -l'." :group 'php-flymake :type '(repeat string) :safe (lambda (v) (and (listp v) (cl-every v #'stringp)))) (defconst php-flymake--diaggnostics-pattern (eval-when-compile (rx bol (? "PHP ") (group (or "Parse" "Fatal")) ;; 1: type, not used " error:" (+ (syntax whitespace)) (group (+? any)) ;; 2: msg " in " (group (+? any)) ;; 3: file, not used " on line " (group (+ num)) ;; 4: line eol))) (defvar-local php-flymake--proc nil) ;;;###autoload (defun php-flymake (report-fn &rest args) "Flymake backend for PHP syntax check. See `flymake-diagnostic-functions' about REPORT-FN and ARGS parameters." (setq-local flymake-proc-allowed-file-name-masks nil) (when (process-live-p php-flymake--proc) (if (plist-get args :interactive) (user-error "There's already a Flymake process running in this buffer") (kill-process php-flymake--proc))) (save-restriction (widen) (cl-multiple-value-bind (use-stdin skip) (php-flymake--buffer-status) (unless skip (setq php-flymake--proc (php-flymake--make-process report-fn buffer-file-name (current-buffer) use-stdin)) (when use-stdin (process-send-region php-flymake--proc (point-min) (point-max))) (process-send-eof php-flymake--proc))))) (defun php-flymake--buffer-status () "Return buffer status about \"use STDIN\" and \"Skip diagnostic\"." (let* ((use-stdin (or (null buffer-file-name) (buffer-modified-p (current-buffer)) (file-remote-p buffer-file-name))) (skip (and (not use-stdin) (save-excursion (goto-char (point-min)) (looking-at-p "#!"))))) (cl-values use-stdin skip))) (defun php-flymake--diagnostics (locus source) "Parse output of `php -l' command in SOURCE buffer. LOCUS means filename." (unless (eval-when-compile (and (fboundp 'flymake-make-diagnostic) (fboundp 'flymake-diag-region))) (error "`php-flymake' requires Emacs 26.1 or later")) (cl-loop while (search-forward-regexp php-flymake--diaggnostics-pattern nil t) for msg = (match-string 2) for line = (string-to-number (match-string 4)) for diag = (or (pcase-let ((`(,beg . ,end) (flymake-diag-region source line))) (flymake-make-diagnostic source beg end :error msg)) (flymake-make-diagnostic locus (cons line nil) nil :error msg)) return (list diag))) (defun php-flymake--build-command-line (file) "Return the command line for `php -l' FILE." (let* ((command-args (or php-flymake-executable-command-args (list (or (bound-and-true-p php-executable) "php")))) (cmd (car-safe command-args)) (default-directory (expand-file-name "~"))) (unless (or (file-executable-p cmd) (executable-find cmd)) (user-error "`%s' is not valid command" cmd)) (nconc command-args (list "-d" "display_errors=0") (when file (list "-f" file)) (list "-l")))) (defun php-flymake--make-process (report-fn locus source use-stdin) "Make PHP process for syntax check SOURCE buffer. See `flymake-diagnostic-functions' about REPORT-FN parameter. See `flymake-make-diagnostic' about LOCUS parameter." (make-process :name "php-flymake" :buffer (generate-new-buffer "*flymake-php-flymake*") :command (php-flymake--build-command-line (unless use-stdin locus)) :noquery t :connection-type 'pipe :sentinel (lambda (p _ev) (unwind-protect (when (and (eq 'exit (process-status p)) (with-current-buffer source (eq p php-flymake--proc))) (with-current-buffer (process-buffer p) (goto-char (point-min)) (funcall report-fn (if (zerop (process-exit-status p)) nil (php-flymake--diagnostics locus source))))) (unless (process-live-p p) ;; (display-buffer (process-buffer p)) ; uncomment to debug (kill-buffer (process-buffer p))))))) (provide 'php-flymake) ;;; php-flymake.el ends here php-mode-1.27.0/lisp/php-format.el000066400000000000000000000224131473104261100166610ustar00rootroot00000000000000;;; php-format.el --- Code reformatter for PHP buffer -*- lexical-binding: t; -*- ;; Copyright (C) 2020 Friends of Emacs-PHP development ;; Author: USAMI Kenta ;; Created: 5 Mar 2023 ;; Version: 0.1.0 ;; Keywords: tools, php ;; URL: https://github.com/emacs-php/php-mode.el ;; License: GPL-3.0-or-later ;; 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 . ;;; Commentary: ;; This feature is for execute PHP code formatting tools. ;; ## Supported tools: ;; ;; - Easy Coding Standard (ecs) https://github.com/easy-coding-standard/easy-coding-standard ;; - PHP-CS-Fixer (php-cs-fixer) https://github.com/PHP-CS-Fixer/PHP-CS-Fixer ;; - PHP_CodeSniffer (phpcbf) https://github.com/squizlabs/PHP_CodeSniffer ;; ;; It supports both per-project and globally installed ones. ;; ;; ## How to use ;; ;; Add following line to setup function for php-mode. ;; ;; (php-format-auto-mode +1) ;; ;; ## Customization ;; ;; These variables can be set either by dir-locals.el or by custom-set-variable. ;; ;; - php-format-auto-mode-hook-depth ;; - php-format-command ;; - php-format-command-dir ;; - php-format-default-idle-time ;; - php-format-result-display-method-alist ;; ;; ## Display methods ;; ;; How formatting is performed and how the results are displayed can be controlled ;; by the following keywords. ;; ;; - idle: Asynchronously apply formatting to idle time in Emacs using `run-with-idle-timer' ;; - async: Immediately execute an asynchronous process to apply formatting ;; - compile: Apply formatting using the compile command. Doesn't lock, but results pop up ;; - silent: Apply formatting immediately and synchronously. ;; No message is displayed, but Emacs is locked while it is being processed. ;; - nil: Apply formatting immediately and synchronously. ;; Emacs will be locked until formatting is done and the result will pop up. ;; ;;; Code: (require 'cl-lib) (require 'php-project) (defvar php-format-formatter-alist '((ecs :marker ("ecs.php") :command ("ecs" "check" "--fix" "--no-progress-bar" "--")) (php-cs-fixer :marker (".php-cs-fixer.dist.php" ".php-cs-fixer.php") :command ("php-cs-fixer" "fix" "--show-progress=none")) (phpcbf :marker ("phpcs.xml.dist" "phpcs.xml") :command ("phpcbf")))) (defvar php-format-lighter " phpf") (defvar php-format-output-buffer " *PHP Format*") (defvar php-format--exec-method nil) (defvar php-format--idle-timer nil) ;; Customize variables (defgroup php-format nil "Apply code reformat." :tag "PHP Format" :group 'php) (defcustom php-format-auto-mode-hook-depth -50 "A depth number in the range -100..100 for `add-hook'." :tag "PHP Format Auto Mode Hook Depth" :type 'integer :safe #'integerp :group 'php) (defcustom php-format-command 'auto "A formatter symbol, or a list of command and arguments." :tag "PHP Format Command" :type '(choice (const :tag "Disabled reformat codes" nil) (const :tag "Auto" auto) (const :tag "Easy Coding Standard" ecs) (const :tag "PHP-CS-Fixer" php-cs-fixer) (const :tag "PHP Code Beautifier and Fixer" phpcbf) (repeat :tag "Command and arguments" string)) :safe (lambda (v) (or (symbolp v) (listp v))) :group 'php-format) (defcustom php-format-command-dir "vendor/bin" "A relative path to the directory where formatting tool is installed." :tag "PHP Format Command" :type 'string :safe #'stringp :group 'php-format) (defcustom php-format-default-idle-time 3 "Number of seconds to wait idle before formatting." :tag "PHP Format Auto Mode Hook Depth" :type 'integer :safe #'integerp :group 'php) (defcustom php-format-result-display-method-alist '((php-format-on-after-save-hook . idle) (php-format-this-buffer-file . silent) (php-format-project . compile)) "An alist of misplay the result method of the formatting process." :tag "PHP Format Result Display Method" :type '(alist :key-type function :value-type symbol) :group 'php-format) (defcustom php-format-disable-async-format-buffer-has-modified t "When set to non-NIL, disables async formatting if buffer is modified (unsaved)." :tag "PHP Format Disable Async Format Buffer Has Modified" :type 'boolean :group 'php-format) ;; Internal functions (defsubst php-format--register-timer (sec command-args) "Register idle-timer with SEC and COMMAND-ARGS." (unless php-format--idle-timer (setq php-format--idle-timer (run-with-idle-timer sec nil #'php-format--execute-delayed-format default-directory command-args)))) (defun php-format--execute-format (files) "Execute PHP formatter with FILES." (let* ((default-directory (php-project-get-root-dir)) (command-args (php-format--get-command-args)) command-line) (when (null command-args) (user-error "No available PHP formatter settings detected")) (setq command-args (append command-args files)) (setq command-line (mapconcat #'shell-quote-argument command-args " ")) (pcase php-format--exec-method (`(idle ,sec) (php-format--register-timer sec command-args)) ('idle (php-format--register-timer php-format-default-idle-time command-args)) ('async (apply #'call-process-shell-command (car command-args) nil nil nil (append (cdr command-args) (list "&")))) ('compile (compile command-line)) ('silent (shell-command-to-string command-line)) ('nil (shell-command command-line)) (_ (user-error "`%s' is unexpected php-format--exec-method" php-format--exec-method))))) (defun php-format--get-command-args () "Return a list of command and arguments." (if (listp php-format-command) php-format-command (let ((cmd php-format-command) args executable vendor) (when (eq 'auto cmd) (setq cmd (cl-loop for (sym . plist) in php-format-formatter-alist for files = (plist-get plist :marker) if (cl-find-if (lambda (file) (file-exists-p (expand-file-name file default-directory))) files) return sym)) (setq-local php-format-command cmd)) (when-let* ((tup (plist-get (cdr-safe (assq cmd php-format-formatter-alist)) :command))) (setq executable (car tup)) (setq args (cdr tup)) (setq vendor (expand-file-name executable (expand-file-name php-format-command-dir default-directory))) (cond ((file-exists-p vendor) (cons vendor args)) ((executable-find executable) (cons executable args))))))) (defun php-format--execute-delayed-format (dir command-args) "Asynchronously execute PHP format with COMMAND-ARGS in DIR." (setq php-format--idle-timer nil) (let ((default-directory dir)) (when (not (and php-format-disable-async-format-buffer-has-modified (buffer-modified-p))) (apply #'call-process-shell-command (car command-args) nil nil nil (append (cdr command-args) (list "&")))))) ;; Public functions and minor mode ;;;###autoload (defun php-format-this-buffer-file () "Apply format this buffer file." (interactive) (when php-format-command (when (null buffer-file-name) (user-error "This file has not yet been saved")) (when (file-remote-p buffer-file-name) (user-error "PHP Format feature does not yet support remote files")) (let ((php-format--exec-method (cdr-safe (assq 'php-format-this-buffer-file php-format-result-display-method-alist)))) (php-format--execute-format (list buffer-file-name))))) ;;;###autoload (defun php-format-project () "Apply format this buffer file." (interactive) (unless php-format-command (user-error "Disabled `php-format-command' in this project")) (let ((php-format--exec-method (cdr-safe (assq 'php-format-project php-format-result-display-method-alist)))) (php-format--execute-format nil))) ;;;###autoload (defun php-format-on-after-save-hook () "Apply format on after save hook." (when (and php-format-command buffer-file-name (not (file-remote-p buffer-file-name))) (let ((php-format--exec-method (cdr-safe (assq 'php-format-on-after-save-hook php-format-result-display-method-alist)))) (php-format--execute-format nil)))) ;;;###autoload (define-minor-mode php-format-auto-mode "Automatically apply formatting when saving an edited file." :group 'php-format :lighter php-format-lighter (if php-format-auto-mode (add-hook 'after-save-hook 'php-format-on-after-save-hook php-format-auto-mode-hook-depth t) (remove-hook 'after-save-hook 'php-format-on-after-save-hook t))) (provide 'php-format) ;;; php-format.el ends here php-mode-1.27.0/lisp/php-ide-phpactor.el000066400000000000000000000122271473104261100177520ustar00rootroot00000000000000;;; php-ide-phpactor.el --- PHP-IDE feature using Phpactor RPC -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: USAMI Kenta ;; Keywords: tools, files ;; URL: https://github.com/emacs-php/php-mode ;; Version: 1.26.1 ;; License: GPL-3.0-or-later ;; 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 . ;;; Commentary: ;; PHP-IDE implementation to integrate Phpactor (phpactor.el). ;; This feature depends on . ;;; Code: (require 'phpactor nil t) (require 'popup nil t) (require 'smart-jump nil t) (require 'cl-lib) (defvar-local php-ide-phpactor-buffer nil) (defvar-local php-ide-phpactor-hover-last-pos nil) (defvar-local php-ide-phpactor-hover-last-msg nil) (declare-function phpactor--command-argments "ext:phpactor" (&rest arg-keys)) (declare-function phpactor--parse-json "ext:phpactor" (buffer)) (declare-function phpactor--rpc-async "ext:phpactor" (action arguments callback)) (declare-function phpactor-goto-definition "ext:phpactor" ()) (declare-function popup-tip "ext:popup" (string)) (declare-function smart-jump-back "ext:smart-jump" ()) (declare-function smart-jump-go "ext:smart-jump" (&optional smart-list continue)) (declare-function smart-jump-references "ext:smart-jump" (&optional smart-list continue)) (defgroup php-ide-phpactor nil "UI support for PHP developing." :tag "PHP-IDE Phpactor" :prefix "php-ide-phpactor-" :group 'php-ide) (defcustom php-ide-phpactor-activate-features '(all) "A set of Phpactor features you want to enable." :tag "PHP-IDE Phpactor Activate Features" :type '(set (const :tag "All" all) (const hover) (const navigation)) :safe (lambda (xs) (and (listp xs) (cl-every (lambda (x) (memq x '(all hover navigation))) xs))) :group 'php-ide-phpactor) (defvar php-ide-phpactor-timer nil "Timer object for execute Phpactor and display hover message.") (defvar php-ide-phpactor-disable-hover-at-point-functions '(php-in-string-or-comment-p)) (defun php-ide-phpactor--disable-hover-at-point-p () "Return non-NIL if any function return non-NIL for disable to hover at point." (cl-loop for f in php-ide-phpactor-disable-hover-at-point-functions never (not (funcall f)))) (defun php-ide-phpactor-hover () "Show brief information about the symbol underneath the cursor." (interactive) (when (and php-ide-phpactor-buffer (not (php-ide-phpactor--disable-hover-at-point-p))) (if (eq (point) php-ide-phpactor-hover-last-pos) (when php-ide-phpactor-hover-last-msg (let ((msg php-ide-phpactor-hover-last-msg)) (setq php-ide-phpactor-hover-last-msg nil) (popup-tip msg))) (setq php-ide-phpactor-hover-last-pos (point)) (let ((main-buffer (current-buffer))) (phpactor--rpc-async "hover" (phpactor--command-argments :source :offset) (lambda (proc) (let* ((response (phpactor--parse-json (process-buffer proc))) (msg (plist-get (plist-get response :parameters) :message))) (with-current-buffer main-buffer (setq php-ide-phpactor-hover-last-msg msg))))))))) (defsubst php-ide-phpactor--feature-activated-p (feature) "Is FEATURE activated in `php-ide-phpactor-activate-features'." (or (memq 'all php-ide-phpactor-activate-features) (memq feature php-ide-phpactor-activate-features))) ;;;###autoload (defun php-ide-phpactor-activate () "Activate PHP-IDE using phpactor.el." (interactive) (when (php-ide-phpactor--feature-activated-p 'navigation) (if (not (bound-and-true-p phpactor-smart-jump-initialized)) (local-set-key [remap xref-find-definitions] #'phpactor-goto-definition) (local-set-key [remap xref-find-definitions] #'smart-jump-go) (local-set-key [remap xref-pop-marker-stack] #'smart-jump-back) (local-set-key [remap xref-find-references] #'smart-jump-references))) (when (php-ide-phpactor--feature-activated-p 'hover) (unless php-ide-phpactor-timer (setq php-ide-phpactor-timer (run-with-timer 0.8 0.8 #'php-ide-phpactor-hover)))) (setq php-ide-phpactor-buffer t)) ;;;###autoload (defun php-ide-phpactor-deactivate () "Dectivate PHP-IDE using phpactor.el." (interactive) (local-unset-key [remap xref-find-definitions]) (local-unset-key [remap xref-pop-marker-stack]) (local-unset-key [remap xref-find-references]) (when php-ide-phpactor-timer (cancel-timer php-ide-phpactor-timer) (setq php-ide-phpactor-timer nil)) (setq php-ide-phpactor-buffer nil)) (provide 'php-ide-phpactor) ;;; php-ide-phpactor.el ends here php-mode-1.27.0/lisp/php-ide.el000066400000000000000000000216441473104261100161370ustar00rootroot00000000000000;;; php-ide.el --- IDE-like UI support for PHP development -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: USAMI Kenta ;; Keywords: tools, files ;; URL: https://github.com/emacs-php/php-mode ;; Version: 1.26.1 ;; License: GPL-3.0-or-later ;; 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 . ;;; Commentary: ;; PHP Mode integrates LSP Mode (lsp-mode), Phpactor (phpactor.el) and IDE-like tools. ;; ;; **Note**: ;; This feature is under development and experimental. ;; All of these functions, modes and terms are subject to change without notice. ;; ;; ## Motivations ;; ;; There are some IDE-like features / packages for PHP development. ;; PHP-IDE bridges projects and their IDE-like features. ;; ;; ## IDE Features ;; ;; We don't recommend features, but bundle some feature bridges. ;; They are sorted alphabetically except "none." ;; ;; - none ;; Does not launch any IDE features. ;; - eglot ;; https://github.com/joaotavora/eglot ;; - lsp-bridge ;; https://github.com/manateelazycat/lsp-bridge ;; - lsp-mode ;; https://emacs-lsp.github.io/lsp-mode/ ;; https://github.com/emacs-lsp/lsp-mode ;; - phpactor ;; https://phpactor.readthedocs.io/ ;; https://github.com/phpactor/phpactor ;; https://github.com/emacs-php/phpactor.el ;; ;; ## Configuration ;; ;; Put follows code into your .emacs (~/.emacs.d/init.el) file: ;; ;; (defun init-php-mode-setup () ;; (add-hook 'hack-local-variables-hook #'php-ide-mode t t)) ;; ;; (defun init-php-ide-mode-setup (feature activate) ;; (pcase feature ;; (`lsp-bridge ;; (if activate ;; (progn (yas-minor-mode +1) ;; (corfu-mode -1)) ;; (yas-minor-mode -1) ;; (corfu-mode +1))))) ;; ;; (with-eval-after-load 'php-ide ;; (custom-set-variables ;; '(php-ide-features . 'eglot) ;; and/or 'none, 'phpactor, 'lsp-mode ;; '(php-ide-eglot-executable "psalm-language-server") ;; or "intelephense", '("php" "vendor/bin/path/to/server") ;; ;; If you want to hide php-ide-mode from the mode line, set an empty string ;; '(php-ide-mode-lighter "")) ;; ;; (add-hook 'php-mode-hook #'init-php-mode-setup) ;; (add-hook 'php-ide-mode-functions #'init-php-ide-mode-setup)) ;; ;; If you don't enable IDE support by default, set '(php-ide-feature 'none) ;; ;; ### For per project configuration ;; ;; Put follows code into .dir-locals.el in project directory: ;; ;; ((nil (php-project-root . git) ;; (php-ide-features . (lsp-mode)))) ;; ;; If you can't put .dir-locals.el in your project directory, consider the sidecar-locals package. ;; https://melpa.org/#/sidecar-locals ;; https://codeberg.org/ideasman42/emacs-sidecar-locals ;; ;;; Code: (require 'cl-lib) (require 'php-project) (eval-when-compile (require 'php-ide-phpactor) (defvar eglot-server-programs) (declare-function lsp-bridge-mode "ext:lsp-bridge" ()) (declare-function eglot-ensure "ext:eglot" ()) (declare-function eglot--managed-mode-off "ext:eglot" ()) (declare-function phpactor--find-executable "ext:phpactor" ())) (defvar php-ide-feature-alist '((none :test (lambda () t) :activate (lambda () t) :deactivate (lambda () t)) (phpactor :test (lambda () (and (require 'phpactor nil t) (featurep 'phpactor))) :activate php-ide-phpactor-activate :deactivate php-ide-phpactor-activate) (eglot :test (lambda () (and (require 'eglot nil t) (featurep 'eglot))) :activate eglot-ensure :deactivate eglot--managed-mode-off) (lsp-bridge :test (lambda () (and (require 'lsp-bridge nil t) (featurep 'lsp-bridge))) :activate (lambda () (lsp-bridge-mode +1)) :deactivate (lambda () (lsp-bridge-mode -1))) (lsp-mode :test (lambda () (and (require 'lsp nil t) (featurep 'lsp))) :activate lsp :deactivate lsp-workspace-shutdown))) (defvar php-ide-lsp-command-alist '((intelephense "intelephense" "--stdio") (phpactor . (lambda () (list (if (fboundp 'phpactor--find-executable) (phpactor--find-executable) "phpactor") "language-server"))))) (defgroup php-ide nil "IDE-like support for PHP developing." :tag "PHP-IDE" :prefix "php-ide-" :group 'php) ;;;###autoload (defcustom php-ide-features nil "A set of PHP-IDE features symbol." :tag "PHP-IDE Feature" :group 'php-ide :type `(set ,@(mapcar (lambda (feature) (list 'const (car feature))) php-ide-feature-alist) symbol) :safe (lambda (v) (cl-loop for feature in (if (listp v) v (list v)) always (symbolp feature)))) ;;;###autoload (defcustom php-ide-eglot-executable nil "Command name or path to the command of Eglot LSP executable." :tag "PHP-IDE Eglot Executable" :group 'php-ide :type '(choice (const intelephense) (const phpactor) string (repeat string)) :safe (lambda (v) (cond ((stringp v) (file-exists-p v)) ((listp v) (cl-every #'stringp v)) ((assq v php-ide-lsp-command-alist))))) ;;;###autoload (defun php-ide-eglot-server-program () "Return a list of command to execute LSP Server." (cond ((stringp php-ide-eglot-executable) (list php-ide-eglot-executable)) ((listp php-ide-eglot-executable) php-ide-eglot-executable) ((when-let* ((command (assq php-ide-eglot-executable php-ide-lsp-command-alist))) (cond ((functionp command) (funcall command)) ((listp command) command)))))) (defcustom php-ide-mode-lighter " PHP-IDE" "A symbol of PHP-IDE feature." :tag "PHP-IDE Mode Lighter" :group 'php-ide :type 'string :safe #'stringp) ;;;###autoload (defcustom php-ide-mode-functions nil "Hook functions called when before activating or deactivating PHP-IDE. Notice that two arguments (FEATURE ACTIVATE) are given. FEATURE: A symbol, like \\='lsp-mode. ACTIVATE: T is given when activeting, NIL when deactivating PHP-IDE." :tag "PHP-IDE Mode Functions" :group 'php-ide :type '(repeat function) :safe (lambda (functions) (and (listp functions) (cl-every #'functionp functions)))) ;;;###autoload (define-minor-mode php-ide-mode "Minor mode for integrate IDE-like tools." :lighter php-ide-mode-lighter (let ((ide-features php-ide-features)) (when-let* ((unavailable-features (cl-loop for feature in ide-features unless (assq feature php-ide-feature-alist) collect feature))) (user-error "%s includes unavailable PHP-IDE features. (available features are: %s)" ide-features (mapconcat (lambda (feature) (concat "'" (symbol-name feature))) (php-ide--avilable-features) ", "))) (cl-loop for feature in ide-features for ide-plist = (cdr-safe (assq feature php-ide-feature-alist)) do (if (null ide-plist) (message "Please set `php-ide-feature' variable in .dir-locals.el or custom variable") (run-hook-with-args 'php-ide-mode-functions feature php-ide-mode) (if php-ide-mode (php-ide--activate-buffer feature ide-plist) (php-ide--deactivate-buffer ide-plist)))))) ;;;###autoload (defun php-ide-turn-on () "Turn on PHP IDE-FEATURES and execute `php-ide-mode'." (unless php-ide-features (user-error "No PHP-IDE feature is installed. Install the lsp-mode, lsp-bridge, eglot or phpactor package")) (php-ide-mode +1)) (defun php-ide--activate-buffer (name ide-plist) "Activate php-ide implementation by NAME and IDE-PLIST." (unless (funcall (plist-get ide-plist :test)) (user-error "PHP-IDE feature `%s' is not available" name)) (funcall (plist-get ide-plist :activate))) (defun php-ide--deactivate-buffer (ide-plist) "Deactivate php-ide implementation by IDE-PLIST." (funcall (plist-get ide-plist :deactivate))) (defun php-ide--avilable-features () "Return list of available PHP-IDE features." (cl-loop for (ide . plist) in php-ide-feature-alist if (funcall (plist-get plist :test)) collect ide)) (provide 'php-ide) ;;; php-ide.el ends here php-mode-1.27.0/lisp/php-local-manual.el000066400000000000000000000224621473104261100177420ustar00rootroot00000000000000;;; php-local-manual.el --- Tools for local PHP manual -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: phil-s ;; Maintainer: USAMI Kenta ;; URL: https://github.com/emacs-php/php-mode/wiki/Local-PHP-Manual ;; Keywords: docs, php ;; Version: 2.0.0 ;; License: GPL-3.0-or-later ;; 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 . ;;; Commentary: ;; This package helps you search the locally installed PHP Manual. ;; If you're only developing online, this feature is probably unnecessary. ;; ;; ## Notice ;; ;; This file is marked as an unmaintained feature. ;; https://github.com/emacs-php/php-mode/wiki/Unmaintained-Features ;; ;; ## How to use ;; ;; see https://github.com/emacs-php/php-mode/wiki/Local-PHP-Manual ;; ;; ### php-local-manual-search ;; ;; Put follows code into your .emacs (~/.emacs.d/init.el) file: ;; ;; (custom-set-variables ;; '(php-manual-path (expand-file-name "~/local/share/php-manual")) ;; '(php-search-documentation-function #'php-local-manual-search)) ;; ;;; Code: (require 'php) (require 'etags) (defconst php-local-manual-documentation-types '("function" "control-structures" "class" "book") ;; "intro" and "ref" also look interesting, but for all practical purposes ;; their terms are sub-sets of the "book" terms (with the few exceptions ;; being very unlikely search terms). "The set (and priority sequence) of documentation file prefixes under which to search for files in the local documentation directory.") (defvar php-local-manual--words-cache nil) (defun php-local-manual--read-arg () "Obtain interactive argument for searching documentation." ;; Cache the list of documentation words available for completion, ;; based on the defined types-of-interest. (let ((types-list php-local-manual-documentation-types) (words-cache php-local-manual--words-cache) (local-manual (and (stringp php-manual-path) (not (string= php-manual-path ""))))) (when (and local-manual (not (assq types-list words-cache))) ;; Generate the cache on the first run, or if the types changed. ;; We read the filenames matching our types list in the local ;; documentation directory, and extract the 'middle' component ;; of each. e.g. "function.array-map.html" => "array_map". (let* ((types-opt (regexp-opt types-list)) (pattern (concat "\\`" types-opt "\\.\\(.+\\)\\.html\\'")) (collection (mapcar (lambda (filename) (subst-char-in-string ?- ?_ (replace-regexp-in-string pattern "\\1" filename))) (directory-files php-manual-path nil pattern)))) ;; Replace the entire cache. If the types changed, we don't need ;; to retain the collection for the previous value. (setq words-cache (list (cons types-list collection))) (setq php-local-manual--words-cache words-cache))) ;; By default we search for (current-word) immediately, without prompting. ;; With a prefix argument, or if there is no (current-word), we perform a ;; completing read for a word from the cached collection. (let* ((default (current-word)) (prompt (if default (format "Search PHP docs (%s): " default) "Search PHP docs: ")) (collection (and local-manual (cdr (assq types-list words-cache)))) (word (if (or current-prefix-arg (not default)) (completing-read prompt collection nil nil nil nil default) default))) ;; Return interactive argument list. (list word)))) ;;;###autoload (defun php-local-manual-search (word) "Search the local PHP documentation (i.e. in `php-manual-path') for the word at point. The function returns t if the requested documentation exists, and nil otherwise. With a prefix argument, prompt (with completion) for a word to search for." (interactive (php-local-manual--read-arg)) (let ((file (catch 'found (cl-loop for type in php-local-manual-documentation-types do (let* ((doc-html (format "%s.%s.html" type (replace-regexp-in-string "_" "-" (downcase word)))) (file (expand-file-name doc-html php-manual-path))) (when (file-exists-p file) (throw 'found file))))))) (when file (let ((file-url (if (string-prefix-p "file://" file) file (concat "file://" file)))) (php-browse-documentation-url file-url)) t))) ;;;###autoload (define-obsolete-function-alias 'php-search-local-documentation #'php-local-manual-search "2.0.0") ;; Define function name completion function (defvar php-local-manual--completion-table nil "Obarray of tag names defined in current tags table and functions known to PHP.") (defun php-local-manual-complete-function () "Perform function completion on the text around point. Completes to the set of names listed in the current tags table and the standard php functions. The string to complete is chosen in the same way as the default for \\[find-tag] (which see)." (interactive) (let ((pattern (php-get-pattern)) beg completion (php-functions (php-local-manual-completion-table))) (if (not pattern) (message "Nothing to complete") (if (not (search-backward pattern nil t)) (message "Can't complete here") (setq beg (point)) (forward-char (length pattern)) (setq completion (try-completion pattern php-functions nil)) (cond ((eq completion t)) ((null completion) (message "Can't find completion for \"%s\"" pattern) (ding)) ((not (string= pattern completion)) (delete-region beg (point)) (insert completion)) (t (let ((selected (completing-read "Select completion: " (all-completions pattern php-functions) nil t pattern))) (delete-region beg (point)) (insert selected)))))))) (defun php-local-manual-completion-table () "Build variable `php-local-manual--completion-table' on demand. The table includes the PHP functions and the tags from the current `tags-file-name'." (or (and tags-file-name (save-excursion (tags-verify-table tags-file-name)) php-local-manual--completion-table) (let ((tags-table (when tags-file-name (with-current-buffer (get-file-buffer tags-file-name) (etags-tags-completion-table)))) (php-table (cond ((and (not (string= "" php-completion-file)) (file-readable-p php-completion-file)) (php-local-manual-build-table-from-file php-completion-file)) ((and (not (string= "" php-manual-path)) (file-directory-p php-manual-path)) (php-local-manual-build-table-from-path php-manual-path)) (t nil)))) (unless (or php-table tags-table) (user-error (concat "No TAGS file active nor are " "`php-completion-file' or `php-manual-path' set"))) (when tags-table ;; Combine the tables. (if (obarrayp tags-table) (mapatoms (lambda (sym) (intern (symbol-name sym) php-table)) tags-table) (setq php-table (append tags-table php-table)))) (setq php-local-manual--completion-table php-table)))) (defun php-local-manual-build-table-from-file (filename) (let ((table (make-vector 1022 0)) (buf (find-file-noselect filename))) (with-current-buffer buf (goto-char (point-min)) (while (re-search-forward "^\\([-a-zA-Z0-9_.]+\\)\n" nil t) (intern (buffer-substring (match-beginning 1) (match-end 1)) table))) (kill-buffer buf) table)) (defun php-local-manual-build-table-from-path (path) "Return list of PHP function name from `PATH' directory." (cl-loop for file in (directory-files path nil "^function\\..+\\.html$") if (string-match "\\.\\([-a-zA-Z_0-9]+\\)\\.html$" file) collect (replace-regexp-in-string "-" "_" (substring file (match-beginning 1) (match-end 1)) t))) (provide 'php-local-manual) ;;; php-local-manual.el ends here php-mode-1.27.0/lisp/php-mode-debug.el000066400000000000000000000147311473104261100174050ustar00rootroot00000000000000;;; php-mode-debug.el --- Debug functions for PHP Mode -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: USAMI Kenta ;; URL: https://github.com/emacs-php/php-mode ;; Keywords: maint ;; Version: 1.26.1 ;; License: GPL-3.0-or-later ;; 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 . ;;; Commentary: ;; Provides functions to debugging php-mode work. ;;; Code: (require 'cc-mode) (require 'cus-edit) (require 'php-mode) (require 'package) (require 'pkg-info nil t) (require 'el-get nil t) (declare-function pkg-info-version-info "ext:pkg-info" (library &optional package show)) (defun php-mode-debug-reinstall (force &optional called-interactive) "Reinstall PHP Mode to solve Cc Mode version mismatch. When FORCE, try to reinstall without interactively asking. When CALLED-INTERACTIVE then message the result." (interactive (list (yes-or-no-p (if (string= php-mode-cc-version c-version) "No need to recompile, but force PHP Mode to reinstall? " "Force reinstall PHP Mode? ")) t)) (let* ((cc-version-mismatched (string= php-mode-cc-version c-version)) (preface (if cc-version-mismatched "" "CC Mode has been updated. "))) (if (catch 'success (cond ((and (not called-interactive) (not force) cc-version-mismatched) nil) ((and (package-installed-p 'php-mode) (or force (yes-or-no-p (format "%sReinstall `php-mode' package? " preface)))) (package-reinstall 'php-mode) (throw 'success t)) ;; This clause is not included in the byte-compiled code when compiled without El-Get ((and (eval-when-compile (and (fboundp 'el-get-package-is-installed) (fboundp 'el-get-reinstall))) (el-get-package-is-installed 'php-mode) (or force (yes-or-no-p (format "%sReinstall `php-mode' package by El-Get? " preface)))) (el-get-reinstall 'php-mode) (throw 'success t)) ((not called-interactive) (user-error (if cc-version-mismatched "PHP Mode cannot be reinstalled automatically. Please try manually if necessary" "Please reinstall or byte recompile PHP Mode files manually"))))) (user-error "PHP Mode reinstalled successfully. Please restart Emacs") (prog1 t (when called-interactive (message "PHP Mode was not reinstalled")))))) (defun php-mode-debug--buffer (&optional command &rest args) "Return buffer for php-mode-debug, and execute `COMMAND' with `ARGS'." (with-current-buffer (get-buffer-create "*PHP Mode DEBUG*") (cl-case command (init (erase-buffer) (goto-address-mode)) (top (goto-char (point-min))) (insert (goto-char (point-max)) (apply #'insert args))) (current-buffer))) (defun php-mode-debug--message (format-string &rest args) "Write message `FORMAT-STRING' and `ARGS' to debug buffer, like `message'." (declare (indent 1)) (php-mode-debug--buffer 'insert (apply #'format format-string args) "\n")) (defun php-mode-debug () "Display informations useful for debugging PHP Mode." (interactive) (unless (eq major-mode 'php-mode) (user-error "Invoke this command only in php-mode buffer")) (php-mode-debug--buffer 'init) (php-mode-debug--message "Feel free to report on GitHub what you noticed!") (php-mode-debug--message "https://github.com/emacs-php/php-mode/issues/new") (php-mode-debug--message "") (php-mode-debug--message "Pasting the following information on the issue will help us to investigate the cause.") (php-mode-debug--message "```") (php-mode-debug--message "--- PHP-MODE DEBUG BEGIN ---") (php-mode-debug--message "versions: %s; %s; Cc Mode %s)" (emacs-version) (php-mode-version) (if (string= php-mode-cc-version c-version) c-version (format "%s (php-mode-cc-version: %s *mismatched*)" c-version php-mode-cc-version))) (php-mode-debug--message "package-version: %s" (if (fboundp 'pkg-info) (pkg-info-version-info 'php-mode) (let ((pkg (and (boundp 'package-alist) (cadr (assq 'php-mode package-alist))))) (when (and pkg (member (package-desc-status pkg) '("unsigned" "dependency"))) (package-version-join (package-desc-version pkg)))))) (php-mode-debug--message "major-mode: %s" major-mode) (php-mode-debug--message "minor-modes: %s" (cl-loop for s in minor-mode-list unless (string-match-p "global" (symbol-name s)) if (and (boundp s) (symbol-value s)) collect s)) (php-mode-debug--message "variables: %s" (cl-loop for v in '(indent-tabs-mode tab-width) collect (list v (symbol-value v)))) (php-mode-debug--message "custom variables: %s" (cl-loop for (v type) in (custom-group-members 'php nil) if (eq type 'custom-variable) collect (list v (symbol-value v)))) (php-mode-debug--message "c-indentation-style: %s" c-indentation-style) (php-mode-debug--message "c-style-variables: %s" (cl-loop for v in c-style-variables unless (memq v '(c-doc-comment-style c-offsets-alist)) collect (list v (symbol-value v)))) (php-mode-debug--message "c-doc-comment-style: %s" c-doc-comment-style) (php-mode-debug--message "c-offsets-alist: %s" c-offsets-alist) (php-mode-debug--message "buffer: %s" (list :length (save-excursion (goto-char (point-max)) (point)))) (php-mode-debug--message "--- PHP-MODE DEBUG END ---") (php-mode-debug--message "```\n") (php-mode-debug--message "Thank you!") (pop-to-buffer (php-mode-debug--buffer 'top))) (provide 'php-mode-debug) ;;; php-mode-debug.el ends here php-mode-1.27.0/lisp/php-mode.el000066400000000000000000001747451473104261100163350ustar00rootroot00000000000000;;; php-mode.el --- Major mode for editing PHP code -*- lexical-binding: t; -*- ;; Copyright (C) 2024 Friends of Emacs-PHP development ;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad ;; 2008 Aaron S. Hawley ;; 2011, 2012, 2013, 2014, 2015, 2016, 2017 Eric James Michael Ritz ;; Author: Eric James Michael Ritz ;; Maintainer: USAMI Kenta ;; URL: https://github.com/emacs-php/php-mode ;; Keywords: languages php ;; Version: 1.26.1 ;; Package-Requires: ((emacs "27.1")) ;; License: GPL-3.0-or-later (eval-and-compile (make-obsolete-variable (defconst php-mode-version-number "1.26.1" "PHP Mode version number.") "Please call (php-mode-version :as-number t) for compatibility." "1.24.2")) ;; 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 . ;;; Commentary: ;; PHP Mode is a major mode for editing PHP script. It's an extension ;; of CC mode; thus it inherits all C mode's navigation functionality. ;; But it colors according to the PHP syntax and indents according to the ;; PSR-2 coding guidelines. It also includes a couple handy IDE-type ;; features such as documentation search and a source and class browser. ;; Please read the manual for setting items compatible with CC Mode. ;; https://www.gnu.org/software/emacs/manual/html_mono/ccmode.html ;; This mode is designed for PHP scripts consisting of a single ") (prefix "\\" "::"))) (c-lang-defconst c-operators php `((prefix "new" "clone") ,@(c-lang-const c-identifier-ops) (postfix "->") (postfix "++" "--" "[" "]" "(" ")") (right-assoc "**") (prefix "++" "--" "+" "-" "~" "(" ")" "@") (prefix "instanceof") (prefix "!") (left-assoc "*" "/" "%") (left-assoc "+" "-" ".") (left-assoc "<<" ">>") (left-assoc "<" ">" "<=" ">=") (left-assoc "==" "!=" "===" "!==" "<>" "<=>") (left-assoc "&") (left-assoc "^") (left-assoc "|") (left-assoc "&&") (left-assoc "||") (right-assoc "??") (left-assoc "?:") (right-assoc-sequence "?" ":") (right-assoc ,@(c-lang-const c-assignment-operators)) (left-assoc "and") (left-assoc "xor") (left-assoc "or") (left-assoc ",") (left-assoc "=>"))) ;; Allow '\' when scanning from open brace back to defining ;; construct like class (c-lang-defconst c-block-prefix-disallowed-chars php (cl-set-difference (c-lang-const c-block-prefix-disallowed-chars) '(?\\))) ;; Allow $ so variables are recognized in cc-mode and remove @. This ;; makes cc-mode highlight variables and their type hints in arglists. (c-lang-defconst c-symbol-start php (concat "[" c-alpha "_$]")) ;; All string literals can possibly span multiple lines (c-lang-defconst c-multiline-string-start-char php t) (c-lang-defconst c-assignment-operators php '("=" "*=" "/=" "%=" "+=" "-=" ">>=" "<<=" "&=" "^=" "|=" ".=" "??=")) (c-lang-defconst beginning-of-defun-function php 'php-beginning-of-defun) (c-lang-defconst end-of-defun-function php 'php-end-of-defun) (c-lang-defconst c-primitive-type-kwds php '("int" "integer" "bool" "boolean" "float" "double" "real" "string" "object" "void" "mixed" "never")) (c-lang-defconst c-class-decl-kwds "Keywords introducing declarations where the following block (if any) contains another declaration level that should be considered a class." php '("class" "trait" "interface" "enum")) (c-lang-defconst c-brace-list-decl-kwds "Keywords introducing declarations where the following block (if any) is a brace list. PHP does not have an C-like \"enum\" keyword." php nil) (c-lang-defconst c-typeless-decl-kwds php (append (c-lang-const c-class-decl-kwds php) '("function" "const"))) (c-lang-defconst c-modifier-kwds php '("abstract" "final" "static" "case" "readonly")) (c-lang-defconst c-protection-kwds "Access protection label keywords in classes." php '("private" "protected" "public")) (c-lang-defconst c-postfix-decl-spec-kwds php '("implements" "extends")) (c-lang-defconst c-type-list-kwds php '("@new" ;; @new is *NOT* language construct, it's workaround for coloring. "new" "use" "implements" "extends" "namespace" "instanceof" "insteadof")) (c-lang-defconst c-ref-list-kwds php nil) (c-lang-defconst c-block-stmt-2-kwds php '("catch" "declare" "elseif" "for" "foreach" "if" "switch" "while")) (c-lang-defconst c-simple-stmt-kwds php '("break" "continue" "die" "echo" "exit" "goto" "return" "throw" "include" "include_once" "print" "require" "require_once")) (c-lang-defconst c-constant-kwds php '("true" "false" "null")) (c-lang-defconst c-lambda-kwds php '("function" "use")) (c-lang-defconst c-inexpr-block-kwds php '("match")) (c-lang-defconst c-other-block-decl-kwds php '("namespace")) (c-lang-defconst c-other-kwds "Keywords not accounted for by any other `*-kwds' language constant." php '("__halt_compiler" "and" "array" "as" "break" "catch" "clone" "default" "empty" "enddeclare" "endfor" "endforeach" "endif" "endswitch" "endwhile" "eval" "fn" ;; NOT c-lambda-kwds "global" "isset" "list" "or" "parent" "static" "unset" "var" "xor" "yield" "yield from" ;; Below keywords are technically not reserved keywords, but ;; threated no differently by php-mode from actual reserved ;; keywords ;; ;;; declare directives: "encoding" "ticks" "strict_types" ;;; self for static references: "self")) ;; PHP does not have <> templates/generics (c-lang-defconst c-recognize-<>-arglists php nil) (c-lang-defconst c-<>-type-kwds php nil) (c-lang-defconst c-inside-<>-type-kwds php nil) (c-lang-defconst c-enums-contain-decls php nil) (c-lang-defconst c-nonlabel-token-key "Regexp matching things that can't occur in generic colon labels. This overrides cc-mode `c-nonlabel-token-key' to support switching on double quoted strings and true/false/null. Note: this regexp is also applied to goto-labels, a future improvement might be to handle switch and goto labels differently." php (concat ;; All keywords except `c-label-kwds' and `c-constant-kwds'. (c-make-keywords-re t (cl-set-difference (c-lang-const c-keywords) (append (c-lang-const c-label-kwds) (c-lang-const c-constant-kwds)) :test 'string-equal)))) (c-lang-defconst c-basic-matchers-before php (cl-remove-if (lambda (elm) (and (listp elm) (equal (car elm) "\\s|"))) (c-lang-const c-basic-matchers-before php))) (c-lang-defconst c-basic-matchers-after php (cl-remove-if (lambda (elm) (and (listp elm) (memq 'c-annotation-face elm))) (c-lang-const c-basic-matchers-after php))) (defconst php-mode--re-return-typed-closure (eval-when-compile (rx symbol-start "function" symbol-end (* (syntax whitespace)) "(" (* (not (any "("))) ")" (* (syntax whitespace)) (? symbol-start "use" symbol-end (* (syntax whitespace)) "(" (* (not (any "("))) ")" (* (syntax whitespace))) ":" (+ (not (any "{}"))) (group "{")))) (defun php-c-lineup-arglist (langelem) "Line up the current argument line under the first argument using `c-lineup-arglist' LANGELEM." (let (in-return-typed-closure) (when (and (consp langelem) (eq 'arglist-cont-nonempty (car langelem))) (save-excursion (save-match-data (when (re-search-backward php-mode--re-return-typed-closure (cdr langelem) t) (goto-char (match-beginning 1)) (when (not (php-in-string-or-comment-p)) (setq in-return-typed-closure t)))))) (unless in-return-typed-closure (c-lineup-arglist langelem)))) (defun php-lineup-cascaded-calls (langelem) "Line up chained methods using `c-lineup-cascaded-calls', but only if the setting is enabled." (cond (php-mode-lineup-cascaded-calls (c-lineup-cascaded-calls langelem)) ((assq 'arglist-cont-nonempty c-syntactic-context) nil) ((assq 'defun-block-intro c-syntactic-context) nil) ((assq 'defun-close c-syntactic-context) nil) ((assq 'statement-cont c-syntactic-context) nil) (t (save-excursion (beginning-of-line) (let ((beginning-of-langelem (cdr langelem)) (beginning-of-current-line (point)) start) (skip-chars-forward " ") (cond ((looking-at-p "->") '+) ((looking-at-p "[:?]") '+) ((looking-at-p "[,;]") nil) ((looking-at-p "//") nil) ;; Is the previous line terminated with `,' ? ((progn (forward-line -1) (end-of-line) (skip-chars-backward " ") (backward-char 1) (while (and (< beginning-of-langelem (point)) (setq start (php-in-string-or-comment-p))) (goto-char start) (skip-chars-backward " \r\n") (backward-char 1)) (and (not (eq (point) beginning-of-current-line)) (not (looking-at-p ",")) (not (php-in-string-or-comment-p)))) '+) (t nil))))))) (defun php-c-looking-at-or-maybe-in-bracelist (orig-fun &optional containing-sexp lim &rest args) "Replace `c-looking-at-or-maybe-in-bracelist'. CONTAINING-SEXP is the position of the brace/paren/bracket enclosing POINT, or nil if there is no such position, or we do not know it. LIM is a backward search limit." (cond ((not (derived-mode-p 'php-mode)) (apply orig-fun containing-sexp lim args)) ((looking-at-p "{") (save-excursion (c-backward-token-2 2 t lim) ;; PHP 8.0 match expression ;; echo match ($var) |{ ;; ↑ matches ↑ initial position (when (looking-at-p (eval-when-compile (rx symbol-start "match" symbol-end))) (cons (point) t)))) (t nil))) (c-add-style "php" `((c-basic-offset . 4) (c-offsets-alist . ((arglist-close . php-lineup-arglist-close) (arglist-cont . (first php-lineup-cascaded-calls 0)) (arglist-cont-nonempty . (first php-lineup-cascaded-calls php-c-lineup-arglist)) (arglist-intro . php-lineup-arglist-intro) (case-label . +) (class-open . 0) (comment-intro . 0) (inexpr-class . 0) (inlambda . 0) (inline-open . 0) (namespace-open . 0) (lambda-intro-cont . +) (label . +) (statement-cont . (first php-lineup-cascaded-calls php-lineup-string-cont +)) (substatement-open . 0) (topmost-intro-cont . (first php-lineup-cascaded-calls +)))) (indent-tabs-mode . nil) (tab-width . ,(default-value 'tab-width)) (fill-column . ,(default-value 'fill-column)) (show-trailing-whitespace . ,(default-value 'show-trailing-whitespace)) (php-mode-lineup-cascaded-calls . t) (php-style-delete-trailing-whitespace . nil))) (defun php-enable-default-coding-style () "Set PHP Mode to use reasonable default formatting." (interactive) (php-set-style "php")) (c-add-style "pear" '("php" (c-basic-offset . 4) (c-offsets-alist . ((case-label . 0) (statement-cont . +))) (tab-width . 4) (php-mode-lineup-cascaded-calls . nil))) (defun php-enable-pear-coding-style () "Set up `php-mode' to use the coding styles preferred for PEAR code and modules." (interactive) (php-set-style "pear")) (c-add-style "drupal" '("php" (c-basic-offset . 2) (tab-width . 2) (fill-column . 78) (show-trailing-whitespace . t) (php-mode-lineup-cascaded-calls . nil) (php-style-delete-trailing-whitespace . t))) (defun php-enable-drupal-coding-style () "Make `php-mode' use coding styles that are preferable for working with Drupal." (interactive) (php-set-style "drupal")) (c-add-style "wordpress" '("php" (c-basic-offset . 4) (c-indent-comments-syntactically-p t) (indent-tabs-mode . t) (tab-width . 4) (fill-column . 78))) (defun php-enable-wordpress-coding-style () "Make `php-mode' use coding styles that are preferable for working with Wordpress." (interactive) (php-set-style "wordpress")) (c-add-style "symfony2" '("php" (c-offsets-alist . ((statement-cont . php-lineup-hanging-semicolon))) (c-indent-comments-syntactically-p . t) (php-mode-lineup-cascaded-calls . nil) (fill-column . 78))) (defun php-enable-symfony2-coding-style () "Make `php-mode' use coding styles that are preferable for working with Symfony2." (interactive) (php-set-style "symfony2")) (c-add-style "psr2" ; PSR-2 / PSR-12 '("php" (c-offsets-alist . ((statement-cont . +))) (c-indent-comments-syntactically-p . t) (fill-column . 78) (show-trailing-whitespace . t) (php-mode-lineup-cascaded-calls . nil) (php-style-delete-trailing-whitespace . t))) (defun php-enable-psr2-coding-style () "Make `php-mode' comply to the PSR-2 coding style." (interactive) (php-set-style "psr2")) (defun php-beginning-of-defun (&optional arg) "Move to the beginning of the ARGth PHP function from point. Implements PHP version of `beginning-of-defun-function'." (interactive "p") (let (found-p (arg (or arg 1))) (while (> arg 0) (setq found-p (re-search-backward php-beginning-of-defun-regexp nil 'noerror)) (setq arg (1- arg))) (while (< arg 0) (end-of-line 1) (let ((opoint (point))) (beginning-of-defun 1) (forward-list 2) (forward-line 1) (if (eq opoint (point)) (setq found-p (re-search-forward php-beginning-of-defun-regexp nil 'noerror))) (setq arg (1+ arg)))) (not (null found-p)))) (defun php-end-of-defun (&optional arg) "Move the end of the ARGth PHP function from point. Implements PHP version of `end-of-defun-function' See `php-beginning-of-defun'." (interactive "p") (php-beginning-of-defun (- (or arg 1)))) (defvar php-warned-bad-indent nil) ;; Do it but tell it is not good if html tags in buffer. (defun php-check-html-for-indentation () (let ((html-tag-re "^\\s-*") (here (point))) (goto-char (line-beginning-position)) (if (or (when (boundp 'mumamo-multi-major-mode) mumamo-multi-major-mode) ;; Fix-me: no idea how to check for mmm or multi-mode (save-match-data (not (or (re-search-forward html-tag-re (line-end-position) t) (re-search-backward html-tag-re (line-beginning-position) t))))) (prog1 t (goto-char here)) (goto-char here) (setq php-warned-bad-indent t) (let* ((known-multi-libs '(("mumamo" mumamo (lambda () (nxhtml-mumamo))) ("mmm-mode" mmm-mode (lambda () (mmm-mode 1))) ("multi-mode" multi-mode (lambda () (multi-mode 1))) ("web-mode" web-mode (lambda () (web-mode))))) (known-names (mapcar (lambda (lib) (car lib)) known-multi-libs)) (available-multi-libs (delq nil (mapcar (lambda (lib) (when (locate-library (car lib)) lib)) known-multi-libs))) (available-names (mapcar (lambda (lib) (car lib)) available-multi-libs)) (base-msg (concat "Indentation fails badly with mixed HTML/PHP in the HTML part in plain `php-mode'. To get indentation to work you must use an Emacs library that supports 'multiple major modes' in a buffer. Parts of the buffer will then be in `php-mode' and parts in for example `html-mode'. Known such libraries are:\n\t" (mapconcat #'identity known-names ", ") "\n" (if available-multi-libs (concat "You have these available in your `load-path':\n\t" (mapconcat #'identity available-names ", ") "\n\n" "Do you want to turn any of those on? ") "You do not have any of those in your `load-path'."))) (is-using-multi (catch 'is-using (dolist (lib available-multi-libs) (when (and (boundp (cadr lib)) (symbol-value (cadr lib))) (throw 'is-using t)))))) (unless is-using-multi (if available-multi-libs (if (not (y-or-n-p base-msg)) (message "Did not do indentation, but you can try again now if you want") (let* ((name (if (= 1 (length available-multi-libs)) (car available-names) ;; Minibuffer window is more than one line, fix that first: (message "") (completing-read "Choose multiple major mode support library: " available-names nil t (car available-names) '(available-names . 1) ))) (mode (when name (cl-caddr (assoc name available-multi-libs))))) (when mode ;; Minibuffer window is more than one line, fix that first: (message "") (load name) (funcall mode)))) (lwarn 'php-indent :warning base-msg))) nil)))) (defun php-cautious-indent-region (start end &optional quiet) "Carefully indent region START to END in contexts other than HTML templates. If the optional argument QUIET is non-nil then no syntactic errors are reported, even if `c-report-syntactic-errors' is non-nil." (if (or (not php-mode-warn-if-mumamo-off) (not (php-in-poly-php-html-mode)) php-warned-bad-indent (php-check-html-for-indentation)) (funcall 'c-indent-region start end quiet))) (defun php-cautious-indent-line () "Carefully indent lines in contexts other than HTML templates." (if (or (not php-mode-warn-if-mumamo-off) (not (php-in-poly-php-html-mode)) php-warned-bad-indent (php-check-html-for-indentation)) (let ((here (point)) doit) (move-beginning-of-line nil) ;; Don't indent heredoc end mark (save-match-data (unless (and (looking-at "[a-zA-Z0-9_]+;\n") (php-in-string-p)) (setq doit t))) (goto-char here) (when doit (funcall 'c-indent-line))))) (defun php-c-at-vsemi-p (&optional pos) "Return T on HTML lines (including php tag) or PHP8 Attribute, otherwise NIL. POS is a position on the line in question. This is was done due to the problem reported here: URL `https://answers.launchpad.net/nxhtml/+question/43320'" ;; If this function could call c-beginning-of-statement-1, change php-c-vsemi-status-unknown-p. (save-excursion (if pos (goto-char pos) (setq pos (point))) (cond ;; Detect PHP8 attribute: #[Attribute()] ((and (< 1 pos) (< 1 (- pos (c-point 'bol)))) (backward-char 1) (looking-at-p (eval-when-compile (rx "]" (* (syntax whitespace)) (or "#[" line-end))))) ;; Detect HTML/XML tag and PHP tag () (php-mode-template-compatibility (beginning-of-line) (looking-at-p (eval-when-compile (rx (or (: bol (0+ space) "<" (in "?a-z")) (: (0+ not-newline) (in "?a-z") ">" (0+ space) eol))))))))) (defun php-c-vsemi-status-unknown-p () "Always return NIL. See `c-vsemi-status-unknown-p'." ;; Current implementation of php-c-at-vsemi-p never calls c-beginning-of-statement-1 nil) (defun php-lineup-string-cont (langelem) "Line up string toward equal sign or dot. e.g. $str = \\='some' . \\='string'; this ^ lineup" (save-excursion (goto-char (cdr langelem)) (let (ret finish) (while (and (not finish) (re-search-forward "[=.]" (line-end-position) t)) (unless (php-in-string-or-comment-p) (setq finish t ret (vector (1- (current-column)))))) ret))) (defun php-lineup-arglist-intro (langelem) (save-excursion (goto-char (cdr langelem)) (vector (+ (current-column) c-basic-offset)))) (defun php-lineup-arglist-close (langelem) (save-excursion (goto-char (cdr langelem)) (vector (current-column)))) (defun php-lineup-arglist (_langelem) (save-excursion (beginning-of-line) (if (looking-at-p "\\s-*->") '+ 0))) (defun php-lineup-hanging-semicolon (_langelem) (save-excursion (beginning-of-line) (if (looking-at-p "\\s-*;\\s-*$") 0 '+))) (eval-and-compile (defconst php-heredoc-start-re (rx "<<<" (* (syntax whitespace)) (or (group (+ (or (syntax word) (syntax symbol)))) (: "\"" (group (+ (or (syntax word) (syntax symbol)))) "\"") (: "'" (group (+ (or (syntax word) (syntax symbol)))) "'")) line-end) "Regular expression for the start of a PHP heredoc.")) (defun php-heredoc-end-re (heredoc-start) "Build a regular expression for the end of a heredoc started by the string HEREDOC-START." ;; Extract just the identifier without <<< and quotes. (string-match "\\_<.+?\\_>" heredoc-start) (concat "^\\s-*\\(" (match-string 0 heredoc-start) "\\)\\W")) (eval-and-compile (defconst php-syntax-propertize-rules (syntax-propertize-precompile-rules (php-heredoc-start-re (0 (ignore (php--syntax-propertize-heredoc (match-beginning 0) (or (match-string 1) (match-string 2) (match-string 3)) (null (match-string 3)))))) ((rx "#[") (0 (ignore (php--syntax-propertize-attributes (match-beginning 0))))) ((rx (or "'" "\"")) (0 (ignore (php--syntax-propertize-quotes-in-comment (match-beginning 0)))))))) (defalias 'php-syntax-propertize-function (syntax-propertize-rules php-syntax-propertize-rules)) (defun php--syntax-propertize-heredoc (start id _is-heredoc) "Apply propertize Heredoc and Nowdoc from START, with ID and IS-HEREDOC." (let ((terminator (rx-to-string `(: line-start (* (syntax whitespace)) ,id word-boundary)))) (put-text-property start (1+ start) 'syntax-table (string-to-syntax "|")) (re-search-forward terminator nil t) (when (match-string 0) (put-text-property (1- (point)) (point) 'syntax-table (string-to-syntax "|"))))) (defun php--syntax-propertize-quotes-in-comment (pos) "Apply propertize quotes (' and \") from POS." (when (php-in-comment-p) (put-text-property pos (1+ pos) 'syntax-table (string-to-syntax "_")))) (defun php--syntax-propertize-attributes (start) "Apply propertize PHP8 #[Attributes] (without # comment) from START." (unless (php-in-string-p) (put-text-property start (1+ start) 'syntax-table (string-to-syntax ".")))) (defvar-local php-mode--propertize-extend-region-current nil "Prevent undesirable recursion in PHP-SYNTAX-PROPERTIZE-EXTEND-REGION.") (defun php-syntax-propertize-extend-region (start end) "Extend the propertize region if START or END falls inside a PHP heredoc." (let ((pair (cons start end))) (when (not (member pair php-mode--propertize-extend-region-current)) ;; re-search functions may trigger ;; syntax-propertize-extend-region-functions to be called again, which in ;; turn call this to be called again. (push pair php-mode--propertize-extend-region-current) (unwind-protect (let (new-start new-end) (goto-char start) ;; Consider bounding this backwards search by `beginning-of-defun'. ;; (Benchmarking for a wide range of cases may be needed to decide ;; whether that's an improvement, as `php-beginning-of-defun' also ;; uses `re-search-backward'.) (when (re-search-backward php-heredoc-start-re nil t) (let ((maybe (point))) (when (and (re-search-forward (php-heredoc-end-re (match-string 0)) nil t) (> (point) start)) (setq new-start maybe) (when (> (point) end) (setq new-end (point)))))) (unless new-end (goto-char end) (when (re-search-backward php-heredoc-start-re start t) (if (re-search-forward (php-heredoc-end-re (match-string 0)) nil t) (when (> (point) end) (setq new-end (point))) (setq new-end (point-max))))) (when (or new-start new-end) (cons (or new-start start) (or new-end end)))) ;; Cleanup (setq php-mode--propertize-extend-region-current (delete pair php-mode--propertize-extend-region-current)))))) (easy-menu-define php-mode-menu php-mode-map "PHP Mode Commands." (cons "PHP" (c-lang-const c-mode-menu php))) (defun php-mode-get-style-alist () "Return an alist consisting of `php' style and styles that inherit it." (cl-loop for l in c-style-alist if (or (string= (car l) "php") (equal (cadr l) "php")) collect l)) (defvar php-mode-set-style-history nil) (defvar-local php-mode--delayed-set-style nil) (defvar-local php-style-delete-trailing-whitespace nil) (defun php-set-style (stylename &optional dont-override) "Set the current `php-mode' buffer to use the style STYLENAME. STYLENAME is one of the names selectable in `php-mode-coding-style'. Borrow the `interactive-form' from `c-set-style' and use the original `c-set-style' function to set all declared stylevars. For compatibility with `c-set-style' pass DONT-OVERRIDE to it. After setting the stylevars run hook `php-mode-STYLENAME-hook'." (interactive (list (let ((completion-ignore-case t) (prompt (format "Which %s indentation style? " mode-name))) (completing-read prompt (php-mode-get-style-alist) nil t nil 'php-mode-set-style-history c-indentation-style)))) (php-mode--disable-delay-set-style) ;; Back up manually set variables (let* (value (backup-vars (and php-mode-enable-backup-style-variables (cl-loop for name in c-style-variables do (setq value (symbol-value name)) if (and value (not (eq 'set-from-style value))) collect (cons name value))))) (c-set-style stylename dont-override) ;; Restore variables (cl-loop for (name . value) in backup-vars do (set (make-local-variable name) value))) (if (eq php-style-delete-trailing-whitespace t) (add-hook 'before-save-hook #'delete-trailing-whitespace nil t) (remove-hook 'before-save-hook #'delete-trailing-whitespace t)) (run-hooks (intern (format "php-mode-%s-hook" stylename)))) (defun php-mode--disable-delay-set-style (&rest _args) "Disable `php-mode-set-style-delay' on after hook. ARGS be ignore." (setq php-mode--delayed-set-style nil) (advice-remove #'php-mode--disable-delay-set-style #'c-set-style)) (defun php-mode-set-style-delay () "Set the current `php-mode' buffer to use the style by custom or local variables." (when php-mode--delayed-set-style (let ((coding-style (or (and (boundp 'php-project-coding-style) php-project-coding-style) php-mode-coding-style))) (prog1 (when coding-style (php-set-style (symbol-name coding-style))) (remove-hook 'hack-local-variables-hook #'php-mode-set-style-delay))))) (defun php-mode-set-local-variable-delay () "Set local variable from php-project." (php-project-apply-local-variables) (remove-hook 'hack-local-variables-hook #'php-mode-set-local-variable-delay)) (defvar php-mode-syntax-table (let ((table (make-syntax-table))) (c-populate-syntax-table table) (modify-syntax-entry ?_ "_" table) (modify-syntax-entry ?` "\"" table) (modify-syntax-entry ?\" "\"" table) (modify-syntax-entry ?# "< b" table) (modify-syntax-entry ?\n "> b" table) (modify-syntax-entry ?$ "_" table) table)) ;;;###autoload (define-derived-mode php-mode php-base-mode "PHP" "Major mode for editing PHP code. \\{php-mode-map}" :syntax-table php-mode-syntax-table :after-hook (progn (c-make-noise-macro-regexps) (c-make-macro-with-semi-re) (c-update-modeline)) (unless (string= php-mode-cc-version c-version) (php-mode-debug-reinstall nil)) (c-initialize-cc-mode t) (setq abbrev-mode t) ;; Must be called once as c-mode to enable font-lock for Heredoc. ;; TODO: This call may be removed in the future. (c-common-init 'c-mode) (c-init-language-vars php-mode) (c-common-init 'php-mode) (cc-imenu-init cc-imenu-c-generic-expression) (setq-local c-auto-align-backslashes nil) (setq-local comment-start "// ") (setq-local comment-start-skip (eval-when-compile (rx (group (or (: "#" (not (any "["))) (: "/" (+ "/")) (: "/*"))) (* (syntax whitespace))))) (setq-local comment-end "") (setq-local page-delimiter php-mode-page-delimiter) (setq-local font-lock-string-face 'php-string) (setq-local font-lock-keyword-face 'php-keyword) (setq-local font-lock-builtin-face 'php-builtin) (setq-local c-preprocessor-face-name 'php-php-tag) (setq-local font-lock-function-name-face 'php-function-name) (setq-local font-lock-variable-name-face 'php-variable-name) (setq-local font-lock-constant-face 'php-constant) (setq-local syntax-propertize-function #'php-syntax-propertize-function) (add-hook 'syntax-propertize-extend-region-functions #'php-syntax-propertize-extend-region t t) (setq imenu-generic-expression (if (symbolp php-imenu-generic-expression) (symbol-value php-imenu-generic-expression) php-imenu-generic-expression)) ;; PHP vars are case-sensitive (setq case-fold-search t) (when php-mode-enable-project-local-variable (add-hook 'hack-local-variables-hook #'php-mode-set-local-variable-delay t t)) ;; When php-mode-enable-project-coding-style is set, it is delayed by hook. ;; Since it depends on the timing at which the file local variable is set. ;; File local variables are set after initialization of major mode except `run-hook' is complete. (if php-mode-enable-project-coding-style (progn (add-hook 'hack-local-variables-hook #'php-mode-set-style-delay t t) (setq php-mode--delayed-set-style t) (advice-add 'c-set-style :after #'php-mode--disable-delay-set-style)) (let ((php-mode-enable-backup-style-variables nil)) (php-set-style (symbol-name php-mode-coding-style)))) (when (or php-mode-force-pear (and (stringp buffer-file-name) (string-match "PEAR\\|pear" buffer-file-name) (string-match "\\.php\\'" buffer-file-name))) (php-set-style "pear")) (setq indent-line-function #'php-cautious-indent-line) (setq indent-region-function #'php-cautious-indent-region) (setq c-at-vsemi-p-fn #'php-c-at-vsemi-p) (setq c-vsemi-status-unknown-p-fn #'php-c-vsemi-status-unknown-p) ;; We map the php-{beginning,end}-of-defun functions so that they ;; replace the similar commands that we inherit from CC Mode. ;; Because of our remapping we may not actually need to keep the ;; following two local variables, but we keep them for now until we ;; are completely sure their removal will not break any current ;; behavior or backwards compatibility. (setq-local beginning-of-defun-function #'php-beginning-of-defun) (setq-local end-of-defun-function #'php-end-of-defun) (setq-local open-paren-in-column-0-is-defun-start nil) (setq-local defun-prompt-regexp "^\\s-*function\\s-+&?\\s-*\\(\\(\\sw\\|\\s_\\)+\\)\\s-*") (setq-local add-log-current-defun-function nil) (setq-local add-log-current-defun-header-regexp php-beginning-of-defun-regexp) (when (and (eval-when-compile (boundp 'flymake-diagnostic-functions)) php-mode-replace-flymake-diag-function) (add-hook 'flymake-diagnostic-functions php-mode-replace-flymake-diag-function nil t)) (advice-add 'c-looking-at-or-maybe-in-bracelist :around 'php-c-looking-at-or-maybe-in-bracelist) (advice-add 'fixup-whitespace :after #'php-mode--fixup-whitespace-after) (advice-add 'acm-backend-tabnine-candidate-expand :filter-args #'php-acm-backend-tabnine-candidate-expand-filter-args) (when (eval-when-compile (>= emacs-major-version 25)) (syntax-ppss-flush-cache (point-min)))) (declare-function semantic-create-imenu-index "semantic/imenu" (&optional stream)) (defvar-mode-local php-mode imenu-create-index-function (if php-do-not-use-semantic-imenu #'imenu-default-create-index-function (require 'semantic/imenu) #'semantic-create-imenu-index) "Imenu index function for PHP.") (when (bound-and-true-p consult-imenu-config) (add-to-list 'consult-imenu-config '(php-mode :toplevel "Namespace" :types ((?n "Namespace" font-lock-function-name-face) (?p "Properties" font-lock-type-face) (?o "Constants" font-lock-type-face) (?c "Classes" font-lock-type-face) (?f "Functions" font-lock-function-name-face) (?i "Imports" font-lock-type-face) (?m "Methods" font-lock-function-name-face))))) (autoload 'php-local-manual-complete-function "php-local-manual") (defun php-complete-function () "Perform function completion on the text around point. Completes to the set of names listed in the current tags table and the standard php functions. The string to complete is chosen in the same way as the default for \\[find-tag] (which see)." (interactive) (php-local-manual-complete-function)) (defun php-show-arglist () "Show function arguments at cursor position." (interactive) (let* ((tagname (php-get-pattern)) (buf (find-tag-noselect tagname nil nil)) arglist) (with-current-buffer buf (save-excursion (goto-char (point-min)) (when (re-search-forward (format "function\\s-+%s\\s-*(\\([^{]*\\))" tagname) nil t) (setq arglist (buffer-substring-no-properties (match-beginning 1) (match-end 1)))))) (if arglist (message "Arglist for %s: %s" tagname arglist) (message "Unknown function: %s" tagname)))) ;; Font Lock (defconst php-phpdoc-type-names '(;; PHPStan and Psalm types "__stringandstringable" "array" "array-key" "associative-array" "bool" "boolean" "callable" "callable-array" "callable-object" "callable-string" "class-string" "closed-resource" "double" "empty" "empty-scalar" "enum-string" "false" "float" "int" "integer" "interface-string" "iterable" "list" "literal-string" "lowercase-string" "mixed" "negative-int" "never" "never-return" "never-returns" "no-return" "non-empty-array" "non-empty-list" "non-empty-literal-string" "non-empty-lowercase-string" "non-empty-mixed" "non-empty-scalar" "non-empty-string" "non-empty-uppercase-string" "non-falsy-string" "non-negative-int" "non-positive-int" "non-zero-int" "noreturn" "null" "number" "numeric" "numeric-string" "object" "open-resource" "parent" "positive-int" "pure-callable" "pure-closure" "resource" "scalar" "self" "static" "string" "trait-string" "true" "truthy-string" "uppercase-string" "void" ;; PHPStan Generic Types "key-of" "value-of" "int-mask-of" "int-mask" "__benevolent" "template-type" "new") "A list of type and pseudotype names that can be used in PHPDoc.") (make-obsolete-variable 'php-phpdoc-type-keywords 'php-phpdoc-type-names "1.24.2") (defconst php-phpdoc-type-tags (list "package" "param" "property" "property-read" "property-write" "return" "throws" "var" "self-out" "this-out" "param-out" "type" "extends" "require-extends" "implemtents" "require-implements" "template" "template-covariant" "template-extends" "template-implements" "require-extends" "require-implements" "assert" "assert-if-true" "assert-if-false" "if-this-is") "A list of tags specifying type names.") (defconst php-phpdoc-font-lock-doc-comments `(("{@[-[:alpha:]]+\\s-*\\([^}]*\\)}" ; "{@foo ...}" markup. (0 'php-doc-annotation-tag prepend nil) (1 'php-string prepend nil)) (,(rx (group "$") (group (in "A-Za-z_") (* (in "0-9A-Za-z_")))) (1 'php-doc-variable-sigil prepend nil) (2 'php-variable-name prepend nil)) ("\\(\\$\\)\\(this\\)\\>" (1 'php-doc-$this-sigil prepend nil) (2 'php-doc-$this prepend nil)) (,(concat "\\s-@" (rx (? (or "phan" "phpstan" "psalm") "-")) (regexp-opt php-phpdoc-type-tags) "\\s-+" "\\(" (rx (+ (? "?") (? "\\") (+ (in "0-9A-Z_a-z")) (? "[]") (? "|"))) "\\)+") 1 'php-string prepend nil) (,(concat "\\(?:|\\|\\?\\|\\s-\\)\\(" (regexp-opt php-phpdoc-type-names 'words) "\\)") 1 font-lock-type-face prepend nil) ("^\\(?:/\\*\\)?\\(?:\\s \\|\\*\\)*\\(@[[:alpha:]][-[:alpha:]\\]*\\)" ; "@foo ..." markup. 1 'php-doc-annotation-tag prepend nil))) (defvar php-phpdoc-font-lock-keywords `((,(lambda (limit) (c-font-lock-doc-comments "/\\*\\*" limit php-phpdoc-font-lock-doc-comments))))) (defconst php-font-lock-keywords-1 (c-lang-const c-matchers-1 php) "Basic highlighting for PHP Mode.") (defconst php-font-lock-keywords-2 (c-lang-const c-matchers-2 php) "Medium level highlighting for PHP Mode.") (defconst php-font-lock-keywords-3 (append php-phpdoc-font-lock-keywords ;; php-mode patterns *before* cc-mode: ;; only add patterns here if you want to prevent cc-mode from applying ;; a different face. `( ;; Class declaration specification keywords (implements, extends) ("\\_<\\(?:implements\\|extends\\)\\_>" . 'php-class-declaration-spec) ;; Namespace declaration ("\\_" . 'php-namespace-declaration) ;; import statement ("\\_" . 'php-import-declaration) ;; Class modifiers (abstract, final) ("\\_<\\(abstract\\|final\\)\\_>\\s-+\\_" 1 'php-class-modifier) ;; Highlight variables, e.g. 'var' in '$var' and '$obj->var', but ;; not in $obj->var() ("\\(->\\)\\(\\sw+\\)\\s-*(" (1 'php-object-op) (2 php-method-call)) ("\\<\\(const\\)\\s-+\\(\\_<.+?\\_>\\)" (1 'php-keyword) (2 'php-constant-assign)) ;; Logical operator (!) ("\\(!\\)[^=]" 1 'php-logical-op) ;; Highlight special variables ("\\(\\$\\)\\(this\\)\\>" (1 'php-this-sigil) (2 'php-this)) ("\\(\\$+\\)\\(\\sw+\\)" (1 'php-variable-sigil) (2 'php-variable-name)) ("\\(->\\)\\([a-zA-Z0-9_]+\\)" (1 'php-object-op) (2 'php-property-name)) ;; Highlight function/method names ("\\" . 'php-class-declaration) ;; Highlight static method calls as such. This is necessary for method ;; names which are identical to keywords to be highlighted correctly. ("\\sw+::\\(\\sw+\\)(" 1 php-static-method-call) ;; Multiple catch (FooException | BarException $e) (,(rx symbol-start "catch" symbol-end (* (syntax whitespace)) "(" (* (syntax whitespace)) (group (+ (or (syntax word) (syntax symbol))))) (1 font-lock-type-face) (,(rx (* (syntax whitespace)) "|" (* (syntax whitespace)) (group (+ (or (syntax word) (syntax symbol))) symbol-end)) nil nil (1 font-lock-type-face))) ;; While c-opt-cpp-* highlights the " "" ;; obsolete ASP tag ;; Obsoleted tags were deleted in PHP 7. ;; @see http://php.net/manual/language.basic-syntax.phptags.php )) 0 'php-php-tag)) ;; cc-mode patterns (c-lang-const c-matchers-3 php) ;; php-mode patterns *after* cc-mode: ;; most patterns should go here, faces will only be applied if not ;; already fontified by another pattern. Note that using OVERRIDE ;; is usually overkill. `( ("\\<\\(@\\)" 1 'php-errorcontrol-op) ;; import function statement (,(rx symbol-start (group "use" (+ (syntax whitespace)) "function") (+ (syntax whitespace))) (1 'php-import-declaration) (,(rx (group (+ (or (syntax word) (syntax symbol) "\\" "{" "}")))) nil nil (1 'php-function-name t))) ;; import constant statement (,(rx symbol-start (group "use" (+ (syntax whitespace)) "const") (+ (syntax whitespace))) (1 'php-import-declaration) (,(rx (group (+ (or (syntax word) (syntax symbol) "\\" "{" "}")))) nil nil (1 'php-constant-assign t))) ;; Highlight function calls ("\\(\\_<\\(?:\\sw\\|\\s_\\)+?\\_>\\)\\s-*(" 1 php-function-call) ;; Highlight all upper-cased symbols as constant ("\\<\\([A-Z_][A-Z0-9_]+\\)\\>" 1 'php-constant) ;; Highlight all statically accessed class names as constant, ;; another valid option would be using type-face, but using ;; constant-face because this is how it works in c++-mode. ("\\(\\sw+\\)\\(::\\)" (1 'php-constant) (2 'php-paamayim-nekudotayim)) ;; Highlight class name after "use .. as" ("\\]+?\\([\-+./%]?=\\)[^==, ...) ("\\([!=]=\\{1,2\\}[>]?\\|[<>]=?\\)" 1 'php-comparison-op) ;; Arithmetic operators (+, -, *, **, /, %) ("\\(?:[A-Za-z0-9[:blank:]]\\)\\([\-+*/%]\\*?\\)\\(?:[A-Za-z0-9[:blank:]]\\)" 1 'php-arithmetic-op) ;; Increment and Decrement operators (++, --) ("\\(\-\-\\|\+\+\\)\$\\w+" 1 'php-inc-dec-op) ;; pre inc/dec ("\$\\w+\\(\-\-\\|\+\+\\)" 1 'php-inc-dec-op) ;; post inc/dec ;; Logical operators (and, or, &&, ...) ;; Not operator (!) is defined in "before cc-mode" section above. ("\\(&&\\|||\\)" 1 'php-logical-op) ;; string interpolation ("$var, ${var}, {$var}") (php-mode--string-interpolated-variable-font-lock-find 0 nil) (,(rx symbol-start (group (or "get" "set")) (+ (syntax whitespace)) (or "{" "=>")) 1 'php-builtin))) "Detailed highlighting for PHP Mode.") (defvar php-font-lock-keywords php-font-lock-keywords-3 "Default expressions to highlight in PHP Mode.") (eval-when-compile (unless (boundp 'flymake-proc-allowed-file-name-masks) (add-to-list 'flymake-allowed-file-name-masks '("\\.php[345s]?\\'" php-flymake-php-init)))) (defun php-send-region (start end) "Send the region between `START' and `END' to PHP for execution. The output will appear in the buffer *PHP*." (interactive "r") (let ((php-buffer (get-buffer-create "*PHP*")) (code (buffer-substring start end))) ;; Calling 'php -r' will fail if we send it code that starts with ;; '\\|::\\)") (save-excursion (forward-char -2) (looking-at-p "->\\|::")))) (delete-char 1))) ;; Advice for lsp-bridge' acm-backend-tabnine ;; see https://github.com/manateelazycat/lsp-bridge/issues/402#issuecomment-1305653058 (defun php-acm-backend-tabnine-candidate-expand-filter-args (args) "Adjust to replace bound-start ARGS for Tabnine in PHP." (if (not (derived-mode-p 'php-mode)) args (cl-multiple-value-bind (candidate-info bound-start) args (save-excursion (goto-char bound-start) (when (looking-at-p (eval-when-compile (regexp-quote "$"))) (setq bound-start (1+ bound-start)))) (list candidate-info bound-start)))) ;;;###autoload (progn (add-to-list 'auto-mode-alist '("/\\.php_cs\\(?:\\.dist\\)?\\'" . php-mode)) (add-to-list 'auto-mode-alist '("\\.\\(?:php\\.inc\\|stub\\)\\'" . php-mode)) (add-to-list 'auto-mode-alist '("\\.\\(?:php[s345]?\\|phtml\\)\\'" . php-mode-maybe))) (provide 'php-mode) ;;; php-mode.el ends here php-mode-1.27.0/lisp/php-project.el000066400000000000000000000251171473104261100170430ustar00rootroot00000000000000;;; php-project.el --- Project support for PHP application -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Author: USAMI Kenta ;; Keywords: tools, files ;; URL: https://github.com/emacs-php/php-mode ;; Version: 1.26.1 ;; License: GPL-3.0-or-later ;; 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 . ;;; Commentary: ;; Define project specific functions and variables for PHP application. ;; ;; ## API ;; ;; ### `php-project-get-root-dir()' ;; ;; Return root directory of current buffer file. The root directory is ;; determined by several marker file or directory. ;; ;; ### `php-project-get-bootstrap-scripts()' ;; ;; Return list of path to bootstrap script file. ;; ;; ### `php-project-get-php-executable()' ;; ;; Return path to PHP executable file with the project settings overriding. ;; ;; ## `.dir-locals.el' support ;; ;; - `php-project-coding-style' ;; - Symbol value of the coding style. (ex. `pear', `psr2') ;; - `php-project-root' ;; - Symbol of marker file of project root. (ex. `git', `composer') ;; - Full path to project root directory. (ex. "/path/to/your-project") ;; - `php-project-bootstrap-scripts' ;; - List of path to bootstrap file of project. ;; (ex. (((root . "vendor/autoload.php") (root . "inc/bootstrap.php"))) ;; - `php-project-php-executable' ;; - Path to project specific PHP executable file. ;; - If you want to use a file different from the system wide `php' command. ;; ;;; Code: (eval-when-compile (require 'cl-lib)) (require 'projectile nil t) ;; Constants (defconst php-project-composer-autoloader "vendor/autoload.php") ;; Custom variables (defgroup php-project nil "Major mode for editing PHP code." :tag "PHP Project" :prefix "php-project-" :group 'php) (defcustom php-project-auto-detect-etags-file nil "If `T', automatically detect etags file when file is opened." :tag "PHP Project Auto Detect Etags File" :group 'php-project :type 'boolean) (defcustom php-project-use-projectile-to-detect-root nil "If `T' and projectile-mode is activated, use Projectile for root detection." :tag "PHP Project Use Projectile To Detect Root" :group 'php-project :type 'boolean) ;; Variables (defvar php-project-available-root-files '((projectile ".projectile") (composer "composer.json" "composer.lock") (git ".git") (mercurial ".hg") (subversion ".svn") ;; NOTICE: This method does not detect the top level of .editorconfig ;; However, we can integrate it by adding the editorconfig.el's API. ;;(editorconfig . ".editorconfig") )) ;; Buffer local variables ;;;###autoload (progn (defvar-local php-project-root 'auto "Method of searching for the top level directory. `auto' (default) Try to search file in order of `php-project-available-root-files'. SYMBOL Key of `php-project-available-root-files'. STRING A file/directory name of top level marker. If the string is an actual directory path, it is set as the absolute path of the root directory, not the marker.") (put 'php-project-root 'safe-local-variable #'(lambda (v) (or (stringp v) (assq v php-project-available-root-files)))) (defvar-local php-project-etags-file nil) (put 'php-project-etags-file 'safe-local-variable #'(lambda (v) (or (functionp v) (eq v t) (php-project--eval-bootstrap-scripts v)))) (defvar-local php-project-bootstrap-scripts nil "List of path to bootstrap php script file. The ideal bootstrap file is silent, it only includes dependent files, defines constants, and sets the class loaders.") (put 'php-project-bootstrap-scripts 'safe-local-variable #'php-project--eval-bootstrap-scripts) (defvar-local php-project-php-executable nil "Path to php executable file.") (put 'php-project-php-executable 'safe-local-variable #'(lambda (v) (and (stringp v) (file-executable-p v)))) (defvar-local php-project-coding-style nil "Symbol value of the coding style of the project that PHP major mode refers to. Typically it is `pear', `drupal', `wordpress', `symfony2' and `psr2'.") (put 'php-project-coding-style 'safe-local-variable #'symbolp) (defvar-local php-project-align-lines t "If T, automatically turn on `php-align-mode' by `php-align-setup'.") (put 'php-project-align-lines 'safe-local-variable #'booleanp) (defvar-local php-project-php-file-as-template 'auto " `auto' (default) Automatically switch to mode for template when HTML tag detected in file. `t' Switch all PHP files in that directory to mode for HTML template. `nil' Any .php in that directory is just a PHP script. \(\(PATTERN . SYMBOL)) Alist of file name pattern regular expressions and the above symbol pairs. PATTERN is regexp pattern. ") (put 'php-project-php-file-as-template 'safe-local-variable #'php-project--validate-php-file-as-template) (defvar-local php-project-repl nil "Function name or path to REPL (interactive shell) script.") (put 'php-project-repl 'safe-local-variable #'(lambda (v) (or (functionp v) (php-project--eval-bootstrap-scripts v)))) (defvar-local php-project-unit-test nil "Function name or path to unit test script.") (put 'php-project-unit-test 'safe-local-variable #'(lambda (v) (or (functionp v) (php-project--eval-bootstrap-scripts v)))) (defvar-local php-project-deploy nil "Function name or path to deploy script.") (put 'php-project-deploy 'safe-local-variable #'(lambda (v) (or (functionp v) (php-project--eval-bootstrap-scripts v)))) (defvar-local php-project-build nil "Function name or path to build script.") (put 'php-project-build 'safe-local-variable #'(lambda (v) (or (functionp v) (php-project--eval-bootstrap-scripts v)))) (defvar-local php-project-server-start nil "Function name or path to server-start script.") (put 'php-project-server-start 'safe-local-variable #'(lambda (v) (or (functionp v) (php-project--eval-bootstrap-scripts v))))) ;; Functions (defun php-project--validate-php-file-as-template (val) "Return T when `VAL' is valid list of safe ." (cond ((null val) t) ((memq val '(t auto)) t) ((listp val) (cl-loop for v in val always (and (consp v) (stringp (car v)) (php-project--validate-php-file-as-template (cdr v))))) (t nil))) (defun php-project--eval-bootstrap-scripts (val) "Return T when `VAL' is valid list of safe bootstrap php script." (cond ((stringp val) (and (file-exists-p val) val)) ((eq 'composer val) (let ((path (expand-file-name php-project-composer-autoloader (php-project-get-root-dir)))) (and (file-exists-p path) path))) ((and (consp val) (eq 'root (car val)) (stringp (cdr val))) (let ((path (expand-file-name (cdr val) (php-project-get-root-dir)))) (and (file-exists-p path) path))) ((null val) nil) ((listp val) (cl-loop for v in val collect (php-project--eval-bootstrap-scripts v))) (t nil))) (defun php-project-get-php-executable () "Return path to PHP executable file." (cond ((and (stringp php-project-php-executable) (file-executable-p php-project-php-executable)) php-project-php-executable) ((boundp 'php-executable) php-executable) (t (executable-find "php")))) (defun php-project-get-file-html-template-type (filename) "Return symbol T, NIL or `auto' by `FILENAME'." (cond ((not php-project-php-file-as-template) nil) ((eq t php-project-php-file-as-template) t) ((eq 'auto php-project-php-file-as-template) 'auto) ((listp php-project-php-file-as-template) (assoc-default filename php-project-php-file-as-template #'string-match-p)) (t (prog1 nil (warn "php-project-php-file-as-template is unexpected format"))))) (defun php-project-apply-local-variables () "Apply php-project variables to local variables." (when (null tags-file-name) (when (or (and php-project-auto-detect-etags-file (null php-project-etags-file)) (eq php-project-etags-file t)) (let ((tags-file (expand-file-name "TAGS" (php-project-get-root-dir)))) (when (file-exists-p tags-file) (setq-local php-project-etags-file tags-file)))) (when php-project-etags-file (setq-local tags-file-name (php-project--eval-bootstrap-scripts php-project-etags-file))))) ;;;###autoload (defun php-project-get-bootstrap-scripts () "Return list of bootstrap script." (let ((scripts (php-project--eval-bootstrap-scripts php-project-bootstrap-scripts))) (if (stringp scripts) (list scripts) scripts))) ;;;###autoload (defun php-project-get-root-dir () "Return path to current PHP project." (if (and (stringp php-project-root) (file-directory-p php-project-root)) php-project-root (php-project--detect-root-dir))) ;;;###autoload (defun php-project-project-find-function (dir) "Return path to current PHP project from DIR. This function is compatible with `project-find-functions'." (let ((default-directory dir)) (when-let* ((root (php-project-get-root-dir))) (if (file-exists-p (expand-file-name ".git" root)) (cons 'vc root) (cons 'transient root))))) (defun php-project--detect-root-dir () "Return detected project root." (if (and php-project-use-projectile-to-detect-root (bound-and-true-p projectile-mode) (fboundp 'projectile-project-root)) (projectile-project-root default-directory) (let ((detect-method (cond ((stringp php-project-root) (list php-project-root)) ((eq php-project-root 'auto) (cl-loop for m in php-project-available-root-files append (cdr m))) (t (cdr-safe (assq php-project-root php-project-available-root-files)))))) (cl-loop for m in detect-method thereis (locate-dominating-file default-directory m))))) (provide 'php-project) ;;; php-project.el ends here php-mode-1.27.0/lisp/php.el000066400000000000000000000732771473104261100154110ustar00rootroot00000000000000;;; php.el --- PHP support for friends -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Friends of Emacs-PHP development ;; Copyright (C) 1985, 1987, 1992-2022 Free Software Foundation, Inc. ;; Author: USAMI Kenta ;; 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 ;; 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 . ;;; Commentary: ;; This file provides common variable and functions for PHP packages. ;; These functions are copied function from GNU Emacs. ;; ;; - c-end-of-token (cc-engine.el) ;; ;;; Code: (eval-when-compile (require 'cc-mode) (require 'cl-lib)) (require 'cc-engine) (require 'flymake) (require 'php-project) (require 'rx) ;;;###autoload (defgroup php nil "Language support for PHP." :tag "PHP" :group 'languages :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") "The location of the PHP executable." :group 'php :tag "PHP Executable" :type 'string) (defcustom php-site-url "https://www.php.net/" "Default PHP.net site URL. The URL to use open PHP manual and search word." :group 'php :tag "PHP Site URL" :type 'string) (defcustom php-manual-url 'en "URL at which to find PHP manual. You can replace \"en\" with your ISO language code." :group 'php :tag "PHP Manual URL" :type '(choice (const :tag "English" en) (const :tag "Brazilian Portuguese" pt_BR) (const :tag "Chinese (Simplified)" zh) (const :tag "French" fr) (const :tag "German" de) (const :tag "Japanese" ja) (const :tag "Romanian" ro) (const :tag "Russian" ru) (const :tag "Spanish" es) (const :tag "Turkish" tr) (string :tag "PHP manual URL"))) (defcustom php-search-url nil "URL at which to search for documentation on a word." :group 'php :tag "PHP Search URL" :type '(choice (string :tag "URL to search PHP documentation") (const :tag "Use `php-site-url' variable" nil))) (defcustom php-completion-file "" "Path to the file which contains the function names known to PHP." :type 'string) (defcustom php-manual-path "" "Path to the directory which contains the PHP manual." :type 'string) (defcustom php-search-documentation-function #'php-search-web-documentation "Function to search PHP Manual at cursor position." :group 'php :tag "PHP Search Documentation Function" :type '(choice (const :tag "Use online documentation" php-search-web-documentation) (const :tag "Use local documentation" php-local-manual-search) (function :tag "Use other function"))) (defcustom php-search-documentation-browser-function nil "Function to display PHP documentation in a WWW browser. If non-nil, this shadows the value of `browse-url-browser-function' when calling `php-search-documentation' or `php-search-local-documentation'." :group 'php :tag "PHP Search Documentation Browser Function" :type '(choice (const :tag "default" nil) function) :link '(variable-link browse-url-browser-function)) ;; Define function for browsing manual (defun php-browse-documentation-url (url) "Browse a documentation URL using the configured browser function. See `php-search-documentation-browser-function'." (let ((browse-url-browser-function (or php-search-documentation-browser-function browse-url-browser-function))) (browse-url url))) (defun php-browse-manual () "Bring up manual for PHP." (interactive) (browse-url (if (stringp php-manual-url) php-manual-url (format "%smanual/%s/" php-site-url php-manual-url)))) (defun php-search-web-documentation (word) "Return URL to search PHP manual search by `WORD'." (interactive (list (current-word))) (php-browse-documentation-url (concat (or php-search-url php-site-url) word))) (defun php-search-documentation (&optional word) "Search PHP documentation for the `WORD' at point. If `php-manual-path' has a non-empty string value then the command will first try searching the local documentation. If the requested documentation does not exist it will fallback to searching the PHP website. With a prefix argument, prompt for a documentation word to search for. If the local documentation is available, it is used to build a completion list." (interactive) (if (called-interactively-p 'interactive) (call-interactively php-search-documentation-function) (funcall php-search-documentation-function word))) (defcustom php-class-suffix-when-insert "::" "Suffix for inserted class." :group 'php :type 'string) (defcustom php-namespace-suffix-when-insert "\\" "Suffix for inserted namespace." :group 'php :type 'string) (defcustom php-default-major-mode 'php-mode "Major mode for editing PHP script." :group 'php :tag "PHP Default Major Mode" :type 'function) (defcustom php-html-template-major-mode 'web-mode "Major mode for editing PHP-HTML template." :group 'php :tag "PHP-HTML Template Major Mode" :type 'function) (defcustom php-blade-template-major-mode 'web-mode "Major mode for editing Blade template." :group 'php :tag "PHP Blade Template Major Mode" :type 'function) (defcustom php-template-mode-alist `(("\\.blade" . ,php-blade-template-major-mode) ("\\.phpt\\'" . ,(if (fboundp 'phpt-mode) 'phpt-mode php-default-major-mode)) ("\\.phtml\\'" . ,php-html-template-major-mode)) "Automatically use another MAJOR-MODE when open template file." :group 'php :tag "PHP Template Mode Alist" :type '(alist :key-type regexp :value-type function) :link '(url-link :tag "web-mode" "http://web-mode.org/") :link '(url-link :tag "phpt-mode" "https://github.com/emacs-php/phpt-mode")) (defcustom php-mode-maybe-hook nil "List of functions to be executed on entry to `php-mode-maybe'." :group 'php :tag "PHP Mode Maybe Hook" :type 'hook) (defcustom php-default-builtin-web-server-port 3939 "Port number of PHP Built-in HTTP server (php -S)." :group 'php :tag "PHP Default Built-in Web Server Port" :type 'integer :link '(url-link :tag "Built-in web server" "https://www.php.net/manual/features.commandline.webserver.php")) (defcustom php-topsy-separator " > " "Separator string for `php-topsy-beginning-of-defun-with-class'." :group 'php :tag "PHP Topsy Separator" :type 'string) (defcustom php-function-call 'php-function-call-traditional "Face name to use for method call." :group 'php :tag "PHP Function Call" :type 'face) (defcustom php-method-call 'php-method-call-traditional "Face name to use for method call." :group 'php :tag "PHP Method Call" :type 'face) (defcustom php-static-method-call 'php-static-method-call-traditional "Face name to use for method call." :group 'php :tag "PHP Static Method Call" :type 'face) ;;; PHP Keywords (defconst php-magical-constants '("__CLASS__" "__DIR__" "__FILE__" "__FUNCTION__" "__LINE__" "__METHOD__" "__NAMESPACE__" "__TRAIT__") "Magical keyword that is expanded at compile time. These are different from \"constants\" in strict terms. see https://www.php.net/manual/language.constants.predefined.php") (defconst php-re-token-symbols (eval-when-compile (regexp-opt (list "&" "&=" "array(" "(array)" "&&" "||" "(bool)" "(boolean)" "break;" "?>" "%>" "??" "??=" ".=" "--" "/=" "=>" "(real)" "(double)" "(float)" "::" "..." "__halt_compiler()" "++" "(int)" "(integer)" "==" ">=" "===" "!=" "<>" "!==" "<=" "-=" "%=" "*=" "\\" "(object)" "->" "?->" "" ">>" ">>=" "<<<" "(string)" "^=" "yield from" "[" "]" "(" ")" "{" "}" ";") t))) ;;; Utillity for locate language construction (defsubst php-in-string-p () "Return non-nil if inside a string. It is the character that will terminate the string, or t if the string should be terminated by a generic string delimiter." (nth 3 (syntax-ppss))) (defsubst php-in-comment-p () "Return NIL if outside a comment, T if inside a non-nestable comment, else an integer (the current comment nesting)." (nth 4 (syntax-ppss))) (defsubst php-in-string-or-comment-p () "Return character address of start of comment or string; nil if not in one." (nth 8 (syntax-ppss))) (defsubst php-in-poly-php-html-mode () "Return T if current buffer is in `poly-html-mode'." (bound-and-true-p poly-php-html-mode)) (defconst php-beginning-of-defun-regexp (eval-when-compile (rx bol (* (syntax whitespace)) (* (or "abstract" "final" "private" "protected" "public" "static") (+ (syntax whitespace))) "function" (+ (syntax whitespace)) (? "&" (* (syntax whitespace))) (group (+ (or (syntax word) (syntax symbol)))) (* (syntax whitespace)) "(")) "Regular expression for a PHP function.") (eval-when-compile (cl-defun php-create-regexp-for-method (&optional visibility &key include-args) "Make a regular expression for methods with the given VISIBILITY. VISIBILITY must be a string that names the visibility for a PHP method, e.g. `public'. The parameter VISIBILITY can itself also be a regular expression. The regular expression this function returns will check for other keywords that can appear in method signatures, e.g. `final' and `static'. The regular expression will have one capture group which will be the name of the method." (when (stringp visibility) (setq visibility (list visibility))) (rx-to-string `(: line-start (* (syntax whitespace)) (group ,@(if visibility `((* (or "abstract" "final" "static") (+ (syntax whitespace))) (or ,@visibility) (+ (syntax whitespace)) (* (or "abstract" "final" "static") (+ (syntax whitespace)))) '((* (* (or "abstract" "final" "static" "private" "protected" "public") (+ (syntax whitespace)))))) "function" (+ (syntax whitespace)) (? "&" (* (syntax whitespace))) (group (+ (or (syntax word) (syntax symbol)))) (* (syntax whitespace)) "(" ,@(when include-args '((* any) line-end)))))) (defun php-create-regexp-for-classlike (type) "Accepts a `TYPE' of a `classlike' object as a string, such as `class' or `interface', and returns a regexp as a string which can be used to match against definitions for that classlike." (concat ;; 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-+\\)?" ;; 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'. "\\s-+\\(\\(?:\\sw\\|\\\\\\|\\s_\\)+\\)"))) (defconst php-imenu-generic-expression-default (eval-when-compile `(("Methods" ,(php-create-regexp-for-method nil :include-args t) 1) ("Properties" ,(rx line-start (* (syntax whitespace)) (group (+ (or "public" "protected" "private" "static" "var") (+ (syntax whitespace))) (* (? (? (or "|" "?")) (or "\\" (syntax word) (syntax symbol)) (+ (syntax whitespace)))) "$" (+ (or (syntax word) (syntax symbol))) word-boundary)) 1) ("Constants" ,(rx line-start (* (syntax whitespace)) (group (* (or "public" "protected" "private") (+ (syntax whitespace))) "const" (+ (syntax whitespace)) (+ (or (syntax word) (syntax symbol))) (* (syntax whitespace)) (? "=" (* (syntax whitespace)) (repeat 0 40 any)))) 1) ("Functions" ,(rx line-start (* (syntax whitespace)) (group "function" (+ (syntax whitespace)) (+ (or (syntax word) (syntax symbol))) (* (syntax whitespace)) "(" (repeat 0 100 any))) 1) ("Import" ,(rx line-start ;; (* (syntax whitespace)) (group "use" (+ (syntax whitespace)) (repeat 0 100 any))) 1) ("Classes" ,(php-create-regexp-for-classlike "\\(?:class\\|interface\\|trait\\|enum\\)") 0) ("Namespace" ,(php-create-regexp-for-classlike "namespace") 1))) "Imenu generic expression for PHP Mode. See `imenu-generic-expression'.") (defconst php-imenu-generic-expression-simple (eval-when-compile `(("Methods" ,(php-create-regexp-for-method nil) 2) ("Properties" ,(rx line-start (* (syntax whitespace)) (+ (or "public" "protected" "private" "static" "var") (+ (syntax whitespace))) (* (? (? (or "|" "?")) (or "\\" (syntax word) (syntax symbol)) (+ (syntax whitespace)))) (group "$" (+ (or (syntax word) (syntax symbol)))) word-boundary) 1) ("Constants" ,(rx line-start (* (syntax whitespace)) (group (* (or "public" "protected" "private") (+ (syntax whitespace))) "const" (+ (syntax whitespace)) (+ (or (syntax word) (syntax symbol))))) 1) ("Functions" ,(rx line-start (* (syntax whitespace)) "function" (+ (syntax whitespace)) (group (+ (or (syntax word) (syntax symbol))))) 1) ("Classes" ,(php-create-regexp-for-classlike "\\(?:class\\|interface\\|trait\\|enum\\)") 1) ("Namespace" ,(php-create-regexp-for-classlike "namespace") 1))) "Imenu generic expression for PHP Mode. See `imenu-generic-expression'.") (defconst php-imenu-generic-expression-legacy (eval-when-compile `(("Namespaces" ,(php-create-regexp-for-classlike "namespace") 1) ("Classes" ,(php-create-regexp-for-classlike "class") 1) ("Interfaces" ,(php-create-regexp-for-classlike "interface") 1) ("Traits" ,(php-create-regexp-for-classlike "trait") 1) ("All Methods" ,(php-create-regexp-for-method) 1) ("Private Methods" ,(php-create-regexp-for-method '("private")) 2) ("Protected Methods" ,(php-create-regexp-for-method '("protected")) 2) ("Public Methods" ,(php-create-regexp-for-method '("public")) 2) ("Anonymous Functions" "\\<\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*=\\s-*f\\(unctio\\)?n\\s-*(" 1) ("Named Functions" "^\\s-*function\\s-+\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" 1))) "Imenu generic expression for PHP Mode. See `imenu-generic-expression'.") (defcustom php-imenu-generic-expression 'php-imenu-generic-expression-default "Default Imenu generic expression for PHP Mode. See `imenu-generic-expression'." :type '(choice (alist :key-type string :value-type (list string)) (const php-imenu-generic-expression-legacy) (const php-imenu-generic-expression-simple) variable) :group 'php) (defconst php--re-namespace-pattern (eval-when-compile (php-create-regexp-for-classlike "namespace"))) (defconst php--re-classlike-pattern (eval-when-compile (php-create-regexp-for-classlike (regexp-opt '("class" "interface" "trait"))))) (defvar php--analysis-syntax-table (eval-when-compile (let ((table (make-syntax-table))) (c-populate-syntax-table table) (modify-syntax-entry ?_ "w" table) (modify-syntax-entry ?` "\"" table) (modify-syntax-entry ?\" "\"" table) (modify-syntax-entry ?# "< b" table) (modify-syntax-entry ?\n "> b" table) table))) (defun php-get-current-element (re-pattern) "Return backward matched element by RE-PATTERN." (save-excursion (save-match-data (when (re-search-backward re-pattern nil t) (match-string-no-properties 1))))) (eval-and-compile (if (eval-when-compile (fboundp 'thing-at-point-bounds-of-string-at-point)) (defalias 'php--thing-at-point-bounds-of-string-at-point #'thing-at-point-bounds-of-string-at-point) ;; Copyright (C) 1991-1998, 2000-2022 Free Software Foundation, Inc. ;; Follows function is copied from Emacs 28's thingatpt.el. ;; https://github.com/emacs-mirror/emacs/commit/2abf143f8185fced544c4f8d144ea710142d7a59 (defun php--thing-at-point-bounds-of-string-at-point () "Return the bounds of the string at point. Prefer the enclosing string with fallback on sexp at point. \[Internal function used by `bounds-of-thing-at-point'.]" (save-excursion (let ((ppss (syntax-ppss))) (if (nth 3 ppss) ;; Inside the string (ignore-errors (goto-char (nth 8 ppss)) (cons (point) (progn (forward-sexp) (point)))) ;; At the beginning of the string (if (eq (char-syntax (char-after)) ?\") (let ((bound (bounds-of-thing-at-point 'sexp))) (and bound (<= (car bound) (point)) (< (point) (cdr bound)) bound)))))))) (if (eval-when-compile (fboundp 'c-end-of-token)) (defalias 'php--c-end-of-token #'c-end-of-token) ;; Copyright (C) 1985, 1987, 1992-2022 Free Software Foundation, Inc. ;; Follows function is copied from Emacs 27's cc-engine.el. ;; https://emba.gnu.org/emacs/emacs/-/commit/95fb826dc58965eac287c0826831352edf2e56f7 (defun php--c-end-of-token (&optional back-limit) ;; Move to the end of the token we're just before or in the middle of. ;; BACK-LIMIT may be used to bound the backward search; if given it's ;; assumed to be at the boundary between two tokens. Return non-nil if the ;; point is moved, nil otherwise. ;; ;; This function might do hidden buffer changes. (let ((start (point))) (cond ;; ((< (skip-syntax-backward "w_" (1- start)) 0) ;; (skip-syntax-forward "w_")) ((> (skip-syntax-forward "w_") 0)) ((< (skip-syntax-backward ".()" back-limit) 0) (while (< (point) start) (if (looking-at c-nonsymbol-token-regexp) (goto-char (match-end 0)) ;; `c-nonsymbol-token-regexp' should always match since ;; we've skipped backward over punctuation or paren ;; syntax, but move forward in case it doesn't so that ;; we don't leave point earlier than we started with. (forward-char)))) (t (if (looking-at c-nonsymbol-token-regexp) (goto-char (match-end 0))))) (> (point) start))))) (defun php-leading-tokens (length) "Return a list of leading LENGTH tokens from cursor point. The token list is lined up in the opposite side of the visual arrangement. The order is reversed by calling as follows: \(nreverse \(php-leading-tokens 3\)\)" (save-excursion (save-match-data (with-syntax-table php--analysis-syntax-table (cl-loop repeat length do (progn (forward-comment (- (point))) (c-backward-token-2 1 nil)) collect (cond ((when-let* ((bounds (php--thing-at-point-bounds-of-string-at-point))) (prog1 (buffer-substring-no-properties (car bounds) (cdr bounds)) (goto-char (car bounds))))) ((looking-at php-re-token-symbols) (prog1 (match-string-no-properties 0) (goto-char (match-beginning 0)))) ((buffer-substring-no-properties (point) (save-excursion (php--c-end-of-token) (point)))))))))) (defun php-get-pattern () "Find the pattern we want to complete. `find-tag-default' from GNU Emacs etags.el." (car (php-leading-tokens 1))) ;;; Provide support for Flymake so that users can see warnings and ;;; errors in real-time as they write code. (defun php-flymake-php-init () "PHP specific init-cleanup routines. This is an alternative function of `flymake-php-init'. Look at the `php-executable' variable instead of the constant \"php\" command." (let ((init (with-no-warnings (flymake-php-init)))) (setf (car init) php-executable) init)) (defconst php-re-detect-html-tag-aggressive (eval-when-compile (rx (or (: string-start (* (in space)) "")) (: "<" (* (in space)) (+ (in alpha "-")) (* (in space)) ">")))))) (defconst php-re-detect-html-tag-default (eval-when-compile (rx (or (: string-start (* (in space)) "")))))) (defcustom php-re-detect-html-tag 'php-re-detect-html-tag-default "Regexp pattern variable-name of HTML detection." :group 'php :tag "PHP Re Detect HTML Tag" :type '(choice (const :tag "Default pattern" php-re-detect-html-tag-default) (const :tag "Aggressive pattern" php-re-detect-html-tag-aggressive) (variable :tag "Variable name of RegExp pattern"))) (defsubst php-re-detect-html-tag () "Return RegExp pattern for HTML detection." (if (symbolp php-re-detect-html-tag) (symbol-value php-re-detect-html-tag) php-re-detect-html-tag)) (defun php-buffer-has-html-tag () "Return position of HTML tag or NIL in current buffer." (save-excursion (save-restriction (widen) (goto-char (point-min)) (save-match-data (re-search-forward (php-re-detect-html-tag) nil t))))) (defun php-derivation-major-mode () "Return major mode for PHP file by file-name and its content." (let ((mode (assoc-default buffer-file-name php-template-mode-alist #'string-match-p)) type) (when (and (null mode) buffer-file-name php-project-php-file-as-template) (setq type (php-project-get-file-html-template-type buffer-file-name)) (cond ((eq t type) (setq mode php-html-template-major-mode)) ((eq 'auto type) (when (php-buffer-has-html-tag) (setq mode php-html-template-major-mode))))) (when (and mode (not (fboundp mode))) (if (string-match-p "\\.blade\\." buffer-file-name) (warn "php-mode is NOT support blade template. %s" "Please install `web-mode' package") (setq mode nil))) (or mode php-default-major-mode))) ;;;###autoload (define-derived-mode php-base-mode prog-mode "PHP" "Generic major mode for editing PHP. This mode is intended to be inherited by concrete major modes. Currently there are `php-mode' and `php-ts-mode'." :group 'php nil) ;;;###autoload (defun php-mode-maybe () "Select PHP mode or other major mode." (interactive) (run-hooks php-mode-maybe-hook) (funcall (php-derivation-major-mode))) ;;;###autoload (defun php-current-class () "Insert current class name if cursor in class context." (interactive) (let ((matched (php-get-current-element php--re-classlike-pattern))) (when matched (insert (concat matched php-class-suffix-when-insert))))) ;;;###autoload (defun php-current-namespace () "Insert current namespace if cursor in namespace context." (interactive) (let ((matched (php-get-current-element php--re-namespace-pattern))) (when matched (insert (concat matched php-namespace-suffix-when-insert))))) ;;;###autoload (defun php-copyit-fqsen () "Copy/kill class/method FQSEN." (interactive) (let ((namespace (or (php-get-current-element php--re-namespace-pattern) "")) (class (or (php-get-current-element php--re-classlike-pattern) "")) (namedfunc (php-get-current-element php-beginning-of-defun-regexp))) (kill-new (concat (if (string= namespace "") "" namespace) (if (string= class "") "" (concat "\\" class "::")) (if (string= namedfunc "") "" (concat namedfunc "()")))))) (defun php-topsy-beginning-of-defun-with-class () "Return function signature and class name string for header line in topsy. You can add the function to topsy with the code below: (add-to-list \\='topsy-mode-functions \\='(php-mode . php-topsy-beginning-of-defun-with-class))" (save-excursion (goto-char (window-start)) (mapconcat #'identity (append (save-match-data (save-excursion (when (re-search-backward php--re-classlike-pattern nil t) (font-lock-ensure (point) (line-end-position)) (list (string-trim (buffer-substring (point) (line-end-position))))))) (progn (beginning-of-defun) (font-lock-ensure (point) (line-end-position)) (list (string-trim (replace-regexp-in-string (eval-when-compile (rx bos ". ### Usage ``` Usage: ./script/extract_functions.php count < php_manual_en.json ./script/extract_functions.php modules < php_manual_en.json ./script/extract_functions.php functions < php_manual_en.json > result.json ./script/extract_functions.php functions-sexp < php_manual_en.json > result.el ``` ### Data A pattern for grouping function modules by function-id is written in `data/module_id_prefixes.php`. * All entries are combined as prefix matching patterns * The meanings of `.` and `\.` (matches) in the regular expression are swapped * `\.` matches any one character * `.` matches only `"."` * An alphanumeric-terminated entry requires an exact match * Other entries require a [`\b`(word boundary)](https://www.php.net/manual/regexp.reference.escape.php) at the end ```php return [ 'apache' => [ 'function.apache-', // matches all "apache-" prefixed IDs 'function.virtual', // matches only "function.virtual" ], 'bcmath' => [ 'function.bc\.+', // matches "function.bcadd", "function.bccomp", ...etc ], ``` php-mode-1.27.0/script/data/000077500000000000000000000000001473104261100155265ustar00rootroot00000000000000php-mode-1.27.0/script/data/module_id_prefixes.php000066400000000000000000000513241473104261100221120ustar00rootroot00000000000000 * @license FSFAP https://spdx.org/licenses/FSFAP.html */ // Copying and distribution of this file, with or without modification, // are permitted in any medium without royalty provided the copyright // notice and this notice are preserved. This file is offered as-is, // without any warranty. return [ 'apache' => [ 'function.apache-', 'function.virtual', ], 'apcu' => [ 'function.apcu-', ], 'bcmath' => [ 'function.bc\.+', ], 'bzip2' => [ 'function.bz\.+', ], 'calendar' => [ 'function.cal-', 'function.easter-date', 'function.easter-days', 'function.frenchtojd', 'function.gregoriantojd', 'function.jddayofweek', 'function.jdmonthname', 'function.jdtofrench', 'function.jdtogregorian', 'function.jdtojewish', 'function.jdtojulian', 'function.jdtounix', 'function.jewishtojd', 'function.unixtojd', ], 'commonmark' => [ 'function.commonmark-', ], 'com_dotnet' => [ 'function.com-', 'function.variant-', ], 'componere' => [ 'componere.', ], 'core' => [ 'function.abs', 'function.acos', 'function.acosh', 'function.addcslashes', 'function.addslashes', 'function.array-', 'function.arsort', 'function.asin', 'function.asinh', 'function.asort', 'function.assert-options', 'function.atan', 'function.atan2', 'function.atanh', 'function.base-convert', 'function.base64-', 'function.basename', 'function.bin2hex', 'function.bindec', 'function.boolval', 'function.call-user-func', 'function.call-user-func-array', 'function.ceil', 'function.chdir', 'function.checkdate', 'function.checkdnsrr', 'function.chgrp', 'function.chmod', 'function.chop', 'function.chown', 'function.chr', 'function.chroot', 'function.chunk-split', 'function.class-alias', 'function.class-exists', 'function.class-implements', 'function.class-parents', 'function.class-uses', 'function.clearstatcache', 'function.cli-', 'function.closedir', 'function.closelog', 'function.compact', 'function.connection-', 'function.constant', 'function.convert-cyr-string', 'function.convert-uudecode', 'function.convert-uuencode', 'function.copy', 'function.cos', 'function.cosh', 'function.count', 'function.count-chars', 'function.crc32', 'function.create-function', 'function.crypt', 'function.ctype-', 'function.current', 'function.date', 'function.date-', 'function.debug-', 'function.decbin', 'function.dechex', 'function.decoct', 'function.define', 'function.defined', 'function.deg2rad', 'function.delete', 'function.die', 'function.dir', 'function.dirname', 'function.disk-', 'function.diskfreespace', 'function.dl', 'function.dns-check-record', 'function.dns-get-mx', 'function.dns-get-record', 'function.doubleval', 'function.each', 'function.enum-exists', 'function.error-', 'function.escapeshellarg', 'function.escapeshellcmd', 'function.eval', 'function.exec', 'function.exit', 'function.exp', 'function.explode', 'function.expm1', 'function.extension-loaded', 'function.extract', 'function.fastcgi-', 'function.fclose', 'function.fdatasync', 'function.fdiv', 'function.feof', 'function.fflush', 'function.fgetc', 'function.fgetcsv', 'function.fgets', 'function.fgetss', 'function.file', 'function.file\.+', 'function.filter-', 'function.finfo-', 'function.floatval', 'function.flock', 'function.floor', 'function.flush', 'function.fmod', 'function.fnmatch', 'function.fopen', 'function.forward-static-call', 'function.forward-static-call-array', 'function.fpassthru', 'function.fprintf', 'function.fputcsv', 'function.fputs', 'function.fread', 'function.fscanf', 'function.fseek', 'function.fsockopen', 'function.fstat', 'function.fsync', 'function.ftell', 'function.ftruncate', 'function.func-get-arg', 'function.func-get-args', 'function.func-num-args', 'function.function-exists', 'function.fwrite', 'function.gc-', 'function.get-', 'function.getallheaders', 'function.getcwd', 'function.getdate', 'function.getenv', 'function.gethostbyaddr', 'function.gethostbyname', 'function.gethostbynamel', 'function.gethostname', 'function.getlastmod', 'function.getmxrr', 'function.getmygid', 'function.getmyinode', 'function.getmypid', 'function.getmyuid', 'function.getopt', 'function.getprotobyname', 'function.getprotobynumber', 'function.getrandmax', 'function.getrusage', 'function.getservbyname', 'function.getservbyport', 'function.gettimeofday', 'function.gettype', 'function.glob', 'function.gmdate', 'function.gmmktime', 'function.gmstrftime', 'function.hash', 'function.hash-', 'function.header', 'function.header-register-callback', 'function.header-remove', 'function.headers-list', 'function.headers-sent', 'function.hebrev', 'function.hebrevc', 'function.hex2bin', 'function.hexdec', 'function.highlight-file', 'function.highlight-string', 'function.hrtime', 'function.html-entity-decode', 'function.htmlentities', 'function.htmlspecialchars', 'function.htmlspecialchars-decode', 'function.http-build-query', 'function.http-response-code', 'function.hypot', 'function.idate', 'function.ignore-user-abort', 'function.implode', 'function.in-array', 'function.inet-', 'function.ini-', 'function.intdiv', 'function.interface-exists', 'function.intval', 'function.ip2long', 'function.is-a', 'function.is-array', 'function.is-bool', 'function.is-callable', 'function.is-countable', 'function.is-dir', 'function.is-double', 'function.is-executable', 'function.is-file', 'function.is-finite', 'function.is-float', 'function.is-infinite', 'function.is-int', 'function.is-integer', 'function.is-iterable', 'function.is-link', 'function.is-long', 'function.is-nan', 'function.is-null', 'function.is-numeric', 'function.is-object', 'function.is-readable', 'function.is-resource', 'function.is-scalar', 'function.is-string', 'function.is-subclass-of', 'function.is-uploaded-file', 'function.is-writable', 'function.is-writeable', 'function.iterator-', 'function.join', 'function.json-', 'function.juliantojd', 'function.key', 'function.key-exists', 'function.krsort', 'function.ksort', 'function.lcfirst', 'function.lcg-value', 'function.lchgrp', 'function.lchown', 'function.levenshtein', 'function.link', 'function.linkinfo', 'function.list', 'function.localeconv', 'function.localtime', 'function.log', 'function.log10', 'function.log1p', 'function.long2ip', 'function.lstat', 'function.ltrim', 'function.mail', 'function.max', 'function.md5', 'function.md5-file', 'function.memory-', 'function.metaphone', 'function.method-exists', 'function.microtime', 'function.mime-content-type', 'function.min', 'function.mkdir', 'function.mktime', 'function.money-format', 'function.move-uploaded-file', 'function.mt-', 'function.natcasesort', 'function.natsort', 'function.net-get-interfaces', 'function.next', 'function.nl-langinfo', 'function.nl2br', 'function.number-format', 'function.ob-', 'function.octdec', 'function.opcache-', 'function.opendir', 'function.openlog', 'function.ord', 'function.output-', 'function.pack', 'function.parse-ini-', 'function.parse-str', 'function.parse-url', 'function.passthru', 'function.password-', 'function.pathinfo', 'function.pclose', 'function.pfsockopen', 'function.php-ini-', 'function.php-sapi-name', 'function.php-strip-whitespace', 'function.php-uname', 'function.phpcredits', 'function.phpdbg-', 'function.phpinfo', 'function.phpversion', 'function.pi', 'function.popen', 'function.pos', 'function.pow', 'function.preg-', 'function.prev', 'function.print-r', 'function.printf', 'function.proc-', 'function.property-exists', 'function.putenv', 'function.quoted-printable-', 'function.quotemeta', 'function.rad2deg', 'function.rand', 'function.random-', 'function.range', 'function.rawurldecode', 'function.rawurlencode', 'function.readdir', 'function.readfile', 'function.readlink', 'function.realpath', 'function.realpath-', 'function.register-shutdown-function', 'function.register-tick-function', 'function.rename', 'function.reset', 'function.restore-', 'function.rewind', 'function.rewinddir', 'function.rmdir', 'function.round', 'function.rsort', 'function.rtrim', 'function.sapi-', 'function.scandir', 'function.seaslog-get-author', 'function.seaslog-get-version', 'function.serialize', 'function.session-', 'function.set-', 'function.setcookie', 'function.setlocale', 'function.setrawcookie', 'function.settype', 'function.sha1', 'function.sha1-file', 'function.shell-exec', 'function.show-source', 'function.shuffle', 'function.similar-text', 'function.sin', 'function.sinh', 'function.sizeof', 'function.sleep', 'function.sort', 'function.soundex', 'function.spl-', 'function.sprintf', 'function.sqrt', 'function.srand', 'function.sscanf', 'function.stat', 'function.str-', 'function.strcasecmp', 'function.strchr', 'function.strcmp', 'function.strcoll', 'function.strcspn', 'function.stream-', 'function.strftime', 'function.strip-tags', 'function.stripcslashes', 'function.stripos', 'function.stripslashes', 'function.stristr', 'function.strlen', 'function.strnatcasecmp', 'function.strnatcmp', 'function.strncasecmp', 'function.strncmp', 'function.strpbrk', 'function.strpos', 'function.strptime', 'function.strrchr', 'function.strrev', 'function.strripos', 'function.strrpos', 'function.strspn', 'function.strstr', 'function.strtok', 'function.strtolower', 'function.strtotime', 'function.strtoupper', 'function.strtr', 'function.strval', 'function.substr', 'function.substr-compare', 'function.substr-count', 'function.substr-replace', 'function.symlink', 'function.sys-get-temp-dir', 'function.sys-getloadavg', 'function.syslog', 'function.system', 'function.tan', 'function.tanh', 'function.tempnam', 'function.time', 'function.time-', 'function.timezone-', 'function.tmpfile', 'function.token-get-all', 'function.token-name', 'function.touch', 'function.trait-exists', 'function.trigger-error', 'function.trim', 'function.uasort', 'function.ucfirst', 'function.ucwords', 'function.uksort', 'function.umask', 'function.uniqid', 'function.unlink', 'function.unpack', 'function.unregister-tick-function', 'function.unserialize', 'function.unset', 'function.urldecode', 'function.urlencode', 'function.user-error', 'function.usleep', 'function.usort', 'function.var-dump', 'function.var-export', 'function.version-compare', 'function.vfprintf', 'function.vprintf', 'function.vsprintf', 'function.wordwrap', 'function.zend-thread-id', 'function.zend-version', 'pdo.getavailabledrivers', ], 'cubrid' => [ 'function.cubrid-', ], 'curl' => [ 'curlfile.', 'function.curl-', 'function.curl_upkeep', ], 'dba' => [ 'function.dba-', ], 'dbase' => [ 'function.dbase-', ], 'dio' => [ 'function.dio-', ], 'eio' => [ 'function.eio-', ], 'enchant' => [ 'function.enchant-', ], 'exif' => [ 'function.exif-', 'function.read-exif-', ], 'expect' => [ 'function.expect-', ], 'fann' => [ 'function.fann-', ], 'fdf' => [ 'function.fdf-', ], 'fpm' => [ 'function.fpm-' ], 'ftp' => [ 'function.ftp-', ], 'gearman' => [ 'gearmanclient.', 'gearmantask.', ], 'gettext' => [ 'function.bind-textdomain-codeset', 'function.bindtextdomain', 'function.dcgettext', 'function.dcngettext', 'function.dgettext', 'function.dngettext', 'function.gettext', 'function.ngettext', 'function.textdomain', ], 'gd' => [ 'function.gd-', 'function.getimagesize', 'function.getimagesizefromstring', 'function.image\.+', 'function.iptcembed', 'function.iptcparse', ], 'gmp' => [ 'function.gmp-', ], 'geoip' => [ 'function.geoip-', ], 'gnupg' => [ 'function.gnupg-', ], 'ibase' => [ 'function.fbird-', 'function.ibase-', ], 'ibm_db2' => [ 'function.db2-', ], 'iconv' => [ 'function.iconv', 'function.iconv-', ], 'igbinary' => [ 'function.igbinary-', ], 'imap' => [ 'function.imap-', ], 'inotify' => [ 'function.inotify-', ], 'intl' => [ 'collator.', 'function.grapheme-', 'function.idn-', 'function.intl-', 'intlcalendar.', 'intldateformatter.', 'intltimezone.', 'locale.', 'messageformatter.', 'normalizer.', 'numberformatter.', 'resourcebundle.', 'transliterator.', ], 'language' => [ 'function.array', 'function.assert', 'function.echo', 'function.empty', 'function.halt-compiler', 'function.isset', 'function.print', ], 'ldap' => [ 'function.ldap-', ], 'libxml' => [ 'function.libxml-', ], 'lzf' => [ 'function.lzf-', ], 'mailparse' => [ 'function.mailparse-', ], 'mbstring' => [ 'function.mb-', ], 'memcache' => [ 'function.memcache-', ], 'mongodb' => [ 'function.mongodb.', ], 'mqseries' => [ 'function.mqseries-', ], 'mysqli' => [ 'mysqli-', 'mysqli.', 'function.mysqli-', ], 'mysql-obsolete' => [ 'function.mysql-', ], 'oauth' => [ 'function.oauth-', ], 'obsolete_7' => [ 'function.autoload', 'function.end', 'function.ezmlm-hash', 'function.is-real', 'function.jpeg2wbmp', 'function.mcrypt-', 'function.mdecrypt-', 'function.png2wbmp', 'function.wddx-', ], 'obsolete_8' => [ 'function.mhash', 'function.mhash-', 'function.utf8-decode', 'function.utf8-encode', 'function.zip-', ], 'oci8' => [ 'function.oci\.+', ], 'odbc' => [ 'function.odbc-', ], 'openal' => [ 'function.openal-', ], 'openssl' => [ 'function.openssl-', ], 'parallel' => [ 'parallel.', ], 'pcntl' => [ 'function.pcntl-', ], 'pgsql' => [ 'function.pg-', ], 'posix' => [ 'function.posix-', ], 'ps' => [ 'function.ps-', ], 'pspell' => [ 'function.pspell-', ], 'radius' => [ 'function.radius-', ], 'rar' => [ 'function.rar-', 'rararchive.', ], 'readline' => [ 'function.readline', 'function.readline-', ], 'recode' => [ 'function.recode', 'function.recode-', ], 'rnp' => [ 'function.rnp-', ], 'runkit7' => [ 'function.runkit7-', ], 'rpminfo' => [ 'function.rpm\.+', ], 'rrd' => [ 'function.rrd-', 'function.rrdc-', ], 'scoutapm' => [ 'function.scoutapm-', ], 'shmop' => [ 'function.shmop-', ], 'simdjson' => [ 'function.simdjson-' ], 'simplexml' => [ 'function.dom-import-simplexml', 'function.simplexml-', ], 'sqlsrv' => [ 'function.sqlsrv-', ], 'smnp' => [ 'function.snmp-', 'function.snmp2-', 'function.snmp3-', 'function.snmp\.+', ], 'sodium' => [ 'function.sodium-', ], 'soap' => [ 'function.is-soap-fault', 'function.use-soap-error-handler', ], 'socket' => [ 'function.socket-', ], 'solr' => [ 'function.solr-', ], 'ssdeep' => [ 'function.ssdeep-', ], 'ssh2' => [ 'function.ssh2-', ], 'stats' => [ 'function.stats-', ], 'stomp' => [ 'function.stomp-', 'stomp.', ], 'svn' => [ 'function.svn-', ], 'swoole' => [ 'function.swoole-', 'swoole-server.', ], 'sysvshm' => [ 'function.ftok', 'function.sem-', 'function.shm-', 'function.msg-get-queue', 'function.msg-queue-exists', 'function.msg-receive', 'function.msg-remove-queue', 'function.msg-send', 'function.msg-set-queue', 'function.msg-stat-queue', ], 'taint' => [ 'function.is-tainted', 'function.taint', 'function.untaint', ], 'tcpwrap' => [ 'function.tcpwrap-', ], 'tidy' => [ 'function.tidy-', 'tidy.', ], 'trader' => [ 'function.trader-', ], 'ui' => [ 'function.ui-', ], 'uopz' => [ 'function.uopz-', ], 'var_representation' => [ 'function.var-representation', ], 'win32service' => [ 'function.win32-', ], 'wincache' => [ 'function.wincache-', ], 'xattr' => [ 'function.xattr-', ], 'xdiff' => [ 'function.xdiff-', ], 'xhprof' => [ 'function.xhprof-', ], 'xml' => [ 'function.xml-', ], 'xmlrpc' => [ 'function.xmlrpc-', ], 'xmlwriter' => [ 'xmlwriter.', ], 'yaml' => [ 'function.yaml-', ], 'yaz' => [ 'function.yaz-', ], 'zlib' => [ 'function.deflate-', 'function.gz\.+', 'function.inflate-', 'function.readgzfile', 'function.zlib-', ], 'zookeeper' => [ 'function.zookeeper-', ] ]; php-mode-1.27.0/script/extract_functions.php000077500000000000000000000065361473104261100211050ustar00rootroot00000000000000#!/usr/bin/env php * @license FSFAP https://spdx.org/licenses/FSFAP.html */ // Copying and distribution of this file, with or without modification, // are permitted in any medium without royalty provided the copyright // notice and this notice are preserved. This file is offered as-is, // without any warranty. declare(strict_types=1); error_reporting(E_ALL); $functions = json_decode(stream_get_contents(STDIN), true); $command = $argv[0]; $subcommand = $argv[1] ?? null; $subcommands = [ 'count' => function (array $extracted) { echo json_encode(array_map(count(...), $extracted), JSON_PRETTY_PRINT), PHP_EOL; }, 'modules' => function (array $extracted) { echo implode(PHP_EOL, array_keys($extracted)), PHP_EOL; }, 'functions' => function (array $extracted) { echo json_encode(array_map(array_keys(...), $extracted), JSON_PRETTY_PRINT), PHP_EOL; }, 'functions-txt' => function (array $extracted) { foreach ($extracted as $functions) { foreach ($functions as $name => $_) { echo $name, PHP_EOL; } } }, 'functions-sexp' => function (array $extracted) { echo " '("; foreach ($extracted as $module => $functions) { echo "\n ({$module}"; // ksort($functions); foreach ($functions as $name => $function) { $escaped_name = strtr($name, ['\\' => '\\\\']); echo "\n \"{$escaped_name}\""; } echo ")"; } echo ")"; }, ]; if (!isset($subcommands[$subcommand])) { $json_url = 'http://doc.php.net/downloads/json/php_manual_en.json'; fwrite(STDERR, implode(PHP_EOL, [ "[Extract PHP Functions]\n", "This script extract PHP function names from <{$json_url}>.\n", "Usage:", "\t{$command} count < php_manual_en.json", "\t{$command} modules < php_manual_en.json", "\t{$command} functions < php_manual_en.json > result.json", "\t{$command} functions-sexp < php_manual_en.json > result.el", '', ])); exit(1); } $module_id_patterns = array_map( fn($allowlist) => '/\A(?:' . implode('|', array_map( fn($preg) => strtr($preg, ['\.' => '.', '.' => '\.']) . (preg_match('/[0-9a-z]\z/', $preg) ? '\z' : '\b'), $allowlist) ) . ')/', include __DIR__ . '/data/module_id_prefixes.php' ); $extracted = []; foreach ($functions as $name => $function) { if (str_contains($name, '::')) { continue; } $module = get_module($function, $module_id_patterns); if ($module === null) { fwrite(STDERR, "{$name}: {$function['id']}\n"); } else { $extracted[$module][$name] = $function; } } ksort($extracted); array_walk($extracted, function (&$functions) { ksort($functions); }); call_user_func($subcommands[$subcommand], $extracted); /** * @param array{id: non-empty-string} $function * @param array $function */ function get_module(array $function, array $patterns): ?string { foreach ($patterns as $module => $pattern) { if (preg_match($pattern, $function['id'])) { return $module; } } return null; } php-mode-1.27.0/script/module_id_prefixes.php000066400000000000000000000472761473104261100212140ustar00rootroot00000000000000 [ 'function.apache-', 'function.virtual', ], 'apcu' => [ 'function.apcu-', ], 'bcmath' => [ 'function.bc\.+', ], 'bzip2' => [ 'function.bz\.+', ], 'commonmark' => [ 'function.commonmark-', ], 'com_dotnet' => [ 'function.com-', 'function.variant-', ], 'componere' => [ 'componere.', ], 'core' => [ 'function.abs', 'function.acos', 'function.acosh', 'function.addcslashes', 'function.addslashes', 'function.array-', 'function.arsort', 'function.asin', 'function.asinh', 'function.asort', 'function.atan', 'function.atan2', 'function.atanh', 'function.base-convert', 'function.base64-', 'function.basename', 'function.bin2hex', 'function.bindec', 'function.boolval', 'function.cal-', 'function.call-user-func', 'function.call-user-func-array', 'function.ceil', 'function.chdir', 'function.checkdate', 'function.checkdnsrr', 'function.chgrp', 'function.chmod', 'function.chop', 'function.chown', 'function.chr', 'function.chroot', 'function.chunk-split', 'function.class-alias', 'function.class-exists', 'function.class-implements', 'function.class-parents', 'function.class-uses', 'function.clearstatcache', 'function.cli-', 'function.closedir', 'function.closelog', 'function.compact', 'function.connection-', 'function.constant', 'function.convert-cyr-string', 'function.convert-uudecode', 'function.convert-uuencode', 'function.copy', 'function.cos', 'function.cosh', 'function.count', 'function.count-chars', 'function.crc32', 'function.create-function', 'function.crypt', 'function.ctype-', 'function.current', 'function.date', 'function.debug-', 'function.decbin', 'function.dechex', 'function.decoct', 'function.define', 'function.defined', 'function.deg2rad', 'function.delete', 'function.die', 'function.dir', 'function.dirname', 'function.disk-', 'function.diskfreespace', 'function.dl', 'function.dns-check-record', 'function.dns-get-mx', 'function.dns-get-record', 'function.dom-import-simplexml', 'function.doubleval', 'function.each', 'function.easter-date', 'function.easter-days', 'function.enum-exists', 'function.error-', 'function.escapeshellarg', 'function.escapeshellcmd', 'function.eval', 'function.exec', 'function.exit', 'function.exp', 'function.explode', 'function.expm1', 'function.extension-loaded', 'function.extract', 'function.fastcgi-', 'function.fclose', 'function.fdatasync', 'function.fdiv', 'function.feof', 'function.fflush', 'function.fgetc', 'function.fgetcsv', 'function.fgets', 'function.fgetss', 'function.file', 'function.file\.+', 'function.filter-', 'function.finfo-', 'function.floatval', 'function.flock', 'function.floor', 'function.flush', 'function.fmod', 'function.fnmatch', 'function.fopen', 'function.forward-static-call', 'function.forward-static-call-array', 'function.fpassthru', 'function.fprintf', 'function.fputcsv', 'function.fputs', 'function.fread', 'function.frenchtojd', 'function.fscanf', 'function.fseek', 'function.fsockopen', 'function.fstat', 'function.fsync', 'function.ftell', 'function.ftruncate', 'function.func-get-arg', 'function.func-get-args', 'function.func-num-args', 'function.function-exists', 'function.fwrite', 'function.gc-', 'function.get-', 'function.getallheaders', 'function.getcwd', 'function.getdate', 'function.getenv', 'function.gethostbyaddr', 'function.gethostbyname', 'function.gethostbynamel', 'function.gethostname', 'function.getlastmod', 'function.getmxrr', 'function.getmygid', 'function.getmyinode', 'function.getmypid', 'function.getmyuid', 'function.getopt', 'function.getprotobyname', 'function.getprotobynumber', 'function.getrandmax', 'function.getrusage', 'function.getservbyname', 'function.getservbyport', 'function.gettimeofday', 'function.gettype', 'function.glob', 'function.gmdate', 'function.gmmktime', 'function.gmstrftime', 'function.gregoriantojd', 'function.hash', 'function.header', 'function.header-register-callback', 'function.header-remove', 'function.headers-list', 'function.headers-sent', 'function.hebrev', 'function.hebrevc', 'function.hex2bin', 'function.hexdec', 'function.highlight-file', 'function.highlight-string', 'function.hrtime', 'function.html-entity-decode', 'function.htmlentities', 'function.htmlspecialchars', 'function.htmlspecialchars-decode', 'function.http-build-query', 'function.http-response-code', 'function.hypot', 'function.idate', 'function.ignore-user-abort', 'function.implode', 'function.in-array', 'function.inet-', 'function.ini-', 'function.intdiv', 'function.interface-exists', 'function.intval', 'function.ip2long', 'function.is-a', 'function.is-array', 'function.is-bool', 'function.is-callable', 'function.is-countable', 'function.is-dir', 'function.is-double', 'function.is-executable', 'function.is-file', 'function.is-finite', 'function.is-float', 'function.is-infinite', 'function.is-int', 'function.is-integer', 'function.is-iterable', 'function.is-link', 'function.is-long', 'function.is-nan', 'function.is-null', 'function.is-numeric', 'function.is-object', 'function.is-readable', 'function.is-resource', 'function.is-scalar', 'function.is-string', 'function.is-subclass-of', 'function.is-uploaded-file', 'function.is-writable', 'function.is-writeable', 'function.iterator-', 'function.jddayofweek', 'function.jdmonthname', 'function.jdtofrench', 'function.jdtogregorian', 'function.jdtojewish', 'function.jdtojulian', 'function.jdtounix', 'function.jewishtojd', 'function.join', 'function.json-', 'function.juliantojd', 'function.key', 'function.key-exists', 'function.krsort', 'function.ksort', 'function.lcfirst', 'function.lcg-value', 'function.lchgrp', 'function.lchown', 'function.levenshtein', 'function.libxml-', 'function.link', 'function.linkinfo', 'function.list', 'function.localeconv', 'function.localtime', 'function.log', 'function.log10', 'function.log1p', 'function.long2ip', 'function.lstat', 'function.ltrim', 'function.mail', 'function.max', 'function.md5', 'function.md5-file', 'function.memory-', 'function.metaphone', 'function.method-exists', 'function.microtime', 'function.mime-content-type', 'function.min', 'function.mkdir', 'function.mktime', 'function.money-format', 'function.move-uploaded-file', 'function.mt-', 'function.natcasesort', 'function.natsort', 'function.net-get-interfaces', 'function.next', 'function.nl-langinfo', 'function.nl2br', 'function.number-format', 'function.ob-', 'function.octdec', 'function.opcache-', 'function.opendir', 'function.openlog', 'function.ord', 'function.output-', 'function.pack', 'function.parse-ini-', 'function.parse-str', 'function.parse-url', 'function.passthru', 'function.password-', 'function.pathinfo', 'function.pclose', 'function.pfsockopen', 'function.php-ini-', 'function.php-sapi-name', 'function.php-strip-whitespace', 'function.php-uname', 'function.phpcredits', 'function.phpdbg-', 'function.phpinfo', 'function.phpversion', 'function.pi', 'function.popen', 'function.pos', 'function.posix-', 'function.pow', 'function.preg-', 'function.prev', 'function.print-r', 'function.printf', 'function.proc-', 'function.property-exists', 'function.putenv', 'function.quoted-printable-', 'function.quotemeta', 'function.rad2deg', 'function.rand', 'function.random-', 'function.range', 'function.rawurldecode', 'function.rawurlencode', 'function.readdir', 'function.readfile', 'function.readlink', 'function.realpath', 'function.register-shutdown-function', 'function.register-tick-function', 'function.rename', 'function.reset', 'function.restore-', 'function.rewind', 'function.rewinddir', 'function.rmdir', 'function.round', 'function.rsort', 'function.rtrim', 'function.sapi-', 'function.scandir', 'function.seaslog-get-author', 'function.seaslog-get-version', 'function.serialize', 'function.session-', 'function.set-', 'function.setcookie', 'function.setlocale', 'function.setrawcookie', 'function.settype', 'function.sha1', 'function.sha1-file', 'function.shell-exec', 'function.show-source', 'function.shuffle', 'function.similar-text', 'function.simplexml-', 'function.sin', 'function.sinh', 'function.sizeof', 'function.sleep', 'function.socket-', 'function.sodium-', 'function.sort', 'function.soundex', 'function.spl-', 'function.sprintf', 'function.sqrt', 'function.srand', 'function.sscanf', 'function.stat', 'function.str-', 'function.strcasecmp', 'function.strchr', 'function.strcmp', 'function.strcoll', 'function.strcspn', 'function.stream-', 'function.strftime', 'function.strip-tags', 'function.stripcslashes', 'function.stripos', 'function.stripslashes', 'function.stristr', 'function.strlen', 'function.strnatcasecmp', 'function.strnatcmp', 'function.strncasecmp', 'function.strncmp', 'function.strpbrk', 'function.strpos', 'function.strptime', 'function.strrchr', 'function.strrev', 'function.strripos', 'function.strrpos', 'function.strspn', 'function.strstr', 'function.strtok', 'function.strtolower', 'function.strtotime', 'function.strtoupper', 'function.strtr', 'function.strval', 'function.substr', 'function.substr-compare', 'function.substr-count', 'function.substr-replace', 'function.symlink', 'function.sys-get-temp-dir', 'function.sys-getloadavg', 'function.syslog', 'function.system', 'function.tan', 'function.tanh', 'function.tempnam', 'function.time', 'function.timezone-', 'function.tmpfile', 'function.token-get-all', 'function.token-name', 'function.touch', 'function.trait-exists', 'function.trigger-error', 'function.trim', 'function.uasort', 'function.ucfirst', 'function.ucwords', 'function.uksort', 'function.umask', 'function.uniqid', 'function.unixtojd', 'function.unlink', 'function.unpack', 'function.unregister-tick-function', 'function.unserialize', 'function.unset', 'function.urldecode', 'function.urlencode', 'function.user-error', 'function.usleep', 'function.usort', 'function.var-dump', 'function.var-export', 'function.version-compare', 'function.vfprintf', 'function.vprintf', 'function.vsprintf', 'function.wordwrap', 'function.xml-', 'function.zend-thread-id', 'function.zend-version', 'pdo.getavailabledrivers', 'xmlwriter.', ], 'cubrid' => [ 'function.cubrid-', ], 'curl' => [ 'curlfile.', 'function.curl-', ], 'dba' => [ 'function.dba-', ], 'dbase' => [ 'function.dbase-', ], 'dio' => [ 'function.dio-', ], 'eio' => [ 'function.eio-', ], 'enchant' => [ 'function.enchant-', ], 'exif' => [ 'function.exif-', 'function.read-exif-', ], 'expect' => [ 'function.expect-', ], 'fann' => [ 'function.fann-', ], 'fdf' => [ 'function.fdf-', ], 'fpm' => [ 'function.fpm-' ], 'ftp' => [ 'function.ftp-', ], 'gearman' => [ 'gearmanclient.', 'gearmantask.', ], 'gettext' => [ 'function.bind-textdomain-codeset', 'function.bindtextdomain', 'function.dcgettext', 'function.dcngettext', 'function.dgettext', 'function.dngettext', 'function.gettext', 'function.ngettext', 'function.textdomain', ], 'gd' => [ 'function.gd-', 'function.getimagesize', 'function.getimagesizefromstring', 'function.image\.+', 'function.iptcembed', 'function.iptcparse', ], 'gmp' => [ 'function.gmp-', ], 'geoip' => [ 'function.geoip-', ], 'gnupg' => [ 'function.gnupg-', ], 'ibase' => [ 'function.fbird-', 'function.ibase-', ], 'ibm_db2' => [ 'function.db2-', ], 'iconv' => [ 'function.iconv', ], 'igbinary' => [ 'function.igbinary-', ], 'imap' => [ 'function.imap-', ], 'inotify' => [ 'function.inotify-', ], 'intl' => [ 'collator.', 'function.grapheme-', 'function.idn-', 'function.intl-', 'intlcalendar.', 'intldateformatter.', 'intltimezone.', 'locale.', 'messageformatter.', 'normalizer.', 'numberformatter.', 'resourcebundle.', 'transliterator.', ], 'language' => [ 'function.array\z', 'function.assert', 'function.echo', 'function.empty', 'function.halt-compiler', 'function.isset', 'function.print\z', ], 'ldap' => [ 'function.ldap-', ], 'lzf' => [ 'function.lzf-', ], 'mailparse' => [ 'function.mailparse-', ], 'mbstring' => [ 'function.mb-', ], 'memcache' => [ 'function.memcache-', ], 'mongodb' => [ 'function.mongodb.', ], 'mqseries' => [ 'function.mqseries-', ], 'mysqli' => [ 'mysqli-', 'mysqli.', 'function.mysqli-', ], 'mysql-obsolete' => [ 'function.mysql-', ], 'oauth' => [ 'function.oauth-', ], 'obsolete_7' => [ 'function.autoload', 'function.end', 'function.ezmlm-hash', 'function.is-real', 'function.jpeg2wbmp', 'function.mcrypt-', 'function.mdecrypt-', 'function.png2wbmp', 'function.wddx-', ], 'obsolete_8' => [ 'function.mhash', 'function.utf8-decode', 'function.utf8-encode', 'function.zip-', ], 'oci8' => [ 'function.oci\.+', ], 'odbc' => [ 'function.odbc-', ], 'openal' => [ 'function.openal-', ], 'openssl' => [ 'function.openssl-', ], 'parallel' => [ 'parallel.', ], 'pcntl' => [ 'function.pcntl-', ], 'pgsql' => [ 'function.pg-', ], 'ps' => [ 'function.ps-', ], 'pspell' => [ 'function.pspell-', ], 'radius' => [ 'function.radius-', ], 'rar' => [ 'function.rar-', 'rararchive.', ], 'readline' => [ 'function.readline', ], 'recode' => [ 'function.recode', ], 'runkit7' => [ 'function.runkit7-', ], 'rpminfo' => [ 'function.rpm\.+', ], 'rrd' => [ 'function.rrd-', 'function.rrdc-', ], 'scoutapm' => [ 'function.scoutapm-', ], 'shmop' => [ 'function.shmop-', ], 'sqlsrv' => [ 'function.sqlsrv-', ], 'smnp' => [ 'function.snmp-', 'function.snmp2-', 'function.snmp3-', 'function.snmp\.+', ], 'soap' => [ 'function.is-soap-fault', 'function.use-soap-error-handler', ], 'solr' => [ 'function.solr-', ], 'ssdeep' => [ 'function.ssdeep-', ], 'ssh2' => [ 'function.ssh2-', ], 'stats' => [ 'function.stats-', ], 'stomp' => [ 'function.stomp-', 'stomp.', ], 'svn' => [ 'function.svn-', ], 'swoole' => [ 'function.swoole-', 'swoole-server.', ], 'sysvshm' => [ 'function.ftok', 'function.sem-', 'function.shm-', 'function.msg-get-queue', 'function.msg-queue-exists', 'function.msg-receive', 'function.msg-remove-queue', 'function.msg-send', 'function.msg-set-queue', 'function.msg-stat-queue', ], 'taint' => [ 'function.is-tainted', 'function.taint', 'function.untaint', ], 'tcpwrap' => [ 'function.tcpwrap-', ], 'tidy' => [ 'function.tidy-', 'tidy.', ], 'trader' => [ 'function.trader-', ], 'ui' => [ 'function.ui-', ], 'uopz' => [ 'function.uopz-', ], 'var_representation' => [ 'function.var-representation', ], 'win32service' => [ 'function.win32-', ], 'wincache' => [ 'function.wincache-', ], 'xattr' => [ 'function.xattr-', ], 'xdiff' => [ 'function.xdiff-', ], 'xhprof' => [ 'function.xhprof-', ], 'xmlrpc' => ['function.xmlrpc-'], 'yaml' => [ 'function.yaml-', ], 'yaz' => [ 'function.yaz-', ], 'zlib' => [ 'function.deflate-', 'function.gz\.+', 'function.inflate-', 'function.readgzfile', 'function.zlib-', ], 'zookeeper' => [ 'function.zookeeper-', ] ]; php-mode-1.27.0/tests/000077500000000000000000000000001473104261100144535ustar00rootroot00000000000000php-mode-1.27.0/tests/.dir-locals.el000066400000000000000000000001001473104261100170730ustar00rootroot00000000000000((emacs-lisp-mode (package-lint-main-file . "../php-mode.el"))) php-mode-1.27.0/tests/.editorconfig000066400000000000000000000003751473104261100171350ustar00rootroot00000000000000# EditorConfig is awesome: http://EditorConfig.org # top-most EditorConfig file root = false # Unix-style newlines with a newline ending every file [*.php] end_of_line = lf charset = utf-8 trim_trailing_whitespace = false insert_final_newline = false php-mode-1.27.0/tests/7.4/000077500000000000000000000000001473104261100147635ustar00rootroot00000000000000php-mode-1.27.0/tests/7.4/arrow-function.php000066400000000000000000000003701473104261100204510ustar00rootroot00000000000000 $x + $y; $fn2 = [ fn($x) => $x + $y ]; $z = 1; $fn3 = fn($x) => fn($y) => $x * $y + $z; php-mode-1.27.0/tests/7.4/arrow-function.php.faces000066400000000000000000000035601473104261100215350ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-comparison-op) (" ") ("$" . php-variable-sigil) ("x" . php-variable-name) (" ") ("+" . php-arithmetic-op) (" ") ("$" . php-variable-sigil) ("y" . php-variable-name) (";\n\n") ("$" . php-variable-sigil) ("fn2" . php-variable-name) (" ") ("=" . php-assignment-op) (" [\n ") ("fn" . php-keyword) ("(") ("$" . php-variable-sigil) ("x" . php-variable-name) (") ") ("=" . php-assignment-op) (">" . php-comparison-op) (" ") ("$" . php-variable-sigil) ("x" . php-variable-name) (" ") ("+" . php-arithmetic-op) (" ") ("$" . php-variable-sigil) ("y" . php-variable-name) ("\n];\n\n") ("$" . php-variable-sigil) ("z" . php-variable-name) (" ") ("=" . php-assignment-op) (" 1;\n") ("$" . php-variable-sigil) ("fn3" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("fn" . php-keyword) ("(") ("$" . php-variable-sigil) ("x" . php-variable-name) (") ") ("=" . php-assignment-op) (">" . php-comparison-op) (" ") ("fn" . php-keyword) ("(") ("$" . php-variable-sigil) ("y" . php-variable-name) (") ") ("=" . php-assignment-op) (">" . php-comparison-op) (" ") ("$" . php-variable-sigil) ("x" . php-variable-name) (" ") ("*" . php-arithmetic-op) (" ") ("$" . php-variable-sigil) ("y" . php-variable-name) (" ") ("+" . php-arithmetic-op) (" ") ("$" . php-variable-sigil) ("z" . php-variable-name) (";\n")) php-mode-1.27.0/tests/7.4/typed-property.php000066400000000000000000000004061473104261100205030ustar00rootroot00000000000000string = $var; } public function print() { var_dump($this->string); } } (new Typed)->print(); php-mode-1.27.0/tests/7.4/typed-property.php.faces000066400000000000000000000025161473104261100215670ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-object-op) ("string" . php-property-name) (" ") ("=" . php-assignment-op) (" ") ("$" . php-variable-sigil) ("var" . php-variable-name) (";\n }\n\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("print" . php-function-name) ("()\n {\n ") ("var_dump" . php-function-call-traditional) ("(") ("$" . php-this-sigil) ("this" . php-this) ("->" . php-object-op) ("string" . php-property-name) (");\n }\n}\n\n(") ("new" . php-keyword) (" ") ("Typed" . font-lock-type-face) (")") ("->" . php-object-op) ("print" . php-method-call-traditional) ("();\n")) php-mode-1.27.0/tests/8.0/000077500000000000000000000000001473104261100147605ustar00rootroot00000000000000php-mode-1.27.0/tests/8.0/attribute/000077500000000000000000000000001473104261100167635ustar00rootroot00000000000000php-mode-1.27.0/tests/8.0/attribute/class.php000066400000000000000000000005771473104261100206120ustar00rootroot00000000000000 static::Small, $cm < 100 => static::Medium, default => static::Large, }; } } php-mode-1.27.0/tests/8.1/enum.php.faces000066400000000000000000000026201473104261100175160ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-comparison-op) (" ") ("static" . php-keyword) ("::" . php-paamayim-nekudotayim) ("Small, ") ("$" . php-variable-sigil) ("cm" . php-variable-name) (" ") ("<" . php-comparison-op) (" 100 ") ("=" . php-assignment-op) (">" . php-comparison-op) (" ") ("static" . php-keyword) ("::" . php-paamayim-nekudotayim) ("Medium, ") ("default" . php-keyword) (" ") ("=" . php-assignment-op) (">" . php-comparison-op) (" ") ("static" . php-keyword) ("::" . php-paamayim-nekudotayim) ("Large, }; } } ")) php-mode-1.27.0/tests/8.1/readonly.php000066400000000000000000000004541473104261100173120ustar00rootroot00000000000000 $this->firstName . ' ' . $this->lastName; } // All write operations go through this hook, and the result is what is written. // Read access happens normally. public string $firstName { set => ucfirst(strtolower($value)); } // All write operations go through this hook, which has to write to the backing value itself. // Read access happens normally. public string $lastName { set { if (strlen($value) < 2) { throw new \InvalidArgumentException('Too short'); } $this->lastName = $value; } } } $p = new Person(); $p->firstName = 'peter'; print $p->firstName; // Prints "Peter" $p->lastName = 'Peterson'; print $p->fullName; // Prints "Peter Peterson" php-mode-1.27.0/tests/8.4/property-hooks.php.faces000066400000000000000000000071321473104261100215650ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-comparison-op) (" ") ("$" . php-this-sigil) ("this" . php-this) ("->" . php-object-op) ("firstName" . php-property-name) (" . ") ("' '" . php-string) (" . ") ("$" . php-this-sigil) ("this" . php-this) ("->" . php-object-op) ("lastName" . php-property-name) (";\n }\n\n ") ("// " . font-lock-comment-delimiter-face) ("All write operations go through this hook, and the result is what is written.\n" . font-lock-comment-face) (" ") ("// " . font-lock-comment-delimiter-face) ("Read access happens normally.\n" . font-lock-comment-face) (" ") ("public" . php-keyword) (" ") ("string" . php-class) (" ") ("$" . php-variable-sigil) ("firstName" . php-variable-name) (" {\n ") ("set" . php-builtin) (" ") ("=" . php-assignment-op) (">" . php-comparison-op) (" ") ("ucfirst" . php-function-call-traditional) ("(") ("strtolower" . php-function-call-traditional) ("(") ("$" . php-variable-sigil) ("value" . php-variable-name) ("));\n }\n\n ") ("// " . font-lock-comment-delimiter-face) ("All write operations go through this hook, which has to write to the backing value itself.\n" . font-lock-comment-face) (" ") ("// " . font-lock-comment-delimiter-face) ("Read access happens normally.\n" . font-lock-comment-face) (" ") ("public" . php-keyword) (" ") ("string" . php-class) (" ") ("$" . php-variable-sigil) ("lastName" . php-variable-name) (" {\n ") ("set" . php-builtin) (" {\n ") ("if" . php-keyword) (" (") ("strlen" . php-function-call-traditional) ("(") ("$" . php-variable-sigil) ("value" . php-variable-name) (") ") ("<" . php-comparison-op) (" 2) {\n ") ("throw" . php-keyword) (" ") ("new" . php-keyword) (" ") ("\\InvalidArgumentException" . font-lock-type-face) ("(") ("'Too short'" . php-string) (");\n }\n ") ("$" . php-this-sigil) ("this" . php-this) ("->" . php-object-op) ("lastName" . php-property-name) (" ") ("=" . php-assignment-op) (" ") ("$" . php-variable-sigil) ("value" . php-variable-name) (";\n }\n }\n}\n\n") ("$" . php-variable-sigil) ("p" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("new" . php-keyword) (" ") ("Person" . font-lock-type-face) ("();\n\n") ("$" . php-variable-sigil) ("p" . php-variable-name) ("->" . php-object-op) ("firstName" . php-property-name) (" ") ("=" . php-assignment-op) (" ") ("'peter'" . php-string) (";\n") ("print" . php-keyword) (" ") ("$" . php-variable-sigil) ("p" . php-variable-name) ("->" . php-object-op) ("firstName" . php-property-name) ("; ") ("// " . font-lock-comment-delimiter-face) ("Prints \"Peter\"\n" . font-lock-comment-face) ("$" . php-variable-sigil) ("p" . php-variable-name) ("->" . php-object-op) ("lastName" . php-property-name) (" ") ("=" . php-assignment-op) (" ") ("'Peterson'" . php-string) (";\n") ("print" . php-keyword) (" ") ("$" . php-variable-sigil) ("p" . php-variable-name) ("->" . php-object-op) ("fullName" . php-property-name) ("; ") ("// " . font-lock-comment-delimiter-face) ("Prints \"Peter Peterson\"\n" . font-lock-comment-face)) php-mode-1.27.0/tests/README.md000066400000000000000000000012271473104261100157340ustar00rootroot00000000000000Tests ===== This directory contains tests for PHP Mode. Each test begins with a comment header explaining the purpose of the test and a link to the relative [Github issue][github]. The main purpose of these tests are to demonstrate whether or not features like syntax highlighting and indentation work properly. Because of that, executing most of the tests is not important, since we do not care about how PHP itself interprets the test scripts. We only care about how Emacs and PHP Mode formats the code within each test. Please use the file `tests/template.php` as a start when creating new tests cases. [github]: https://github.com/emacs-php/php-mode php-mode-1.27.0/tests/arrays.php000066400000000000000000000006351473104261100164710ustar00rootroot00000000000000something() ->something(); // ###php-mode-test### ((indent 4)) var_dump( $object->something() // ###php-mode-test### ((indent 4)) ->something(), // ###php-mode-test### ((indent 8)) ); // ###php-mode-test### ((indent 0)) $arr = [ $object->something() // ###php-mode-test### ((indent 4)) /* comment */ ->something() // ###php-mode-test### ((indent 8)) ->something(), // ###php-mode-test### ((indent 8)) ]; // ###php-mode-test### ((indent 0)) php-mode-1.27.0/tests/indent/issue-702.php000066400000000000000000000014761473104261100201130ustar00rootroot00000000000000 PHP_VERSION_ID === 80000 ? 'foo' : 'bar', true && false, false || true, 'value1' , 'value2' , ]; var_dump( PHP_VERSION_ID === 80000 ? 'foo' : 'bar', true && // ###php-mode-test### ((indent 4)) false, false // ###php-mode-test### ((indent 4)) || true, // ###php-mode-test### ((indent 8)) // ###php-mode-test### ((indent 4)) 1 // ###php-mode-test### ((indent 4)) + 2 // ###php-mode-test### ((indent 8)) / 3, // ###php-mode-test### ((indent 8)) 'value1' // ###php-mode-test### ((indent 4)) , // ###php-mode-test### ((indent 4)) 'value2' // ###php-mode-test### ((indent 4)) , // ###php-mode-test### ((indent 4)) ); php-mode-1.27.0/tests/indent/issue-726.php000066400000000000000000000004201473104261100201050ustar00rootroot00000000000000 [ 'bee' => 2, ], // 'foo' => [ // 'bar' => 1, // ], // ###php-mode-test### ((indent 4)) 'lee' => 2, // 'dee' => 3 'gee' => 4, // ###php-mode-test### ((indent 4)) ]; // ###php-mode-test### ((indent 0)) php-mode-1.27.0/tests/indent/issue-774.php000066400000000000000000000007661473104261100201250ustar00rootroot00000000000000someFunction("some", "parameter") // ###php-mode-test### ((indent 0)) ->someOtherFunc(23, 42) // ###php-mode-test### ((indent 4)) ->andAThirdFunction(); // ###php-mode-test### ((indent 4)) $result = DateTime::createFromFormat('Y-m-d', '2112-09-03') // ###php-mode-test### ((indent 0)) ->someFunction(); // ###php-mode-test### ((indent 4)) $pages = $dbOld->createQueryBuilder() // ###php-mode-test### ((indent 0)) ->select('*'); // ###php-mode-test### ((indent 4)) php-mode-1.27.0/tests/issue-100.php000066400000000000000000000007731473104261100166210ustar00rootroot00000000000000' characters. * */ $x = ["x" => $this->foo() /* | column 18 */ ->bar() // ###php-mode-test### ((indent 18)) ->baz()]; // ###php-mode-test### ((indent 18)) $y = array("y" => $this->foo() /* | column 23 */ ->bar() // ###php-mode-test### ((indent 23)) ->baz()); // ###php-mode-test### ((indent 23)) // Test the combination of arglist indentation and cascaded calls $x = ['x' => M_PI, /* | column 6 */ 'x' => 123, // ###php-mode-test### ((indent 6)) 'x' => $y->method() // ###php-mode-test### ((indent 6)) /* | column 15 */ ->method()] // ###php-mode-test### ((indent 15))php-mode-1.27.0/tests/issue-124.php000066400000000000000000000006451473104261100166250ustar00rootroot00000000000000 'bar', // ###php-mode-test### ((indent 4)) 'spam' => 'ham', // ###php-mode-test### ((indent 4)) ); $levels = array(E_USER_NOTICE => 'notice', /* | column 16 */ E_USER_WARNING => 'warning', // ###php-mode-test### ((indent 16)) E_USER_ERROR => 'error'); // ###php-mode-test### ((indent 16)) array( 'a' => 1, /* | column 7 */ 'b' => 2 ); // ###php-mode-test### ((indent 7)) php-mode-1.27.0/tests/issue-135.php000066400000000000000000000036301473104261100166240ustar00rootroot00000000000000method() // ###php-mode-test### ((indent 0)) /* | column 9 */ ->chained(); // ###php-mode-test### ((indent 9)) // Test indentation of statement continuations (statement-cont) $variable ->method() // ###php-mode-test### ((indent 4)) ->method(); // ###php-mode-test### ((indent 4)) ClassName::method() ->chained(); // ###php-mode-test### ((indent 4)) // Test same behaviour inside a block function foo() { $variable->method() // ###php-mode-test### ((indent 4)) /* | column 13 */ ->chained(); // ###php-mode-test### ((indent 13)) ClassName::method() ->chained(); // ###php-mode-test### ((indent 8)) } // Test same behaviour inside an arglist foo($db->baz() /* | column 7 */ ->quux()); // ###php-mode-test### ((indent 7)) foo( $variable->method() // ###php-mode-test### ((indent 4)) /* | column 13 */ ->chained(), // ###php-mode-test### ((indent 13)) // Note that below indentation is different than when not inside // an arglist. When inside an arglist, cc-mode doesn't provide the // information that we're in a statement-cont as well. // // Future improvement: create a function like c-lineup-cascaded-calls // to have this indented like statement-cont. ClassName::method() ->chained() // ###php-mode-test### ((indent 4)) ); // Test same behaviour inside method class Test { public function test() { $variable->method() // ###php-mode-test### ((indent 8)) /* | column 17 */ ->chained(); // ###php-mode-test### ((indent 17)) ClassName::method() // ###php-mode-test### ((indent 8)) ->chained(); // ###php-mode-test### ((indent 12)) } } php-mode-1.27.0/tests/issue-136.php000066400000000000000000000021751473104261100166300ustar00rootroot00000000000000name; } public function getID() { return $this->id; } } $user = new User(); $user->name = "Eric"; $users = array($user); $index = 0; ob_start(); echo "My name is $name"; echo "My name is ${name}"; echo "My name is {$name}"; echo "My name is {$user->name}"; echo "My name is {$user->getName()}"; echo "My name is {$users[0]->name}"; echo "My name is {$users[$index]->name}"; echo "My name is {$users[$user->id]->name}"; echo "My name is {$users[$user->getID()]->name}"; ob_end_clean(); php-mode-1.27.0/tests/issue-136.php.faces000066400000000000000000000140371473104261100177100ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("\n * " . font-lock-doc-face) ("@link" php-doc-annotation-tag font-lock-doc-face) (" https://github.com/emacs-php/php-mode\n * " . font-lock-doc-face) ("@package" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("Emacs\\PHPMode" php-string font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n\n") ("// " . font-lock-comment-delimiter-face) ("one-line comment\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("@annotation This is NOT annotation. 1\n" . font-lock-comment-face) ("\n") ("/*" . font-lock-comment-delimiter-face) ("------------------------------------------------\n Multi-line comment\n\n * @annotation This is NOT annotation. 2\n -------------------------------------------------*/" . font-lock-comment-face) ("\n\n") ("// " . font-lock-comment-delimiter-face) ("/**\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("* Comment outed class implementation\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("*\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("* @annotation This is NOT annotation. 3\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("*/\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("class CommentOuted\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("{\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("}\n" . font-lock-comment-face) ("\n") ("/**\n * Class level doc-comment\n *\n * Description " . font-lock-doc-face) ("{@internal " php-doc-annotation-tag font-lock-doc-face) ("Description" php-string php-doc-annotation-tag font-lock-doc-face) ("}" php-doc-annotation-tag font-lock-doc-face) (" inline tag.\n *\n * " . font-lock-doc-face) ("@property-read" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) ("[]" php-string font-lock-doc-face) (" " . font-lock-doc-face) ("$" php-doc-variable-sigil font-lock-doc-face) ("name" php-variable-name font-lock-doc-face) ("\n * " . font-lock-doc-face) ("@ORM\\Table" php-doc-annotation-tag font-lock-doc-face) ("(name=\"majormodes\")\n * " . font-lock-doc-face) ("@ORM\\Entity" php-doc-annotation-tag font-lock-doc-face) ("(repositoryClass=\"Emacs\\Repository\\MajorModeRepository\")\n */" . font-lock-doc-face) ("\n") ("final" . php-keyword) (" ") ("class" . php-class-declaration) (" ") ("SampleClass" . font-lock-type-face) ("\n{\n ") ("/** Const doc-comment */" . font-lock-doc-face) ("\n ") ("const" . php-keyword) (" ") ("SAMPLE" . font-lock-type-face) (" = ") ("'SAMPLE'" . php-string) (";\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) (" sample property doc-comment */" . font-lock-doc-face) ("\n ") ("private" . php-keyword) (" ") ("$" . php-variable-sigil) ("name" . php-variable-name) (";\n\n ") ("/**\n * " . font-lock-doc-face) ("@param" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) (" " . font-lock-doc-face) ("$" php-doc-variable-sigil font-lock-doc-face) ("name" php-variable-name font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("__construct" . php-function-name) ("(") ("$" . php-variable-sigil) ("name" . php-variable-name) (")\n {\n ") ("$" . php-this-sigil) ("this" . php-this) ("->" . php-object-op) ("name" . php-property-name) (" = ") ("$" . php-variable-sigil) ("name" . php-variable-name) ("; ") ("// " . font-lock-comment-delimiter-face) ("comment in after code\n" . font-lock-comment-face) ("\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) ("|" php-string font-lock-doc-face) ("bool" font-lock-type-face php-string font-lock-doc-face) ("|" php-string font-lock-doc-face) ("array" font-lock-type-face php-string font-lock-doc-face) ("[]|ArrayObject" php-string font-lock-doc-face) (" */" . font-lock-doc-face) ("\n ") ("$" . php-variable-sigil) ("foo" . php-variable-name) (" = hoge();\n\n ") ("// " . font-lock-comment-delimiter-face) ("one-line comment\n" . font-lock-comment-face) (" ") ("// " . font-lock-comment-delimiter-face) ("@annotation This is NOT annotation. 4\n" . font-lock-comment-face) ("\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("int" font-lock-type-face php-string font-lock-doc-face) (" internal linter variable */" . font-lock-doc-face) ("\n ") ("$" . php-variable-sigil) ("offset" . php-variable-name) (" = 0;\n }\n\n ") ("/**\n * Summary\n *\n * " . font-lock-doc-face) ("@throws" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("\\RuntimeException" php-string font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("test" . php-function-name) ("()\n {\n ") ("throw" . php-keyword) (" ") ("new" . php-keyword) (" ") ("\\RuntimeException" . font-lock-type-face) (";\n }\n}\n")) php-mode-1.27.0/tests/issue-14.php000066400000000000000000000012701473104261100165360ustar00rootroot00000000000000find(array( * 'select' => 'title', * 'condition' => 'postID=:postID', * 'params' => array(':postID'=>10), * )); * */ $post = Post::model()->find(array( 'select' => 'title', // ###php-mode-test### ((indent c-basic-offset)) 'condition' => 'postID=:postID', // ###php-mode-test### ((indent c-basic-offset)) 'params' => array(':postID'=>10), // ###php-mode-test### ((indent c-basic-offset)) )); // ###php-mode-test### ((indent 0))php-mode-1.27.0/tests/issue-144.php000066400000000000000000000003611473104261100166220ustar00rootroot00000000000000 php-mode-1.27.0/tests/issue-145.php000066400000000000000000000005131473104261100166220ustar00rootroot00000000000000 $value) {} class Test { use TestTrait { test as protected; } } php-mode-1.27.0/tests/issue-18.php000066400000000000000000000007601473104261100165450ustar00rootroot00000000000000 html; return; }php-mode-1.27.0/tests/issue-186.php000066400000000000000000000024641473104261100166360ustar00rootroot00000000000000' operators aligned: * * $object = new SomeClass(); * $object->method() * ->another(); * * Alignment should occur on the '->' characters regardless of the * scope in which the method calls appear. */ $object = new StdClass(); $object->call() ->something(); class Whatever { public function __construct() { $object = new StdClass(); $object->call() ->something(); } public function something() { $object = new StdClass(); $object->call() ->something(); } } $closure = function() { $object = new StdClass(); $object->call() ->something(); }; function something() { $object = new StdClass(); $object->call() ->something(); } php-mode-1.27.0/tests/issue-197.php000066400000000000000000000003551473104261100166350ustar00rootroot00000000000000array; $test->int; $test->string; $test->int(); $test->string(); php-mode-1.27.0/tests/issue-197.php.faces000066400000000000000000000015751473104261100177220ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-object-op) ("array" . php-property-name) (";\n") ("$" . php-variable-sigil) ("test" . php-variable-name) ("->" . php-object-op) ("int" . php-property-name) (";\n") ("$" . php-variable-sigil) ("test" . php-variable-name) ("->" . php-object-op) ("string" . php-property-name) (";\n") ("$" . php-variable-sigil) ("test" . php-variable-name) ("->" . php-object-op) ("int" . php-method-call-traditional) ("();\n") ("$" . php-variable-sigil) ("test" . php-variable-name) ("->" . php-object-op) ("string" . php-method-call-traditional) ("();\n")) php-mode-1.27.0/tests/issue-200.php000066400000000000000000000005061473104261100166140ustar00rootroot00000000000000di->get('provider') ->filterByLanguage('en'); // ###php-mode-test### ((indent c-basic-offset)) function foo() { if (true) { $provider = $this->di->get('provier') ->filterByLanguage('en'); // ###php-mode-test### ((indent (+ c-basic-offset 8))) } }php-mode-1.27.0/tests/issue-253.php000066400000000000000000000004621473104261100166250ustar00rootroot00000000000000x = $x; } $STRING = '\'\'\''; function b($x = null) { $this->x = $x; } } php-mode-1.27.0/tests/issue-259.php000066400000000000000000000020731473104261100166330ustar00rootroot00000000000000/** * GitHub Issue: https://github.com/emacs-php/php-mode/issues/259 * * This code shows how writing a closure which imports external * variables with the `use` keyword causes php-mode to incorrectly * indent one level deeper when the closure is used as the actual * parameter of another function. * * Expected indentation: * * $foo(function($par1, $par2) use ($ext) { * return $par1 + $par2 + $ext; * }); */ $foo(function($par1, $par2) use ($ext) { return $par1 + $par2 + $ext; }); array_map(function($par1, $par2) use ($ext) { return $par1 + $par2 + $ext; }, $foo); class Foo { protected function foo() { $foo(function($par1, $par2) use ($ext) { return $par1 + $par2 + $ext; }); array_map(function($par1, $par2) use ($ext) { return $par1 + $par2 + $ext; }, $foo); } } function foo() { $foo(function($par1, $par2) use ($ext) { return $par1 + $par2 + $ext; }); array_map(function($par1, $par2) use ($ext) { return $par1 + $par2 + $ext; }, $foo); } php-mode-1.27.0/tests/issue-27.php000066400000000000000000000007701473104261100165460ustar00rootroot00000000000000#!/usr/bin/env php get("/index", function() { * $app->redirect("foo"); * }); * */ $app->get("/index", function() { $app->redirect("foo"); // ###php-mode-test### ((indent c-basic-offset)) }); // ###php-mode-test### ((indent 0)) php-mode-1.27.0/tests/issue-305.php000066400000000000000000000002441473104261100166210ustar00rootroot00000000000000set('config', function () use ($config) { return $config; }); $di->set('logger', function() use ($config) { $filename = date('Ymd'); $logger = new \Logger($config->application->logger->dir . $filename); $logger->setFormat($config->application->logger->format); return $logger; }); php-mode-1.27.0/tests/issue-439.php000066400000000000000000000007251473104261100166350ustar00rootroot00000000000000 /** GitHub Issue: https://github.com/emacs-php/php-mode/issues/443 */ <% echo "obsolete ASP tags" %> php-mode-1.27.0/tests/issue-443.php.27.faces000066400000000000000000000031251473104261100201340ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-php-tag) ("\n") ("/** GitHub Issue: https://github.com/emacs-php/php-mode/issues/443 */" . font-lock-doc-face) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("<%" . php-php-tag) (" ") ("echo" . php-keyword) (" ") ("\"obsolete ASP tags\"" . php-string) (" ") ("%>" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n")) php-mode-1.27.0/tests/issue-443.php.faces000066400000000000000000000030031473104261100177000ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-php-tag) ("\n") ("/** GitHub Issue: https://github.com/emacs-php/php-mode/issues/443 */" . font-lock-doc-face) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("<%" . php-php-tag) (" ") ("echo" . php-keyword) (" ") ("\"obsolete ASP tags\"" . php-string) (" ") ("%>" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n") ("" . php-php-tag) ("\n")) php-mode-1.27.0/tests/issue-503.php000066400000000000000000000000331473104261100166150ustar00rootroot00000000000000bar = $bar; } public function getBar() { // here is the whitespace return $this->bar; } } $foo = new Foo('bar'); $bar = $foo->getBar(); php-mode-1.27.0/tests/issue-66-bracket-namespace.php000066400000000000000000000007021473104261100221070ustar00rootroot00000000000000 php-mode-1.27.0/tests/issue-66-multi-namespace.php000066400000000000000000000006401473104261100216270ustar00rootroot00000000000000 php-mode-1.27.0/tests/issue-66-namespace.php000066400000000000000000000014651473104261100205050ustar00rootroot00000000000000call() ->something(); } } // place code here } // end of namespace foo\bar namespace another\bar; use my\space\MyClass; use my\space\AnotherClass; { $more = "other"; } // end of namespace another\bar ?>php-mode-1.27.0/tests/issue-66.php000066400000000000000000000013271473104261100165500ustar00rootroot00000000000000getMessage(), "\n"; } // http://www.php.net/manual/en/functions.anonymous.php $greet = function($name) { printf("Hello %s\r\n", $name); }; $greet('World'); $greet('PHP');php-mode-1.27.0/tests/issue-68.php000066400000000000000000000026751473104261100165610ustar00rootroot00000000000000 'mat_replica')); } catch (\MongoConnectionException $e) { throw $e; } catch (\Exception $e) { throw $e; } /* CC Mode uses the indentation syntax for 'topmost-intro' for the * 'catch' keywords in the remaining tests. */ try { $mongo = new \Mongo($dsn, array("replicaSet" => 'mat_replica')); } catch (\MongoConnectionException $e) { throw $e; } catch (\Exception $e) { throw $e; } try { $mongo = new \Mongo($dsn, array("replicaSet" => 'mat_replica')); } catch (\MongoConnectionException $e) { throw $e; } catch (\Exception $e) { throw $e; } php-mode-1.27.0/tests/issue-73.php000066400000000000000000000011341473104261100165420ustar00rootroot00000000000000' amd '::' and after '->' and * '::'. */ # Correct TEST::di->set('config', function () use ($config); # Test TEST :: di->set('config', function () use ($config); # Test TEST::di -> set('config', function () use ($config); # Test TEST::di->set('config' , function () use ($config); # Test TEST::di->set('config', function () use ($config) ; php-mode-1.27.0/tests/issue-83.php000066400000000000000000000005451473104261100165500ustar00rootroot00000000000000 tag should match the highlighting of its opening tag. */ ?> We'll go therephp-mode-1.27.0/tests/issue-99.php000066400000000000000000000007251473104261100165570ustar00rootroot00000000000000 * @link https://github.com/emacs-php/php-mode * @package Emacs\PHPMode */ // one-line comment // @annotation This is NOT annotation. 1 /*------------------------------------------------ Multi-line comment * @annotation This is NOT annotation. 2 -------------------------------------------------*/ // /** // * Comment outed class implementation // * // * @annotation This is NOT annotation. 3 // */ // class CommentOuted // { // } /** * Class level doc-comment * * Description {@internal Description} inline tag. * * @property-read string[] $name * @ORM\Table(name="majormodes") * @ORM\Entity(repositoryClass="Emacs\Repository\MajorModeRepository") */ final class SampleClass { /** Const doc-comment */ const SAMPLE = 'SAMPLE'; /** @var string sample property doc-comment */ private $name; /** * @param string $name */ public function __construct($name) { $this->name = $name; // comment in after code /** @var string|bool|array[]|ArrayObject */ $foo = hoge(); // one-line comment // @annotation This is NOT annotation. 4 /** @var int internal linter variable */ $offset = 0; } /** * Summary * * @throws \RuntimeException */ public function test() { throw new \RuntimeException; } } php-mode-1.27.0/tests/lang/doc-comment/comments.php.24.faces000066400000000000000000000143221473104261100234450ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("\n * " . font-lock-doc-face) ("@link" php-doc-annotation-tag font-lock-doc-face) (" https://github.com/emacs-php/php-mode\n * " . font-lock-doc-face) ("@package" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("Emacs\\PHPMode" php-string font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n\n") ("// " . font-lock-comment-delimiter-face) ("one-line comment\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("@annotation This is NOT annotation. 1\n" . font-lock-comment-face) ("\n") ("/*" . font-lock-comment-delimiter-face) ("------------------------------------------------\n Multi-line comment\n\n * @annotation This is NOT annotation. 2\n -------------------------------------------------*/" . font-lock-comment-face) ("\n\n") ("// " . font-lock-comment-delimiter-face) ("/**\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("* Comment outed class implementation\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("*\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("* @annotation This is NOT annotation. 3\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("*/\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("class CommentOuted\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("{\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("}\n" . font-lock-comment-face) ("\n") ("/**\n * Class level doc-comment\n *\n * Description " . font-lock-doc-face) ("{@internal " php-doc-annotation-tag font-lock-doc-face) ("Description" php-string php-doc-annotation-tag font-lock-doc-face) ("}" php-doc-annotation-tag font-lock-doc-face) (" inline tag.\n *\n * " . font-lock-doc-face) ("@property-read" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) ("[]" php-string font-lock-doc-face) (" " . font-lock-doc-face) ("$" php-doc-variable-sigil font-lock-doc-face) ("name" php-variable-name font-lock-doc-face) ("\n * " . font-lock-doc-face) ("@ORM\\Table" php-doc-annotation-tag font-lock-doc-face) ("(name=\"majormodes\")\n * " . font-lock-doc-face) ("@ORM\\Entity" php-doc-annotation-tag font-lock-doc-face) ("(repositoryClass=\"Emacs\\Repository\\MajorModeRepository\")\n */" . font-lock-doc-face) ("\n") ("final" . php-class-modifier) (" ") ("class" . php-class-declaration) (" ") ("SampleClass" . font-lock-type-face) ("\n{\n ") ("/** Const doc-comment */" . font-lock-doc-face) ("\n ") ("const" . php-keyword) (" ") ("SAMPLE" . php-constant-assign) (" ") ("=" . php-assignment-op) (" ") ("'SAMPLE'" . php-string) (";\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) (" sample property doc-comment */" . font-lock-doc-face) ("\n ") ("private" . php-keyword) (" ") ("$" . php-variable-sigil) ("name" . php-variable-name) (";\n\n ") ("/**\n * " . font-lock-doc-face) ("@param" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) (" " . font-lock-doc-face) ("$" php-doc-variable-sigil font-lock-doc-face) ("name" php-variable-name font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("__construct" . php-function-name) ("(") ("$" . php-variable-sigil) ("name" . php-variable-name) (")\n {\n ") ("$" . php-this-sigil) ("this" . php-this) ("->" . php-object-op) ("name" . php-property-name) (" ") ("=" . php-assignment-op) (" ") ("$" . php-variable-sigil) ("name" . php-variable-name) ("; ") ("// " . font-lock-comment-delimiter-face) ("comment in after code\n" . font-lock-comment-face) ("\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) ("|" php-string font-lock-doc-face) ("bool" font-lock-type-face php-string font-lock-doc-face) ("|" php-string font-lock-doc-face) ("array" font-lock-type-face php-string font-lock-doc-face) ("[]|ArrayObject" php-string font-lock-doc-face) (" */" . font-lock-doc-face) ("\n ") ("$" . php-variable-sigil) ("foo" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("hoge" . php-function-call-traditional) ("();\n\n ") ("// " . font-lock-comment-delimiter-face) ("one-line comment\n" . font-lock-comment-face) (" ") ("// " . font-lock-comment-delimiter-face) ("@annotation This is NOT annotation. 4\n" . font-lock-comment-face) ("\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("int" font-lock-type-face php-string font-lock-doc-face) (" internal linter variable */" . font-lock-doc-face) ("\n ") ("$" . php-variable-sigil) ("offset" . php-variable-name) (" ") ("=" . php-assignment-op) (" 0;\n }\n\n ") ("/**\n * Summary\n *\n * " . font-lock-doc-face) ("@throws" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("\\RuntimeException" php-string font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("test" . php-function-name) ("()\n {\n ") ("throw" . php-keyword) (" ") ("new" . php-keyword) (" ") ("\\RuntimeException" . font-lock-type-face) (";\n }\n}\n")) php-mode-1.27.0/tests/lang/doc-comment/comments.php.27.faces000066400000000000000000000143731473104261100234560ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("\n * " . font-lock-doc-face) ("@link" php-doc-annotation-tag font-lock-doc-face) (" https://github.com/emacs-php/php-mode\n * " . font-lock-doc-face) ("@package" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("Emacs\\PHPMode" php-string font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n\n") ("// " . font-lock-comment-delimiter-face) ("one-line comment\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("@annotation This is NOT annotation. 1\n" . font-lock-comment-face) ("\n") ("/*" . font-lock-comment-delimiter-face) ("------------------------------------------------\n Multi-line comment\n\n * @annotation This is NOT annotation. 2\n -------------------------------------------------" . font-lock-comment-face) ("*/" . font-lock-comment-delimiter-face) ("\n\n") ("// " . font-lock-comment-delimiter-face) ("/**\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("* Comment outed class implementation\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("*\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("* @annotation This is NOT annotation. 3\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("*/\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("class CommentOuted\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("{\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("}\n" . font-lock-comment-face) ("\n") ("/**\n * Class level doc-comment\n *\n * Description " . font-lock-doc-face) ("{@internal " php-doc-annotation-tag font-lock-doc-face) ("Description" php-string php-doc-annotation-tag font-lock-doc-face) ("}" php-doc-annotation-tag font-lock-doc-face) (" inline tag.\n *\n * " . font-lock-doc-face) ("@property-read" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) ("[]" php-string font-lock-doc-face) (" " . font-lock-doc-face) ("$" php-doc-variable-sigil font-lock-doc-face) ("name" php-variable-name font-lock-doc-face) ("\n * " . font-lock-doc-face) ("@ORM\\Table" php-doc-annotation-tag font-lock-doc-face) ("(name=\"majormodes\")\n * " . font-lock-doc-face) ("@ORM\\Entity" php-doc-annotation-tag font-lock-doc-face) ("(repositoryClass=\"Emacs\\Repository\\MajorModeRepository\")\n */" . font-lock-doc-face) ("\n") ("final" . php-class-modifier) (" ") ("class" . php-class-declaration) (" ") ("SampleClass" . font-lock-type-face) ("\n{\n ") ("/** Const doc-comment */" . font-lock-doc-face) ("\n ") ("const" . php-keyword) (" ") ("SAMPLE" . php-constant-assign) (" ") ("=" . php-assignment-op) (" ") ("'SAMPLE'" . php-string) (";\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) (" sample property doc-comment */" . font-lock-doc-face) ("\n ") ("private" . php-keyword) (" ") ("$" . php-variable-sigil) ("name" . php-variable-name) (";\n\n ") ("/**\n * " . font-lock-doc-face) ("@param" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) (" " . font-lock-doc-face) ("$" php-doc-variable-sigil font-lock-doc-face) ("name" php-variable-name font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("__construct" . php-function-name) ("(") ("$" . php-variable-sigil) ("name" . php-variable-name) (")\n {\n ") ("$" . php-this-sigil) ("this" . php-this) ("->" . php-object-op) ("name" . php-property-name) (" ") ("=" . php-assignment-op) (" ") ("$" . php-variable-sigil) ("name" . php-variable-name) ("; ") ("// " . font-lock-comment-delimiter-face) ("comment in after code\n" . font-lock-comment-face) ("\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) ("|" php-string font-lock-doc-face) ("bool" font-lock-type-face php-string font-lock-doc-face) ("|" php-string font-lock-doc-face) ("array" font-lock-type-face php-string font-lock-doc-face) ("[]|ArrayObject" php-string font-lock-doc-face) (" */" . font-lock-doc-face) ("\n ") ("$" . php-variable-sigil) ("foo" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("hoge" . php-function-call-traditional) ("();\n\n ") ("// " . font-lock-comment-delimiter-face) ("one-line comment\n" . font-lock-comment-face) (" ") ("// " . font-lock-comment-delimiter-face) ("@annotation This is NOT annotation. 4\n" . font-lock-comment-face) ("\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("int" font-lock-type-face php-string font-lock-doc-face) (" internal linter variable */" . font-lock-doc-face) ("\n ") ("$" . php-variable-sigil) ("offset" . php-variable-name) (" ") ("=" . php-assignment-op) (" 0;\n }\n\n ") ("/**\n * Summary\n *\n * " . font-lock-doc-face) ("@throws" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("\\RuntimeException" php-string font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("test" . php-function-name) ("()\n {\n ") ("throw" . php-keyword) (" ") ("new" . php-keyword) (" ") ("\\RuntimeException" . font-lock-type-face) (";\n }\n}\n")) php-mode-1.27.0/tests/lang/doc-comment/comments.php.faces000066400000000000000000000143221473104261100232210ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("\n * " . font-lock-doc-face) ("@link" php-doc-annotation-tag font-lock-doc-face) (" https://github.com/emacs-php/php-mode\n * " . font-lock-doc-face) ("@package" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("Emacs\\PHPMode" php-string font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n\n") ("// " . font-lock-comment-delimiter-face) ("one-line comment\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("@annotation This is NOT annotation. 1\n" . font-lock-comment-face) ("\n") ("/*" . font-lock-comment-delimiter-face) ("------------------------------------------------\n Multi-line comment\n\n * @annotation This is NOT annotation. 2\n -------------------------------------------------*/" . font-lock-comment-face) ("\n\n") ("// " . font-lock-comment-delimiter-face) ("/**\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("* Comment outed class implementation\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("*\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("* @annotation This is NOT annotation. 3\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("*/\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("class CommentOuted\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("{\n" . font-lock-comment-face) ("// " . font-lock-comment-delimiter-face) ("}\n" . font-lock-comment-face) ("\n") ("/**\n * Class level doc-comment\n *\n * Description " . font-lock-doc-face) ("{@internal " php-doc-annotation-tag font-lock-doc-face) ("Description" php-string php-doc-annotation-tag font-lock-doc-face) ("}" php-doc-annotation-tag font-lock-doc-face) (" inline tag.\n *\n * " . font-lock-doc-face) ("@property-read" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) ("[]" php-string font-lock-doc-face) (" " . font-lock-doc-face) ("$" php-doc-variable-sigil font-lock-doc-face) ("name" php-variable-name font-lock-doc-face) ("\n * " . font-lock-doc-face) ("@ORM\\Table" php-doc-annotation-tag font-lock-doc-face) ("(name=\"majormodes\")\n * " . font-lock-doc-face) ("@ORM\\Entity" php-doc-annotation-tag font-lock-doc-face) ("(repositoryClass=\"Emacs\\Repository\\MajorModeRepository\")\n */" . font-lock-doc-face) ("\n") ("final" . php-class-modifier) (" ") ("class" . php-class-declaration) (" ") ("SampleClass" . font-lock-type-face) ("\n{\n ") ("/** Const doc-comment */" . font-lock-doc-face) ("\n ") ("const" . php-keyword) (" ") ("SAMPLE" . php-constant-assign) (" ") ("=" . php-assignment-op) (" ") ("'SAMPLE'" . php-string) (";\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) (" sample property doc-comment */" . font-lock-doc-face) ("\n ") ("private" . php-keyword) (" ") ("$" . php-variable-sigil) ("name" . php-variable-name) (";\n\n ") ("/**\n * " . font-lock-doc-face) ("@param" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) (" " . font-lock-doc-face) ("$" php-doc-variable-sigil font-lock-doc-face) ("name" php-variable-name font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("__construct" . php-function-name) ("(") ("$" . php-variable-sigil) ("name" . php-variable-name) (")\n {\n ") ("$" . php-this-sigil) ("this" . php-this) ("->" . php-object-op) ("name" . php-property-name) (" ") ("=" . php-assignment-op) (" ") ("$" . php-variable-sigil) ("name" . php-variable-name) ("; ") ("// " . font-lock-comment-delimiter-face) ("comment in after code\n" . font-lock-comment-face) ("\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("string" font-lock-type-face php-string font-lock-doc-face) ("|" php-string font-lock-doc-face) ("bool" font-lock-type-face php-string font-lock-doc-face) ("|" php-string font-lock-doc-face) ("array" font-lock-type-face php-string font-lock-doc-face) ("[]|ArrayObject" php-string font-lock-doc-face) (" */" . font-lock-doc-face) ("\n ") ("$" . php-variable-sigil) ("foo" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("hoge" . php-function-call-traditional) ("();\n\n ") ("// " . font-lock-comment-delimiter-face) ("one-line comment\n" . font-lock-comment-face) (" ") ("// " . font-lock-comment-delimiter-face) ("@annotation This is NOT annotation. 4\n" . font-lock-comment-face) ("\n ") ("/** " . font-lock-doc-face) ("@var" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("int" font-lock-type-face php-string font-lock-doc-face) (" internal linter variable */" . font-lock-doc-face) ("\n ") ("$" . php-variable-sigil) ("offset" . php-variable-name) (" ") ("=" . php-assignment-op) (" 0;\n }\n\n ") ("/**\n * Summary\n *\n * " . font-lock-doc-face) ("@throws" php-doc-annotation-tag font-lock-doc-face) (" " . font-lock-doc-face) ("\\RuntimeException" php-string font-lock-doc-face) ("\n */" . font-lock-doc-face) ("\n ") ("public" . php-keyword) (" ") ("function" . php-keyword) (" ") ("test" . php-function-name) ("()\n {\n ") ("throw" . php-keyword) (" ") ("new" . php-keyword) (" ") ("\\RuntimeException" . font-lock-type-face) (";\n }\n}\n")) php-mode-1.27.0/tests/lang/doc-comment/inheritdoc.php000066400000000000000000000000401473104261100224340ustar00rootroot00000000000000string(); $foo->isset(); $a->b(); $a = a(); $aaa = aaa(); $_aa = _aa(); $a_a = a_a(); $aa_ = aa_(); $a1c = a1c(); $あ = あ(); $_a = $a(); php-mode-1.27.0/tests/lang/function/calls.php.faces000066400000000000000000000036251473104261100221160ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-object-op) ("string" . php-method-call-traditional) ("();\n") ("$" . php-variable-sigil) ("foo" . php-variable-name) ("->" . php-object-op) ("isset" . php-method-call-traditional) ("();\n\n\n") ("$" . php-variable-sigil) ("a" . php-variable-name) ("->" . php-object-op) ("b" . php-method-call-traditional) ("();\n") ("$" . php-variable-sigil) ("a" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("a" . php-function-call-traditional) ("();\n") ("$" . php-variable-sigil) ("aaa" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("aaa" . php-function-call-traditional) ("();\n") ("$" . php-variable-sigil) ("_aa" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("_aa" . php-function-call-traditional) ("();\n") ("$" . php-variable-sigil) ("a_a" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("a_a" . php-function-call-traditional) ("();\n") ("$" . php-variable-sigil) ("aa_" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("aa_" . php-function-call-traditional) ("();\n") ("$" . php-variable-sigil) ("a1c" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("a1c" . php-function-call-traditional) ("();\n") ("$" . php-variable-sigil) ("あ" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("あ" . php-function-call-traditional) ("();\n") ("$" . php-variable-sigil) ("_a" . php-variable-name) (" ") ("=" . php-assignment-op) (" ") ("$" . php-variable-sigil) ("a" . php-variable-name) ("();\n")) php-mode-1.27.0/tests/lang/function/closure.php000066400000000000000000000002441473104261100214060ustar00rootroot00000000000000 ;; Maintainer: USAMI Kenta ;; URL: https://github.com/emacs-php/php-mode ;; License: GPL-3.0-or-later ;;; License ;; 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 . ;;; Commentary: ;; Automate tests from the "tests" directory using `ert', which comes bundled ;; with Emacs >= 24.1. ;;; Code: (require 'php) (require 'php-mode) (require 'php-mode-debug) (require 'php-project) (require 'ert) (require 'cl-lib) (require 'imenu) ;; Work around bug #14325 ;; . (c-after-font-lock-init) (defvar php-mode-test-dir (if load-file-name (file-name-directory load-file-name) default-directory) "Directory containing the `php-mode' test files.") (defvar php-mode-test-valid-magics '(indent) "List of allowed \"magic\" directives which can appear in test cases.") (defvar php-mode-test-magic-regexp "###php-mode-test### \\((.+)\\)" "Regexp which identifies a magic comment.") ;; cl-letf does not work for global function on Emacs 24.3 or lower versions (when (and (= emacs-major-version 24) (<= emacs-minor-version 3)) (defun indent ())) (defun php-mode-test-process-magics () "Process the test directives in the current buffer. These are the ###php-mode-test### comments. Valid magics are listed in `php-mode-test-valid-magics'; no other directives will be processed." (cl-letf (((symbol-function 'indent) (lambda (offset) (let ((current-offset (current-indentation))) (unless (eq current-offset offset) (warn "line: %d context: %s\n" (line-number-at-pos) (c-guess-basic-syntax)) (list :line (line-number-at-pos) :expected offset :actual current-offset)))))) (let (directives answers) (save-excursion (goto-char (point-min)) (cl-loop while (re-search-forward php-mode-test-magic-regexp nil t) for directives = (read (buffer-substring (match-beginning 1) (match-end 1))) for result = (mapcar (lambda (expr) (let ((fn (car expr)) (args (mapcar 'eval (cdr-safe expr)))) (if (memq fn php-mode-test-valid-magics) (apply fn args)))) directives) append (cl-remove-if #'null result)))))) (defun php-mode-test--buffer-face-list (buffer) "Return list of (STRING . FACE) from `BUFFER'." (with-temp-buffer (jit-lock-mode -1) (insert (with-current-buffer buffer (buffer-substring (point-min) (point-max)))) (goto-char (point-min)) (let (retval begin-pos last-face current-face str) (setq last-face (get-text-property (point) 'face)) (setq begin-pos (point)) (forward-char 1) (while (< (point) (point-max)) (setq current-face (get-text-property (point) 'face)) (unless (equal current-face last-face) (setq str (buffer-substring-no-properties begin-pos (point))) (setq retval (nconc retval (list (cons str last-face)))) (setq begin-pos (point)) (setq last-face current-face)) (forward-char 1)) (setq str (buffer-substring-no-properties begin-pos (point))) (nconc retval (list (cons str last-face)))))) (defun php-mode-test--parse-list-file (file-path) "Return list from `FILE-PATH'." (with-temp-buffer (insert-file-contents file-path) (let ((read-circle t)) (read (current-buffer))))) (cl-defmacro with-php-mode-test ((file &key style indent magic custom faces) &rest body) "Set up environment for testing `php-mode'. Execute BODY in a temporary buffer containing the contents of FILE, in `php-mode'. Optional keyword `:style' can be used to set the coding style to one of the following: 1. `pear' 2. `drupal' 3. `wordpress' 4. `symfony2' 5. `psr2' Using any other symbol for STYLE results in undefined behavior. The test will use the PHP style by default. If the `:custom' keyword is set, customized variables are not reset to their default state prior to starting the test. Use this if the test should run with specific customizations set. If the `:faces' keyword is set, read the file with `.faces' added to that file name and check that the faces of the fonts in the buffer match." (declare (indent 1)) `(with-temp-buffer (setq php-mode-enable-backup-style-variables nil) (insert-file-contents (expand-file-name ,file php-mode-test-dir)) (setq default-directory (expand-file-name ".." (expand-file-name ,file php-mode-test-dir))) (php-mode) ,(if (fboundp 'font-lock-ensure) '(font-lock-ensure) '(with-no-warnings (font-lock-fontify-buffer))) ,(cl-case style (pear '(php-enable-pear-coding-style)) (drupal '(php-enable-drupal-coding-style)) (wordpress '(php-enable-wordpress-coding-style)) (symfony2 '(php-enable-symfony2-coding-style)) (psr2 '(php-enable-psr2-coding-style)) (t '(php-enable-default-coding-style))) ,(unless custom '(custom-set-variables '(php-lineup-cascaded-calls nil))) ,(if indent '(let ((inhibit-message t)) (indent-region (point-min) (point-max)))) ,(if magic `(should (equal (cons ,file nil) (cons ,file (php-mode-test-process-magics))))) ,(if faces `(should (equal (cons ,file (php-mode-test--parse-list-file (concat (expand-file-name ,file php-mode-test-dir) (if (eq t ,faces) ".faces" ,faces)))) (cons ,file (php-mode-test--buffer-face-list (current-buffer)))))) (goto-char (point-min)) (let ((case-fold-search nil)) ,@body))) (ert-deftest php-mode-test-namespace-block () "Proper indentation for classs and functions in namespace block." (with-php-mode-test ("namespace-block.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-9 () "Single quote in text in HTML misinterpreted. The next character after \">We\" is a single quote. It should not have a string face." :expected-result :failed (skip-unless (not (eq system-type darwin))) ; TODO: Failed on macOS 28.2 or above! (with-php-mode-test ("issue-9.php") (search-forward ">We") (forward-char) ;; Jump to after the opening apostrophe (should-not (eq (get-text-property (point) 'face) 'php-string)))) (ert-deftest php-mode-test-issue-14 () "Array indentation." (with-php-mode-test ("issue-14.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-16 () "Comma separated \"use\" (namespaces). Gets the face of the text after the comma." (with-php-mode-test ("issue-16.php") (re-search-forward "^use " nil nil 3) (should (eq (get-text-property (search-forward ", ") 'face) 'font-lock-type-face)))) (ert-deftest php-mode-test-issue-18 () "Indentation of strings which include \"//\"." (with-php-mode-test ("issue-18.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-19 () "Alignment of arrow operators." (custom-set-variables '(php-lineup-cascaded-calls t)) (with-php-mode-test ("issue-19.php" :indent t :custom t) (while (search-forward "$object->" (point-max) t) ;; Point is just after `->' (let ((col (current-column))) (search-forward "->") (should (= (current-column) col))))) ;; Test indentation again, but without php-lineup-cascaded-calls enabled (with-php-mode-test ("issue-19.php" :indent t) (while (search-forward "\\($object->\\)" (point-max) t) (match-beginning 0) ;; Point is just on `$' (let ((col (current-column))) (search-forward "->") (should (= (current-column) (+ col c-basic-offset))))))) (ert-deftest php-mode-test-issue-21 () "Font locking multi-line string." (with-php-mode-test ("issue-21.php") (search-forward "= ") (while (not (looking-at ";")) (should (eq (get-text-property (point) 'face) 'php-string)) (forward-char)))) (ert-deftest php-mode-test-issue-22 () "Font lock quotes within comments as regular comments. This applies for both single and double quotes." (with-php-mode-test ("issue-21.php") (while (search-forward "#" nil t) (while (not (looking-at "\n")) (should (eq (get-text-property (point) 'face) 'font-lock-comment-face)) (forward-char))))) (ert-deftest php-mode-test-issue-27 () "Indentation in a file with a shebang." (with-php-mode-test ("issue-27.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-28 () "Slowdown when scrolling. No obvious way to test this. One possibility is to record time it takes to scroll down the whole buffer using `next-line'. This may not cause the desired fontification, and it could take different amounts of time on different machines, so an absolute time would not be very useful. This doesn't test anything, for now." (should t)) (ert-deftest php-mode-test-issue-29 () "Indentation of anonymous functions as arguments. The closing brace and parenthesis should be at column 0." (with-php-mode-test ("issue-29.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-42 () "Error while indenting closures. If the bug has been fixed, indenting the buffer should not cause an error." (with-php-mode-test ("issue-42.php" :indent t))) (ert-deftest php-mode-test-issue-53 () "Check if whitespace effects are undone when changing coding style from Drupal." (dolist (mode '(pear wordpress symfony2)) ;; the file written to has no significance, only the buffer (let ((tmp-filename (concat (make-temp-name temporary-file-directory) ".php")) (auto-mode-alist '(("\\.php\\'" . php-mode)))) (with-php-mode-test ("issue-53.php") (search-forward "return $this->bar;") (should (equal (list "before-write-file" mode nil) (list "before-write-file" mode (looking-at-p "$")))) (php-set-style "drupal") (php-set-style (symbol-name mode)) (should (equal (list "drupal" mode nil) (list "drupal" mode show-trailing-whitespace))) (php-set-style "psr2") (php-set-style (symbol-name mode)) (should (equal (list "psr2" mode nil) (list "psr2" mode show-trailing-whitespace))) (php-set-style "drupal") (should (equal (list "drupal-2" mode t) (list "drupal-2" mode show-trailing-whitespace))) (write-file tmp-filename) (should (equal (list "after-write-file" mode t) (list "after-write-file" mode (looking-at-p "$")))))))) (ert-deftest php-mode-test-issue-73 () "The `delete-indentation' function should work properly for PHP. This means modifying the logic of `fixup-whitespace' so that it eliminates spaces before ',', ';', '->' amd '::' and after '->' and '::'." (with-php-mode-test ("issue-73.php") (when (search-forward "# Correct" nil t) (forward-line 1) (let ((correct-line (thing-at-point 'line))) (while (search-forward "# Test" nil t) (forward-line 1) (let ((current-line (line-number-at-pos))) (catch 'eob (while (not (looking-at-p "$")) (unless (zerop (forward-line 1)) (throw 'eob t)))) (forward-line -1) (while (not (eq (line-number-at-pos) current-line)) (delete-indentation)) (beginning-of-line) (should (string= (thing-at-point 'line) correct-line)))))))) (ert-deftest php-mode-test-issue-83 () "All static method should appear on imenu whether 'static' keyword is placed before or after visibility" (with-php-mode-test ("issue-83.php") (let* ((index-alist (imenu--make-index-alist)) (all-methods (mapcar 'car (cdr (assoc "Methods" index-alist))))) (should (equal all-methods (list "static public function staticBeforeVisibility()" "public static function staticAfterVisibility()")))))) (ert-deftest php-mode-test-issue-99 () "Proper indentation for 'foreach' statements without braces." (with-php-mode-test ("issue-99.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-115 () "Proper alignment for chained method calls inside arrays." (custom-set-variables '(php-lineup-cascaded-calls t)) (with-php-mode-test ("issue-115.php" :indent t :magic t :custom t))) (ert-deftest php-mode-test-issue-135 () "Proper alignment multiline statements." (custom-set-variables '(php-lineup-cascaded-calls t)) (with-php-mode-test ("issue-135.php" :indent t :magic t :custom t))) (ert-deftest php-mode-test-issue-130 () "Proper alignment array elements." (with-php-mode-test ("issue-130.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-124 () "Proper syntax propertizing when a quote appears in a heredoc." (with-php-mode-test ("issue-124.php" :indent t) (search-forward "Start of heredoc") ;; The heredoc should be recognized as a string. (dolist (syntax (c-guess-basic-syntax)) (should (eq (car syntax) 'string))) (search-forward "function bar") ;; After the heredoc should *not* be recognized as a string. (dolist (syntax (c-guess-basic-syntax)) (should (not (eq (car syntax) 'string)))))) (ert-deftest php-mode-test-issue-136 () "Proper highlighting for variable interpolation." (with-php-mode-test ("issue-136.php") :faces t)) (ert-deftest php-mode-test-issue-144 () "Indentation test '#' comment line has single quote." (with-php-mode-test ("issue-144.php" :indent t) (search-forward "$a" nil nil 3) (should (= (current-indentation) c-basic-offset)))) (ert-deftest php-mode-test-issue-145 () "Closure indentation." (with-php-mode-test ("issue-145.php" :indent t))) (ert-deftest php-mode-test-constants () "Proper highlighting for constants." (with-php-mode-test ("constants.php" :faces t))) (ert-deftest php-mode-test-identifiers() "Proper highlighting for identifiers including their namespace." (with-php-mode-test ("identifiers.php" :faces t))) (ert-deftest php-mode-test-variables () "Proper highlighting for variables." (with-php-mode-test ("variables.php" :faces t) (let ((variables '("regularVariable" "variableVariable" "staticVariable"))) (dolist (variable variables) (save-excursion (search-forward variable) (goto-char (match-beginning 0)) (should (eq 'php-variable-name (get-text-property (point) 'face)))))) (search-forward "memberVariable") (should (eq 'php-property-name (get-text-property (match-beginning 0) 'face))) (search-forward "funCall") (should-not (eq 'php-property-name (get-text-property (match-beginning 0) 'face))))) (ert-deftest php-mode-test-arrays() "Proper highlighting for array keyword." (with-php-mode-test ("arrays.php" :faces t))) (ert-deftest php-mode-test-issue-174 () "Test escaped quotes in string literals" (with-php-mode-test ("issue-174.php") (while (search-forward "quotation mark" nil t) (should (eq 'php-string (get-text-property (- (point) 1) 'face)))))) (ert-deftest php-mode-test-issue-175 () "Not highlight more than 2 digit number" (with-php-mode-test ("issue-175.php") (search-forward "10") (goto-char (match-beginning 0)) (should-not (get-text-property (point) 'face)))) (ert-deftest php-mode-test-language-constructs() "Test highlighting of language constructs and reserved keywords" (with-php-mode-test ("language-constructs.php") (while (search-forward "ClassName" nil t) (backward-char) (let ((token (symbol-at-point))) (should (equal (list token 'font-lock-type-face) (list token (get-text-property (point) 'face))))))) (with-php-mode-test ("language-constructs.php") (search-forward "Start:") (while (not (= (line-number-at-pos) (count-lines (point-min) (point-max)))) (forward-line 1) (let ((token (symbol-at-point))) (should (equal (list token 'php-keyword) (list token (get-text-property (point) 'face)))))))) (ert-deftest php-mode-test-issue-178 () "Highligth as keyword and following symbol" (with-php-mode-test ("issue-178.php") (search-forward "use Test as") (should (eq 'php-keyword (get-text-property (- (point) 1) 'face))) (should (eq 'font-lock-type-face (get-text-property (+ (point) 1) 'face))) (search-forward "$values as") (should (eq 'php-keyword (get-text-property (- (point) 1) 'face))) (should (eq 'php-variable-name (get-text-property (+ (point) 2) 'face))) (search-forward "test as") (should (eq 'php-keyword (get-text-property (- (point) 1) 'face))) (should (eq 'php-keyword (get-text-property (+ (point) 1) 'face))))) (ert-deftest php-mode-test-issue-186 () "Indentation of switch case body preceeded by multiple case statements" (with-php-mode-test ("issue-186.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-197 () "Test highlighting of member and function names (should not have type face)" (with-php-mode-test ("issue-197.php" :faces t))) (ert-deftest php-mode-test-issue-200 () "Test highlighting and elimination of extraneous whitespace in PSR-2 mode" (with-php-mode-test ("issue-200.php") (php-set-style "psr2") (should show-trailing-whitespace) (should (and (listp before-save-hook) (member 'delete-trailing-whitespace before-save-hook))))) (ert-deftest php-mode-test-issue-201 () "Test highlighting of special variables" (with-php-mode-test ("issue-201.php" :faces t))) (ert-deftest php-mode-test-issue-211 () "Test indentation of string concatination" (with-php-mode-test ("issue-211.php") (search-forward "\$str =") (let ((equal-indentation (1- (current-column)))) ;; because cursor is after '=' (forward-line 1) (call-interactively 'indent-for-tab-command) (should (= (current-column) equal-indentation))) (search-forward "\$str_long_name =") (let ((equal-indentation (1- (current-column)))) (forward-line 1) (call-interactively 'indent-for-tab-command) (should (= (current-column) equal-indentation))) (search-forward "\$sql =") (let ((equal-indentation (1- (current-column)))) (forward-line 2) (call-interactively 'indent-for-tab-command) (should (= (current-column) equal-indentation))))) (ert-deftest php-mode-test-issue-184() "Test indent-line for statements and heredoc end at beginning of lines" (with-php-mode-test ("issue-184.php") (search-forward "html;") (php-cautious-indent-line) (should (= (current-indentation) 0)) (search-forward "return;") (php-cautious-indent-line) (should (= (current-indentation) c-basic-offset)))) (ert-deftest php-mode-test-switch-statements() "Test indentation inside switch statements" (with-php-mode-test ("switch-statements.php" :indent t :style pear) (search-forward "case true:") (should (eq (current-indentation) 0)) (search-forward "break") (should (eq (current-indentation) c-basic-offset))) (with-php-mode-test ("switch-statements.php" :indent t :style psr2) (search-forward "case true:") (should (eq (current-indentation) c-basic-offset)) (search-forward "break") (should (eq (current-indentation) (* 2 c-basic-offset))) (search-forward "return") (should (eq (current-indentation) (* 2 c-basic-offset))))) (ert-deftest php-mode-test-issue-237 () "Indent chaining method for PSR2." (with-php-mode-test ("issue-237.php" :indent t :style psr2 :magic t))) (ert-deftest php-mode-test-issue-253 () "Test highlight after string literal which contains many escaped quotes." (with-php-mode-test ("issue-253.php") (search-forward "$x" nil nil 3) (should (eq 'php-variable-name (get-text-property (1- (point)) 'face))) (search-forward "$this") (should (eq 'php-this-sigil (get-text-property (match-beginning 0) 'face))) (should (eq 'php-this (get-text-property (1+ (match-beginning 0)) 'face))) (search-forward "$x") (should (eq 'php-variable-sigil (get-text-property (match-beginning 0) 'face))) (should (eq 'php-variable-name (get-text-property (1+ (match-beginning 0)) 'face))))) (ert-deftest php-mode-test-issue-305 () "Test highlighting variables which contains 'this' or 'that'." (with-php-mode-test ("issue-305.php" :faces t))) (ert-deftest php-mode-test-issue-307 () "Activating php-mode should not mark the buffer as modified." (with-php-mode-test ("issue-307.php") (set-buffer-modified-p nil) (php-mode) (should-not (buffer-modified-p)))) (ert-deftest php-mode-test-issue-314 () "Activating php-mode should not move point." (with-php-mode-test ("issue-314.php") (let ((orig-point (point))) (php-mode) (should (eq (point) orig-point))))) (ert-deftest php-mode-test-issue-310 () "Proper indentation after function with return type." (with-php-mode-test ("issue-310.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-333 () "Do not freeze Emacs by font-lock regexp pattern." (with-php-mode-test ("issue-333.php"))) (ert-deftest php-mode-test-issue-357 () "Match version-specific interpreters." (dolist (on '("php" "php3" "php5" "php7" "php-5" "php-5.5" "php7.0.1")) (with-temp-buffer (insert "#!" on) (set-auto-mode) (should (eq 'php-mode major-mode)))) (dolist (off '("php2" "xphp5" "foo" "php7x")) (with-temp-buffer (insert "#!" off) (set-auto-mode) (should (not (eq 'php-mode major-mode)))))) (ert-deftest php-mode-test-issue-439 () "Various heredoc/nowdoc formats are highlighted appropriately." (with-php-mode-test ("issue-439.php" :faces t))) (ert-deftest php-mode-test-issue-443 () "This case allows you to color things that are not authentic PHP tags (ex. ` pos bof) (< pos (point))))))) (ert-deftest php-mode-test-issue-503 () "Function `php-beginning-of-defun' should return non-nil on success." (with-php-mode-test ("issue-503.php") (php-mode) (goto-char (point-max)) (should (eq (php-mode-test-in-function-p) nil)) (should (eq (php-mode-test-in-function-p (1- (point))) t)) (should (eq (php-mode-test-in-function-p 1) nil)) (should (eq (php-mode-test-in-function-p 24) t)) (goto-char (point-min)) (should (eq (php-mode-test-in-function-p nil) nil)))) (ert-deftest php-mode-test-issue-623 () "Proper alignment object -> accessor." (with-php-mode-test ("indent/issue-623.php" :indent t :magic t))) (ert-deftest php-mode-test-issue-702 () "Proper alignment arglist." (with-php-mode-test ("indent/issue-702.php" :indent t :magic t)) (with-php-mode-test ("indent/issue-726.php" :indent t :magic t))) (ert-deftest php-mode-test-php74 () "Test highlighting language constructs added in PHP 7.4." (with-php-mode-test ("7.4/arrow-function.php" :faces t)) (with-php-mode-test ("7.4/typed-property.php" :faces t))) (ert-deftest php-mode-test-php80 () "Test highlighting language constructs added in PHP 8.0." (with-php-mode-test ("8.0/attribute/class.php" :faces t)) (with-php-mode-test ("8.0/attribute/function.php" :faces t)) (with-php-mode-test ("8.0/attribute/function2.php" :faces t))) (ert-deftest php-mode-test-php81 () "Test highlighting language constructs added in PHP 8.1." (with-php-mode-test ("8.1/enum.php" :faces t)) (with-php-mode-test ("8.1/readonly.php" :faces t))) (ert-deftest php-mode-test-php84 () "Test highlighting language constructs added in PHP 8.4." (with-php-mode-test ("8.4/property-hooks.php" :faces t))) (ert-deftest php-mode-test-lang () "Test highlighting for language constructs." (with-php-mode-test ("lang/class/anonymous-class.php" :indent t :magic t :faces t)) (with-php-mode-test ("lang/doc-comment/comments.php" :faces (cond ((eq emacs-major-version 24) ".24.faces") ((version<= "27" emacs-version) ".27.faces") (t t)))) (with-php-mode-test ("lang/doc-comment/annotation.php" :faces t)) (with-php-mode-test ("lang/doc-comment/issue-8.php" :faces t)) (with-php-mode-test ("lang/doc-comment/inheritdoc.php" :faces t)) (with-php-mode-test ("lang/doc-comment/return-type.php" :faces t)) (with-php-mode-test ("lang/function/calls.php" :faces t)) (with-php-mode-test ("lang/function/closure.php" :indent t :magic t :faces t)) (with-php-mode-test ("lang/import/import-constant.php" :faces t)) (with-php-mode-test ("lang/import/import-function.php" :faces t)) (with-php-mode-test ("lang/try-cactch/multiple.php" :faces t)) (with-php-mode-test ("lang/types/cast.php" :faces t)) (with-php-mode-test ("lang/types/function.php" :faces t)) (with-php-mode-test ("lang/types/keywords.php" :faces t)) (with-php-mode-test ("lang/errorcontrol.php" :faces t)) (with-php-mode-test ("lang/magical-constants/echo.php" :faces t))) (ert-deftest php-mode-test-pear () "Tests for PEAR style." (with-php-mode-test ("indent/issue-227.php" :indent t :magic t :style pear)) (with-php-mode-test ("indent/issue-774.php" :indent t :magic t :style pear))) ;; For developers: How to make .faces list file. ;; ;; 1. Press `M-x eval-buffer' in this file bufffer. ;; 2. Copy follows code snippet: ;; (setq x (php-mode-test--buffer-face-list (current-buffer))) ;; 3. Visit target buffer of testing PHP file. ;; 4. Press `M-:' (or `M-x eval-expression') and yank killed the code snippet. ;; 5. Press `M-x ielm' and input `x' and RET key. ;; 6. Kill output list and yank list to .faces file. ;; 7. Execute `make test' in shell. ;;; php-mode-test.el ends here php-mode-1.27.0/tests/profiler/000077500000000000000000000000001473104261100162755ustar00rootroot00000000000000php-mode-1.27.0/tests/profiler/large-string-interpolation.php000066400000000000000000001161211473104261100242730ustar00rootroot00000000000000memberVariable; $object->funCall(); php-mode-1.27.0/tests/variables.php.faces000066400000000000000000000027221473104261100202170ustar00rootroot00000000000000;; -*- mode: emacs-lisp -*- (("" . php-object-op) ("memberVariable" . php-property-name) (";\n") ("$" . php-variable-sigil) ("object" . php-variable-name) ("->" . php-object-op) ("funCall" . php-method-call-traditional) ("();\n"))