MW

Tag php - page 2

Recent Posts

PHP & PHP-Docs now in extragear/sdk/kdevelop-plugins (January 08, 2010)

Hey everyone! The PHP & PHP-Docs plugins for KDevelop now moved to Extragear! The new locations are:

    svn+ssh://svn.kde.org/home/kde/trunk/extragear/sdk/kdevelop-plugins/php
    svn+ssh://svn.kde.org/home/kde/trunk/extragear/sdk/kdevelop-plugins/php-docs

Or the anonsvn equivalent:

    svn://anonsvn.kde.org/home/kde/trunk/extragear/sdk/kdevelop-plugins/php
    svn://anonsvn.kde.org/home/kde/trunk/extragear/sdk/kdevelop-plugins/php-docs

Happy coding!

continue reading...

Will code for food (December 22, 2009)

Ha, what a bit of a bribe can do to me… Someday earlier today a user of the PHP plugin for KDevelop brought up the flickering issue in it again. Well as I told him: I myself find it very annoying and wanted to fix it since quite some time, but never got around to it… Usually that would be it and I’d go watch some more FamilyGuy until I’m in the mood to track this bugger down. But well, thankfully Phlogi wasn’t so easy to dispatch:

milian: ok… I’ll send you pizza and beer if you fix this!

Hours of gdb sessions later, I finally committed a fix. So Phlogi, if you read this: You owe me ;-)

To all others: If you tried the PHP plugin out and the flickering was too much for you: Give it a try again! I’m personally totally overwhelmed, the difference is huge! I often perceived the PHP plugin to be magnitudes slower than the C++ one. Well, looks like most of this was only due to the flickering. Now things are much smoother.

Happy holidays!

continue reading...

PHP and PHP-Docs plugins now up for review (meaning: SVN location moved!) (December 18, 2009)

Hey all!

Just a quick note: Niko and me moved PHP & PHP-Docs to kdereview, we hope to move both plugins to extragear/sdk/kdevelop-plugins. So, if I understood things correctly, after a two week period the plugins will get moved there (well, if we pass the review, but I think we can do that).

So for anybody that uses the plugins from SVN, you’ll have to relocate. The new addresses are:

  • /trunk/kdereview/kdevelop-php
  • /trunk/kdereview/kdevelop-php-docs

See you in two weeks :)

continue reading...

Improving KDevelop-PG-Qt (October 26, 2009)

Good news everyone :)

Documentation

After years of pretty much no documentation (except looking at the sources… ), The_User aka. Jonathan Schmidt-Dominé started documenting the parser generator that is used for most KDevelop language plugins (java, python, php, …). You can find it here: http://techbase.kde.org/Development/KDevelop-PG-Qt_Introduction

It has to be improved and more examples have to be put in there, but it’s already a huge improvement over the situation before…

Performance

In related news I did some profiling on the parsing of the quite big file that includes all internal PHP declarations (i.e. all functions, classes, definitions,…). It drops in at a whopping 1.9M, with ~80k lines. Well, turns out that this showed a pretty easy to fix bottleneck in KDevelop-PG’s LocationTable, which used to use a linear lookup algorithm. Profiling showed that nearly 75% was spent in that function. But I used the past tense for a reason:

I replaced it with an algorithm that combines a relative search (i.e. relative to the last lookup) with a binary search fallback. That’s comparatively blazingly fast. I added some benchmarks to KDevelop-PG-Qt that proofs that (benchmark below run with release mode build):

continue reading...

KDevelop PHP digest - August to Oktober 2009 (October 02, 2009)

Hi there again! I’ve been silent again on my blog, but didn’t rest on development. In the one and a half months since the last digest, I started writing a PHP application This finally made me eat my own dog food :). It resulted in lots of polishing and quite a few bug fixes for the PHP plugin in KDevelop. Here’s a list of what I think are the notably changes since the last digest:

