Giter Site home page Giter Site logo

php.tmbundle's Introduction

PHP Bundle for TextMate

Version 3.0.1 [2010-03-03]

Contributors: Josh Varner [email protected]

  • Fixes in the language grammar for class instantiations using variable class names

Version 3.0.0 [2010-03-02]

Contributors: Josh Varner [email protected]

  • Updated function lists and completion lists to be in line with PHP 5.3.1
  • Added script to make functions.plist completions file from functions.txt
  • Added support in language grammar for:
    • Namespaces
    • Interfaces extending other interfaces
    • Multi-line class/extends/inherits areas (before { or ;)
    • Anonymous function declarations
    • Closure calls and __invoke calls
    • New magic methods (__invoke, __callStatic, and so on)
    • Nowdoc support (essentially Heredoc but without interpolation)
  • Reformatted README in Markdown
  • Updated test-cases.php with examples for these new language

Version 2.0beta6 [2005-03-04] [email protected]

Contributors: Justin French, Sune Foldager, Allan Odgaard, Matteo Spinelli, Kumar McMillan, Mats Persson

PHP.plist

  • amended "comments.block.phpdocs.php" to highlight until end of line
  • amended "keywords.operators.comparison.php" to prevent highlighting of tags

Also added a reworked HTML (PHP) and added CSS (PHP) and JavaScript (PHP) syntaxes. These syntax files may still have some issues, visual bugs or missing words/tags/attributes, etc. If you find any fault, please let me know. Thanks!

HTML (PHP).plist

A reworking/rebuilding of the existing HTML-PHP syntax for more fine-grained control of tags, attributes and values, as well as some additions from the main HTML syntax file.

  • changed text formatting for better readability of syntax structure
  • changed syntax colouring to a darker more easy to read scheme (temporary display where all syntax groups have a unique colour)
  • added "macros.server-side-includes.html" for Server Side Includes syntax.
  • added "meta.docinfo.xml.html" for <?xml..> highlighting
  • removed "keywords.markup.tags.html" and "keywords.markup.tag.options.html" replaced with improved elements and attributes syntax groups (see next two points)
  • added "keywords.markup.elements.html" with named html elements so that only proper HTML tags are highlighted
  • added "keywords.markup.attributes.html" with named attributes so that only proper attributes are highlighted
  • changed "embedded.php" to "embedded.php.html"
  • added "embedded.css.html" for CSS syntax inside HTML files (see below for more info)
  • added "embedded.js.html" for JavaScript syntax inside HTML files (see below for more info)

CSS (PHP).plist

Added a CSS syntax for PHP which is also a complete reworking/rebuilding of the existing CSS syntax for more fine-grained control of selectors, properties and values.

  • text formatted for better readability of syntax structure
  • temporary syntax colouring in line with other files in this package for easier to read scheme (all syntax groups have a unique colour)
  • added/reworked "keywords.selectors.css" syntax group enabling unique syntax colouring for each sub-pattern
    • "keywords.selectors.html-elements.css" with named <tags>
    • "keywords.selectors.classes.css" for User Defined .Classes
    • "keywords.selectors.id.css" for User Defined #IDs
    • "keywords.selectors.pseudo-class.css" for :hover, :visited etc.
  • added "keywords.at-rules.css" for @import or @media syntaxes.
  • added "keywords.properties.css" for named properties values;
  • added/reworked "keywords.properties.values.css" with sub syntax groups
    • "keywords.properties.values.keywords.css" for CSS value keywords, like top, left, inherit etc.
    • "keywords.properties.values.fonts.css" for common Fonts, or "quoted fonts"
    • "keywords.properties.values.digits.css" for displayed numbers. = 10px
    • "keywords.properties.values.units.css" for px/em/cm/pt/% etc,
    • "keywords.properties.values.colors.css" for #FFFFFF colours
    • "keywords.properties.values.functions.css" for url(),rgb() etc. with sub patterns for strings, rgb colour and % values.

JavaScript (PHP).plist

Added a JS syntax for PHP which is also a complete reworking/rebuilding of the existing JavaScript syntax for more fine-grained control of Objects, Methods and properties.

  • text formatted for better readability of syntax structure
  • temporary syntax colouring in line with other files in this package for easier to read scheme (all syntax groups have a unique colour)
  • added "comments.html.js" for supported <!-- tags inside <script> tags in HTML.
  • changed "keywords.js" to "keywords.reserved.js" and added all known reserved keywords
  • added "keywords.objects.js" syntax group with named JS Objects (currently set to be case-insensitive, but can be changed to case sensitive)
  • added "keywords.methods.js" syntax group with named JS methods (case-sensitive)
  • added "keywords.properties.js" syntax group with named JS properties (case-sensitive)
  • added "keywords.event-handlers.js" syntax group with named JS Event-handlers (case-sensitive)
  • added "keywords.operators.js" syntax group with complete range of operators
  • added "constants.js" for JavaScript defined constants
  • disabled "strings.regex.js" as it cuts out syntax colouring. Needs more work.

Other

Also added a number of generic snippets.

Version 2.0beta5 [2005-02-28] [email protected]

  • changed text formatting for better readability of syntax structure
  • changed syntax colouring to a darker more easy to read scheme (still experimental)
  • changed Comments-> "PHPDoc tags" to "comments.block.phpdocs.php" for better TM stylesheet support
  • changed "keywords.control.php" syntax group to only deal with Control Structures.
  • added "keywords.control.includerequire.php" syntax group for separate highlighting of include/require functions
  • added "keywords.exceptions.php" syntax group to deal with Exception handling in PHP5
  • added "keywords.constructs.php" syntax group to deal with classes for PHP4/5
  • incorporated the Scope Resolution Operator :: and -> into the "keywords.constructs.php" syntax group
  • added "keywords.constructs.members.php" syntax group for class member status declaration
  • changed all "keywords..php" to "keywords.functions..php" for better TM stylesheet support
  • incorporated the [ => ] into the "keywords.functions.array.php" syntax group
  • added/reworked the Operators syntax group
    • "keywords.operators.arithmetic.php" syntax group
    • "keywords.operators.comparison.php" syntax group
    • "keywords.operators.error-control.php" syntax group
    • "keywords.operators.increment-decrement.php" syntax group
    • "keywords.operators.logical.php" syntax group
    • "keywords.operators.strings.php" syntax group
    • "keywords.operators.type.php" syntax group
    • removed "keywords.operators.arrows.php" syntax group as these were incorporated in other groups -> keywords.constructs & keywords.functions.array
  • changed Variables-> "Superglobal Variable" syntax group to "keywords.variables.globals.php"
  • amended list of variables in "keywords.variables.globals.php" to contain only the (validation required) globals
  • added "keywords.variables.globals.safer.php" syntax group for safer (=non-validation required) global variables.
  • changed Misc. -> "keywords.control.php" to "constants.php" and added a few good usability shortcuts (need to be define()'d in code )
  • moved "constants.numeric.php" syntax group to be part of Constants syntax group
  • added "constants.core-predefined.php" syntax group
  • added "constants.std-predefined.php syntax group

Version 2.0beta4 [2005-02-25] [email protected]

Contributors: Justin French, Sune Foldager, Allan Odgaard, Matteo Spinelli, Kumar McMillan

  • Added PHP Documentor snippets (snippet "phpdoc_u" prints usage)

Version 2.0beta3 [2005-02-24]

  • Added PHP5 language constructs and PHPDoc tags to inline comments

Version 2.0beta2 [2005-02-23]

Under Allan suggestion I stripped out some functions from the list.

Stripped functions

  • Advanced PHP debugger functions
  • Aspell functions
  • PHP bytecode Compiler
  • CCVS API Functions
  • COM and .Net (any complains about this?)
  • Cybercash Payment Functions (is someone really using them?)
  • DBM Functions
  • DOM Functions (most of them are class functions, don't know how to handle them exactly with code highlighting)
  • DOM XML Functions (same as above)
  • Hyperwave Functions
  • Hyperwave API Functions
  • ICAP Functions
  • Ingres II Functions (removed as considered experimental)
  • mailparse Functions
  • MCVE Payment Functions
  • Memcache Functions
  • mnoGoSearch Functions
  • Mohawk Software Session Handler Functions (I heard bugs about it)
  • muscat Functions (here kitty-kitty-kitty!)
  • Ncurses Terminal Screen Control Functions
  • YP/NIS Functions
  • OpenAL Audio Bindings
  • PDO Functions
  • Verisign Payflow Pro Functions
  • XSL functions
  • YAZ Functions

Please let me know if you think I removed an important set of functions or you think I kept useless ones.

I heard a new code colouring method is under development, so I am not working anymore on color scheme until the new TM version will be available

Version 2.0beta1 [2005-02-21]

Contributors: Matteo Spinelli

  • added all 3500+ PHP's functions, deprecated onces are also available but commented out
  • all functions are grouped by topic/type and displayed alphabetically
  • new color scheme

Version 1.0

Contributors: Justin French, Sune Foldager, Allan Odgaard

  • commented out the auto-indent feature, because it helps some, and makes life a real pain for others, depending on coding style
  • PHP's 3500+ native functions aren't here yet -- just reserved words and basic constants from the docs, plus the control structures and language constructs

php.tmbundle's People

Contributors

ciaran avatar cowboy avatar infininight avatar joshvarner avatar lilyball avatar sorbits avatar star-szr avatar torsten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

drewreece

php.tmbundle's Issues

"class Foo implements Interface" breaks syntax highlighter

This has been a bug for a while. If you have a class that implements an interface like this:

class Foo implements interface
{
    public function __construct() { /* ... */
}

The formatter will hiccup and not highlight anything until a comma is hit. For example, both of these will cause the formatting to be correct:

class Foo implements Interface //,

Or

class Foo implements Interface
{
    public function __construct() {}
    // This is a clause, and this is too.

In the first example, all highlighting will be correct. In the second, only code after "This is a clause," will be highlighted correctly.

Namespaces aren't recognized in a few situations.

When using static class members:

use My\Namespace as Alias;

\PDO::FETCH_ASSOC;

\My\Namespace\MyClass::StaticProperty;
Alias\MyClass::StaticMethod();

When type hinting:

class Test {
    public function __construct(\My\Namespace\MyClass $myClass) {
        // ..
    }
}

Assuming this is in the same area as type hinting, in catch blocks:

try {
    // ..
} catch (\PDOException $e) {
    // ..
}

Also while technically not an issue, the namespace keyword isn't actually interpreted as a library keyword and rather as if it was a user defined namespace. (http://www.php.net/manual/en/language.namespaces.nsconstants.php)

$keyword = new namespace\MyClass();

Add support for goto and labels

Need to add support to the bundle for the goto operator and labels.

Examples

From http://php.net/goto

Simple Usage

<?php

goto a;
echo 'Foo';

a:
echo 'Bar';

?>

Breaking Out of a Loop

<?php

for ($i = 0, $j = 50; $i < 100; $i++) {
    while ($j--) {
        if ($j == 17) goto end; 
    }  
}

echo "i = $i";
end:
echo 'j hit 17';

?>

Using bracket syntax, highlighting fails for global namespace

The bundle currently relies on there being a namespace name after the namespace keyword, but it needs to be able to support the following syntax, which is used for defining items to be placed in the global namespace.

<?php

namespace {
    // This function will go into the global namespace as `\foo()`
    function foo() {
        echo "Bar!";
    }
}

namespace blah {
    // This function will go into the `blah` namespace as `\blah\foo()`
    function foo() {
        echo "Bar!";
    }
}

?>

Add support for declare()

One of the new features in PHP 5.3 is a construct called declare(). Support for this needs to be added to the bundle.

Examples from http://php.net/declare

<?php
declare(ticks=1) {
    // entire script here
}

// or you can use this:
declare(ticks=1);

declare(encoding='ISO-8859-1');

error in PHP bundle - "please cache your project first"

updated some bundles last week and now my PHP bundle is behaving very weirdly.

each time I type a left parenthesis i.e.
(
symbol

it gives me the error "please cache your project first"

and does not type the parenthesis, making it impossible to use. Argh.

I have deleted all bundles added and when I deleted the PHP one, the error went away, but obviously I still need the PHP bundle back! When I tried ti again I got the error.

Is there an alternative PHP bundle I could try or is it something else?

my textmate is up to date and the php I installed through get-bundles and it is default one.

Mac Os 10.5.6 intel mac.

many thanks to anyone who can help me shed light on this matter!

Luke

Add support for namespaced constants

We need to handle cases like these:

<?php

namespace foo;

const BLAH = 1;

namespace bar;

// \foo\BLAH is currently not highlighted properly
var_dump(\foo\BLAH);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.