(Note: to view screenshots, go to the bottom of this article.)

  • refactoring of parts of the Code Completion code, should already result in faster code under certain situations
  • properly mark constants as “Kind: Constant” in the declaration tooltips
  • offer argument hints for ctors during code completion in class init statements
  • greatly improve the generate inline documentation of built-in PHP functions, classes, properties etc. pp.
    • add documentation of public properties
    • support aliased functions (thanks to Victor Grischenko for his patch)
    • show more/all documentation, and not only the first paragraph
    • fix type-lookup
    • don’t get confused when a documentation file documents both, a method and a function (greatly improves e.g. MySQLi documentation)
  • don’t offer “jump to declaration” for built-in PHP declarations
  • add support for list(...) statement
  • cleanup code-completion list, esp. show the return type of functions in the prefix field, and not something a la “function ReturnType ($arg1, $arg2, …)”
  • improve the code-completion for include/require statements
  • add language constructs to code completion (e.g. class, while, foreach, print, …)
  • show declaration tooltip for magic constants, showing their current value
  • make functions, methods and classes case-insensitive, just like PHP handles them
  • some performance improvements, especially in code completion and parsing of the generated file containing php-internal declarations
  • lots of bug fixes, don’t want to iterate them all ;-)

continue reading...

Kate linter plugin (September 28, 2009)

Just a quicky: I wrote a little plugin for KTextEditor which supplies you with basic error checking when you save documents. Currently only PHP (via php -l) and JavaScript (via JavaScript Lint) are supported.

Screenshots

Requirements

  • usual tools for compiling C++, e.g. gcc.
  • cmake
  • Qt development packages, i.e. under Ubuntu: sudo aptitude install libqt4-dev
  • KDE 4.2 with development packages for kdelibs and kdebase, i.e. under Ubuntu: sudo aptitude install kdebase-dev kdebase-workspace-dev kdelibs5-dev. Note: You’ll need the experimental KDE 4.2 packages activated as of now, see for example the Kubuntu news on KDE 4.2 RC1 for hints.
  • proper setup of environment variables, read this techbase article for more information. the .bashrc linked there should be enough for most people
  • For PHP support: a PHP executable which supports the -l switch for linting
  • For JavaScript support: a JavaScript Lint executable, you could download and compile the sources for example.

continue reading...

Improved PHP support in Kate (August 27, 2009)

Not only KDevelop gets better and better PHP support — the Kate PHP syntax file also got a few new features and fixes over the last weeks. The good thing is of course that all users of KWrite, Kate, Quanta, KDevelop and other editors leveraging the Katepart benefit from these changes.

Improved HereDocs

screenshot of improved highlighting in PHP heredocs
screenshot of improved highlighting in PHP heredocs

I went over PHP related bugs on bugs.kde.org today and spotted one that was fairly easy to fix:

continue reading...

News for PHP in KDevelop (August 16, 2009)

So, after a period of silence I present you an unsorted list of features and bug fixes I did to the PHP plugin for KDevelop in the last few weeks:

  • added support for path autocompletion after require / include statements: This shares code with the Cpp plugin and it’s completion after #include. I plan to use this autocompletion eventually also for functions accepting filenames or paths. Think of fopen, file_get_contents etc. pp. So far only URLs that are covered by an open project can be completed. We will need support for custom include paths so we can support e.g. global PEAR or framework installations.

  • worked around a bug where the “schedule all project files for parsing” had no affect. Apaku is currently working on making some internal changes so I can remove the workaround and fix this properly. With this fixed/worked around you should retry the PHP plugin along with frameworks or similar to see how well it works. Just make sure to have the framework inside your project so it gets parsed.

continue reading...

Trying Mollom (July 15, 2009)

I’ve just installed the Mollom module for Drupal, lets see how it works. I’ve read so much praise on the official Drupal Planet (read for example this, this or that) that I could no longer resist. Installation and setup is a breeze, OpenID is supported on the Mollom website.

As you might have read I’ve ported the Spam module for Drupal 6. It worked fine. Haven’t got a problem with it at all. But I recon Mollom is the way to go.

continue reading...

Progress in non-cpp KDevelop4 land (May 28, 2009)

Has been a time since I wrote the last update for PHP / webdevelopment related work in KDevelop4…

XDebug

First of all, Niko (nsams) is working diligently on the general debugger framework for KDevelop4. Of course gdb is still the main focus so far yet he always has his XDebug plugin (which is currently unusable) in mind. So expect some great debugging features once he’s done with the framework.

Remote Projects

Another thing I’ve not yet written about is a bunch of commits I did just after the Hackaton: Remote Projects! Yes, finally you can work directly on the server with KDevelop. I still have to make sure that the user does not try to open a remote cmake project (or similar), because that is of course not supported. Only the Generic Project Manager (basically a list of files in a dir) works. There’s for sure some things to polish, yet I’d like to see user feedback for that use-case at least.

Note : There is still some functionality missing in other areas, like creating a new remote project from a template etc.

continue reading...