From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/php/Makefile.am | 24 + languages/php/README.dox | 32 + languages/php/app_templates/Makefile.am | 3 + languages/php/app_templates/php.appwizard | 2 + languages/php/app_templates/phphello/.kdev_ignore | 0 languages/php/app_templates/phphello/Makefile.am | 16 + languages/php/app_templates/phphello/app.kdevelop | 87 + languages/php/app_templates/phphello/app.php | 28 + languages/php/app_templates/phphello/phphello | 25 + .../app_templates/phphello/phphello.kdevtemplate | 108 + languages/php/app_templates/phphello/phphello.png | Bin 0 -> 483 bytes languages/php/data/Makefile.am | 6 + languages/php/data/phpfunctions | 1657 +++++ languages/php/doc/Makefile.am | 6 + languages/php/doc/php.toc | 7069 ++++++++++++++++++++ languages/php/doc/php_bugs.toc | 7 + languages/php/file_templates/Makefile.am | 4 + languages/php/file_templates/php | 12 + languages/php/kdevphpsupport.desktop | 86 + languages/php/kdevphpsupport.rc | 18 + languages/php/phpcodecompletion.cpp | 712 ++ languages/php/phpcodecompletion.h | 103 + languages/php/phpconfigdata.cpp | 88 + languages/php/phpconfigdata.h | 155 + languages/php/phpconfigwidget.cpp | 161 + languages/php/phpconfigwidget.h | 32 + languages/php/phpconfigwidgetbase.ui | 561 ++ languages/php/phperrorview.cpp | 422 ++ languages/php/phperrorview.h | 104 + languages/php/phpfile.cpp | 639 ++ languages/php/phpfile.h | 119 + languages/php/phphtmlview.cpp | 39 + languages/php/phphtmlview.h | 42 + languages/php/phpinfodlg.ui | 87 + languages/php/phpnewclassdlg.cpp | 123 + languages/php/phpnewclassdlg.h | 42 + languages/php/phpnewclassdlgbase.ui | 201 + languages/php/phpparser.cpp | 160 + languages/php/phpparser.h | 73 + languages/php/phpsupport_event.h | 110 + languages/php/phpsupportpart.cpp | 751 +++ languages/php/phpsupportpart.h | 133 + languages/php/phptemplates | 4 + 43 files changed, 14051 insertions(+) create mode 100644 languages/php/Makefile.am create mode 100644 languages/php/README.dox create mode 100644 languages/php/app_templates/Makefile.am create mode 100644 languages/php/app_templates/php.appwizard create mode 100644 languages/php/app_templates/phphello/.kdev_ignore create mode 100644 languages/php/app_templates/phphello/Makefile.am create mode 100644 languages/php/app_templates/phphello/app.kdevelop create mode 100644 languages/php/app_templates/phphello/app.php create mode 100644 languages/php/app_templates/phphello/phphello create mode 100644 languages/php/app_templates/phphello/phphello.kdevtemplate create mode 100644 languages/php/app_templates/phphello/phphello.png create mode 100644 languages/php/data/Makefile.am create mode 100644 languages/php/data/phpfunctions create mode 100644 languages/php/doc/Makefile.am create mode 100644 languages/php/doc/php.toc create mode 100644 languages/php/doc/php_bugs.toc create mode 100644 languages/php/file_templates/Makefile.am create mode 100644 languages/php/file_templates/php create mode 100644 languages/php/kdevphpsupport.desktop create mode 100644 languages/php/kdevphpsupport.rc create mode 100644 languages/php/phpcodecompletion.cpp create mode 100644 languages/php/phpcodecompletion.h create mode 100644 languages/php/phpconfigdata.cpp create mode 100644 languages/php/phpconfigdata.h create mode 100644 languages/php/phpconfigwidget.cpp create mode 100644 languages/php/phpconfigwidget.h create mode 100644 languages/php/phpconfigwidgetbase.ui create mode 100644 languages/php/phperrorview.cpp create mode 100644 languages/php/phperrorview.h create mode 100644 languages/php/phpfile.cpp create mode 100644 languages/php/phpfile.h create mode 100644 languages/php/phphtmlview.cpp create mode 100644 languages/php/phphtmlview.h create mode 100644 languages/php/phpinfodlg.ui create mode 100644 languages/php/phpnewclassdlg.cpp create mode 100644 languages/php/phpnewclassdlg.h create mode 100644 languages/php/phpnewclassdlgbase.ui create mode 100644 languages/php/phpparser.cpp create mode 100644 languages/php/phpparser.h create mode 100644 languages/php/phpsupport_event.h create mode 100644 languages/php/phpsupportpart.cpp create mode 100644 languages/php/phpsupportpart.h create mode 100644 languages/php/phptemplates (limited to 'languages/php') diff --git a/languages/php/Makefile.am b/languages/php/Makefile.am new file mode 100644 index 00000000..ac053aaf --- /dev/null +++ b/languages/php/Makefile.am @@ -0,0 +1,24 @@ +# Here resides the PHP support part. + +INCLUDES = -I$(top_srcdir)/lib/interfaces \ + -I$(top_srcdir)/lib/interfaces/extensions -I$(top_srcdir)/lib/interfaces/external -I$(top_srcdir)/lib/util \ + -I$(top_srcdir)/lib/widgets $(all_includes) +SUBDIRS = data app_templates file_templates doc + + +kde_module_LTLIBRARIES = libkdevphpsupport.la +libkdevphpsupport_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) +libkdevphpsupport_la_LIBADD = $(top_builddir)/lib/libkdevelop.la $(top_builddir)/lib/widgets/libkdevwidgets.la $(LIB_KHTML) + +libkdevphpsupport_la_SOURCES = phpsupportpart.cpp phpconfigwidgetbase.ui phpconfigwidget.cpp phpinfodlg.ui phphtmlview.cpp phperrorview.cpp phpconfigdata.cpp phpcodecompletion.cpp phpparser.cpp phpnewclassdlgbase.ui phpnewclassdlg.cpp phpfile.cpp + +METASOURCES = AUTO + +servicedir = $(kde_servicesdir) +service_DATA = kdevphpsupport.desktop + +rcdir = $(kde_datadir)/kdevphpsupport +rc_DATA = kdevphpsupport.rc + +templatedir = ${kde_datadir}/kdevabbrev/templates +template_DATA = phptemplates diff --git a/languages/php/README.dox b/languages/php/README.dox new file mode 100644 index 00000000..14e69997 --- /dev/null +++ b/languages/php/README.dox @@ -0,0 +1,32 @@ +/** \class PHPSupportPart +This is PHP language support plugin. + +Support for the PHP Language, you can +develop php script for web or php script for shell. + +It's support checking of your script with problems report and also parse +all include files from your script. + +\authors Sandy Meier +\authors Escuder Nicolas + +\maintainer Sandy Meier +\maintainer Escuder Nicolas + +\feature PHP language support +\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part. + +\bug bugs in php support component at Bugzilla database + +\requirement PHP Cli Version or WebServer with php + +\todo extended classtools (new class,new function...) based on filetemplates +\todo debugger and profiler support dbg (http://dd.cron.ru/dbg) +\todo html form support (dialogs for generating html code, tables...) +\todo support for phpdoc +\todo documentation viewer for php (maybe plugins for the current docviewer) (tf) +\todo integrated filemanager with ftp client (maybe a konqueror part) +\todo code template factory (contains useful php code snippet like array_display,trace,validator) +\todo new functions list from php 5 documentation + +*/ diff --git a/languages/php/app_templates/Makefile.am b/languages/php/app_templates/Makefile.am new file mode 100644 index 00000000..12fdee76 --- /dev/null +++ b/languages/php/app_templates/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = phphello +profilesdir = $(kde_datadir)/kdevelop/profiles/IDE/ScriptingLanguageIDE/PHPIDE +profiles_DATA = php.appwizard diff --git a/languages/php/app_templates/php.appwizard b/languages/php/app_templates/php.appwizard new file mode 100644 index 00000000..5cddaac5 --- /dev/null +++ b/languages/php/app_templates/php.appwizard @@ -0,0 +1,2 @@ +[General] +List=phphello diff --git a/languages/php/app_templates/phphello/.kdev_ignore b/languages/php/app_templates/phphello/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/php/app_templates/phphello/Makefile.am b/languages/php/app_templates/phphello/Makefile.am new file mode 100644 index 00000000..12d29f1b --- /dev/null +++ b/languages/php/app_templates/phphello/Makefile.am @@ -0,0 +1,16 @@ +dataFiles = app.php app.kdevelop +templateName = phphello + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/php/app_templates/phphello/app.kdevelop b/languages/php/app_templates/phphello/app.kdevelop new file mode 100644 index 00000000..c8844e1e --- /dev/null +++ b/languages/php/app_templates/phphello/app.kdevelop @@ -0,0 +1,87 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevScriptProject + PHP + + PHP + + + KDevDoxygen + KDevdistpart + KDevVisualBoyAdvance + + + + + + *.php,*.phps,*.php3,*.inc + + + + + ada + ada_bugs_gcc + bash + bash_bugs + c++_bugs_gcc + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + kde2book + libc + libstdc++ + opengl + pascal_bugs_fp + perl + perl_bugs + python + python_bugs + qt-kdev3 + ruby + ruby_bugs + sdl + stl + sw + wxwidgets_bugs + + + Guide to the Qt Translation Tools + Qt Assistant Manual + Qt Designer Manual + Qt Reference Documentation + qmake User Guide + + + KDE Libraries (Doxygen) + + + + + true + true + true + + + + + + + + + + + + + + diff --git a/languages/php/app_templates/phphello/app.php b/languages/php/app_templates/phphello/app.php new file mode 100644 index 00000000..c6a62b4f --- /dev/null +++ b/languages/php/app_templates/phphello/app.php @@ -0,0 +1,28 @@ +Hello World!\n"; +printFooter(); + +function printHeader(){ + echo << + + + + + + %{APPNAME} + + + +EOF; +} + +function printFooter(){ + echo "\n"; +} + +?> diff --git a/languages/php/app_templates/phphello/phphello b/languages/php/app_templates/phphello/phphello new file mode 100644 index 00000000..f9f1a69f --- /dev/null +++ b/languages/php/app_templates/phphello/phphello @@ -0,0 +1,25 @@ +# KDE Config File +[General] +Name=Simple PHP script +Name[fr]=Un simple script de test Hello world +Category=PHP +Comment=This generates a simplistic 'Hello world' program in PHP (http://www.php.net) +Comment[fr]=Gnre un simple script de test du type Hello world dans le language PHP (http://www.php.net). +DefaultDestinatonDir=HOMEDIR/public_html +FileTemplates=php,CPPStyle +ShowFilesAfterGeneration=%{APPNAMELC}.php +Archive=phphello.tar.gz + +[PROJECT] +Type=install +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[APP.PHP] +Type=install +Source=%{src}/app.php +Dest=%{dest}/%{APPNAMELC}.php + +[MGS] +Type=message +Comment=A simple PHP project was created in %{dest}. diff --git a/languages/php/app_templates/phphello/phphello.kdevtemplate b/languages/php/app_templates/phphello/phphello.kdevtemplate new file mode 100644 index 00000000..8d52f490 --- /dev/null +++ b/languages/php/app_templates/phphello/phphello.kdevtemplate @@ -0,0 +1,108 @@ +# KDE Config File +[General] +Name=Simple PHP script +Name[ca]=Simple script en PHP +Name[da]=Simpelt PHP script +Name[de]=Einfaches PHP-Skript +Name[el]=Απλό σενάριο PHP +Name[es]=Guión sencillo en PHP +Name[et]=Lihtne PHP skript +Name[eu]=PHP script sinplea +Name[fa]=دست‌نوشتۀ سادۀ پی‌اچ‌پی +Name[fr]=Script PHP simple +Name[ga]=Script Simplí PHP +Name[gl]=Script sinxelo en PHP +Name[hu]=Egyszerű PHP-szkript +Name[it]=Semplice script PHP +Name[ja]=簡単な PHP スクリプト +Name[nds]=Eenfach PHP-Skript +Name[ne]=साधारण पी एच पी स्क्रिप्ट +Name[nl]=Eenvoudig PHP-script +Name[pl]=Prosty skrypt w PHP +Name[pt]=Programa simples em PHP +Name[pt_BR]=Programa simples em PHP +Name[ru]=Простой скрипт PHP +Name[sk]=Jednoduchý PHP skript +Name[sr]=Једноставна PHP скрипта +Name[sr@Latn]=Jednostavna PHP skripta +Name[sv]=Enkelt PHP-skript +Name[tr]=Basit PHP betiği +Name[zh_CN]=简单 PHP 脚本 +Name[zh_TW]=簡單的 PHP 文稿 +Category=PHP +Comment=This generates a simplistic 'Hello world' program in PHP (http://www.php.net) +Comment[ca]=Genera un simple programa de 'Hello world' en PHP (http://www.php.net) +Comment[da]=Dette genererer et simplistisk 'Goddag verden' program i PHP (http://www.php.net) +Comment[de]=Hiermit wird ein einfaches "Hello World"-Programm in PHP erstellt (http://www.php.net). +Comment[el]=Αυτό δημιουργεί ένα πρόγραμμα 'Γεια σου κόσμε' σε PHP (http://www.php.net) +Comment[es]=Genera un programa «Hola mundo» sencillo en PHP (http://www.php.net) +Comment[et]=Lihtsa "Tere, maailm" programmi loomine PHP-s (http://www.php.net) +Comment[eu]=Honek PHP-n (http://www.php.net) idatzitako "Kaixo mundua" programa sinple bat sortzen du +Comment[fa]=یک برنامۀ سادۀ «Hello world» در پی‌اچ‌پی ( http://www.php.net)تولید می‌کند +Comment[fr]=Génère un programme « Bonjour monde » simple en PHP (http://www.php.net) +Comment[ga]=Cruthaíonn sé seo ríomhchlár simplí "Hello world" i PHP (http://www.php.net/) +Comment[gl]=Isto xera un programa sinxelo en PHP 'Ola mundo'(http://www.php.net) +Comment[hu]=Létrehoz egy egyszerű 'Hello world' programot PHP-ban (http://www.php.net) +Comment[it]=Genera un semplice programma di "Hello world" in PHP (http://www.php.net) +Comment[ja]=PHP で書かれた簡単な Hello world プログラムを作成します +Comment[nds]=Dit stellt en eenfach "Moin Welt"-Programm in PHP op. (http://www.php.net) +Comment[ne]=यसले पी एच पी मा साधारण 'हेल्लो वोल्ड' कार्यक्रम उत्पन्न गर्दछ(http://www.php.net) +Comment[nl]=Dit genereert een eenvoudig 'Hello World'-programma in PHP (http://www.php.net) +Comment[pl]=Generuje prosty program "Witaj świecie" w PHP (http://www.php.net) +Comment[pt]=Isto gera uma programa simples 'Olá Mundo' em PHP (http://www.php.net) +Comment[pt_BR]=Isto gera uma programa simples 'Olá Mundo' em PHP (http://www.php.net) +Comment[ru]=Создание простой программы 'Hello world' на PHP (http://www.php.net) +Comment[sk]=Vygeneruje jednoduchý Ahoj svet program v PHP (http://www.php.net) +Comment[sr]=Ово прави једноставан „Здраво свете“ програм у PHP-у (http://www.php.net) +Comment[sr@Latn]=Ovo pravi jednostavan „Zdravo svete“ program u PHP-u (http://www.php.net) +Comment[sv]=Detta skapar ett förenklat 'Hello world'-program i PHP (http://www.php.net) +Comment[tr]=Bu PHP'de basit bir "Merhaba Dünya "programı yaratır (http://www.php.net) +Comment[zh_CN]=这将生成一个简单的 PHP 语言“Hello world”程序 +Comment[zh_TW]=產生一個 PHP(http://www.php.net)的 Hello world 程式 +DefaultDestinatonDir=HOMEDIR/public_html +FileTemplates=php,CPPStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.php +Archive=phphello.tar.gz + +[PROJECT] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[APP.PHP] +Type=install +Source=%{src}/app.php +Dest=%{dest}/%{APPNAMELC}.php + +[MGS] +Type=message +Comment=A simple PHP project was created in %{dest}. +Comment[ca]=Un simple projecte en PHP ha estat creat en %{dest}. +Comment[da]=Et simpelt PHP projekt blev oprettet i %{dest}. +Comment[de]=Ein einfaches PHP-Projekt wurde in %{dest} erstellt. +Comment[el]=Ένα απλό έργο PHP δημιουργήθηκε στο %{dest}. +Comment[es]=Un sencillo proyecto en PHP ha sido creado en %{dest}. +Comment[et]=Lihtne PHP projekt loodi asukohta %{dest}. +Comment[eu]=PHP-n idatzitako programa sinple bat sortu da hemen: %{dest}. +Comment[fa]=یک پروژۀ سادۀ پی‌اچ‌پی در %{dest} ایجاد شد. +Comment[fr]=Un projet PHP simple a été créé dans %{dest}. +Comment[ga]=Cruthaíodh tionscadal simplí PHP i %{dest} +Comment[gl]=Creouse un proxecto sinxelo en PHP en %{dest} +Comment[hu]=Létrejött egy egyszerű PHP-alapú projekt itt: %{dest}. +Comment[it]=È stato creato un semplice progetto PHP in %{dest}. +Comment[ja]=簡単な PHP プロジェクトを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en eenfach PHP-Projekt opstellt. +Comment[ne]=साधारण PHP परियोजना %{dest} मा सिर्जना गरियो +Comment[nl]=Een eenvoudig PHP-project is aangemaakt in %{dest}. +Comment[pl]=Prosty projekt w PHP został utworzony w %{dest}. +Comment[pt]=Foi criado um projecto simples em PHP em %{dest}. +Comment[pt_BR]=Foi criado um projecto simples em PHP em %{dest}. +Comment[ru]=Простой скрипт PHP создан в %{dest}. +Comment[sk]=Jednoduchý PHP projekt bol vytvorený v %{dest}. +Comment[sr]=Једноставан PHP пројекат направљен је у %{dest}. +Comment[sr@Latn]=Jednostavan PHP projekat napravljen je u %{dest}. +Comment[sv]=Ett enkelt PHP-projekt skapades i %{dest}. +Comment[tr]=Basit bir PHP projesi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 创建了一个简单的 PHP 工程。 +Comment[zh_TW]=一個簡單的 PHP 專案已建立於 %{dest} diff --git a/languages/php/app_templates/phphello/phphello.png b/languages/php/app_templates/phphello/phphello.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/php/app_templates/phphello/phphello.png differ diff --git a/languages/php/data/Makefile.am b/languages/php/data/Makefile.am new file mode 100644 index 00000000..e54b0415 --- /dev/null +++ b/languages/php/data/Makefile.am @@ -0,0 +1,6 @@ +phpsupportdatadir = ${kde_datadir}/kdevphpsupport + +install-data-local: + mkdir -p $(DESTDIR)$(phpsupportdatadir) + $(INSTALL_DATA) $(srcdir)/phpfunctions $(DESTDIR)$(phpsupportdatadir)/phpfunctions + diff --git a/languages/php/data/phpfunctions b/languages/php/data/phpfunctions new file mode 100644 index 00000000..d0897bd5 --- /dev/null +++ b/languages/php/data/phpfunctions @@ -0,0 +1,1657 @@ +CODING_STANDARDS:int abs(int number) +CODING_STANDARDS:object imap_header(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]]) +README:bool my_drawtext(resource image, string text, resource font, int x, int y[, int color]) +zend_builtin_functions:int strlen(string str) +zend_builtin_functions:int strcmp(string str1, string str2) +zend_builtin_functions:int strncmp(string str1, string str2, int len) +zend_builtin_functions:int strcasecmp(string str1, string str2) +zend_builtin_functions:int strncasecmp(string str1, string str2, int len) +zend_builtin_functions:string get_class(object object) +zend_builtin_functions:string get_parent_class(object object) +zend_builtin_functions:bool is_subclass_of(object object, string class_name) +zend_builtin_functions:array get_class_vars(string class_name) +zend_builtin_functions:array get_object_vars(object obj) +zend_builtin_functions:array get_class_methods(string class_name) +zend_builtin_functions:bool method_exists(object object, string method) +zend_builtin_functions:bool class_exists(string classname) +zend_builtin_functions:bool function_exists(string function_name) +zend_builtin_functions:array get_included_files(void) +zend_builtin_functions:void trigger_error(string messsage [, int error_type]) +zend_builtin_functions:string set_error_handler(string error_handler) +zend_builtin_functions:void restore_error_handler(void) +zend_builtin_functions:array get_declared_classes(void) +zend_builtin_functions:string create_function(string args, string code) +aspell:int aspell_new(string master [, string personal]) +aspell:array aspell_suggest(aspell int, string word) +aspell:int aspell_check(aspell int, string word) +aspell:int aspell_check_raw(aspell int, string word) +bcmath:string bcadd(string left_operand, string right_operand [, int scale]) +bcmath:string bcsub(string left_operand, string right_operand [, int scale]) +bcmath:string bcmul(string left_operand, string right_operand [, int scale]) +bcmath:string bcdiv(string left_operand, string right_operand [, int scale]) +bcmath:string bcmod(string left_operand, string right_operand) +bcmath:string bcpow(string x, string y [, int scale]) +bcmath:string bcsqrt(string operand [, int scale]) +bcmath:string bccomp(string left_operand, string right_operand [, int scale]) +bcmath:string bcscale(int scale) +cal_unix:int unixtojd([int timestamp]) +cal_unix:int jdtounix(int jday) +calendar:string jdtogregorian(int juliandaycount) +calendar:int gregoriantojd(int month, int day, int year) +calendar:string jdtojulian(int juliandaycount) +calendar:int juliantojd(int month, int day, int year) +calendar:string jdtojewish(int juliandaycount) +calendar:int jewishtojd(int month, int day, int year) +calendar:string jdtofrench(int juliandaycount) +calendar:int frenchtojd(int month, int day, int year) +calendar:mixed jddayofweek(int juliandaycount [, int mode]) +calendar:string jdmonthname(int juliandaycount, int mode) +easter:int easter_date([int year]) +easter:int easter_days([int year]) +ccvs:string ccvs_init(string name) +ccvs:string ccvs_done(string sess) +ccvs:string ccvs_new(string session, string invoice) +ccvs:string ccvs_add(string session, string invoice, string argtype, string argval) +ccvs:string ccvs_delete(string session, string invoice) +ccvs:string ccvs_auth(string session, string invoice) +ccvs:string ccvs_return(string session, string invoice) +ccvs:string ccvs_reverse(string session, string invoice) +ccvs:string ccvs_sale(string session, string invoice) +ccvs:string ccvs_void(string session, string invoice) +ccvs:string ccvs_status(string session, string invoice) +ccvs:int ccvs_count(string session, string type) +ccvs:string ccvs_lookup(string session, string invoice, int inum) +ccvs:string ccvs_report(string session, string type) +ccvs:string ccvs_command(string session, string type, string argval) +ccvs:string ccvs_textvalue(string session) +COM:int com_load(string module_name) +COM:mixed com_invoke(int module, string handler_name [, mixed arg [, ...]]) +COM:mixed com_propget(int module, string property_name) +COM:bool com_propput(int module, string property_name, mixed value) +cpdf:void cpdf_global_set_document_limits(int maxPages, int maxFonts, int maxImages, int maxAnnots, int maxObjects) +cpdf:bool cpdf_set_creator(int pdfdoc, string creator) +cpdf:bool cpdf_set_title(int pdfptr, string title) +cpdf:bool cpdf_set_subject(int pdfptr, string subject) +cpdf:bool cpdf_set_keywords(int pdfptr, string keywords) +cpdf:void cpdf_set_viewer_preferences(int pdfdoc, int pagemode) +cpdf:int cpdf_open(int compression [, string filename [, array doc_limits]]) +cpdf:void cpdf_close(int pdfdoc) +cpdf:void cpdf_page_init(int pdfdoc, int pagenr, int orientation, int height, int width [, double unit]) +cpdf:void cpdf_finalize_page(int pdfdoc, int pagenr) +cpdf:void cpdf_set_current_page(int pdfdoc, int pagenr) +cpdf:void cpdf_begin_text(int pdfdoc) +cpdf:void cpdf_end_text(int pdfdoc) +cpdf:void cpdf_show(int pdfdoc, string text) +cpdf:void cpdf_show_xy(int pdfdoc, string text, double x-koor, double y-koor [, int mode]) +cpdf:void cpdf_continue_text(int pdfdoc, string text) +cpdf:void cpdf_text(int pdfdoc, string text [, double x-koor, double y-koor [, int mode [, double orientation [, int alignmode]]]]) +cpdf:void cpdf_set_font(int pdfdoc, string font, double size, string encoding) +cpdf:void cpdf_set_leading(int pdfdoc, double distance) +cpdf:void cpdf_set_text_rendering(int pdfdoc, int rendermode) +cpdf:void cpdf_set_horiz_scaling(int pdfdoc, double scale) +cpdf:void cpdf_set_text_rise(int pdfdoc, double value) +cpdf:void cpdf_set_text_matrix(int pdfdoc, arry matrix) +cpdf:void cpdf_set_text_pos(int pdfdoc, double x, double y [, int mode]) +cpdf:void cpdf_rotate_text(int pdfdoc, double angle) +cpdf:void cpdf_set_char_spacing(int pdfdoc, double space) +cpdf:void cpdf_set_word_spacing(int pdfdoc, double space) +cpdf:double cpdf_stringwidth(int pdfdoc, string text) +cpdf:void cpdf_save(int pdfdoc) +cpdf:void cpdf_restore(int pdfdoc) +cpdf:void cpdf_translate(int pdfdoc, double x, double y) +cpdf:void cpdf_scale(int pdfdoc, double x-scale, double y-scale) +cpdf:void cpdf_rotate(int pdfdoc, double angle) +cpdf:void cpdf_setflat(int pdfdoc, double value) +cpdf:void cpdf_setlinejoin(int pdfdoc, int value) +cpdf:void cpdf_setlinecap(int pdfdoc, int value) +cpdf:void cpdf_setmiterlimit(int pdfdoc, double value) +cpdf:void cpdf_setlinewidth(int pdfdoc, double width) +cpdf:void cpdf_setdash(int pdfdoc, long white, long black) +cpdf:void cpdf_moveto(int pdfdoc, double x, double y [, int mode]) +cpdf:void cpdf_rmoveto(int pdfdoc, double x, double y [, int mode]) +cpdf:void cpdf_curveto(int pdfdoc, double x1, double y1, double x2, double y2, double x3, double y3 [, int mode]) +cpdf:void cpdf_lineto(int pdfdoc, double x, double y [, int mode]) +cpdf:void cpdf_rlineto(int pdfdoc, double x, double y [, int mode]) +cpdf:void cpdf_circle(int pdfdoc, double x, double y, double radius [, int mode]) +cpdf:void cpdf_arc(int pdfdoc, double x, double y, double radius, double start, double end [, int mode]) +cpdf:void cpdf_rect(int pdfdoc, double x, double y, double width, double height [, int mode]) +cpdf:void cpdf_newpath(int pdfdoc) +cpdf:void cpdf_closepath(int pdfdoc) +cpdf:void cpdf_closepath_stroke(int pdfdoc) +cpdf:void cpdf_stroke(int pdfdoc) +cpdf:void cpdf_fill(int pdfdoc) +cpdf:void cpdf_fill_stroke(int pdfdoc) +cpdf:void cpdf_closepath_fill_stroke(int pdfdoc) +cpdf:void cpdf_clip(int pdfdoc) +cpdf:void cpdf_setgray_fill(int pdfdoc, double value) +cpdf:void cpdf_setgray_stroke(int pdfdoc, double value) +cpdf:void cpdf_setgray(int pdfdoc, double value) +cpdf:void cpdf_setrgbcolor_fill(int pdfdoc, double red, double green, double blue) +cpdf:void cpdf_setrgbcolor_stroke(int pdfdoc, double red, double green, double blue) +cpdf:void cpdf_setrgbcolor(int pdfdoc, double red, double green, double blue) +cpdf:void cpdf_set_page_animation(int pdfdoc, int transition, double duration, double direction, int orientation, int inout) +cpdf:array cpdf_finalize(int pdfdoc) +cpdf:array cpdf_output_buffer(int pdfdoc) +cpdf:array cpdf_save_to_file(int pdfdoc, string filename) +cpdf:void cpdf_import_jpeg(int pdfdoc, string filename, double x, double y, double angle, double width, double height, double x-scale, double y-scale, int gsave [, int mode]) +cpdf:void cpdf_place_inline_image(int pdfdoc, int gdimage, double x, double y, double angle, fload width, float height, int gsave [, int mode]) +cpdf:void cpdf_add_annotation(int pdfdoc, double xll, double yll, double xur, double xur, string title, string text [, int mode]) +cpdf:void cpdf_set_action_url(int pdfdoc, double xll, double yll, double xur, double xur, string url [, int mode]) +cpdf:int cpdf_add_outline(int pdfdoc, int lastoutline, int sublevel, int open, int pagenr, string title) +curl:string curl_version(void) +curl:int curl_init([string url]) +curl:bool curl_setopt(int ch, string option, mixed value) +curl:bool curl_exec(int ch) +curl:string curl_error(int ch) +curl:int curl_errno(int ch) +curl:void curl_close(int ch) +dav:void dav_set_mkcol_handlers(string test, string create) +db:string dblist(void) +db:int dbmopen(string filename, string mode) +db:bool dbmclose(int dbm_identifier) +db:int dbminsert(int dbm_identifier, string key, string value) +db:int dbmreplace(int dbm_identifier, string key, string value) +db:string dbmfetch(int dbm_identifier, string key) +db:int dbmexists(int dbm_identifier, string key) +db:int dbmdelete(int dbm_identifier, string key) +db:string dbmfirstkey(int dbm_identifier) +db:string dbmnextkey(int dbm_identifier, string key) +dba:int dba_popen(string path, string mode, string handlername [, string ...]) +dba:int dba_open(string path, string mode, string handlername [, string ...]) +dba:void dba_close(int handle) +dba:bool dba_exists(string key, int handle) +dba:string dba_fetch(string key, int handle) +dba:string dba_firstkey(int handle) +dba:string dba_nextkey(int handle) +dba:bool dba_delete(string key, int handle) +dba:bool dba_insert(string key, string value, int handle) +dba:bool dba_replace(string key, string value, int handle) +dba:bool dba_optimize(int handle) +dba:bool dba_sync(int handle) +dbase:int dbase_open(string name, int mode) +dbase:bool dbase_close(int identifier) +dbase:int dbase_numrecords(int identifier) +dbase:int dbase_numfields(int identifier) +dbase:bool dbase_pack(int identifier) +dbase:bool dbase_add_record(int identifier, array data) +dbase:bool dbase_replace_record(int identifier, array data, int recnum) +dbase:bool dbase_delete_record(int identifier, int record) +dbase:array dbase_get_record(int identifier, int record) +dbase:array dbase_get_record_with_names(int identifier, int record) +dbase:bool dbase_create(string filename, array fields) +domxml:string domxml_test(int id) +domxml:string domxml_attrname([int dir_handle]) +domxml:class domxml_node(string name) +domxml:string domxml_lastchild([int node]) +domxml:string domxml_parent([int node]) +domxml:string domxml_children([int node]) +domxml:string domxml_getattr([int node,] string attrname) +domxml:bool domxml_setattr([int node,] string attrname, string value) +domxml:array domxml_attributes([int node]) +domxml:string domxml_rootnew([int doc]) +domxml:string domxml_root([int doc_handle]) +domxml:string domxml_dtd([int doc_handle]) +domxml:string domxml_dumpmem([int doc_handle]) +domxml:class xmldoc(string xmldoc) +domxml:class xmldocfile(string filename) +domxml:string domxml_new_child([int node_handle,] string name, string content) +domxml:string domxml_add_root([int doc_handle,] string name) +domxml:class domxml_new_xmldoc(string version) +domxml:string node_namespace([int node]) +domxml:string node_attributes([int node]) +domxml:string node_children([int node]) +domxml:class xmltree(string xmldoc) +dotnet:int dotnet_load(string module_name) +exif:string read_exif_data(string filename) +fdf:int fdf_open(string filename) +fdf:void fdf_close(int fdfdoc) +fdf:void fdf_create(void) +fdf:void fdf_get_value(int fdfdoc, string fieldname) +fdf:void fdf_set_value(int fdfdoc, string fieldname, string value, int isName) +fdf:void fdf_next_field_name(int fdfdoc [, string fieldname]) +fdf:void fdf_set_ap(int fdfdoc, string fieldname, int face, string filename, int pagenr) +fdf:void fdf_set_status(int fdfdoc, string status) +fdf:void fdf_get_status(int fdfdoc) +fdf:void fdf_set_file(int fdfdoc, string filename) +fdf:void fdf_get_file(int fdfdoc) +fdf:void fdf_save(int fdfdoc, string filename) +fdf:void fdf_add_template(int fdfdoc, int newpage, string filename, string template, int rename) +fdf:void fdf_set_flags(int fdfdoc, string fieldname, int whichFlags, int newFlags) +fdf:void fdf_set_opt(int fdfdoc, string fieldname, int element, string value, string name) +fdf:void fdf_set_submit_form_action(int fdfdoc, string fieldname, int whichTrigger, string url, int flags) +fdf:void fdf_set_javascript_action(int fdfdoc, string fieldname, int whichTrigger, string script) +filepro:bool filepro(string directory) +filepro:int filepro_rowcount(void) +filepro:string filepro_fieldname(int fieldnumber) +filepro:string filepro_fieldtype(int field_number) +filepro:int filepro_fieldwidth(int field_number) +filepro:int filepro_fieldcount(void) +filepro:string filepro_retrieve(int row_number, int field_number) +ftp:int ftp_connect(string host [, int port]) +ftp:int ftp_login(int stream, string username, string password) +ftp:string ftp_pwd(int stream) +ftp:int ftp_cdup(int stream) +ftp:int ftp_chdir(int stream, string directory) +ftp:int ftp_exec(int stream, string command) +ftp:string ftp_mkdir(int stream, string directory) +ftp:int ftp_rmdir(int stream, string directory) +ftp:array ftp_nlist(int stream, string directory) +ftp:array ftp_rawlist(int stream, string directory) +ftp:string ftp_systype(int stream) +ftp:int ftp_fget(int stream, int fp, string remote_file, int mode) +ftp:int ftp_pasv(int stream, int pasv) +ftp:int ftp_get(int stream, string local_file, string remote_file, int mode) +ftp:int ftp_fput(int stream, string local_file, string remote_file, int mode) +ftp:int ftp_put(int stream, string remote_file, string local_file, int mode) +ftp:int ftp_size(int stream, string path) +ftp:int ftp_mdtm(int stream, string path) +ftp:int ftp_rename(int stream, string src, string dest) +ftp:int ftp_delete(int stream, string path) +ftp:int ftp_site(int stream, string cmd) +ftp:int ftp_quit(int stream) +gd:int imageloadfont(string filename) +gd:int imagecreate(int x_size, int y_size) +gd:int imagetypes(void) +gd:int imagecreatefromgif(string filename) +gd:int imagecreatefromjpeg(string filename) +gd:int imagecreatefrompng(string filename) +gd:int imagecreatefromxbm(string filename) +gd:int imagecreatefromwbmp(string filename) +gd:int imagegif(int im [, string filename]) +gd:int imagepng(int im [, string filename]) +gd:int imagejpeg(int im [, string filename [, int quality]]) +gd:int imagewbmp(int im [, string filename]) +gd:int imagedestroy(int im) +gd:int imagecolorallocate(int im, int red, int green, int blue) +gd:int imagepalettecopy(int dst, int src) +gd:int imagecolorat(int im, int x, int y) +gd:int imagecolorclosest(int im, int red, int green, int blue) +gd:int imagecolorclosesthwb(int im, int red, int green, int blue) +gd:int imagecolordeallocate(int im, int index) +gd:int imagecolorresolve(int im, int red, int green, int blue) +gd:int imagecolorexact(int im, int red, int green, int blue) +gd:int imagecolorset(int im, int col, int red, int green, int blue) +gd:array imagecolorsforindex(int im, int col) +gd:int imagegammacorrect(int im, double inputgamma, double outputgamma) +gd:int imagesetpixel(int im, int x, int y, int col) +gd:int imageline(int im, int x1, int y1, int x2, int y2, int col) +gd:int imagedashedline(int im, int x1, int y1, int x2, int y2, int col) +gd:int imagerectangle(int im, int x1, int y1, int x2, int y2, int col) +gd:int imagefilledrectangle(int im, int x1, int y1, int x2, int y2, int col) +gd:int imagearc(int im, int cx, int cy, int w, int h, int s, int e, int col) +gd:int imagefilltoborder(int im, int x, int y, int border, int col) +gd:int imagefill(int im, int x, int y, int col) +gd:int imagecolorstotal(int im) +gd:int imagecolortransparent(int im [, int col]) +gd:int imageinterlace(int im [, int interlace]) +gd:int imagepolygon(int im, array point, int num_points, int col) +gd:int imagefilledpolygon(int im, array point, int num_points, int col) +gd:int imagefontwidth(int font) +gd:int imagefontheight(int font) +gd:int imagechar(int im, int font, int x, int y, string c, int col) +gd:int imagecharup(int im, int font, int x, int y, string c, int col) +gd:int imagestring(int im, int font, int x, int y, string str, int col) +gd:int imagestringup(int im, int font, int x, int y, string str, int col) +gd:int imagecopy(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h) +gd:int imagecopymerge(int src_im, int dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) +gd:int imagecopyresized(int dst_im, int src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) +gd:int imagesx(int im) +gd:int imagesy(int im) +gd:array imagettfbbox(int size, int angle, string font_file, string text) +gd:array imagettftext(int im, int size, int angle, int x, int y, int col, string font_file, string text) +gd:int imagepsloadfont(string pathname) +gd:bool imagepsfreefont(int font_index) +gd:bool imagepsencodefont(int font_index, string filename) +gd:bool imagepsextendfont(int font_index, double extend) +gd:bool imagepsslantfont(int font_index, double slant) +gd:array imagepstext(int image, string text, int font, int size, int xcoord, int ycoord [, int space, int tightness, double angle, int antialias]) +gd:array imagepsbbox(string text, int font, int size [, int space, int tightness, int angle]) +gdt1:int imagepsloadfont(string pathname) +gdt1:bool imagepsfreefont(int font_index) +gdt1:bool imagepsencodefont(int font_index, string filename) +gdt1:bool imagepsextendfont(int font_index, double extend) +gdt1:bool imagepsslantfont(int font_index, double slant) +gdt1:array imagepstext(int image, string text, int font, int size, int xcoord, int ycoord [, int space, int tightness, double angle, int antialias]) +gdt1:array imagepsbbox(string text, int font, int size [, int space, int tightness, int angle]) +gettext:string textdomain(string domain) +gettext:string gettext(string msgid) +gettext:string dgettext(string domain_name, string msgid) +gettext:string dcgettext(string domain_name, string msgid, long category) +gettext:string bindtextdomain(string domain_name, string dir) +hw:int hw_connect(string host, int port [string username [, string password]]) +hw:int hw_pconnect(string host, int port [, string username [, string password]]) +hw:void hw_close(int link) +hw:void hw_info(int link) +hw:int hw_error(int link) +hw:string hw_errormsg(int link) +hw:int hw_root(void) +hw:string hw_stat(int link) +hw:array hw_who(int link) +hw:string hw_dummy(int link, int id, int msgid) +hw:string hw_getobject(int link, int objid [, string linkroot]) +hw:int hw_insertobject(int link, string objrec, string parms) +hw:string hw_getandlock(int link, int objid) +hw:void hw_unlock(int link, int objid) +hw:void hw_deleteobject(int link, int objid) +hw:void hw_changeobject(int link, int objid, array attributes) +hw:void hw_modifyobject(int link, int objid, array remattributes, array addattributes [, int mode]) +hw:void hw_mv(int link, array objrec, int from, int dest) +hw:void hw_cp(int link, array objrec, int dest) +hw:hwdoc hw_gettext(int link, int objid [, int rootid]) +hw:void hw_edittext(int link, hwdoc doc) +hw:hwdoc hw_getcgi(int link, int objid) +hw:int hw_getremote(int link, int objid) +hw:[array|int] hw_getremotechildren(int link, string objrec) +hw:void hw_setlinkroot(int link, int rootid) +hw:hwdoc hw_pipedocument(int link, int objid) +hw:hwdoc hw_pipecgi(int link, int objid) +hw:void hw_insertdocument(int link, int parentid, hwdoc doc) +hw:hwdoc hw_new_document(string objrec, string data, int size) +hw:void hw_free_document(hwdoc doc) +hw:void hw_outputdocument(hwdoc doc) +hw:void hw_output_document(hwdoc doc) +hw:string hw_documentbodytag(hwdoc doc [, string prefix]) +hw:string hw_document_bodytag(hwdoc doc [, string prefix]) +hw:string hw_document_content(hwdoc doc) +hw:int hw_document_setcontent(hwdoc doc, string content) +hw:int hw_documentsize(hwdoc doc) +hw:int hw_document_size(hwdoc doc) +hw:string hw_documentattributes(hwdoc doc) +hw:string hw_document_attributes(hwdoc doc) +hw:array hw_getparentsobj(int link, int objid) +hw:array hw_getparents(int link, int objid) +hw:array hw_children(int link, int objid) +hw:array hw_childrenobj(int link, int objid) +hw:array hw_getchildcoll(int link, int objid) +hw:array hw_getchildcollobj(int link, int objid) +hw:int hw_docbyanchor(int link, int anchorid) +hw:array hw_docbyanchorobj(int link, int anchorid) +hw:array hw_getobjectbyquery(int link, string query, int maxhits) +hw:array hw_getobjectbyqueryobj(int link, string query, int maxhits) +hw:array hw_getobjectbyquerycoll(int link, int collid, string query, int maxhits) +hw:array hw_getobjectbyquerycollobj(int link, int collid, string query, int maxhits) +hw:array hw_getchilddoccoll(int link, int objid) +hw:array hw_getchilddoccollobj(int link, int objid) +hw:array hw_getanchors(int link, int objid) +hw:array hw_getanchorsobj(int link, int objid) +hw:string hw_getusername(int link) +hw:void hw_identify(int link, string username, string password) +hw:array hw_objrec2array(string objrec, [array format]) +hw:string hw_array2objrec(array objarr) +hw:array hw_incollections(int link, array objids, array collids, int para) +hw:void hw_inscoll(int link, int parentid, array objarr) +hw:void hw_insdoc(int link, int parentid, string objrec [, string text]) +hw:int hw_getsrcbydestobj(int link, int destid) +hw:int hw_mapid(int link, int serverid, int destid) +hw:string hw_getrellink(int link, int rootid, int sourceid, int destid) +hw:void hw_connection_info(int link) +icap:int icap_close(int stream_id [, int options]) +icap:int icap_open(string calendar, string user, string password [, int options]) +icap:int icap_reopen(int stream_id, string calendar [, int options]) +icap:int icap_expunge(int stream_id) +icap:int icap_fetch_event(int stream_id, int eventid [, int options]) +icap:array icap_list_events(int stream_id, int begindate [, int enddate]) +icap:string icap_create_calendar(int stream_id, string calendar) +icap:string icap_rename_calendar(int stream_id, string src_calendar, string dest_calendar) +icap:int icap_list_alarms(int stream_id, array date, array time) +icap:string icap_delete_calendar(int stream_id, string calendar) +icap:string icap_delete_event(int stream_id, int uid) +icap:string icap_delete_calendar(int stream_id, int uid) +icap:string icap_store_event(int stream_id, object event) +icap:string icap_snooze(int stream_id, int uid) +imap:int imap_open(string mailbox, string user, string password [, int options]) +imap:int imap_popen(string mailbox, string user, string password [, int options]) +imap:int imap_reopen(int stream_id, string mailbox [, int options]) +imap:int imap_append(int stream_id, string folder, string message [, string flags]) +imap:int imap_num_msg(int stream_id) +imap:int imap_ping(int stream_id) +imap:int imap_num_recent(int stream_id) +imap:int imap_expunge(int stream_id) +imap:int imap_close(int stream_id [, int options]) +imap:array imap_headers(int stream_id) +imap:string imap_body(int stream_id, int msg_no [, int options]) +imap:string imap_fetchtext_full(int stream_id, int msg_no [, int options]) +imap:int imap_mail_copy(int stream_id, int msg_no, string mailbox [, int options]) +imap:int imap_mail_move(int stream_id, int msg_no, string mailbox [, int options]) +imap:int imap_createmailbox(int stream_id, string mailbox) +imap:int imap_renamemailbox(int stream_id, string old_name, string new_name) +imap:int imap_deletemailbox(int stream_id, string mailbox) +imap:array imap_list(int stream_id, string ref, string pattern) +imap:array imap_getmailboxes(int stream_id, string ref, string pattern) +imap:array imap_scan(int stream_id, string ref, string pattern, string content) +imap:object imap_check(int stream_id) +imap:int imap_delete(int stream_id, int msg_no [, int flags]) +imap:int imap_undelete(int stream_id, int msg_no) +imap:object imap_headerinfo(int stream_id, int msg_no [, int from_length [, int subject_length [, string default_host]]]) +imap:object imap_rfc822_parse_headers(string headers [, string default_host]) +imap:array imap_lsub(int stream_id, string ref, string pattern) +imap:array imap_getsubscribed(int stream_id, string ref, string pattern) +imap:int imap_subscribe(int stream_id, string mailbox) +imap:int imap_unsubscribe(int stream_id, string mailbox) +imap:object imap_fetchstructure(int stream_id, int msg_no [, int options]) +imap:string imap_fetchbody(int stream_id, int msg_no, int section [, int options]) +imap:string imap_base64(string text) +imap:string imap_qprint(string text) +imap:string imap_8bit(string text) +imap:string imap_binary(string text) +imap:object imap_mailboxmsginfo(int stream_id) +imap:string imap_rfc822_write_address(string mailbox, string host, string personal) +imap:array imap_rfc822_parse_adrlist(string address_string, string default_host) +imap:string imap_utf8(string string) +imap:string imap_utf7_decode(string buf) +imap:string imap_utf7_encode(string buf) +imap:int imap_setflag_full(int stream_id, string sequence, string flag [, int options]) +imap:int imap_clearflag_full(int stream_id, string sequence, string flag [, int options]) +imap:array imap_sort(int stream_id, int criteria, int reverse [, int options]) +imap:string imap_fetchheader(int stream_id, int msg_no [, int options]) +imap:int imap_uid(int stream_id, int msg_no) +imap:int imap_msgno(int stream_id, int unique_msg_id) +imap:object imap_status(int stream_id, string mailbox, int options) +imap:object imap_bodystruct(int stream_id, int msg_no, int section) +imap:array imap_fetch_overview(int stream_id, int msg_no) +imap:string imap_mail_compose(array envelope, array body) +imap:int imap_mail(string to, string subject, string message [, string additional_headers [, string cc [, string bcc [, string rpath]]]]) +imap:array imap_search(int stream_id, string criteria [, long flags]) +imap:array imap_alerts(void) +imap:array imap_errors(void) +imap:string imap_last_error(void) +imap:array imap_mime_header_decode(string str) +ifx:int ifx_connect([string database [, string userid [, string password]]]) +ifx:int ifx_pconnect([string database [, string userid [, string password]]]) +ifx:int ifx_close(int connid) +ifx:int ifx_query(string query, int connid [, int cursortype] [, array idarray]) +ifx:int ifx_prepare(string query, int connid [, int cursortype] [, array idarray]) +ifx:int ifx_do(int resultid) +ifx:string ifx_error([int connection_id]) +ifx:string ifx_errormsg([int errorcode]) +ifx:int ifx_affected_rows(int resultid) +ifx:array ifx_fetch_row(int resultid [, mixed position]) +ifx:int ifx_htmltbl_result(int resultid [, string htmltableoptions]) +ifx:array ifx_fieldtypes(int resultid) +ifx:array ifx_fieldproperties(int resultid) +ifx:int ifx_num_rows(int resultid) +ifx:int ifx_getsqlca(int resultid) +ifx:int ifx_num_fields(int resultid) +ifx:int ifx_free_result(int resultid) +ifx:int ifx_create_blob(int type, int mode, string param) +ifx:int ifx_copy_blob(int bid) +ifx:int ifx_free_blob(int bid) +ifx:string ifx_get_blob(int bid) +ifx:int ifx_update_blob(int bid, string content) +ifx:void ifx_blobinfile_mode(int mode) +ifx:void ifx_textasvarchar(int mode) +ifx:void ifx_byteasvarchar(int mode) +ifx:void ifx_nullformat(int mode) +ifx:int ifx_create_char(string param) +ifx:string ifx_get_char(int bid) +ifx:int ifx_free_char(int bid) +ifx:int ifx_update_char(int bid, string content) +ifx:int ifxus_create_slob(int mode) +ifx:int ifxus_free_slob(int bid) +ifx:int ifxus_close_slob(int bid) +ifx:int ifxus_open_slob(long bid, int mode) +ifx:int ifxus_tell_slob(long bid) +ifx:int ifxus_seek_slob(long bid, int mode, long offset) +ifx:int ifxus_read_slob(long bid, long nbytes) +ifx:int ifxus_write_slob(long bid, string content) +ii:resource ingres_connect([string database [, string username [, string password]]]) +ii:resource ingres_pconnect([string database [, string username [, string password]]]) +ii:bool ingres_close([resource link]) +ii:bool ingres_query(string query [, resource link]) +ii:int ingres_num_rows([resource link]) +ii:int ingres_num_fields([resource link]) +ii:string ingres_field_name(int index [, resource link]) +ii:string ingres_field_type(int index [, resource link]) +ii:string ingres_field_nullable(int index [, resource link]) +ii:string ingres_field_length(int index [, resource link]) +ii:string ingres_field_precision(int index [, resource link]) +ii:string ingres_field_scale(int index [, resource link]) +ii:array ingres_fetch_array([int result_type [, resource link]]) +ii:array ingres_fetch_row([resource link]) +ii:array ingres_fetch_object([int result_type [, resource link]]) +ii:bool ingres_rollback([resource link]) +ii:bool ingres_commit([resource link]) +ii:bool ingres_autocommit([resource link]) +interbase:string ibase_errmsg(void) +interbase:int ibase_connect(string database [, string username] [, string password] [, string charset] [, int buffers] [, int dialect] [, string role]) +interbase:int ibase_pconnect(string database [, string username] [, string password] [, string charset] [, int buffers] [, int dialect] [, string role]) +interbase:int ibase_close([int link_identifier]) +interbase:int ibase_trans([int trans_args [, int link_identifier]]) +interbase:int ibase_commit([int link_identifier,] int trans_number) +interbase:int ibase_rollback([int link_identifier,] int trans_number) +interbase:int ibase_query([int link_identifier,] string query [, int bind_args]) +interbase:array ibase_fetch_row(int result [, int blob_flag]) +interbase:object ibase_fetch_object(int result [, int blob_flag]) +interbase:int ibase_free_result(int result) +interbase:int ibase_prepare([int link_identifier,] string query) +interbase:int ibase_execute(int query [, int bind_args [, int ...]) +interbase:int ibase_free_query(int query) +interbase:int ibase_timefmt(string format) +interbase:int ibase_num_fields(int result) +interbase:array ibase_field_info(int result, int field_number) +interbase:int ibase_blob_create([int link_identifier]) +interbase:int ibase_blob_open(string blob_id) +interbase:int ibase_blob_add(int blob_id, string data) +interbase:string ibase_blob_get(int blob_id, int len) +interbase:int ibase_blob_close(int blob_id) +interbase:int ibase_blob_cancel(int blob_id) +interbase:object ibase_blob_info(string blob_id_str) +interbase:int ibase_blob_echo(string blob_id_str) +interbase:string ibase_blob_import([link_identifier,] int file_id) +ldap:int ldap_connect([string host [, int port]]) +ldap:int ldap_bind(int link [, string dn, string password]) +ldap:int ldap_unbind(int link) +ldap:int ldap_read(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] ) +ldap:int ldap_list(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] ) +ldap:int ldap_search(int link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]] ) +ldap:int ldap_free_result(int result) +ldap:int ldap_count_entries(int link, int result) +ldap:int ldap_first_entry(int link, int result) +ldap:int ldap_next_entry(int link, int entry) +ldap:array ldap_get_entries(int link, int result) +ldap:string ldap_first_attribute(int link, int result, int ber) +ldap:string ldap_next_attribute(int link, int result, int ber) +ldap:array ldap_get_attributes(int link, int result) +ldap:array ldap_get_values(int link, int result, string attribute) +ldap:array ldap_get_values_len(int link, int result, string attribute) +ldap:string ldap_get_dn(int link, int result) +ldap:array ldap_explode_dn(string dn, int with_attrib) +ldap:string ldap_dn2ufn(string dn) +ldap:int ldap_add(int link, string dn, array entry) +ldap:int ldap_modify(int link, string dn, array entry) +ldap:int ldap_mod_replace(int link, string dn, array entry) +ldap:int ldap_mod_add(int link, string dn, array entry) +ldap:int ldap_mod_del(int link, string dn, array entry) +ldap:int ldap_delete(int link, string dn) +ldap:int ldap_errno(int link) +ldap:string ldap_err2str(int errno) +ldap:string ldap_error(int link) +ldap:int ldap_compare(int link, string dn, string attr, string value) +ldap:string ldap_t61_to_8859(string value) +ldap:string ldap_8859_to_t61(string value) +mcal:int mcal_close(int stream_id [, int options]) +mcal:int mcal_open(string calendar, string user, string password [, int options]) +mcal:string mcal_popen(string calendar, string user, string password [, int options]) +mcal:int mcal_reopen(int stream_id, string calendar [, int options]) +mcal:int mcal_expunge(int stream_id) +mcal:int mcal_fetch_event(int stream_id, int eventid [, int options]) +mcal:object mcal_fetch_current_stream_event(int stream_id) +mcal:array mcal_list_events(int stream_id, object begindate [, object enddate]) +mcal:string mcal_create_calendar(int stream_id, string calendar) +mcal:string mcal_rename_calendar(int stream_id, string src_calendar, string dest_calendar) +mcal:bool mcal_list_alarms(int stream_id, int year, int month, int day, int hour, int min, int sec) +mcal:string mcal_delete_calendar(int stream_id, string calendar) +mcal:string mcal_delete_event(int stream_id, int event_id) +mcal:string mcal_append_event(int stream_id) +mcal:string mcal_store_event(int stream_id) +mcal:string mcal_snooze(int stream_id, int uid) +mcal:string mcal_event_set_category(int stream_id, string category) +mcal:string mcal_event_set_title(int stream_id, string title) +mcal:string mcal_event_set_description(int stream_id, string description) +mcal:string mcal_event_set_start(int stream_id, int year,int month, int day [[[, int hour], int min], int sec]) +mcal:string mcal_event_set_end(int stream_id, int year,int month, int day [[[, int hour], int min], int sec]) +mcal:int mcal_event_set_alarm(int stream_id, int alarm) +mcal:int mcal_event_init(int stream_id) +mcal:int mcal_event_set_class(int stream_id, int class) +mcal:string mcal_event_add_attribute(int stream_id, string attribute, string value) +mcal:bool mcal_is_leap_year(int year) +mcal:int mcal_days_in_month(int month, bool leap_year) +mcal:bool mcal_date_valid(int year, int month, int day) +mcal:bool mcal_time_valid(int hour, int min, int sec) +mcal:int mcal_day_of_week(int year, int month, int day) +mcal:int mcal_day_of_year(int year, int month, int day) +mcal:int mcal_week_of_year(int day, int month, int year) +mcal:int mcal_date_compare(int ayear, int amonth, int aday, int byear, int bmonth, int bday) +mcal:object mcal_next_recurrence(int stream_id, int weekstart, array next) +mcal:string mcal_event_set_recur_none(int stream_id) +mcal:string mcal_event_set_recur_daily(int stream_id, int year, int month, int day, int interval) +mcal:string mcal_event_set_recur_weekly(int stream_id, int year, int month, int day, int interval, int weekdays) +mcal:string mcal_event_set_recur_monthly_mday(int stream_id, int year, int month, int day, int interval) +mcal:string mcal_event_set_recur_monthly_wday(int stream_id, int year, int month, int day, int interval) +mcal:string mcal_event_set_recur_yearly(int stream_id, int year, int month, int day, int interval) +mcrypt:resource mcrypt_module_open(string cipher, string cipher_directory, string mode, string mode_directory) +mcrypt:int mcrypt_generic_init(resource td, string key, string iv) +mcrypt:string mcrypt_generic(resource td, string data) +mcrypt:string mdecrypt_generic(resource td, string data) +mcrypt:int mcrypt_enc_get_supported_key_sizes(resource td) +mcrypt:int mcrypt_enc_self_test(resource td) +mcrypt:bool mcrypt_generic_end(resource td) +mcrypt:bool mcrypt_enc_is_block_algorithm_mode(resource td) +mcrypt:bool mcrypt_enc_is_block_algorithm(resource td) +mcrypt:bool mcrypt_enc_is_block_mode(resource td) +mcrypt:int mcrypt_enc_get_block_size(resource td) +mcrypt:int mcrypt_enc_get_key_size(resource td) +mcrypt:int mcrypt_enc_get_iv_size(resource td) +mcrypt:string mcrypt_enc_get_algorithms_name(resource td) +mcrypt:string mcrypt_enc_get_modes_name(resource td) +mcrypt:bool mcrypt_module_self_test(string algorithm [, string lib_dir]) +mcrypt:bool mcrypt_module_is_block_algorithm_mode(string mode [, string lib_dir]) +mcrypt:bool mcrypt_module_is_block_algorithm(string algorithm [, string lib_dir]) +mcrypt:bool mcrypt_module_is_block_mode(string mode [, string lib_dir]) +mcrypt:int mcrypt_module_get_algo_block_size(string algorithm [, string lib_dir]) +mcrypt:int mcrypt_module_get_algo_key_size(string algorithm [, string lib_dir]) +mcrypt:int mcrypt_module_get_supported_key_sizes(string algorithm [, string lib_dir]) +mcrypt:array mcrypt_list_algorithms([string lib_dir]) +mcrypt:array mcrypt_list_modes([string lib_dir]) +mcrypt:int mcrypt_get_key_size(string cipher, string module) +mcrypt:int mcrypt_get_block_size(string cipher, string module) +mcrypt:int mcrypt_get_iv_size(string cipher, string module) +mcrypt:string mcrypt_get_cipher_name(string cipher) +mcrypt:string mcrypt_encrypt(string cipher, string key, string data, string mode, string iv) +mcrypt:string mcrypt_decrypt(string cipher, string key, string data, string mode, string iv) +mcrypt:string mcrypt_ecb(int cipher, string key, string data, int mode, string iv) +mcrypt:string mcrypt_cbc(int cipher, string key, string data, int mode, string iv) +mcrypt:string mcrypt_cfb(int cipher, string key, string data, int mode, string iv) +mcrypt:string mcrypt_ofb(int cipher, string key, string data, int mode, string iv) +mcrypt:string mcrypt_create_iv(int size, int source) +mcrypt:string mcrypt_get_cipher_name(int cipher) +mcrypt:int mcrypt_get_key_size(int cipher) +mcrypt:int mcrypt_get_block_size(int cipher) +mcrypt:string mcrypt_ofb(int cipher, string key, string data, int mode, string iv) +mcrypt:string mcrypt_cfb(int cipher, string key, string data, int mode, string iv) +mcrypt:string mcrypt_cbc(int cipher, string key, string data, int mode [, string iv]) +mcrypt:string mcrypt_ecb(int cipher, string key, string data, int mode) +mhash:int mhash_count() +mhash:int mhash_get_block_size(int hash) +mhash:string mhash_get_hash_name(int hash) +mhash:string mhash(int hash, string data) +msql:int msql_connect([string hostname[ +msql:int msql_pconnect([string hostname[ +msql:int msql_close([int link_identifier]) +msql:int msql_select_db(string database_name [, int link_identifier]) +msql:int msql_create_db(string database_name [, int link_identifier]) +msql:int msql_drop_db(string database_name [, int link_identifier]) +msql:int msql_query(string query [, int link_identifier]) +msql:int msql_db_query(string database_name, string query [, int link_identifier]) +msql:int msql_list_dbs([int link_identifier]) +msql:int msql_list_tables(string database_name [, int link_identifier]) +msql:int msql_list_fields(string database_name, string table_name [, int link_identifier]) +msql:string msql_error([int link_identifier]) +msql:int msql_result(int query, int row [, mixed field]) +msql:int msql_num_rows(int query) +msql:int msql_num_fields(int query) +msql:array msql_fetch_row(int query) +msql:object msql_fetch_object(int query [, int result_type]) +msql:array msql_fetch_array(int query [, int result_type]) +msql:int msql_data_seek(int query, int row_number) +msql:object msql_fetch_field(int query [, int field_offset]) +msql:int msql_field_seek(int query, int field_offset) +msql:string msql_field_name(int query, int field_index) +msql:string msql_field_table(int query, int field_offset) +msql:int msql_field_len(int query, int field_offet) +msql:string msql_field_type(int query, int field_offset) +msql:string msql_field_flags(int query, int field_offset) +msql:int msql_free_result(int query) +msql:int msql_affected_rows(int query) +mssql:int mssql_connect([string servername [, string username [, string password]]]) +mssql:int mssql_pconnect([string servername [, string username [, string password]]]) +mssql:int mssql_close([int connectionid]) +mssql:bool mssql_select_db(string database_name [, int conn_id]) +mssql:int mssql_query(string query [, int conn_id]) +mssql:int mssql_free_result(string result_index) +mssql:string mssql_get_last_message(void) +mssql:int mssql_num_rows(int mssql_result_index) +mssql:int mssql_num_fields(int mssql_result_index) +mssql:array mssql_fetch_row(int result_id) +mssql:object mssql_fetch_object(int result_id) +mssql:array mssql_fetch_array(int result_id) +mssql:int mssql_data_seek(int result_id, int offset) +mssql:object mssql_fetch_field(int result_id [, int offset]) +mssql:int mssql_field_length(int result_id [, int offset]) +mssql:string mssql_field_name(int result_id [, int offset]) +mssql:string mssql_field_type(int result_id [, int offset]) +mssql:bool mssql_field_seek(int result_id, int offset) +mssql:string mssql_result(int result_id, int row, mixed field) +mssql:void mssql_min_error_severity(int severity) +mssql:void mssql_min_message_severity(int severity) +mysql:int mysql_connect([string hostname]) +mysql:int mysql_pconnect([string hostname]) +mysql:int mysql_close([int link_identifier]) +mysql:int mysql_select_db(string database_name [, int link_identifier]) +mysql:int mysql_create_db(string database_name [, int link_identifier]) +mysql:int mysql_drop_db(string database_name [, int link_identifier]) +mysql:int mysql_query(string query [, int link_identifier]) +mysql:int mysql_db_query(string database_name, string query [, int link_identifier]) +mysql:int mysql_list_dbs([int link_identifier]) +mysql:int mysql_list_tables(string database_name [, int link_identifier]) +mysql:int mysql_list_fields(string database_name, string table_name [, int link_identifier]) +mysql:string mysql_error([int link_identifier]) +mysql:int mysql_errno([int link_identifier]) +mysql:int mysql_affected_rows([int link_identifier]) +mysql:char mysql_escape_string([char string]) +mysql:int mysql_insert_id([int link_identifier]) +mysql:int mysql_result(int result, int row [, mixed field]) +mysql:int mysql_num_rows(int result) +mysql:int mysql_num_fields(int result) +mysql:array mysql_fetch_row(int result) +mysql:object mysql_fetch_object(int result [, int result_type]) +mysql:array mysql_fetch_array(int result [, int result_type]) +mysql:array mysql_fetch_assoc(int result) +mysql:int mysql_data_seek(int result, int row_number) +mysql:array mysql_fetch_lengths(int result) +mysql:object mysql_fetch_field(int result [, int field_offset]) +mysql:int mysql_field_seek(int result, int field_offset) +mysql:string mysql_field_name(int result, int field_index) +mysql:string mysql_field_table(int result, int field_offset) +mysql:int mysql_field_len(int result, int field_offet) +mysql:string mysql_field_type(int result, int field_offset) +mysql:string mysql_field_flags(int result, int field_offset) +mysql:int mysql_free_result(int result) +oci8:int ocidefinebyname(int stmt, string name, mixed &var [, int type]) +oci8:int ocibindbyname(int stmt, string name, mixed &var, int maxlength [, int type]) +oci8:string ocifreedesc(object lob) +oci8:string ocisavelob(object lob) +oci8:string ocisavelobfile(object lob) +oci8:string ociloadlob(object lob) +oci8:void ociwritelobtofile(object lob [, string filename] [, int start] [, int length]) +oci8:string ocinewdescriptor(int connection [, int type]) +oci8:string ocirollback(int conn) +oci8:string ocicommit(int conn) +oci8:string ocicolumnname(int stmt, int col) +oci8:int ocicolumnsize(int stmt, int col) +oci8:int ocicolumnscale(int stmt, int col) +oci8:int ocicolumnprecision(int stmt, int col) +oci8:mixed ocicolumntype(int stmt, int col) +oci8:mixed ocicolumntyperaw(int stmt, int col) +oci8:int ocicolumnisnull(int stmt, int col) +oci8:void ociinternaldebug(int onoff) +oci8:int ociexecute(int stmt [, int mode]) +oci8:int ocicancel(int stmt) +oci8:int ocifetch(int stmt) +oci8:int ocifetchinto(int stmt, array &output [, int mode]) +oci8:int ocifetchstatement(int stmt, array &output) +oci8:int ocifreestatement(int stmt) +oci8:int ocilogoff(int conn) +oci8:int ocinlogon(string user, string pass [, string db]) +oci8:int ocilogon(string user, string pass [, string db]) +oci8:int ociplogon(string user, string pass [, string db]) +oci8:array ocierror([int stmt|conn|global]) +oci8:int ocinumcols(int stmt) +oci8:int ociparse(int conn, string query) +oci8:int ocisetprefetch(int conn, string query) +oci8:int ocinewcursor(int conn) +oci8:string ociresult(int stmt, mixed column) +oci8:string ociserverversion(int conn) +oci8:int ocistatementtype(int stmt) +oci8:int ocirowcount(int stmt) +odbc:void odbc_close_all(void) +odbc:int odbc_binmode(int result_id, int mode) +odbc:int odbc_longreadlen(int result_id, int length) +odbc:int odbc_prepare(int connection_id, string query) +odbc:int odbc_execute(int result_id [, array parameters_array]) +odbc:string odbc_cursor(int result_id) +odbc:int odbc_exec(int connection_id, string query [, int flags]) +odbc:object odbc_fetch_object(int result [, int rownumber]) +odbc:array odbc_fetch_array(int result [, int rownumber]) +odbc:int odbc_fetch_into(int result_id [, int rownumber], array result_array) +odbc:int odbc_fetch_row(int result_id [, int row_number]) +odbc:string odbc_result(int result_id, mixed field) +odbc:int odbc_result_all(int result_id [, string format]) +odbc:int odbc_free_result(int result_id) +odbc:int odbc_connect(string DSN, string user, string password [, int cursor_option]) +odbc:int odbc_pconnect(string DSN, string user, string password [, int cursor_option]) +odbc:void odbc_close(int connection_id) +odbc:int odbc_num_rows(int result_id) +odbc:int odbc_num_fields(int result_id) +odbc:string odbc_field_name(int result_id, int field_number) +odbc:string odbc_field_type(int result_id, int field_number) +odbc:int odbc_field_len(int result_id, int field_number) +odbc:int odbc_field_scale(int result_id, int field_number) +odbc:int odbc_field_num(int result_id, string field_name) +odbc:int odbc_autocommit(int connection_id [, int OnOff]) +odbc:int odbc_commit(int connection_id) +odbc:int odbc_rollback(int connection_id) +odbc:int odbc_setoption(int conn_id|result_id, int which, int option, int value) +odbc:int odbc_tables(int connection_id [, string qualifier, string owner, string name, string table_types]) +odbc:int odbc_columns(int connection_id, string qualifier, string owner, string table_name, string column_name) +odbc:int odbc_columnprivileges(int connection_id, string catalog, string schema, string table, string column) +odbc:int odbc_foreignkeys(int connection_id, string pk_qualifier, string pk_owner, string pk_table, string fk_qualifier, string fk_owner, string fk_table) +odbc:int odbc_gettypeinfo(int connection_id [, int data_type]) +odbc:int odbc_primarykeys(int connection_id, string qualifier, string owner, string table) +odbc:int odbc_procedurecolumns(int connection_id [, string qualifier, string owner, string proc, string column]) +odbc:int odbc_procedures(int connection_id [, string qualifier, string owner, string name]) +odbc:int odbc_specialcolumns(int connection_id, int type, string qualifier, string owner, string table, int scope, int nullable) +odbc:int odbc_statistics(int connection_id, string qualifier, string owner, string name, int unique, int accuracy) +odbc:int odbc_tableprivileges(int connection_id, string qualifier, string owner, string name) +oracle:int ora_logon(string user, string password) +oracle:int ora_plogon(string user, string password) +oracle:int ora_logoff(int connection) +oracle:int ora_open(int connection) +oracle:int ora_close(int cursor) +oracle:int ora_commitoff(int connection) +oracle:int ora_commiton(int connection) +oracle:int ora_commit(int connection) +oracle:int ora_rollback(int connection) +oracle:int ora_parse(int cursor, string sql_statement [, int defer]) +oracle:int ora_bind(int cursor, string php_variable_name, string sql_parameter_name, int length [, int type]) +oracle:int ora_exec(int cursor) +oracle:int ora_numcols(int cursor) +oracle:int ora_numrows(int cursor) +oracle:int ora_do(int connection, int cursor) +oracle:int ora_fetch(int cursor) +oracle:int ora_fetch_into(int cursor, array result [, int flags]) +oracle:string ora_columnname(int cursor, int column) +oracle:string ora_columntype(int cursor, int column) +oracle:int ora_columnsize(int cursor, int column) +oracle:mixed ora_getcolumn(int cursor, int column) +oracle:string ora_error(int cursor_or_connection) +oracle:int ora_errorcode(int cursor_or_connection) +ovrimos:int ovrimos_connect(string host, string db, string user, string password) +ovrimos:void ovrimos_close(int connection) +ovrimos:void ovrimos_close_all() +ovrimos:int ovrimos_longreadlen(int result_id, int length) +ovrimos:int ovrimos_prepare(int connection_id, string query) +ovrimos:int ovrimos_execute(int result_id [, array parameters_array]) +ovrimos:string ovrimos_cursor(int result_id) +ovrimos:int ovrimos_exec(int connection_id, string query) +ovrimos:int ovrimos_fetch_into(int result_id, array result_array [, string how, [int rownumber]]) +ovrimos:int ovrimos_fetch_row(int result_id [, int how, [int row_number]]) +ovrimos:string ovrimos_result(int result_id, mixed field) +ovrimos:int ovrimos_result_all(int result_id [, string format]) +ovrimos:int ovrimos_free_result(int result_id) +ovrimos:int ovrimos_num_rows(int result_id) +ovrimos:int ovrimos_num_fields(int result_id) +ovrimos:string ovrimos_field_name(int result_id, int field_number) +ovrimos:string ovrimos_field_type(int result_id, int field_number) +ovrimos:int ovrimos_field_len(int result_id, int field_number) +ovrimos:int ovrimos_field_num(int result_id, string field_name) +ovrimos:int ovrimos_autocommit(int connection_id, int OnOff) +ovrimos:int ovrimos_commit(int connection_id) +ovrimos:int ovrimos_rollback(int connection_id) +ovrimos:int ovrimos_setoption(int conn_id|result_id, int which, int option, int value) +pcre:int preg_match(string pattern, string subject [, array subpatterns]) +pcre:int preg_match_all(string pattern, string subject, array subpatterns [, int order]) +pcre:string preg_replace(string|array regex, string|array replace, string|array subject [, int limit]) +pcre:array preg_split(string pattern, string subject [, int limit [, int flags]]) +pcre:string preg_quote(string str, string delim_char) +pcre:array preg_grep(string regex, array input) +pdf:bool pdf_set_info(int pdfdoc, string fieldname, string value) +pdf:bool pdf_set_info_creator(int pdfdoc, string creator) +pdf:bool pdf_set_info_title(int pdfdoc, string title) +pdf:bool pdf_set_info_subject(int pdfdoc, string subject) +pdf:bool pdf_set_info_author(int pdfdoc, string author) +pdf:bool pdf_set_info_keywords(int pdfdoc, string keywords) +pdf:int pdf_open([int filedesc]) +pdf:void pdf_close(int pdfdoc) +pdf:void pdf_begin_page(int pdfdoc, double width, double height) +pdf:void pdf_end_page(int pdfdoc) +pdf:void pdf_show(int pdfdoc, string text) +pdf:void pdf_show_xy(int pdfdoc, string text, double x-koor, double y-koor) +pdf:int pdf_show_boxed(int pdfdoc, string text, double x-koor, double y-koor, double width, double height, string mode, [string feature]) +pdf:void pdf_set_font(int pdfdoc, string font, double size, string encoding [, int embed]) +pdf:int pdf_get_font(int pdfdoc) +pdf:string pdf_get_fontname(int pdfdoc) +pdf:double pdf_get_fontsize(int pdfdoc) +pdf:void pdf_set_leading(int pdfdoc, double distance) +pdf:void pdf_set_text_rendering(int pdfdoc, int mode) +pdf:void pdf_set_horiz_scaling(int pdfdoc, double scale) +pdf:void pdf_set_text_rise(int pdfdoc, double value) +pdf:void pdf_set_text_matrix(int pdfdoc, arry matrix) +pdf:void pdf_set_text_pos(int pdfdoc, double x, double y) +pdf:void pdf_set_char_spacing(int pdfdoc, double space) +pdf:void pdf_set_word_spacing(int pdfdoc, double space) +pdf:void pdf_continue_text(int pdfdoc, string text) +pdf:double pdf_stringwidth(int pdfdoc, string text) +pdf:void pdf_save(int pdfdoc) +pdf:void pdf_restore(int pdfdoc) +pdf:void pdf_translate(int pdfdoc, double x, double y) +pdf:void pdf_scale(int pdfdoc, double x-scale, double y-scale) +pdf:void pdf_rotate(int pdfdoc, double angle) +pdf:void pdf_skew(int pdfdoc, double xangle, double yangle) +pdf:void pdf_setflat(int pdfdoc, double value) +pdf:void pdf_setlinejoin(int pdfdoc, int value) +pdf:void pdf_setlinecap(int pdfdoc, int value) +pdf:void pdf_setmiterlimit(int pdfdoc, double value) +pdf:void pdf_setlinewidth(int pdfdoc, double width) +pdf:void pdf_setdash(int pdfdoc, double white, double black) +pdf:void pdf_moveto(int pdfdoc, double x, double y) +pdf:void pdf_curveto(int pdfdoc, double x1, double y1, double x2, double y2, double x3, double y3) +pdf:void pdf_lineto(int pdfdoc, double x, double y) +pdf:void pdf_circle(int pdfdoc, double x, double y, double radius) +pdf:void pdf_arc(int pdfdoc, double x, double y, double radius, double start, double end) +pdf:void pdf_rect(int pdfdoc, double x, double y, double width, double height) +pdf:void pdf_closepath(int pdfdoc) +pdf:void pdf_closepath_stroke(int pdfdoc) +pdf:void pdf_stroke(int pdfdoc) +pdf:void pdf_fill(int pdfdoc) +pdf:void pdf_fill_stroke(int pdfdoc) +pdf:void pdf_closepath_fill_stroke(int pdfdoc) +pdf:void pdf_endpath(int pdfdoc) +pdf:void pdf_clip(int pdfdoc) +pdf:void pdf_set_parameter(int pdfdoc, string key, string value) +pdf:string pdf_get_parameter(int pdfdoc, string key, mixed modifier) +pdf:void pdf_set_value(int pdfdoc, string key, double value) +pdf:double pdf_get_value(int pdfdoc, string key, double modifier) +pdf:void pdf_setgray_fill(int pdfdoc, double value) +pdf:void pdf_setgray_stroke(int pdfdoc, double value) +pdf:void pdf_setgray(int pdfdoc, double value) +pdf:void pdf_setrgbcolor_fill(int pdfdoc, double red, double green, double blue) +pdf:void pdf_setrgbcolor_stroke(int pdfdoc, double red, double green, double blue) +pdf:void pdf_setrgbcolor(int pdfdoc, double red, double green, double blue) +pdf:int pdf_add_outline(int pdfdoc, string text [, int parent, int open]); +pdf:void pdf_set_transition(int pdfdoc, int transition) +pdf:void pdf_set_duration(int pdfdoc, double duration) +pdf:int pdf_open_gif(int pdf, string giffile) +pdf:int pdf_open_jpeg(int pdf, string jpegfile) +pdf:int pdf_open_png(int pdf, string pngfile) +pdf:int pdf_open_tiff(int pdf, string tifffile) +pdf:int pdf_open_image_file(int pdf, string type, string file) +pdf:int pdf_open_memory_image(int pdf, int image) +pdf:void pdf_close_image(int pdfimage) +pdf:void pdf_place_image(int pdf, int pdfimage, double x, double y, double scale) +pdf:void pdf_get_image_width(int pdf, int pdfimage) +pdf:void pdf_get_image_height(int pdf, int pdfimage) +pdf:void pdf_add_weblink(int pdfdoc, double llx, double lly, double urx, double ury, string url) +pdf:void pdf_add_pdflink(int pdfdoc, double llx, double lly, double urx, double ury, string filename, int page, string dest) +pdf:void pdf_set_border_style(int pdfdoc, string style, double width) +pdf:void pdf_set_border_color(int pdfdoc, double red, double green, double blue) +pdf:void pdf_set_border_dash(int pdfdoc, double black, double white) +pdf:void pdf_add_annotation(int pdfdoc, double xll, double yll, double xur, double xur, string title, string text) +pfpro:string pfpro_version() +pfpro:void pfpro_init() +pfpro:void pfpro_cleanup() +pfpro:string pfpro_process_raw(string parmlist [, string hostaddress [, int port, [, int timeout [, string proxyAddress [, int proxyPort [, string proxyLogon [, string proxyPassword]]]]]]]) +pfpro:array pfpro_process(array parmlist [, string hostaddress [, int port, [, int timeout [, string proxyAddress [, int proxyPort [, string proxyLogon [, string proxyPassword]]]]]]]) +pgsql:int pg_connect([string connection_string] | [string host, string port [, string options [, string tty,]] string database) +pgsql:int pg_pconnect([string connection_string] | [string host, string port [, string options [, string tty,]] string database) +pgsql:bool pg_close([int connection]) +pgsql:string pg_dbname([int connection]) +pgsql:string pg_errormessage([int connection]) +pgsql:string pg_options([int connection]) +pgsql:int pg_port([int connection]) +pgsql:string pg_tty([int connection]) +pgsql:string pg_host([int connection]) +pgsql:int pg_exec([int connection,] string query) +pgsql:int pg_end_copy([int connection]) +pgsql:int pg_put_line([int connection,] string query) +pgsql:int pg_numrows(int result) +pgsql:int pg_numfields(int result) +pgsql:int pg_cmdtuples(int result) +pgsql:string pg_fieldname(int result, int field_number) +pgsql:int pg_fieldsize(int result, int field_number) +pgsql:string pg_fieldtype(int result, int field_number) +pgsql:int pg_fieldnum(int result, string field_name) +pgsql:mixed pg_result(int result, int row_number, mixed field_name) +pgsql:array pg_fetch_row(int result, int row) +pgsql:array pg_fetch_array(int result, int row [, int result_type]) +pgsql:object pg_fetch_object(int result, int row [, int result_type]) +pgsql:int pg_fieldprtlen(int result, int row, mixed field_name_or_number) +pgsql:int pg_fieldisnull(int result, int row, mixed field_name_or_number) +pgsql:int pg_freeresult(int result) +pgsql:int pg_getlastoid(int result) +pgsql:bool pg_trace(string filename [, string mode [, resource connection]]) +pgsql:bool pg_untrace([int connection]) +pgsql:int pg_locreate(int connection) +pgsql:void pg_lounlink([int connection,] int large_obj_id) +pgsql:int pg_loopen([int connection,] int objoid, string mode) +pgsql:void pg_loclose(int fd) +pgsql:string pg_loread(int fd, int len) +pgsql:int pg_lowrite(int fd, string buf) +pgsql:void pg_loreadall(int fd) +pgsql:int pg_loimport(string filename [, resource connection]) +pgsql:bool pg_loexport(int objoid, string filename [, resource connection]) +pgsql:int pg_set_client_encoding([int connection,] string encoding) +pgsql:string pg_client_encoding([int connection]) +posix:int posix_kill(int pid, int sig) +posix:long posix_getpid(void) +posix:long posix_getppid(void) +posix:long posix_getuid(void) +posix:long posix_getgid(void) +posix:long posix_geteuid(void) +posix:long posix_getegid(void) +posix:long posix_setuid(long uid) +posix:long posix_setgid(long uid) +posix:long posix_seteuid(long uid) +posix:long posix_setegid(long uid) +posix:long posix_getgroups(void) +posix:string posix_getlogin(void) +posix:long posix_getpgrp(void) +posix:long posix_setsid(void) +posix:long posix_setpgid(long pid, long pgid) +posix:long posix_getpgid(void) +posix:long posix_getsid(void) +posix:array posix_uname(void) +posix:array posix_times(void) +posix:string posix_ctermid(void) +posix:string posix_ttyname(int fd) +posix:bool posix_isatty(int fd) +posix:string posix_getcwd(void) +posix:string posix_mkfifo(void) +posix:array posix_getgrnam(string groupname) +posix:array posix_getgrgid(long gid) +posix:array posix_getpwnam(string groupname) +posix:array posix_getpwuid(long uid) +posix:long posix_getrlimit(void) +pspell:int pspell_new(string language [, string spelling [, string jargon [, string encoding [, int mode]]]]) +pspell:int pspell_new_personal(string personal, string language [, string spelling [, string jargon [, string encoding [, int mode]]]]) +pspell:int pspell_new_config(int config) +pspell:int pspell_check(int pspell, string word) +pspell:array pspell_suggest(int pspell, string word) +pspell:int pspell_store_replacement(int pspell, string misspell, string correct) +pspell:int pspell_add_to_personal(int pspell, string word) +pspell:int pspell_add_to_session(int pspell, string word) +pspell:int pspell_clear_session(int pspell) +pspell:int pspell_save_wordlist(int pspell) +pspell:int pspell_config_create(string language [, string spelling [, string jargon [, string encoding]]]) +pspell:int pspell_config_runtogether(int conf, bool runtogether) +pspell:int pspell_config_mode(int conf, long mode) +pspell:int pspell_config_ignore(int conf, int ignore) +pspell:int pspell_config_personal(int conf, string personal) +pspell:int pspell_config_repl(int conf, string repl) +pspell:int pspell_config_save_repl(int conf, bool save) +readline:string readline([string prompt]) +readline:mixed readline_info([string varname] [, string newvalue]) +readline:void readline_add_history([string prompt]) +readline:void readline_clear_history(void) +readline:array readline_list_history(void) +readline:int readline_read_history([string filename] [, int from] [,int to]) +readline:int readline_write_history([string filename]) +readline:void readline_completion_function(string funcname) +recode:string recode_string(string request, string str) +recode:bool recode_file(string request, resource input, resource output) +sablot:resource xslt_create(void) +sablot:bool xslt_run(resource xh, string xslt_file, string data_file[, string result[, array xslt_params[, array xslt_args]]]) +sablot:bool xslt_openlog(resource xh, string logfile[, int loglevel]) +sablot:bool xslt_closelog(resource xh) +sablot:string xslt_fetch_result(resource xh[, string result_name]) +sablot:void xslt_free(resource xh) +sablot:void xslt_set_sax_handler(resource xh, array handlers) +sablot:mixed xslt_error([int xh]) +sablot:int xslt_errno([int xh]) +session:void session_set_cookie_params(int lifetime [, string path [, string domain]]) +session:array session_get_cookie_params(void) +session:string session_name([string newname]) +session:string session_module_name([string newname]) +session:void session_set_save_handler(string open, string close, string read, string write, string destroy, string gc) +session:string session_save_path([string newname]) +session:string session_id([string newid]) +session:string session_cache_limiter([string new_cache_limiter]) +session:bool session_register(mixed var_names [, mixed ...]) +session:bool session_unregister(string varname) +session:bool session_is_registered(string varname) +session:string session_encode(void) +session:bool session_decode(string data) +session:bool session_start(void) +session:bool session_destroy(void) +session:void session_unset(void) +shmop:int shm_open (int key, int flags, int mode, int size) +shmop:string shm_read (int shmid, int start, int count) +shmop:void shm_close (int shmid) +shmop:int shm_size (int shmid) +shmop:int shm_write (int shmid, string data, int offset) +shmop:bool shm_delete (int shmid) +create_stubs:{{{ proto " types[i] " " funcs[i] "(" +skeleton:string confirm_extname_compiled(string arg) +snmp:string snmpget(string host, string community, string object_id [, int timeout [, int retries]]) +snmp:array snmpwalk(string host, string community, string object_id [, int timeout [, int retries]]) +snmp:array snmprealwalk(string host, string community, string object_id [, int timeout [, int retries]]) +snmp:bool snmp_get_quick_print(void) +snmp:void snmp_set_quick_print(int quick_print) +snmp:int snmpset(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]]) +sockets:resource fd_alloc(void) +sockets:void fd_dealloc(void) +sockets:bool fd_set(int fd, resource set) +sockets:bool fd_clear(int fd, resource set) +sockets:bool fd_isset(int fd, resource set) +sockets:void fd_zero(resource set) +sockets:int select(int max_fd, resource readfds, resource writefds, resource exceptfds, int tv_sec, int tv_usec) +sockets:int open_listen_sock(int port) +sockets:int accept_connect(int fd) +sockets:bool set_nonblock(int fd) +sockets:bool listen(int fd, int backlog) +sockets:bool close(int fd) +sockets:int write(int fd, string buf, int length) +sockets:int read(int fd, string &buf, int length) +sockets:int getsockname(int fd, string &addr, int &port) +sockets:int gethostbyname(string name, string &addr) +sockets:int getpeername(int fd, string &addr, int &port) +sockets:int gethostbyaddr(string addr, string &name) +sockets:int socket(int domain, int type, int protocol) +sockets:int connect(int sockfd, string addr [, int port]) +sockets:string strerror(int errno) +sockets:int bind(int sockfd, string addr [, int port]) +sockets:resource build_iovec(int num_vectors [, int ...]) +sockets:string fetch_iovec(resource iovec_id, int iovec_position) +sockets:bool set_iovec(resource iovec_id, int iovec_position, string new_val) +sockets:bool add_iovec(resource iovec_id, int iov_len) +sockets:bool delete_iovec(resource iovec_id, int iov_pos) +sockets:bool free_iovec(resource iovec_id) +sockets:int readv(int fd, resource iovec_id) +sockets:int writev(int fd, resource iovec_id) +sockets:int recv(int fd, string buf, int len, int flags) +sockets:int send(int fd, string buf, int len, int flags) +sockets:int recvfrom(int fd, string &buf, int len, int flags, string &name [, int &port]) +sockets:int sendto(int fd, string buf, int len, int flags, string addr [, int port]) +sockets:int recvmsg(int fd, resource iovec, array &control, int &controllen, int &flags, string &addr [, int &port]) +sockets:int sendmsg(int fd, resource iovec, int flags, string addr [, int port]) +sockets:int getsockopt(int fd, int level, int optname, array|int &optval) +sockets:int setsockopt(int fd, int level, int optname, int|array optval) +sockets:int socketpair(int domain, int type, int protocol, array &fds) +sockets:int shutdown(int fd, int how) +array:int krsort(array array_arg [, int sort_flags]) +array:int ksort(array array_arg [, int sort_flags]) +array:int count(mixed var) +array:void natsort(array array_arg) +array:void natcasesort(array array_arg) +array:void asort(array array_arg [, int sort_flags]) +array:void arsort(array array_arg [, int sort_flags]) +array:void sort(array array_arg [, int sort_flags]) +array:void rsort(array array_arg [, int sort_flags]) +array:void usort(array array_arg, string cmp_function) +array:void uasort(array array_arg, string cmp_function) +array:void uksort(array array_arg, string cmp_function) +array:mixed end(array array_arg) +array:mixed prev(array array_arg) +array:mixed next(array array_arg) +array:mixed reset(array array_arg) +array:mixed current(array array_arg) +array:mixed key(array array_arg) +array:mixed min(mixed arg1 [, mixed arg2 [, mixed ...]]) +array:mixed max(mixed arg1 [, mixed arg2 [, mixed ...]]) +array:int array_walk(array input, string funcname [, mixed userdata]) +array:bool in_array(mixed needle, array haystack [, bool strict]) +array:void extract(array var_array, int extract_type [, string prefix]) +array:array compact(mixed var_names [, mixed ...]) +array:array range(int low, int high) +array:int shuffle(array array_arg) +array:int array_push(array stack, mixed var [, mixed ...]) +array:mixed array_pop(array stack) +array:mixed array_shift(array stack) +array:int array_unshift(array stack, mixed var [, mixed ...]) +array:array array_splice(array input, int offset [, int length [, array replacement]]) +array:array array_slice(array input, int offset [, int length]) +array:array array_merge(array arr1, array arr2 [, array ...]) +array:array array_merge_recursive(array arr1, array arr2 [, array ...]) +array:array array_keys(array input [, mixed search_value]) +array:array array_values(array input) +array:array array_count_values(array input) +array:array array_reverse(array input [, bool preserve keys]) +array:array array_pad(array input, int pad_size, mixed pad_value) +array:array array_flip(array input) +array:array array_unique(array input) +array:array array_intersect(array arr1, array arr2 [, array ...]) +array:array array_diff(array arr1, array arr2 [, array ...]) +array:bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]], ...]) +array:mixed array_rand(array input [, int num_req]) +assert:int assert(string|bool assertion) +assert:mixed assert_options(int what [, mixed value]) +base64:string base64_encode(string str) +base64:string base64_decode(string str) +basic_functions:int ip2long(string ip_address) +basic_functions:string long2ip(int proper_address) +basic_functions:string getenv(string varname) +basic_functions:void putenv(string setting) +basic_functions:int intval(mixed var [, int base]) +basic_functions:double doubleval(mixed var) +basic_functions:string strval(mixed var) +basic_functions:void flush(void) +basic_functions:void sleep(int seconds) +basic_functions:void usleep(int micro_seconds) +basic_functions:string gettype(mixed var) +basic_functions:int settype(string var, string type) +basic_functions:string get_current_user(void) +basic_functions:string get_cfg_var(string option_name) +basic_functions:int set_magic_quotes_runtime(int new_setting) +basic_functions:int get_magic_quotes_runtime(void) +basic_functions:int get_magic_quotes_gpc(void) +basic_functions:bool is_resource(mixed var) +basic_functions:bool is_bool(mixed var) +basic_functions:bool is_long(mixed var) +basic_functions:bool is_double(mixed var) +basic_functions:bool is_string(mixed var) +basic_functions:bool is_array(mixed var) +basic_functions:bool is_object(mixed var) +basic_functions:bool is_numeric(mixed value) +basic_functions:int error_log(string message, int message_type [, string destination] [, string extra_headers]) +basic_functions:mixed call_user_func(string function_name [, mixed parmeter] [, mixed ...]) +basic_functions:mixed call_user_method(string method_name, object object [, mixed parameter] [, mixed ...]) +basic_functions:void register_shutdown_function(string function_name) +basic_functions:void highlight_file(string file_name) +basic_functions:void highlight_string(string string) +basic_functions:string ini_get(string varname) +basic_functions:string ini_set(string varname, string newvalue) +basic_functions:string ini_restore(string varname) +basic_functions:string print_r(mixed var) +basic_functions:int connection_aborted(void) +basic_functions:int connection_timeout(void) +basic_functions:int connection_status(void) +basic_functions:int ignore_user_abort(boolean value) +basic_functions:int getservbyname(string service, string protocol) +basic_functions:string getservbyport(int port, string protocol) +basic_functions:int getprotobyname(string name) +basic_functions:string getprotobynumber(int proto) +basic_functions:array get_loaded_extensions(void) +basic_functions:bool extension_loaded(string extension_name) +basic_functions:array get_extension_funcs(string extension_name) +basic_functions:void register_tick_function(string function_name [, mixed arg [, ... ]]) +basic_functions:void unregister_tick_function(string function_name) +basic_functions:boolean is_uploaded_file(string path) +basic_functions:boolean move_uploaded_file(string path, string new_path) +browscap:object get_browser(string browser_name) +crc32:string crc32(string str) +crypt:string crypt(string str [, string salt]) +cyr_convert:string convert_cyr_string(string str, string from, string to) +datetime:int time(void) +datetime:int mktime(int hour, int min, int sec, int mon, int day, int year) +datetime:int gmmktime(int hour, int min, int sec, int mon, int day, int year) +datetime:string date(string format [, int timestamp]) +datetime:string gmdate(string format [, int timestamp]) +datetime:array localtime([int timestamp [, bool associative_array]]) +datetime:array getdate([int timestamp]) +datetime:bool checkdate(int month, int day, int year) +datetime:string strftime(string format [, int timestamp]) +datetime:string gmstrftime(string format [, int timestamp]) +datetime:int strtotime(string time, int now) +dir:int opendir(string path) +dir:class dir(string directory) +dir:void closedir([int dir_handle]) +dir:int chdir(string directory) +dir:string getcwd(void) +dir:void rewinddir([int dir_handle]) +dir:string readdir([int dir_handle]) +dl:int dl(string extension_filename) +dns:string gethostbyaddr(string ip_address) +dns:string gethostbyname(string hostname) +dns:array gethostbynamel(string hostname) +dns:int checkdnsrr(string host [, string type]) +dns:int getmxrr(string hostname, array mxhosts [, array weight]) +exec:int exec(string command [, array output [, int return_value]]) +exec:int system(string command [, int return_value]) +exec:void passthru(string command [, int return_value]) +exec:string escapeshellcmd(string command) +exec:string escapeshellarg(string arg) +exec:string shell_exec(string cmd) +file:bool flock(int fp, int operation [, int wouldblock]) +file:array get_meta_tags(string filename [, int use_include_path]) +file:array file(string filename [, int use_include_path]) +file:string tempnam(string dir, string prefix) +file:int tmpfile(void) +file:int fopen(string filename, string mode [, int use_include_path]) +file:int fclose(int fp) +file:int popen(string command, string mode) +file:int pclose(int fp) +file:int feof(int fp) +file:int set_socket_blocking(int socket_descriptor, int mode) +file:bool socket_set_timeout(int socket_descriptor, int seconds, int microseconds) +file:array socket_get_status(resource socket_descriptor) +file:string fgets(int fp, int length) +file:string fgetc(int fp) +file:string fgetss(int fp, int length [, string allowable_tags]) +file:mixed fscanf(string str, string format [, string ...]) +file:int fwrite(int fp, string str [, int length]) +file:int fflush(int fp) +file:int set_file_buffer(int fp, int buffer) +file:int rewind(int fp) +file:int ftell(int fp) +file:int fseek(int fp, int offset [, int whence]) +file:int mkdir(string pathname, int mode) +file:int rmdir(string dirname) +file:int readfile(string filename [, int use_include_path]) +file:int umask([int mask]) +file:int fpassthru(int fp) +file:int rename(string old_name, string new_name) +file:int unlink(string filename) +file:int ftruncate (int fp, int size) +file:int fstat(int fp) +file:int copy(string source_file, string destination_file) +file:int fread(int fp, int length) +file:array fgetcsv(int fp, int length) +file:string realpath(string path) +filestat:double diskfreespace(string path) +filestat:bool chgrp(string filename, mixed group) +filestat:bool chown (string filename, mixed user) +filestat:bool chmod(string filename, int mode) +filestat:bool touch(string filename [, int time]) +filestat:void clearstatcache(void) +filestat:int fileperms(string filename) +filestat:int fileinode(string filename) +filestat:int filesize(string filename) +filestat:int fileowner(string filename) +filestat:nt filegroup(string filename) +filestat:int fileatime(string filename) +filestat:int filemtime(string filename) +filestat:int filectime(string filename) +filestat:string filetype(string filename) +filestat:int is_writable(string filename) +filestat:int is_readable(string filename) +filestat:int is_executable(string filename) +filestat:int is_file(string filename) +filestat:int is_dir(string filename) +filestat:int is_link(string filename) +filestat:bool file_exists(string filename) +filestat:array lstat(string filename) +filestat:array stat(string filename) +formatted_print:string sprintf(string format [, mixed arg1 [, mixed ...]]) +formatted_print:int printf(string format [, mixed arg1 [, mixed ...]]) +fsock:int fsockopen(string hostname, int port [, int errno [, string errstr [, double timeout]]]) +fsock:int pfsockopen(string hostname, int port [, int errno [, string errstr [, double timeout]]]) +head:void header(string header) +head:void setcookie(string name [, string value [, int expires [, string path [, string domain [, string secure]]]]]) +head:int headers_sent(void) +html:string htmlspecialchars(string string [, int quote_style]) +html:string htmlentities(string string [, int quote_style]) +html:array get_html_translation_table([int table [, int quote_style]]) +image:array getimagesize(string imagefile [, array info]) +info:void phpinfo([int what]) +info:string phpversion(void) +info:void phpcredits([int flag]) +info:string php_logo_guid(void) +info:string php_egg_logo_guid(void) +info:string zend_logo_guid(void) +info:string php_sapi_name(void) +info:string php_uname(void) +iptc:array iptcembed(string iptcdata, string jpeg_file_name [, int spool]) +iptc:array iptcparse(string iptcdata) +lcg:double lcg_value() +levenshtein:int levenshtein(string str1, string str2) +link:string readlink(string filename) +link:int linkinfo(string filename) +link:int symlink(string target, string link) +link:int link(string target, string link) +mail:int ezmlm_hash(string addr) +mail:int mail(string to, string subject, string message [, string additional_headers]) +math:int abs(int number) +math:double ceil(double number) +math:double floor(double number) +math:double round(double number [, int precision]) +math:double sin(double number) +math:double cos(double number) +math:double tan(double number) +math:double asin(double number) +math:double acos(double number) +math:double atan(double number) +math:double atan2(double y, double x) +math:double pi(void) +math:double pow(double base, double exponent) +math:double exp(double number) +math:double log(double number) +math:double log10(double number) +math:double sqrt(double number) +math:double deg2rad(double number) +math:double rad2deg(double number) +math:int bindec(string binary_number) +math:int hexdec(string hexadecimal_number) +math:int octdec(string octal_number) +math:string decbin(int decimal_number) +math:string decoct(int decimal_number) +math:string dechex(int decimal_number) +math:string base_convert(string number, int frombase, int tobase) +math:string number_format(double number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]]) +md5:string md5(string str) +metaphone:string metaphone(string text, int phones) +microtime:string microtime(void) +microtime:array gettimeofday(void) +microtime:array getrusage([int who]) +output:void ob_start(void) +output:void ob_end_flush(void) +output:void ob_end_clean(void) +output:string ob_get_contents(void) +output:string ob_get_length(void) +output:void ob_implicit_flush([int flag]) +pack:string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]]) +pack:array unpack(string format, string input) +pageinfo:int getmyuid(void) +pageinfo:int getmypid(void) +pageinfo:int getmyinode(void) +pageinfo:int getlastmod(void) +rand:void srand(int seed) +rand:void mt_srand(int seed) +rand:int rand([int min, int max]) +rand:int mt_rand([int min, int max]) +rand:int getrandmax(void) +rand:int mt_getrandmax(void) +quot_print:string quoted_printable_decode(string str) +reg:int ereg(string pattern, string string [, array registers]) +reg:int eregi(string pattern, string string [, array registers]) +reg:string ereg_replace(string pattern, string replacement, string string) +reg:string eregi_replace(string pattern, string replacement, string string]) +reg:array split(string pattern, string string [, int limit]) +reg:array spliti(string pattern, string string [, int limit]) +reg:string sql_regcase(string string) +soundex:string soundex(string str) +string:string bin2hex(string data) +string:int strspn(string str, string mask) +string:int strcspn(string str, string mask) +string:string rtrim(string str) +string:string chop(string str) +string:string trim(string str) +string:string ltrim(string str) +string:string wordwrap(string str [, int width [, string break [, int cut]]]) +string:array explode(string separator, string str [, int limit]) +string:string join(array src, string glue) +string:string implode(string glue, array src) +string:string strtok([string str,] string token) +string:string strtoupper(string str) +string:string strtolower(string str) +string:string basename(string path) +string:string dirname(string path) +string:array pathinfo(string path) +string:string stristr(string haystack, string needle) +string:string strstr(string haystack, string needle) +string:string strchr(string haystack, string needle) +string:int strpos(string haystack, string needle [, int offset]) +string:int strrpos(string haystack, string needle) +string:string strrchr(string haystack, string needle) +string:string chunk_split(string str [, int chunklen [, string ending]]) +string:string substr(string str, int start [, int length]) +string:string substr_replace(string str, string repl, int start [, int length]) +string:string quotemeta(string str) +string:int ord(string character) +string:string chr(int ascii) +string:string ucfirst(string str) +string:string ucwords(string str) +string:string strtr(string str, string from, string to) +string:string strrev(string str) +string:int similar_text(string str1, string str2 [, double percent]) +string:string addcslashes(string str, string charlist) +string:string addslashes(string str) +string:string stripcslashes(string str) +string:string stripslashes(string str) +string:string str_replace(string needle, string str, string haystack) +string:string hebrev(string str [, int max_chars_per_line]) +string:string hebrevc(string str [, int max_chars_per_line]) +string:string nl2br(string str) +string:string strip_tags(string str [, string allowable_tags]) +string:string setlocale(string category, string locale) +string:void parse_str(string encoded_string, [array result]) +string:string str_repeat(string input, int mult) +string:mixed count_chars(string input [, int mode]) +string:int strnatcmp(string s1, string s2) +string:int strnatcasecmp(string s1, string s2) +string:int substr_count(string haystack, string needle) +string:string str_pad(string input, int pad_length [, string pad_string [, int pad_type]]) +string:mixed sscanf(string str, string format [, string ...]) +syslog:void define_syslog_variables(void) +syslog:int openlog(string ident, int option, int facility) +syslog:int closelog(void) +syslog:int syslog(int priority, string message) +uniqid:string uniqid(string prefix, [bool more_entropy]) +url:array parse_url(string url) +url:string urlencode(string str) +url:string urldecode(string str) +url:string rawurlencode(string str) +url:string rawurldecode(string str) +var:void var_dump(mixed var) +var:string serialize(mixed variable) +var:mixed unserialize(string variable_representation) +swf:void swf_openfile(string name, double xsize, double ysize, double framerate, double r, double g, double b) +swf:void swf_closefile(void) +swf:void swf_labelframe(string name) +swf:void swf_showframe(void) +swf:void swf_setframe(int frame_number) +swf:int swf_getframe(void) +swf:void swf_mulcolor(double r, double g, double b, double a) +swf:void swf_addcolor(double r, double g, double b, double a) +swf:void swf_placeobject(int objid, int depth) +swf:void swf_modifyobject(int depth, int how) +swf:void swf_removeobject(int depth) +swf:int swf_nextid(void) +swf:void swf_startdoaction(void) +swf:void swf_enddoaction(void) +swf:void swf_actiongotoframe(int frame_number) +swf:void swf_actiongeturl(string url, string target) +swf:void swf_actionnextframe(void) +swf:void swf_actionprevframe(void) +swf:void swf_actionplay(void) +swf:void swf_actionstop(void) +swf:void swf_actiontogglequality(void) +swf:void swf_actionwaitforframe(int frame, int skipcount) +swf:void swf_actionsettarget(string target) +swf:void swf_actiongotolabel(string label) +swf:void swf_defineline(int objid, double x1, double y1, double x2, double y2, double width) +swf:void swf_definerect(int objid, double x1, double y1, double x2, double y2, double width) +swf:void swf_definepoly(int obj_id, array coords, int npoints, double width) +swf:void swf_startshape(int objid) +swf:void swf_shapelinesolid(double r, double g, double b, double a, double width) +swf:void swf_shapefilloff(void) +swf:void swf_shapefillsolid(double r, double g, double b, double a) +swf:void swf_shapefillbitmapclip(int bitmapid) +swf:void swf_shapefillbitmaptile(int bitmapid) +swf:void swf_shapemoveto(double x, double y) +swf:void swf_shapelineto(double x, double y) +swf:void swf_shapecurveto(double x1, double y1, double x2, double y2) +swf:void swf_shapecurveto3(double x1, double y1, double x2, double y2, double x3, double y3) +swf:void swf_shapearc(double x, double y, double r, double ang1, double ang2) +swf:void swf_endshape(void) +swf:void swf_definefont(int fontid, string name) +swf:void swf_setfont(int fontid) +swf:void swf_fontsize(double height) +swf:void swf_fontslant(double slant) +swf:void swf_fonttracking(track) +swf:array swf_getfontinfo(void) +swf:void swf_definetext(int objid, string str, int docCenter) +swf:void swf_textwidth(string str) +swf:void swf_definebitmap(int objid, string imgname) +swf:array swf_getbitmapinfo(int bitmapid) +swf:void swf_startsymbol(int objid) +swf:void swf_endsymbol(void) +swf:void swf_startbutton(int objid, int type) +swf:void swf_addbuttonrecord(int state, int objid, int depth) +swf:void swf_oncondition(int transitions) +swf:void swf_endbutton(void) +swf:void swf_viewport(double xmin, double xmax, double ymin, double ymax) +swf:void swf_ortho2(double xmin, double xmax, double ymin, double ymax) +swf:void swf_ortho(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) +swf:void swf_polarview(double dist, double azimuth, double incidence, double twist) +swf:void swf_perspective(double fovy, double aspect, double near, double far) +swf:void swf_lookat(double vx, double vy, double vz, double px, double py, double pz, double twist) +swf:void swf_pushmatrix(void) +swf:void swf_popmatrix(void) +swf:void swf_scale(double x, double y, double z) +swf:void swf_translate(double x, double y, double z) +swf:void swf_rotate(double angle, string axis) +swf:void swf_posround(int doit) +sybase_db:int sybase_connect([string host [, string user [, string password [, string charset]]]]) +sybase_db:int sybase_pconnect([string host [, string user [, string password [, string charset]]]]) +sybase_db:bool sybase_close([int link_id]) +sybase_db:bool sybase_select_db(string database [, int link_id]) +sybase_db:int sybase_query(string query [, int link_id]) +sybase_db:bool sybase_free_result(int result) +sybase_db:string sybase_get_last_message(void) +sybase_db:int sybase_num_rows(int result) +sybase_db:int sybase_num_fields(int result) +sybase_db:array sybase_fetch_row(int result) +sybase_db:object sybase_fetch_object(int result) +sybase_db:array sybase_fetch_array(int result) +sybase_db:bool sybase_data_seek(int result, int offset) +sybase_db:object sybase_fetch_field(int result [, int offset]) +sybase_db:bool sybase_field_seek(int result, int offset) +sybase_db:string sybase_result(int result, int row, mixed field) +sybase_db:void sybase_min_error_severity(int severity) +sybase_db:void sybase_min_message_severity(int severity) +sybase_ct:int sybase_connect([string host [, string user [, string password [, string charset]]]]) +sybase_ct:int sybase_pconnect([string host [, string user [, string password [, string charset]]]]) +sybase_ct:bool sybase_close([int link_id]) +sybase_ct:bool sybase_select_db(string database [, int link_id]) +sybase_ct:int sybase_query(string query [, int link_id]) +sybase_ct:bool sybase_free_result(int result) +sybase_ct:int sybase_num_rows(int result) +sybase_ct:int sybase_num_fields(int result) +sybase_ct:array sybase_fetch_row(int result) +sybase_ct:object sybase_fetch_object(int result) +sybase_ct:array sybase_fetch_array(int result) +sybase_ct:bool sybase_data_seek(int result, int offset) +sybase_ct:object sybase_fetch_field(int result [, int offset]) +sybase_ct:bool sybase_field_seek(int result, int offset) +sybase_ct:string sybase_result(int result, int row, mixed field) +sybase_ct:int sybase_affected_rows([int link_id]) +sybase_ct:void sybase_min_client_severity(int severity) +sybase_ct:void sybase_min_server_severity(int severity) +sysvsem:int sem_get(int key [, int max_acquire [, int perm]]) +sysvsem:int sem_acquire(int id) +sysvsem:int sem_release(int id) +sysvshm:int shm_attach(int key [, int memsize [, int perm]]) +sysvshm:int shm_detach(int shm_identifier) +sysvshm:int shm_remove(int shm_identifier) +sysvshm:int shm_put_var(int shm_identifier, int variable_key, mixed variable) +sysvshm:mixed shm_get_var(int id, int variable_key) +sysvshm:int shm_remove_var(int id, int variable_key) +wddx:string wddx_serialize_value(mixed var [, string comment]) +wddx:string wddx_serialize_vars(mixed var_name [, mixed ...]) +wddx:int wddx_packet_start([string comment]) +wddx:string wddx_packet_end(int packet_id) +wddx:int wddx_add_vars(int packet_id [, mixed var_names [, mixed ...]]) +wddx:mixed wddx_deserialize(string packet) +xml:int xml_parser_create(void) +xml:int xml_set_object(int pind, object &obj) +xml:int xml_set_element_handler(int pind, string shdl, string ehdl) +xml:int xml_set_character_data_handler(int pind, string hdl) +xml:int xml_set_processing_instruction_handler(int pind, string hdl) +xml:int xml_set_default_handler(int pind, string hdl) +xml:int xml_set_unparsed_entity_decl_handler(int pind, string hdl) +xml:int xml_set_notation_decl_handler(int pind, string hdl) +xml:int xml_set_external_entity_ref_handler(int pind, string hdl) +xml:int xml_parse(int pind, string data [, int isFinal]) +xml:int xml_parse_into_struct(int pind, string data, array &struct, array &index) +xml:int xml_get_error_code(int pind) +xml:string xml_error_string(int code) +xml:int xml_get_current_line_number(int pind) +xml:int xml_get_current_column_number(int pind) +xml:int xml_get_current_byte_index(int pind) +xml:int xml_parser_free(int pind) +xml:int xml_parser_set_option(int pind, int option, mixed value) +xml:int xml_parser_get_option(int pind, int option) +xml:string utf8_encode(string data) +xml:string utf8_decode(string data) +yaz:int yaz_connect(string zurl [, string user [, string group, string pass]]) +yaz:int yaz_close(int id) +yaz:int yaz_search(int id, string type, string query) +yaz:int yaz_wait() +yaz:int yaz_errno(int id) +yaz:string yaz_error(int id) +yaz:string yaz_addinfo(int id) +yaz:int yaz_hits(int id) +yaz:string yaz_record(int id, int pos, string type) +yaz:int yaz_syntax(int id, string syntax) +yaz:int yaz_element(int id, string elementsetname) +yaz:int yaz_range(int id, int start, int number) +yp:string yp_get_default_domain(void) +yp:int yp_order(string domain, string map) +yp:string yp_master(string domain, string map) +yp:string yp_match(string domain, string map, string key) +yp:array yp_first(string domain, string map) +yp:array yp_next(string domain, string map, string key) +zlib:array gzfile(string filename [, int use_include_path]) +zlib:int gzopen(string filename, string mode [, int use_include_path]) +zlib:int gzclose(int zp) +zlib:int gzeof(int zp) +zlib:string gzgets(int zp, int length) +zlib:string gzgetc(int zp) +zlib:string gzgetss(int zp, int length [, string allowable_tags]) +zlib:int gzwrite(int zp, string str [, int length]) +zlib:int gzputs(int zp, string str [, int length]) +zlib:int gzrewind(int zp) +zlib:int gztell(int zp) +zlib:int gzseek(int zp, int offset) +zlib:int readgzfile(string filename [, int use_include_path]) +zlib:int gzpassthru(int zp) +zlib:string gzread(int zp, int length) +zlib:string gzcompress(string data [, int level]) +zlib:string gzuncompress(string data, int length) +configuration-parser:void parse_ini_file(string filename) +main:void set_time_limit(int seconds) +configuration-parser:void parse_ini_file(string filename) +apache:string apache_note(string note_name [, string note_value]) +apache:int virtual(string filename) +apache:array getallheaders(void) +apache:class apache_lookup_uri(string URI) diff --git a/languages/php/doc/Makefile.am b/languages/php/doc/Makefile.am new file mode 100644 index 00000000..163d435b --- /dev/null +++ b/languages/php/doc/Makefile.am @@ -0,0 +1,6 @@ +tocdir = ${kde_datadir}/kdevdocumentation/tocs +toc_DATA = php.toc php_bugs.toc + +#indexdir = ${kde_datadir}/devdoctreeview/indices +#index_DATA = php.index + diff --git a/languages/php/doc/php.toc b/languages/php/doc/php.toc new file mode 100644 index 00000000..f09df62e --- /dev/null +++ b/languages/php/doc/php.toc @@ -0,0 +1,7069 @@ + + +PHP Manual + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/languages/php/doc/php_bugs.toc b/languages/php/doc/php_bugs.toc new file mode 100644 index 00000000..48c180a6 --- /dev/null +++ b/languages/php/doc/php_bugs.toc @@ -0,0 +1,7 @@ + + +PHP bugs + + + + diff --git a/languages/php/file_templates/Makefile.am b/languages/php/file_templates/Makefile.am new file mode 100644 index 00000000..7f031b4a --- /dev/null +++ b/languages/php/file_templates/Makefile.am @@ -0,0 +1,4 @@ +templatedir = $(kde_datadir)/kdevfilecreate/file-templates +template_DATA = php + + diff --git a/languages/php/file_templates/php b/languages/php/file_templates/php new file mode 100644 index 00000000..393d4867 --- /dev/null +++ b/languages/php/file_templates/php @@ -0,0 +1,12 @@ + +// +---------------------------------------------------------------------- +// | +// | Copyright: See COPYING file that comes with this distribution +// +---------------------------------------------------------------------- +// + +?> diff --git a/languages/php/kdevphpsupport.desktop b/languages/php/kdevphpsupport.desktop new file mode 100644 index 00000000..f1dc6597 --- /dev/null +++ b/languages/php/kdevphpsupport.desktop @@ -0,0 +1,86 @@ +[Desktop Entry] +Type=Service +Exec=blubb +Comment=PHP Support +Comment[ca]=Suport per a PHP +Comment[da]=PHP-understøttelse +Comment[de]=PHP-Unterstützung für KDevelop +Comment[el]=Υποστήριξη PHP +Comment[es]=Soporte para PHP +Comment[et]=PHP toetus +Comment[eu]=PHP euskarria +Comment[fa]=پشتیبانی پی‌اچ‌پی +Comment[fr]=Prise en charge du langage PHP +Comment[ga]=Tacaíocht PHP +Comment[gl]=Soporte para PHP +Comment[hi]=पीएचपी समर्थन +Comment[hu]=PHP-támogatás +Comment[is]=PHP stuðningur +Comment[it]=Supporto per PHP +Comment[ja]=PHP サポート +Comment[nds]=Ünnerstütten för PHP +Comment[ne]=पी एच पी समर्थन +Comment[nl]=Ondersteuning voor PHP +Comment[pa]=PHP ਸਹਿਯੋਗ +Comment[pl]=Obsługa PHP +Comment[pt]=Suporte a PHP +Comment[pt_BR]=Suporte ao PHP +Comment[ru]=Поддержка языка PHP +Comment[sk]=PHP podpora +Comment[sl]=Podpora za PHP +Comment[sr]=Подршка за PHP +Comment[sr@Latn]=Podrška za PHP +Comment[sv]=PHP-stöd +Comment[ta]=பிஎச்பிஆதரவு +Comment[tg]=Ёрӣ намудани забони PHP +Comment[tr]=PHP Desteği +Comment[zh_CN]=PHP 支持 +Comment[zh_TW]=PHP 支援 +Name=KDevPHPSupport +Name[da]=KDevelop PHP-understøttelse +Name[de]=Unterstützung für PHP (KDevelop) +Name[hi]=के-डेव-पीएचपी-समर्थन +Name[nds]=PHP-Ünnerstütten för KDevelop +Name[pl]=KDevObsługaPHP +Name[sk]=KDev PHP podpora +Name[sv]=KDevelop PHP-stöd +Name[ta]=கெடெவ் பிஎச்பி ஆதரவு +Name[zh_TW]=KDevelop PHP 支援 +GenericName=PHP Support +GenericName[ca]=Suport per a PHP +GenericName[da]=PHP-understøttelse +GenericName[de]=Unterstützung für PHP +GenericName[el]=Υποστήριξη PHP +GenericName[es]=Soporte para PHP +GenericName[et]=PHP toetus +GenericName[eu]=PHP euskarria +GenericName[fa]=پشتیبانی پی‌اچ‌پی +GenericName[fr]=Prise en charge du langage PHP +GenericName[ga]=Tacaíocht PHP +GenericName[gl]=Soporte para PHP +GenericName[hi]=पीएचपी समर्थन +GenericName[hu]=PHP-támogatás +GenericName[it]=Supporto per PHP +GenericName[ja]=PHP サポート +GenericName[nds]=Ünnerstütten för PHP +GenericName[ne]=पी एच पी समर्थन +GenericName[nl]=Ondersteuning voor PHP +GenericName[pl]=Obsługa PHP +GenericName[pt]=Suporte a PHP +GenericName[pt_BR]=Suporte ao PHP +GenericName[ru]=Поддержка языка PHP +GenericName[sk]=PHP podpora +GenericName[sl]=Podpora za PHP +GenericName[sr]=Подршка за PHP +GenericName[sr@Latn]=Podrška za PHP +GenericName[sv]=PHP-stöd +GenericName[ta]=பிஎச்பி ஆதரவு +GenericName[tg]=Ёрӣ намудани забони PHP +GenericName[tr]=PHP Desteği +GenericName[zh_CN]=PHP 支持 +GenericName[zh_TW]=PHP 支援 +ServiceTypes=KDevelop/LanguageSupport +X-KDE-Library=libkdevphpsupport +X-KDevelop-Version=5 +X-KDevelop-Language=PHP + diff --git a/languages/php/kdevphpsupport.rc b/languages/php/kdevphpsupport.rc new file mode 100644 index 00000000..14ebd3ba --- /dev/null +++ b/languages/php/kdevphpsupport.rc @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/languages/php/phpcodecompletion.cpp b/languages/php/phpcodecompletion.cpp new file mode 100644 index 00000000..c9bd7213 --- /dev/null +++ b/languages/php/phpcodecompletion.cpp @@ -0,0 +1,712 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + Copyright (C) 2001 by smeier@kdevelop.org + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "phpcodecompletion.h" +#include "phpsupportpart.h" +#include "phpconfigdata.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "phpfile.h" + +using namespace std; + +PHPCodeCompletion::PHPCodeCompletion(PHPSupportPart *phpSupport, PHPConfigData *config) : QObject(), m_cursorInterface(0), m_codeInterface(0), m_editInterface(0), m_selectionInterface(0) { + + m_phpSupport = phpSupport; + m_config = config; + m_model = phpSupport->codeModel(); + m_argWidgetShow = false; + m_completionBoxShow = false; + + readGlobalPHPFunctionsFile(); +} + +PHPCodeCompletion::~PHPCodeCompletion(){ +} + +void PHPCodeCompletion::readGlobalPHPFunctionsFile(){ + KStandardDirs *dirs = PHPSupportFactory::instance()->dirs(); + QString phpFuncFile = dirs->findResource("data","kdevphpsupport/phpfunctions"); + QRegExp lineReg(":([0-9A-Za-z_]+) ([0-9A-Za-z_]+)\\((.*)\\)"); + FunctionCompletionEntry e; + + QFile f(phpFuncFile); + if ( f.open(IO_ReadOnly) ) { // file opened successfully + QTextStream t( &f ); // use a text stream + QString s; + while ( !t.eof() ) { // until end of file... + s = t.readLine(); // line of text excluding '\n' + if (lineReg.search(s.local8Bit()) != -1) { + e.prefix = lineReg.cap(1); + e.text = lineReg.cap(2); + e.postfix = "(" + QString(lineReg.cap(3)) + ")"; + e.prototype = QString(lineReg.cap(1)) + " " + QString(lineReg.cap(2)) + "(" + QString(lineReg.cap(3)) + ")"; + m_globalFunctions.append(e); + } + } + f.close(); + } +} + +void PHPCodeCompletion::argHintHided(){ + kdDebug(9018) << "PHPCodeCompletion::argHintHided" << endl; + m_argWidgetShow = false; +} + +void PHPCodeCompletion::completionBoxHided(){ + kdDebug(9018) << "PHPCodeCompletion::completionBoxHided()" << endl; + m_completionBoxShow = false; +} + +void PHPCodeCompletion::setActiveEditorPart(KParts::Part *part) +{ + if (!part || !part->widget()) + return; + + kdDebug(9018) << "PHPCodeCompletion::setActiveEditorPart" << endl; + + if (!(m_config->getCodeCompletion() || m_config->getCodeHinting())) + return; // no help + + m_editInterface = dynamic_cast(part); + if (!m_editInterface) { + kdDebug(9018) << "editor doesn't support the EditDocumentIface" << endl; + return; + } + + m_cursorInterface = dynamic_cast(part->widget()); + if (!m_cursorInterface) { + kdDebug(9018) << "editor does not support the ViewCursorInterface" << endl; + return; + } + + m_codeInterface = dynamic_cast(part->widget()); + if (!m_codeInterface) { // no CodeCompletionDocument available + kdDebug(9018) << "editor doesn't support the CodeCompletionDocumentIface" << endl; + return; + } + + m_selectionInterface = dynamic_cast(part); + if (!m_selectionInterface) { + kdDebug(9018) << "editor doesn't support the SelectionInterface" << endl; + return; + } + + disconnect(part->widget(), 0, this, 0 ); // to make sure that it is't connected twice +// connect(part->widget(), SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged())); + connect( part, SIGNAL(textChanged()), this, SLOT(cursorPositionChanged()) ); + connect(part->widget(), SIGNAL(argHintHidden()), this, SLOT(argHintHided())); + connect(part->widget(), SIGNAL(completionAborted()), this, SLOT(completionBoxHided())); + connect(part->widget(), SIGNAL(completionDone()), this, SLOT(completionBoxHided())); +} + +void PHPCodeCompletion::cursorPositionChanged(){ + uint line, col; + if( !m_cursorInterface || !m_selectionInterface || !m_codeInterface || !m_editInterface ) + return; + m_cursorInterface->cursorPositionReal(&line, &col); + + kdDebug(9018) << "cursorPositionChanged:" << line << ":" << col << endl; + + m_currentLine = line; + QString lineStr = m_editInterface->textLine(line); + if (lineStr.isNull() || lineStr.isEmpty()) { + return; + } + + if (m_selectionInterface->hasSelection()) { + kdDebug(9018) << "No CodeCompletion/ArgHinting at the moment, because text is selected" << endl; + return; + } + + if (m_config->getCodeHinting()) { + int pos1 = lineStr.findRev("(", col - 1); + int pos2 = lineStr.findRev(QRegExp("[ \\t=;\\$\\.\\(\\)]"), pos1 - 1); + int pos3 = lineStr.findRev(")", col); + + if (pos1 > pos2 && pos1 != -1 && pos3 < pos1) { + QString line = lineStr.mid(pos2 + 1, pos1 - pos2 - 1).stripWhiteSpace(); + checkForArgHint(line, col); + kdDebug(9018) << "end checkForArgHint" << endl; + } + + } + + if (m_config->getCodeCompletion()) { + if (m_completionBoxShow == true) { + return; + } + + int pos = lineStr.findRev(QRegExp("[ \\t=;\\$\\.\\(\\)]"), col - 1); + QString line = lineStr.mid(pos + 1, col - pos).stripWhiteSpace(); + + if (checkForVariable(line, col)) { +kdDebug(9018) << "end checkForVariable" << endl; + return; + } + if (checkForStaticFunction(line, col)) { +kdDebug(9018) << "end checkForStaticFunction" << endl; + return; + } + + if(checkForGlobalFunction(line, col)) { +kdDebug(9018) << "end checkForGlobalFunction" << endl; + return; + } + + pos = lineStr.stripWhiteSpace().findRev(QRegExp("[ \\t=;\\$\\.\\(\\)]"), col - 1); + line = lineStr.mid(pos + 1, col - pos); + + if (checkForNew(line, col)) { +kdDebug(9018) << "end checkForNew" << endl; + return; + } + + if (checkForExtends(line, col)) { +kdDebug(9018) << "end checkForExtends" << endl; + return; + } +kdDebug(9018) << "end checkFor" << endl; + } +} + +bool PHPCodeCompletion::showCompletionBox(QValueList list, unsigned long max) { + if (list.count() > 0) { + if (list.count() == 1) { + KTextEditor::CompletionEntry e = list.first(); + if (e.text.length() == max) + return false; + } + m_completionBoxShow = true; + m_codeInterface->showCompletionBox(list, max, FALSE); + return true; + } + return false; +} + +bool PHPCodeCompletion::checkForStaticFunction(QString line, int col) { + kdDebug(9018) << "checkForStaticFunction" << endl; + QValueList list; + + if (line.find("::") == -1) + return false; + + QRegExp Class("([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)::([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)"); + Class.setCaseSensitive(FALSE); + + if (Class.search(line) != -1) { + QString classname = Class.cap(1); + QString function = Class.cap(2); + + ClassList classList = getClassByName(classname); + + ClassList::Iterator classIt; + for (classIt = classList.begin(); classIt != classList.end(); ++classIt) { + ClassDom nClass = *classIt; + FunctionList funcList = nClass->functionList(); + FunctionList::Iterator funcIt; + + for (funcIt = funcList.begin(); funcIt != funcList.end(); ++funcIt) { + FunctionDom nFunc = *funcIt; + if ((function.isEmpty() || nFunc->name().startsWith(function, FALSE)) && nFunc->isStatic()) { + KTextEditor::CompletionEntry e; + e.prefix = nClass->name() + " ::"; + e.text = nFunc->name(); + ArgumentDom pArg = (*funcIt)->argumentList().first(); + if (pArg) + e.postfix = "(" + pArg->type() +")"; + else + e.postfix = "()"; + list.append(e); + } + } + + if (nClass->baseClassList().count() != 0) { + QStringList base = nClass->baseClassList(); + QStringList::Iterator nameIt; + for (nameIt = base.begin(); nameIt != base.end(); ++nameIt) { + ClassList baseList = getClassByName(*nameIt); + ClassList::Iterator baseIt; + for (baseIt = baseList.begin(); baseIt != baseList.end(); ++baseIt) + classList.append(*baseIt); + } + } + } + return showCompletionBox(list, Class.cap(2).length()); + } + return false; +} + +bool PHPCodeCompletion::checkForNew(QString line, int col){ + kdDebug(9018) << "checkForNew" << endl; + QValueList list; + + if (line.find("new ", 0, FALSE) == -1) + return false; + + QRegExp New("[& \t]*new[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)"); + New.setCaseSensitive(FALSE); + + if (New.search(line) != -1) { + list = getClasses( New.cap(1) ); + + if (New.cap(1).lower() == "ob") { + KTextEditor::CompletionEntry e; + e.text = "object"; + list.append(e); + } + + if (New.cap(1).lower() == "ar") { + KTextEditor::CompletionEntry e; + e.text = "array"; + list.append(e); + } + return showCompletionBox(list, New.cap(1).length()); + } + + return false; +} + +bool PHPCodeCompletion::checkForExtends(QString line, int col){ + kdDebug(9018) << "checkForExtends" << endl; + QValueList list; + + if (line.find("extends", 0, FALSE) == -1) + return false; + + QRegExp extends("[ \t]*extends[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|)"); + extends.setCaseSensitive(FALSE); + + if (extends.search(line) != -1) { + list = getClasses(extends.cap(1)); + return showCompletionBox(list, extends.cap(1).length()); + } + + return false; +} + +bool PHPCodeCompletion::checkForVariable(QString line, int col){ + kdDebug(9018) << "checkForVariable" << endl; + QValueList list; + QString args; + + if (line.find("->") == -1) { + return false; + } + + if (line.left(2) != "->") { + int pos = line.findRev("->"); + args = line.mid(pos + 2, line.length() - pos); + line = line.mid(0, pos); + } + + QStringList vars = QStringList::split("->", line); + QString classname; + + for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it ) { + classname = getClassName(*it, classname); + } + + if (classname.isEmpty()) { + return false; + } + + this->setStatusBar(line, classname); + + list = this->getFunctionsAndVars(classname, args); + return showCompletionBox(list, args.length()); +} + +bool PHPCodeCompletion::checkForGlobalFunction(QString line, int col) { + kdDebug(9018) << "checkForGlobalFunction(" + line + "," << col << endl; + QValueList list; + + if (line.length() < 3) + return false; + + list = this->getFunctionsAndVars("", line); + return showCompletionBox(list, line.length()); +} + +QValueList PHPCodeCompletion::getClasses(QString name) { + QValueList list; + QStringList added; + + ClassList classList = m_model->globalNamespace()->classList(); + ClassList::Iterator classIt; + for (classIt = classList.begin(); classIt != classList.end(); ++classIt) { + ClassDom nClass = *classIt; + if (name == NULL || name.isEmpty() || nClass->name().startsWith(name, FALSE)) { + KTextEditor::CompletionEntry e; + + QStringList::Iterator it = added.find(nClass->name()); + if (it == added.end()) { + e.text = nClass->name(); + list.append(e); + added.append(nClass->name()); + } + } + } + return list; +} + +QValueList PHPCodeCompletion::getFunctionsAndVars(QString classname, QString function) { + kdDebug(9018) << "getFunctionsAndVars " << classname << endl; + QValueList list; + + if (classname.isEmpty()) { + QValueList::Iterator it; + for( it = m_globalFunctions.begin(); it != m_globalFunctions.end(); ++it ) { + if((*it).text.startsWith(function, FALSE)){ + KTextEditor::CompletionEntry e; + e = (*it); + list.append(e); + } + } + + FunctionList methodList = m_model->globalNamespace()->functionList(); + FunctionList::Iterator methodIt; + for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) { + if ((*methodIt)->name().startsWith(function, FALSE)){ + KTextEditor::CompletionEntry e; + e.text = (*methodIt)->name(); + ArgumentDom pArg = (*methodIt)->argumentList().first(); + if (pArg) + e.postfix = "(" + pArg->type() +")"; + else + e.postfix = "()"; + list.append(e); + } + } + return list; + } + + ClassList classList = getClassByName(classname); + ClassList::Iterator classIt; + for (classIt = classList.begin(); classIt != classList.end(); ++classIt) { + ClassDom nClass = *classIt; + + FunctionList methodList = nClass->functionList(); + FunctionList::Iterator methodIt; + for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) { + FunctionDom pMethod = *methodIt; + if (function.isEmpty() || pMethod->name().startsWith(function, FALSE)) { + KTextEditor::CompletionEntry e; + ArgumentDom arg = pMethod->argumentList().first(); + + e.prefix = nClass->name() + " ::"; + e.text = pMethod->name(); + e.postfix = "(" + arg->type() + ")"; + list.append(e); + } + } + VariableList attrList = nClass->variableList(); + VariableList::Iterator attrIt; + for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) { + VariableDom pVar = *attrIt; + if (function.isEmpty() || pVar->name().startsWith(function, FALSE)) { + KTextEditor::CompletionEntry e; + e.prefix = nClass->name() + " ::"; + e.text = pVar->name(); + e.postfix = ""; + list.append(e); + } + } + + if (nClass->baseClassList().count() != 0) { + QStringList base = nClass->baseClassList(); + QStringList::Iterator nameIt; + for (nameIt = base.begin(); nameIt != base.end(); ++nameIt) { + ClassList baseList = getClassByName(*nameIt); + ClassList::Iterator baseIt; + for (baseIt = baseList.begin(); baseIt != baseList.end(); ++baseIt) + classList.append(*baseIt); + } + } + } + return list; +} + +QStringList PHPCodeCompletion::getArguments(QString classname, QString function) { + kdDebug(9018) << "getArguments " << function << endl; + QStringList list; + + if (classname.isEmpty()) { + QValueList::Iterator it; + for( it = m_globalFunctions.begin(); it != m_globalFunctions.end(); ++it ) { + if((*it).text.lower() == function.lower()){ + KTextEditor::CompletionEntry e = (*it); + list.append(e.text + e.postfix); + } + } + + FunctionList methodList = m_model->globalNamespace()->functionList(); + FunctionList::Iterator methodIt; + for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) { + if ((*methodIt)->name().lower() == function.lower()){ + KTextEditor::CompletionEntry e; + ArgumentDom pArgs; + QString args = "()"; + + ArgumentDom pArg = (*methodIt)->argumentList().first(); + if (pArgs) + args = "(" + pArg->type() +")"; + + list.append((*methodIt)->name() + "(" + args +")"); + } + } + return list; + } + + ClassList classList = getClassByName(classname); + ClassList::Iterator classIt; + for (classIt = classList.begin(); classIt != classList.end(); ++classIt) { + ClassDom nClass = *classIt; + + FunctionList methodList = nClass->functionList(); + FunctionList::Iterator methodIt; + for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) { + if ((*methodIt)->name().lower() == function.lower()) { + ArgumentDom pArg = (*methodIt)->argumentList().first(); + if (pArg) + list.append(nClass->name() + "::" + function + "(" + pArg->type() +")"); + } + } + + if (nClass->baseClassList().count() != 0) { + QStringList base = nClass->baseClassList(); + QStringList::Iterator nameIt; + for (nameIt = base.begin(); nameIt != base.end(); ++nameIt) { + ClassList baseList = getClassByName(*nameIt); + ClassList::Iterator baseIt; + for (baseIt = baseList.begin(); baseIt != baseList.end(); ++baseIt) + classList.append(*baseIt); + } + } + + } + return list; +} + +QString PHPCodeCompletion::getCurrentClassName() { + kdDebug(9018) << "getCurrentClassName" << endl; + QRegExp Class("^[ \t]*(abstract|final|)[ \t]*class[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*(extends[ \t]*([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))?.*$"); + Class.setCaseSensitive(FALSE); + + for(int i = m_currentLine; i >= 0; i--){ + QString line = m_editInterface->textLine(i); + if (!line.isNull()) { + if (Class.search(line) != -1) + return Class.cap(2); + } + } + return QString::null; +} + +QString PHPCodeCompletion::getClassName(QString varName, QString classname) { + kdDebug(9018) << "getClassName " << varName << "::" << classname << endl; + + if (varName.find("$") == 0) + varName = varName.mid(1); + + if (varName.lower() == "this") + return this->getCurrentClassName(); + + if (classname.isEmpty()) { + VariableList attrList = m_model->globalNamespace()->variableList(); + VariableList::Iterator attrIt; + + for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) { + if ((*attrIt)->name().lower() == varName.lower()) + return (*attrIt)->type(); + } + } + + ClassList classList = getClassByName( classname ); + ClassList::Iterator classIt; + for (classIt = classList.begin(); classIt != classList.end(); ++classIt) { + ClassDom pClass = *classIt; + + FunctionList funcList = pClass->functionList(); + FunctionList::Iterator funcIt; + + for (funcIt = funcList.begin(); funcIt != funcList.end(); ++funcIt) { + if (QString((*funcIt)->name().lower() + "(") == varName.lower()) + return (*funcIt)->resultType(); + } + + VariableList attrList = pClass->variableList(); + VariableList::Iterator attrIt; + + for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) { + if ((*attrIt)->name().lower() == varName.lower()) + return (*attrIt)->type(); + } + } + + kdDebug(9018) << "Need " << classname << " " << varName << endl; +/* + /// @fixme peut devenir recursif voir xbutton.php ligne 204 + QRegExp createmember("\\" + varName + "[ \t]*=[ \t]*(.*)[ \t]*;"); + + for(int i = m_currentLine; i >= 0; i--){ + QString line = m_editInterface->textLine(i); + if (!line.isNull() && line.find(varName,0 , FALSE) != -1) { + + if (createmember.search(line) != -1) { + QString right = createmember.cap(1).stripWhiteSpace(); + + QStringList vars = QStringList::split("->", right); + for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it ) { + QString objet = *it; + ++it; + if (it == vars.end()) + break; + + QString var = *it; + + if (objet.lower() == "$this") + objet = this->getCurrentClassName(); + + classname = getClassName(var, objet); + + NamespaceDom varns = m_model->globalNamespace()->namespaceByName("varsns"); + QString fromns; + if (varns) { + QString name = objet + "::" + var; + kdDebug(9018) << name << endl; + VariableDom nVar = varns->variableByName(name); + fromns = nVar->type(); + + } + kdDebug(9018) << "Need " << objet << " " << var << " " << fromns << " " << vars.size() << endl; + + } + kdDebug(9018) << "Dehors" << " " << classname << endl; + + return classname; + } + } + } + */ + return ""; +} + +QValueList PHPCodeCompletion::getClassByName(QString classname) { + QValueList CList; + + ClassList classList = m_model->globalNamespace()->classList(); + + ClassList::Iterator classIt; + for (classIt = classList.begin(); classIt != classList.end(); ++classIt) { + ClassDom nClass = *classIt; + if (nClass->name().lower() == classname.lower()) + CList.append( nClass ); + } + return CList; +} + +bool PHPCodeCompletion::checkForArgHint(QString line, int col) { + kdDebug(9018) << "checkForArgHint" << endl; + QValueList list; + QStringList argsList; + + if (m_argWidgetShow == true) + return false; + + if (line.find("::") != -1) { + QRegExp Static("([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)::([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)"); + Static.setCaseSensitive(FALSE); + + if (Static.search(line) != -1) { + QString classname = Static.cap(1); + QString function = Static.cap(2); + + argsList = getArguments(classname, function); + + if (argsList.count() > 0) { + m_argWidgetShow = true; + m_codeInterface->showArgHint ( argsList, "()", "," ); + return true; + } + } + } + + if (line.findRev("->") != -1) { + int pos1 = line.findRev("->"); + + QString classname; + QString function = line.mid(pos1 + 2); + + line = line.mid(0, pos1); + +kdDebug(9018) << "checkForArgHint 2 " << line << endl; + + QStringList vars = QStringList::split("->", line); + + for ( QStringList::Iterator it = vars.begin(); it != vars.end(); ++it ) { +kdDebug(9018) << "for " << line << endl; + classname = getClassName(*it, classname); +kdDebug(9018) << "next " << line << endl; + } + +kdDebug(9018) << "checkForArgHint 4 " << line << endl; + + argsList = getArguments(classname, function); + if (argsList.count() > 0) { + m_argWidgetShow = true; + m_codeInterface->showArgHint ( argsList, "()", "," ); + return true; + } + } + +kdDebug(9018) << "checkForArgHint 0 " << line << endl; + + argsList = getArguments("", line); + if (argsList.count() > 0) { + m_argWidgetShow = true; + m_codeInterface->showArgHint ( argsList, "()", "," ); + return true; + } + + argsList = getArguments(line, line); + if (argsList.count() > 0) { + m_argWidgetShow = true; + m_codeInterface->showArgHint ( argsList, "()", "," ); + return true; + } + + return false; +} + +void PHPCodeCompletion::setStatusBar(QString expr, QString type) { + m_phpSupport->mainWindow()->statusBar()->message( i18n("Type of %1 is %2").arg(expr).arg(type), 1000 ); +} + +#include "phpcodecompletion.moc" diff --git a/languages/php/phpcodecompletion.h b/languages/php/phpcodecompletion.h new file mode 100644 index 00000000..41d79934 --- /dev/null +++ b/languages/php/phpcodecompletion.h @@ -0,0 +1,103 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + Copyright (C) 2001 by smeier@kdevelop.org + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#ifndef PHPCODECOMPLETION_H +#define PHPCODECOMPLETION_H + +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + + +class KDevCore; +class PHPSupportPart; +class PHPConfigData; + +class FunctionCompletionEntry : public KTextEditor::CompletionEntry { +public: + QString prototype; +}; + +class PHPCodeCompletion : public QObject { + Q_OBJECT + +public: + PHPCodeCompletion(PHPSupportPart *phpSupport, PHPConfigData *config); + ~PHPCodeCompletion(); + void setActiveEditorPart(KParts::Part *part); + +public slots: + void cursorPositionChanged(); + +protected slots: + void argHintHided(); + void completionBoxHided(); + +protected: + bool showCompletionBox(QValueList list, unsigned long max); + + bool checkForVariable(QString line, int col); + bool checkForStaticFunction(QString line, int col); + bool checkForNew(QString line, int col); + bool checkForExtends(QString line, int col); + bool checkForGlobalFunction(QString line, int col); + + bool checkForArgHint(QString line, int col); + + QValueList getClasses(QString name); + QValueList getFunctionsAndVars(QString classname, QString str); + QStringList getArguments(QString classname, QString function); + QString getCurrentClassName(); + QString getClassName(QString varName, QString classname); + QValueList getClassByName(QString classname); + + void readGlobalPHPFunctionsFile(); + void setStatusBar(QString expr, QString type); + + private: + int m_currentLine; + QValueList m_globalFunctions; + + PHPSupportPart* m_phpSupport; + PHPConfigData* m_config; + CodeModel* m_model; + + bool m_argWidgetShow; + bool m_completionBoxShow; + + KTextEditor::EditInterface *m_editInterface; + KTextEditor::CodeCompletionInterface *m_codeInterface; + KTextEditor::ViewCursorInterface *m_cursorInterface; + KTextEditor::SelectionInterface *m_selectionInterface; + + QString findDeclaration(QString name, int line = -1); +}; + +#endif diff --git a/languages/php/phpconfigdata.cpp b/languages/php/phpconfigdata.cpp new file mode 100644 index 00000000..45f27a79 --- /dev/null +++ b/languages/php/phpconfigdata.cpp @@ -0,0 +1,88 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + Copyright (C) 2001 by smeier@kdevelop.org + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "kstandarddirs.h" +#include "phpconfigdata.h" +#include "domutil.h" +#include + +PHPConfigData::PHPConfigData(QDomDocument* dom) { + QString file = KStandardDirs::findExe("php"); + + if (file.isEmpty()) + file = "/usr/local/bin/php"; + + document = dom; + invocationMode = (InvocationMode) DomUtil::readIntEntry(*dom, "/kdevphpsupport/general/invocationMode", Web); + + webURL = DomUtil::readEntry(*document, "/kdevphpsupport/webInvocation/weburl"); + + phpExePath = DomUtil::readEntry(*document, "/kdevphpsupport/shell/phpexe", file); + phpIniPath = DomUtil::readEntry(*document, "/kdevphpsupport/shell/phpini"); + + phpIncludePath = DomUtil::readEntry(*document, "/kdevphpsupport/options/phpincludepath"); + phpStartupFile = DomUtil::readEntry(*document, "/kdevphpsupport/options/defaultFile"); + phpStartupFileMode = (StartupFileMode)DomUtil::readIntEntry(*document, "/kdevphpsupport/options/startupFileMode", Current); + + m_codeCompletion = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/codeCompletion", true); + m_codeHinting = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/codeHinting", true); + m_realtimeParsing = DomUtil::readBoolEntry(*document,"kdevphpsupport/codeHelp/realtimeParsing", true); +} + +PHPConfigData::~PHPConfigData() { +} + +void PHPConfigData::storeConfig() { + DomUtil::writeIntEntry(*document, "/kdevphpsupport/general/invocationMode",(int) invocationMode); + + DomUtil::writeEntry(*document, "/kdevphpsupport/webInvocation/weburl",webURL); + + DomUtil::writeEntry(*document, "/kdevphpsupport/shell/phpexe",phpExePath); + DomUtil::writeEntry(*document, "/kdevphpsupport/shell/phpini",phpIniPath); + + DomUtil::writeEntry(*document, "/kdevphpsupport/options/phpincludepath",phpIncludePath); + DomUtil::writeEntry(*document, "/kdevphpsupport/options/defaultFile",phpStartupFile); + DomUtil::writeIntEntry(*document, "/kdevphpsupport/options/startupFileMode",(int) phpStartupFileMode); + + DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/codeCompletion",m_codeCompletion); + DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/codeHinting",m_codeHinting); + DomUtil::writeBoolEntry(*document,"kdevphpsupport/codeHelp/realtimeParsing",m_realtimeParsing); + emit configStored(); // inform all others +} + +bool PHPConfigData::validateConfig(){ + bool valid = false; + if (invocationMode == Web || invocationMode == Shell) { + valid = true; + } + if (valid) { + if (invocationMode == Web) { + if (!(!webURL.isEmpty() && (phpStartupFileMode == Default || phpStartupFileMode == Current))) { + valid = false; + } + } + if (invocationMode == Shell) { + if (phpExePath.isEmpty()) { + valid = false; + } + } + } + return valid; +} +#include "phpconfigdata.moc" diff --git a/languages/php/phpconfigdata.h b/languages/php/phpconfigdata.h new file mode 100644 index 00000000..0c7a49eb --- /dev/null +++ b/languages/php/phpconfigdata.h @@ -0,0 +1,155 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + Copyright (C) 2001 by smeier@kdevelop.org + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef PHPCONFIGDATA_H +#define PHPCONFIGDATA_H + +#include +#include +#include + +/** + *@author Sandy Meier + */ + +class PHPConfigData : public QObject { +Q_OBJECT + +signals: + void configStored(); + +public: + enum InvocationMode {Web=1,Shell=2}; + enum StartupFileMode {Current=1,Default=2}; + + PHPConfigData(QDomDocument* document); + ~PHPConfigData(); + + /** returns true if the configuration is ok, false if something is missing + */ + bool validateConfig(); + /** write the configuration to the DOM document(project file) + */ + void storeConfig(); + + InvocationMode getInvocationMode() { + return invocationMode; + } + + void setInvocationMode(InvocationMode mode) { + invocationMode = mode; + } + + // web + QString getWebURL() { + return webURL; + } + void setWebURL(QString weburl) { + webURL = weburl; + } + + // shell + QString getPHPExecPath() { + return phpExePath; + } + + void setPHPExePath(QString path) { + phpExePath = path; + } + + // config + QString getPHPIniPath() { + return phpIniPath; + } + + void setPHPIniPath(QString path) { + phpIniPath = path; + } + + // options + QString getPHPIncludePath() { + return phpIncludePath; + } + void setPHPIncludePath(QString path) { + phpIncludePath = path; + } + + QString getStartupFile() { + return phpStartupFile; + } + void setStartupFile(QString defaultFile) { + phpStartupFile = defaultFile; + } + + StartupFileMode getStartupFileMode() { + return phpStartupFileMode; + } + + void setStartupFileMode(StartupFileMode mode) { + phpStartupFileMode = mode; + } + + // code help + void setCodeCompletion(bool enable) { + m_codeCompletion = enable; + } + + bool getCodeCompletion() { + return m_codeCompletion; + } + + void setCodeHinting(bool enable) { + m_codeHinting = enable; + } + + bool getCodeHinting() { + return m_codeHinting; + } + + void setRealtimeParsing(bool enable) { + m_realtimeParsing = enable; + } + + bool getRealtimeParsing() { + return m_realtimeParsing; + } + +private: + QDomDocument* document; + InvocationMode invocationMode; + // web + QString webURL; + + // shell + QString phpExePath; + QString phpIniPath; + QString phpStartupFile; + + // options + QString phpIncludePath; + QString phpDefaultFile; + StartupFileMode phpStartupFileMode; + + // code help + bool m_codeCompletion; + bool m_codeHinting; + bool m_realtimeParsing; +}; + +#endif diff --git a/languages/php/phpconfigwidget.cpp b/languages/php/phpconfigwidget.cpp new file mode 100644 index 00000000..829e3038 --- /dev/null +++ b/languages/php/phpconfigwidget.cpp @@ -0,0 +1,161 @@ +#include "domutil.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "phpinfodlg.h" +#include "phpconfigwidget.h" +#include "phpconfigdata.h" + +using namespace std; + +PHPConfigWidget::PHPConfigWidget(PHPConfigData* data,QWidget* parent, const char* name, WFlags fl ) + : PHPConfigWidgetBase( parent, name, fl ) +{ + configData = data; + m_phpInfo = ""; + + PHPConfigData::InvocationMode mode = configData->getInvocationMode(); + + // page "Invocation" + if (mode == PHPConfigData::Shell) { + callPHPDirectly_radio->setChecked(true); + } + + if (mode == PHPConfigData::Web) { + callWebserver_radio->setChecked(true); + } + + // page webserver + QString weburl = configData->getWebURL(); + if (weburl.isEmpty()) + weburl = "http://localhost/"; + weburl_edit->setText(weburl); + + // page shell + QString exepath = configData->getPHPExecPath(); + if (exepath.isEmpty()) { + QString fiexepath = KStandardDirs::findExe("php"); + + if (exepath.isEmpty()) + exepath = "/usr/local/bin/php"; + } + + exe_edit->setText(exepath); + + // page options + PHPConfigData::StartupFileMode phpStartupFileMode = configData->getStartupFileMode(); + QString phpStartupFile = configData->getStartupFile(); + + useDefaultFile_edit->setText(phpStartupFile); + + if(phpStartupFileMode == PHPConfigData::Current) { + useCurrentFile_radio->setChecked(true); + } + + if(phpStartupFileMode == PHPConfigData::Default) { + useDefaultFile_radio->setChecked(true); + } + + QString includepath = configData->getPHPIncludePath(); + include_path_edit->setText(includepath); + + codeCompletion_checkbox->setChecked(configData->getCodeCompletion()); + codeHinting_checkbox->setChecked(configData->getCodeHinting()); + realtimeParsing_checkbox->setChecked(configData->getRealtimeParsing()); +} + +/* + * Destroys the object and frees any allocated resources + */ +PHPConfigWidget::~PHPConfigWidget() +{ + // no need to delete child widgets, Qt does it all for us +} + +void PHPConfigWidget::accept() +{ + // invocation + if (callPHPDirectly_radio->isChecked()){ + configData->setInvocationMode(PHPConfigData::Shell); + } + if (callWebserver_radio->isChecked()){ + configData->setInvocationMode(PHPConfigData::Web); + } + + // webserver + configData->setWebURL(weburl_edit->text()); + + // shell + configData->setPHPExePath(exe_edit->text()); + + // config + configData->setPHPIniPath(ini_edit->text()); + + // options + configData->setStartupFile(useDefaultFile_edit->text()); + + if (useCurrentFile_radio->isChecked()) { + configData->setStartupFileMode(PHPConfigData::Current); + } + if (useDefaultFile_radio->isChecked()){ + configData->setStartupFileMode(PHPConfigData::Default); + } + + configData->setPHPIncludePath(include_path_edit->text()); + configData->setCodeCompletion(codeCompletion_checkbox->isChecked()); + configData->setCodeHinting(codeHinting_checkbox->isChecked()); + configData->setRealtimeParsing(realtimeParsing_checkbox->isChecked()); + + configData->storeConfig(); +} + +void PHPConfigWidget::slotZendButtonClicked() +{ + qWarning( "PHPConfigWidgetBase::slotZendButtonClicked(): Not implemented yet!" ); +} + +void PHPConfigWidget::slotAboutClicked() +{ + qWarning( "PHPConfigWidget::slotAboutClicked()" ); + KShellProcess proc("/bin/sh"); + proc << exe_edit->text(); + proc << "-m"; + + connect( &proc, SIGNAL(receivedStdout (KProcess*, char*, int)), + this, SLOT(slotReceivedPHPInfo (KProcess*, char*, int))); + proc.start(KProcess::Block,KProcess::Stdout); + PHPInfoDlg dlg(this,"phpinfo",true); + dlg.php_edit->setText(m_phpInfo); + dlg.exec(); + m_phpInfo = ""; +} + +void PHPConfigWidget::slotReceivedPHPInfo (KProcess* /*proc*/, char* buffer, int buflen){ + m_phpInfo += QCString(buffer,buflen+1); +} + +void PHPConfigWidget::slotPHPExeButtonClicked(){ + QString exe = KFileDialog::getOpenFileName(QFileInfo(exe_edit->text()).filePath()); + if (!exe.isEmpty()){ + exe_edit->setText(exe); + } +} + +void PHPConfigWidget::slotPHPIniButtonClicked() +{ + QString file = KFileDialog::getOpenFileName(QFileInfo(exe_edit->text()).filePath(), QString("*.ini|INI File (*.ini)")); + + if (!file.isEmpty()){ + ini_edit->setText(file); + } +} + +#include "phpconfigwidget.moc" diff --git a/languages/php/phpconfigwidget.h b/languages/php/phpconfigwidget.h new file mode 100644 index 00000000..87bb6ab3 --- /dev/null +++ b/languages/php/phpconfigwidget.h @@ -0,0 +1,32 @@ +#ifndef PHPCONFIGWIDGET_H +#define PHPCONFIGWIDGET_H + +#include "phpconfigwidgetbase.h" +#include +class KProcess; +class PHPConfigData; + +class PHPConfigWidget : public PHPConfigWidgetBase +{ + Q_OBJECT + +public: + PHPConfigWidget( PHPConfigData* data,QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~PHPConfigWidget(); + +public slots: + virtual void slotZendButtonClicked(); + virtual void slotAboutClicked(); + virtual void slotPHPExeButtonClicked(); + virtual void slotPHPIniButtonClicked(); + void accept(); + void slotReceivedPHPInfo (KProcess* proc, char* buffer, int buflen); + + private: + QDomDocument* dom; + QString m_phpInfo; + PHPConfigData* configData; + +}; + +#endif diff --git a/languages/php/phpconfigwidgetbase.ui b/languages/php/phpconfigwidgetbase.ui new file mode 100644 index 00000000..8cfae9dc --- /dev/null +++ b/languages/php/phpconfigwidgetbase.ui @@ -0,0 +1,561 @@ + +PHPConfigWidgetBase + + + PHPConfigWidgetBase + + + + 0 + 0 + 545 + 510 + + + + PHP Options + + + + unnamed + + + + TabWidget1 + + + + TabPage + + + Genera&l + + + + unnamed + + + + ButtonGroup1_2 + + + &Startup + + + + unnamed + + + + useCurrentFile_radio + + + Use current file in editor + + + + + + true + + + + + useDefaultFile_radio + + + Use &this file as default: + + + + + useDefaultFile_edit + + + + + + + + + + GroupBox13 + + + Code Help + + + + unnamed + + + + codeCompletion_checkbox + + + &Enable code completion + + + + + codeHinting_checkbox + + + Enable code &hinting + + + + + + + GroupBox14 + + + Parser + + + + unnamed + + + + TextLabel1_3_3_2_2 + + + PHP &include path: + + + include_path + + + + + include_path_edit + + + + + realtimeParsing_checkbox + + + Ena&ble realtime parser + + + + + + + Spacer11_2 + + + Vertical + + + Expanding + + + + 20 + 170 + + + + + + PixmapLabel1 + + + + 4 + 5 + 0 + 0 + + + + image0 + + + false + + + + + + + tab + + + In&vocation + + + + unnamed + + + + select_label + + + Please select how KDevelop should execute your scripts. + + + + + ButtonGroup3 + + + Invocation Mode + + + + unnamed + + + + callPHPDirectly_radio + + + true + + + Ca&lling the PHP interpreter directly + + + + + TextLabel1 + + + <font size="+1">The php executable is called directly. Ideal for developers who want to develop terminal or graphical applications in PHP. +You need a correctly installed php cgi version.</font> + + + WordBreak|AlignVCenter|AlignLeft + + + + + + + + + callWebserver_radio + + + Using an &existing webserver (local or remote) + + + + + TextLabel1_4 + + + <font size="+1">Uses an existing webserver. The pages are previewed in +the internal web browser. Please make sure that the webserver was compiled with PHP support.</font> + + + WordBreak|AlignVCenter|AlignLeft + + + + + + + + + spacer18 + + + Vertical + + + Expanding + + + + 21 + 171 + + + + + + + + tab + + + &Webserver + + + + unnamed + + + + TextLabel1_2 + + + Pro&ject root URL on webserver: + + + weburl_edit + + + + + weburl_edit + + + + + Spacer12 + + + Vertical + + + Expanding + + + + 20 + 20 + + + + + + + + tab + + + &Shell + + + + unnamed + + + + TextLabel1_3_2 + + + PHP &executable: + + + exe_edit + + + + + layout7 + + + + unnamed + + + + exe_edit + + + + + exe_button + + + + 22 + 0 + + + + TabFocus + + + ... + + + + + about_button + + + About + + + + + + + textLabel2 + + + PaletteBackground + + + PHP &Ini File: + + + ini_edit + + + + + layout8 + + + + unnamed + + + + ini_edit + + + true + + + + + phpini_button + + + true + + + + 20 + 0 + + + + TabFocus + + + ... + + + + + + + zend_checkbox + + + Load &Zend extension: + + + + + layout9 + + + + unnamed + + + + zend_edit + + + false + + + + + zend_button + + + false + + + + 20 + 0 + + + + TabFocus + + + ... + + + + + + + Spacer11 + + + Vertical + + + Expanding + + + + 20 + 343 + + + + + + + + + + + 89504e470d0a1a0a0000000d4948445200000078000000400806000000d14db312000014f649444154789ced9d6d881dd779c77f2a13742edcc24c58c34c90e04e59c18e90c077b1a0bb8e215ec7506d2ca8d649c12b8762af1b48e5b6d0bcd158fe90daca9758fdd2a8812676a08ea50f469b82aa75c0ce2a607bafa9c4bd02891d8144e78217664097cc015fb8c778e0f6c399fbb2ba3377df575bd77f58b4ab997b66cef99f97ff799ee73c77dfd2d2125fe0f38b3f79d02ff00576165f10fc3987f1a05f60a358beb9bfdd796b21d2fffcd27d377d2601504affa9921600adcedf0a40adba07004320babf17f4330c281802913eecf0d14ff76d473d760b7b96e00e914280280884808200cfd3ffd74f8c4af4bf2dd5214da05a6ae0bebe4fa4f7a57f264a979148e2a453a682a457b610600941b062b685109a78612184d8d3a4ef1982976fee6f8ba226d32a16281f03ab2806ee6b35557744c64d856c82fa44a19298962aa0540bd5212651b4125611753f046af55f09e80ed0b9d2eb0ca18a8118d1d76a4258042ba22d8a26c2286015cd3d45f8be07a9a297fdfd6dd3d2849ab626d4143d52a5529ac4468bb0a1909f28e286229431aa090a3dca004d625fd9835d631d18dadd7ba56bea5b99d72c211045075134b1f6c008df7582bba49a60db1605419754a914b15484518b7a28095662e2865a3d5d1a2979bb3af7dcdf5dd4aadf7b842b4856af0956d1c4b45d2ce1307e6cdfae13bd2b0477a65fd3123876414fbd2941715311ae684297ef8648d9590f7940646e04fdc4abeebf82982ed97d845ba6adc92eba8c97776754ef28c11d621d4760164114b532958d1641a4f0ef84049142293d4285c1d6c91cb2dec2363d23bff4bedf95fe496244a200d9d50ec22860d91ef688cba313851d257a47085ebeb9bf2d2c7046b4daeca8d92ea92b522b5883558265cb48c0b14dcac7dccccbea13c5d28d0025d52ecd0afd844b50318208a5e2ee0ce5d81eb6edf1e8635fde11a2b795e00eb166110ae956226c48828f157e3d4636f574b5ada4f62381d3cf4d12dc59228c02307a0dac9462eac9698215c1fce51a62532a6c2be83c504122a1194012a33ed36d621ff4700f94b79de86d696abd6755980fa9ae41200c23fc7a4b8fd644576fc7880548c01c3111a2c50ba75f40350737c0ee011765783bf812c3d0791f01860da60d8944347d542ba41ed4a80735829572fbf0e8d4b609b22d37b95e6725a2a0898d4285bf12134629b1db3d0de74001ce8845184599e40a21281f9be4c2e5e0018bb6be77334c3027104589ba570555c7f717a9dfa91144d36daf54def2166bd355ed8c5a0c6d1694b12288f488ed2ae0dd6cc8041c5b107dec675e764b368e691236e2cded91770429d98689e94ca19a11dcabd2523e4b575f27743de2e6a9f65684d8a628a8d6f6b73142045a15072b2d8295540defa84a1d0efb218babd7b309f6c60e133414aac91edc7669cb9928da88e214341c54b884efd7083e0e881a73eda74ffcd9a648deb037a97aaddd6e25210071b345f56e8c7f57f6c87d401006584558aa648b46cff3083b5bb23d89745b85c0b4cb38eed388a2896c442cfcf62cbffae5efdb9b2975439454afb5db2d620062c9ea513b0c6bec4dd78bdc3d6c02c2148822f8b7f3a6688ffac7714af090497ac8d2b22d7d63cda52bb5099836eed139027f917065918577cf13c5617be6f8dc86d6e57513fc61a5d556498c1002d950040dd55d6b8722015114cc3ee95128167ab6e375a295768e288c09ea2141a4d7fcfe4652803b6211ae04482907cad002ab8cc2c173adcc670044f76282ba36912aa5566fa51298faaa8b77c8d9741d946a110412bf1ea29a6af8562dd11dd13d3a8d1016feadb758fae002a80878a9bd5e92d745f08795565b36638480a8a108a3f5afb52a81a9475c94f239f72fe7b1526bd6baf025813d62e2d82ee56393cc1e9fc48f140beff8f877c3de884ec03d6022ef658f5e9528beffc3ef673e5b1404a669e2d80e9e57e6f4b7c75149994beff854ae07bd8e2404b327ca5cb8f806972e5fda503d3acf70473da68e4d32736292cab590c58f02dd9172db514122700f4d0050bbfe3a8b7f5800e0f0d1efafebd96b52d42117404a4528d7f3a9d5700f5a5cba789eabef5dddd807ef837dc066e6c434a79e9963e2d824177e5bedda7a4dcba256c9269884753f5b1405d35f9fe2f9ef7c8f716f92d7df5e4225e09a7ab8bd75f12d2a1f55b6540fef88c7ccc919661e9fa67647e1df0e878c66854a044e4a72e50fe759f8dd3ca6e5b65ffcbba7d71cc5434556f55abb2d65a81de22a2577831042dba17d3fa7f137806825e2df7ef1064f4c3f8192554effcda4de6818e098f9026b23504dc5fc7f2ef0d4f413c48d2a332726514d855b7200f0ef6ebd1efe2d9fb3af9ce5e51f9f62e2287863ce1a1a452f87aef738e53f9f05e0c2c573fce6e2876b0aaf5c82976fee6f878db0eb3cdf0cb92469448610f877834d14900dd5547c73f69bc42b55a6bfe621841658b51bb56d7b06c08bfff8225e09ec1193926be1dfae211b9b69886cf8b7ebbcf8f773940fadf6836743a194c43d3a4df991694093fce1fb7f1c4a72ee641b4a8952ba32a1dabc69c0322d6423208aa2cceba55209cb5c2d7c948a091b520ba6bc9e9dc00f7efc037e73e18adefec830536041c78429063e2f9b32d3ead541b412e1dfaae28d39b8b6c9c23b97b26f34c01bf310fdb6ef44d1522d64a71e39a8dfad33fff639a69e7a8985f7fc75d9c8bdf22c41bd8a6c44cc5f3ec7a38f9dcdbd3793e06a6d7f5b369653f52736ac1a3b500978a326b55a25b30c210497e6af60994e379eaa1f41dd67feedb778e3cd37323fefdff2a9551639757296c577e733efb16d9bea7f2fa112d155cb5d248adab525cebc7286fadd7a661da230c239e8619902ff56f6f4fcf85727b874e10aa1ccea2c0aff5695f3ff9eaf4116de5d64faa9d388a21808181840a2edfde5474e71f577e7a87c54e1ca3bffd3fec6f16c434826c1b10cbb8db1d5fdabed585cbd9e3d3d7b473c44d1e2d57f5decba0fa1e7e4770f389c79f9e778632e3ff8d1cb99652c7db0c8dc77e608ead9d3b377c4239482f3bfce5e9f674e4cf1eacbaff2ec5f3f9b5b07b3584018f93a62f2b129966e49de787b69d54cd1a9c7f81197b7fee30a2ffec3b3ccbf3d3ff079d990d46e54714cafb743190295289c431394ee4e50bf5b61e19d0b7ce3f899cc7b07d6e0e59bfbdba194a844abb74d4637016924e2108135f5d8144a69754ea2b425416941a79a8adaad80d77eb9c8d4f15398a6995946106aabdad2b56ae675ef908b944a478a3457ffc8a662e1dd2ae6434e6ea39aa68935a2475650cfe9a8a31ed1bdd4c7ab06ebb1f05e8db77e5be3f9e74ee7b655abe9774375d70301b8a39300f8b79772d7e20182e3a64435d3b8e26e84e126908030046651b07c7739f3166fcc236c740cee833f4268f29502e7809359866a2ae230ce1558eea847d868653f03700f58a8669cbd0c19603ee4600a81bf92af23cc871ced64c9a80306984541b0126365698114526ecc39a312700e96114513d594d46e644fff03044bd54a0bd8bacfc53205b21912ad64378c7dd0a51ec4c30be9543a69655eb64c8b200ab2c592019e378eef47b9264ed775f0fdecce619a26ce884d4108fcda907b6c9bb0d11a3ad715d622cf101b5c0ef55aec8da5a3f84ef62c393882a5ec7bd0e6495689dedff9b55aa6815f14058e6db3dcb1486521d1424c0808f23a896313d483cc67d823366ec9cb77111a6099f9f6ebf2c36554524008a8dec871628c7928554049993bcd2bc0342de228cc757698238326d4f5c01cd1010c71237bf91820783bbd2db663e5369e37eaa192825e7f87348c6b6b1b73de76c61b73893ece26df1b73f53ad827e0fad133c26437cee4c4240a315c604d4c1237d710a309b8ae493da8675f3774b449dc6c6dc84aa880c29fa681168d30f39e4143c75a327d9de8b8ef8220bb612626cac4728d0e9580e739d4aee55ba8bca3932c7db4987dcdf3f4c987ac6724bdb34d79e2c93de076efc933d47863a9c01a026180572ab0f0ce42e6f5d28112aeebe95960c348c5670e6f3b73ba30e98c0e41f556b6c03a3c368e6c66afaba085a86d9b782578fdd7af67dee31df1987cb8cce2fbd91dc02db93d81757ff9806b3b0477abd98608436b04530882153f5760d907dda15b1ba5a0fcb08b6a862cbc974df0f8b1718270d37276280609de26a7bd280e175825b74410a40d9bf47eb45b0d4c5370fab9492e5c7c9d7abd9e59c6ec33b3a8441245d93ddf3b3a897f6788c03a64e2dfcc9e61cc624f60d5aed5b20d35a98e08a238b71edea8c3a99365cefef46cae529ffefa0c7e7d8ba14446f6a707aa2e0c812266ab02ebf0a843e0fbf902eb80cbd55a84288adee90543e08e14f00ed94c3eec70e9edf39c7d25db0ce78d9538f3e3335cb97c25737a32474cdc92cbfcbbd5dc9a38230516739c07e587bdaec0cad511631e5000a57ab66443cf5eee010bef90c3e192e0cc8f5e60e177d9a377e6e40c143da4f4371cc32680d6277a0099c56c3bc1409156d1a4e31edc0a4a072d2a57b3b716f6888d655acc9e2c40e2ae7a1325437cbfc2d37f759edaf51ce78101affcf36b00b95b1c6fd4ebda1c72059600ff4ef6da3a5eee09aceacd6c234af96819f780cde9e7c657bd1b498b308af06b6ff1e277f267a0d26889d967bec7c2d5609387e5840ea207ac916c3bc1e0082e5a40a04785b1c95521155879c2a4be52677cfcf0c0d395ea1d6319869f9d7d056774922bef06f8b773c4cf2117a9188ccc8034caa4e3e5ca0bf1e909ac20a71e172e5e60fef2a0e95135d78efd1242f0da4f5fa376471fbadb4c04aa528ae0b61698ee81ec78efcc112c843e67ab2701938d2eff1df75dae0f3861a887251706bcf29357983a3ec7f937abcc7deb30954ab6f37d9505eb3e74b65f41ddcf75ffd9076d4c21081b51aec0ea76c80dc2b66d5efdc96b449fb8f8b7d7e7411a802190514014d5c180f2b1a9ccdb0644d678f9d37d8e69039d73b01bac40a24d7324addcedc766501a2df15ff3ffc5d4f139cefd62290da8cf7f8677d423b893637c48c03b64e3dfcc56dfa228700f78a9c05ada56dbc0e35f9be0576f5c214e5c163fd824b9e8a11706da3ce98d4db0216f9233e21036027d1aced8d8285668fbae7fb336d4d7ba2e18503e5266e65b339c7a668ea51b316ffc62318dc17208ead922ce1c317147c759a8ac21b02ee7ef6d3b026b3b8208445130f1489953cfcce17a532cbcbb4cb022377f3eca10445140ed869e9e271e9bc9bf35eb3fc78feddb1736dc76d808d0e7e83ba1a6eb202cb5efd62ad9aad1344da69e9cca5d734cd3c4322d1d68572e63da2e415df1da2fab44916e1495683bb71016337f39dd3d36031d13a95e8ff282dc85a10fc87963eee0e75b8a9993b3c40a5cf2455869b4c4d4c4a43e9c3e50be4014059669e1963cbc7219128ba55ac8e29b4bba3537bd49d11f5caecd43a2f08e4cf0c2b71fcd8dcdca5dda1ddbd59e25d5d932adf38dd2f8a8f91cf1327d7c8ad7cefd06ff6ef6ba063a1b4e742f66feaa246c2ce91053a3d728c280eaad80a79f1ce7f40f7f3e20ca84018bef87a8245bbc2860b11232fed829c6274e0dbc3f0afc2066f288cdf2ed6c057dfabba7993e3e4794b386b79476dc841f4b5e7f3b444abf17c2945bf3b52184c0afcd53bf5b0143307d626ee8fdb9048f973fdd1737dd76508f11c4e9d85d7baaee09acec9e5f7e6482c5eb01172e567404c3fde823ab13163bd0db0d900dc5f9379772d7d86101e6c280ca8d80caf5ec8368aaa9987daa8c5251aea106c3e2dcaf97b448bbbf8cfe0e67f49dacdca21149089368c5a7f2c10500a69f7a9ea74f1c1e1a5939f4914f3c56d877a5994ed5499caec743a6ea34c81df2a30fdd832ed13dedeaca2460bd8d30ec84c03aca18dae042e07a0e4b1f650b2c1d7c60e707afefc0111e610864a3cee23b67bb53f3ccf139e0d3a19f5bd316fd8de35fd967998e9e2209a1bb1e0fa2bbfdb85dcd3dc2e9945c2d30f6dc01b01e8400d74e63c932608e98148a56e6fabb23ef6308a48c58b8fc2aaa2929953c9e7feed5751d615997b3c12b7958a6b6946892259924a7de9f5c07fa888910167163eb96b21d43c7076d0c71231e1bef66cddb6908611245010bbf3d839211a592c7dc777fb6eedc1eeb1a47baa7786dbfae03f256afc9b02a4f94996ff9999c9844cacd5b6e76039d734e30cc065d463677fa4d74270bfcab5cfdc37950aa4bee131b48f3b0ee66ee901cac08c246d04d15a430e9accba2a8edbbb51c0f4df9e1327193f51d5a7b5048c02b992815e51a5184e910463b77905c1802a514b56b17a85dd7db4defc804cf3ff7ea86b3f26ca8990f1ffd74dfe1a35fe1f757453b58f1811682160a0b9234a34e5130f7dc1cb10cb93fadd0f4f169162bd991077b09a6251086c94bfff4d2c03551145845975a23dcfe4e9a26438da280eafbe7b5191298fe8be79939797a53e91c369d65e7c34aab1dac045d6f06145089895b72f03c3be3e541de532ce59cc0df33487702e3475c4c2b7b8cd66a0161941f83b571e86cb652460437e7bba3d61cb1997de67b3cfb4cbe21632d6c298dd2f2cdfded200a74caa2142ab1864664ee7efaa24d60d792a9e9594f2945706791daf5f96ec872f9916966bff5b75b4eabb42d79b23eacb4da511410f7f9911516ab2d607b3575c283409aca5129c28f6bf8372e75a7e352c963fac4f35b1ab5fdd8d64468bf7fff8fed70c55fd5fbbf20ba0f9db09a4411063582db0b44517a085c08664e9e66f2abb3db9ac772db5319566bfbdbb10c091b51dffa0c50407589feff42762fe92a89423642e27b3eb2e11346da13668fb81c7ef8712626a637b4fd592f762c19e9f24d4d74d488564ddd1a5964c3ff7dc27b7159803e38df94c4f70264c32796cbdd88156bc465e2d834e38f4cef68e6d95d4927fc61a5d596322696418678e9271b062d647b99f4be7735e8a60f963286cf02e2868f52fa0c722b6961152d1cbb8c579ec22b79bb92287c5713827747b594b49a618e525d8bf00e768bf861b25f75d35b2815c22721ad449fc2e82431174260991ea5431e874727773d29f8034be95faded6fb79a21b229899b2a5daffb49eb34ac3e52a90608dfcdfd56fa5e492707740b54846cb52089f47743a47a432502ab68615a2e8e6de396769fd47e3cd0ef6ce860f9e6feb6528ab819239b125448abf34d2899c823fffeebeb415fa7ea3f2edb39cda8527f709212f899ea799112a5ad4f86c0b49c34a3bb875574762da3fb5ad81304df8f0ee12da50957890215f748df0e37dd7d65a8fee3a95d02d36b694e67f1250142870a092128145dec11878230f70ca1f7634f9afcb5f8d8077c39fd49494fa0a5746a7cad4655977c80d67ddf91001916a99cce213aa7eb8d3410c110140c01c24a63ac867d8bca70a7fb83c49e24380bbd462dd0999a1f0cf62e9959f8e2bb0b3fe7f882e0cf39fe17a14b594f9ff48c020000000049454e44ae426082 + + + + + about_button + clicked() + PHPConfigWidgetBase + slotAboutClicked() + + + exe_button + clicked() + PHPConfigWidgetBase + slotPHPExeButtonClicked() + + + + TabWidget1 + useCurrentFile_radio + useDefaultFile_edit + codeCompletion_checkbox + codeHinting_checkbox + include_path_edit + realtimeParsing_checkbox + callPHPDirectly_radio + callWebserver_radio + weburl_edit + exe_edit + exe_button + ini_edit + phpini_button + zend_checkbox + zend_edit + zend_button + + + kdialog.h + + + slotAboutClicked() + slotPHPExeButtonClicked() + slotPHPIniButtonClicked() + slotZendButtonClicked() + + + + diff --git a/languages/php/phperrorview.cpp b/languages/php/phperrorview.cpp new file mode 100644 index 00000000..011e8b77 --- /dev/null +++ b/languages/php/phperrorview.cpp @@ -0,0 +1,422 @@ +/* + Copyright (C) 2002 by Roberto Raggi + Copyright (C) 2005 by Nicolas Escuder + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "phperrorview.h" +#include "phpsupportpart.h" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ProblemItem: public KListViewItem +{ +public: + ProblemItem( QListView* parent, const QString& problem, + const QString& file, const QString& line, const QString& column ) + : KListViewItem( parent, problem, file, line, column ) {} + + ProblemItem( QListViewItem* parent, const QString& problem, + const QString& file, const QString& line, const QString& column ) + : KListViewItem( parent, problem, file, line, column ) {} + + int compare( QListViewItem* item, int column, bool ascending ) const { + if( column == 2 || column == 3 ){ + int a = text( column ).toInt(); + int b = item->text( column ).toInt(); + if( a == b ) + return 0; + return( a > b ? 1 : -1 ); + } + return KListViewItem::compare( item, column, ascending ); + } + +}; + +PHPErrorView::PHPErrorView( PHPSupportPart* part, QWidget* parent, const char* name ) + : QWidget( parent, name ? name : "problemreporter" ), + m_phpSupport( part ), + m_document( 0 ), + m_markIface( 0 ) +{ + QWhatsThis::add(this, i18n("Problem reporter

This window shows various \"problems\" in your project. " + "It displays TODO entries, FIXME's and errors reported by a language parser. " + "To add a TODO or FIXME entry, just type
" + "//@todo my todo
" + "//TODO: my todo
" + "//FIXME fix this")); + + m_gridLayout = new QGridLayout(this,2,3); + + m_errorList = new KListView(this); + m_fixmeList = new KListView(this); + m_todoList = new KListView(this); + m_filteredList = new KListView(this); + m_currentList = new KListView(this); + + m_filteredList->addColumn( i18n("Level") ); + m_currentList->addColumn( i18n("Level") ); + + //addColumn( i18n("Level") ); + InitListView(m_errorList); + InitListView(m_fixmeList); + InitListView(m_todoList); + InitListView(m_filteredList); + InitListView(m_currentList); + m_currentList->removeColumn(1); + + m_widgetStack = new QWidgetStack(this); + m_widgetStack->addWidget(m_currentList,0); + m_widgetStack->addWidget(m_errorList,1); + m_widgetStack->addWidget(m_fixmeList,2); + m_widgetStack->addWidget(m_todoList,3); + m_widgetStack->addWidget(m_filteredList,4); + + m_tabBar = new QTabBar(this); + m_tabBar->insertTab(new QTab(i18n("Current")),0); + m_tabBar->insertTab(new QTab(i18n("Errors")),1); + m_tabBar->insertTab(new QTab(i18n("Fixme")),2); + m_tabBar->insertTab(new QTab(i18n("Todo")),3); + m_tabBar->insertTab(new QTab(i18n("Filtered")),4); + m_tabBar->setTabEnabled(0,false); + m_tabBar->setTabEnabled(4,false); + + m_tabBar->setCurrentTab(0); + + m_filterEdit = new KLineEdit(this); + + QLabel* m_filterLabel = new QLabel(i18n("Lookup:"),this); + + m_gridLayout->addWidget(m_tabBar,0,0); + m_gridLayout->addMultiCellWidget(m_widgetStack,1,1,0,2); + m_gridLayout->addWidget(m_filterLabel,0,1,Qt::AlignRight); + m_gridLayout->addWidget(m_filterEdit,0,2,Qt::AlignLeft); + + connect( m_filterEdit, SIGNAL(returnPressed()), this, SLOT(slotFilter()) ); + connect( m_filterEdit, SIGNAL(textChanged( const QString & )), this, SLOT(slotFilter()) ); + connect( m_tabBar, SIGNAL(selected(int)), this, SLOT(slotTabSelected(int)) ); + connect( part->partController(), SIGNAL(activePartChanged(KParts::Part*)), this, SLOT(slotActivePartChanged(KParts::Part*)) ); + connect( part->partController(), SIGNAL(partAdded(KParts::Part*)), this, SLOT(slotPartAdded(KParts::Part*)) ); + connect( part->partController(), SIGNAL(partRemoved(KParts::Part*)), this, SLOT(slotPartRemoved(KParts::Part*)) ); + + slotActivePartChanged( part->partController()->activePart() ); +} + +void PHPErrorView::slotFilter() +{ + if(!m_tabBar->isTabEnabled(4)) + m_tabBar->setTabEnabled(4,true); + + m_tabBar->tab(4)->setText(i18n("Filtered: %1").arg( m_filterEdit->text() )); + m_tabBar->setCurrentTab(4); + + m_filteredList->clear(); + + filterList(m_errorList,i18n("Error")); + filterList(m_fixmeList,i18n("Fixme")); + filterList(m_todoList,i18n("Todo")); + +} + +void PHPErrorView::filterList(KListView* listview, const QString& level) +{ + QListViewItemIterator it( listview ); + while ( it.current() ) { + if ( it.current()->text(3).contains(m_filterEdit->text(),false)) + new KListViewItem(m_filteredList,level, + it.current()->text(0),it.current()->text(1),it.current()->text(2),it.current()->text(3)); + ++it; + } +} + +void PHPErrorView::slotTabSelected( int tabindex ) +{ + m_widgetStack->raiseWidget(tabindex); +} + +void PHPErrorView::InitListView(KListView* listview) +{ + listview->addColumn( i18n("File") ); + listview->addColumn( i18n("Line") ); + listview->addColumn( i18n("Column") ); + listview->addColumn( i18n("Problem") ); + listview->setAllColumnsShowFocus( TRUE ); + + connect( listview, SIGNAL(executed(QListViewItem*)), + this, SLOT(slotSelected(QListViewItem*)) ); + + connect( listview, SIGNAL(returnPressed(QListViewItem*)), + this, SLOT(slotSelected(QListViewItem* )) ); + +} + +PHPErrorView::~PHPErrorView() +{ +} + +void PHPErrorView::slotActivePartChanged( KParts::Part* part ) +{ + if ( !part ) { + m_tabBar->setTabEnabled(0,false); + return; + } + + if ( m_document ) + disconnect( m_document, 0, this, 0 ); + + m_document = dynamic_cast( part ); + m_markIface = 0; + + if ( !m_document ) { + m_tabBar->setTabEnabled(0,false); + return; + } + + m_fileName = m_document->url().path(); + + initCurrentList(); + + m_markIface = dynamic_cast( part ); +} + +void PHPErrorView::removeAllItems( QListView* listview, const QString& filename ) +{ + QListViewItem* current = listview->firstChild(); + while( current ){ + QListViewItem* i = current; + current = current->nextSibling(); + + if( i->text(0) == filename ) + delete( i ); + } +} + +void PHPErrorView::removeAllProblems( const QString& filename ) +{ + QString relFileName = filename; + relFileName.remove(m_phpSupport->project()->projectDirectory()); + + kdDebug(9008) << "PHPErrorView::removeAllProblems()" << relFileName << endl; + + if (filename == m_fileName) + m_currentList->clear(); + + removeAllItems(m_errorList,relFileName); + removeAllItems(m_fixmeList,relFileName); + removeAllItems(m_todoList,relFileName); + + if ( m_document && m_markIface ) { + QPtrList marks = m_markIface->marks(); + QPtrListIterator it( marks ); + while( it.current() ) { + m_markIface->removeMark( it.current()->line, KTextEditor::MarkInterface::markType07 ); + ++it; + } + } +} + +void PHPErrorView::initCurrentList() +{ + m_tabBar->setTabEnabled(0,true); + + QString relFileName = m_fileName; + + if (m_phpSupport->project()) + relFileName.remove(m_phpSupport->project()->projectDirectory()); + + m_currentList->clear(); + + updateCurrentWith(m_errorList, i18n("Error"),relFileName); + updateCurrentWith(m_fixmeList,i18n("Fixme"),relFileName); + updateCurrentWith(m_todoList,i18n("Todo"),relFileName); +} + +void PHPErrorView::updateCurrentWith(QListView* listview, const QString& level, const QString& filename) +{ + QListViewItemIterator it(listview); + while ( it.current() ) { + if ( it.current()->text(0) == filename) + new QListViewItem(m_currentList,level,it.current()->text(1),it.current()->text(2),it.current()->text(3)); + ++it; + } +} + +void PHPErrorView::slotSelected( QListViewItem* item ) +{ + bool is_filtered = false; + bool is_current = false; + + if (item->listView() == m_filteredList) + is_filtered = true; + else if(item->listView() == m_currentList) + is_current = true; + + KURL url( is_current ? m_fileName : item->text(0 + is_filtered) ); + int line = item->text( 1 + is_filtered).toInt(); + m_phpSupport->partController()->editDocument( url, line-1 ); +} + +void PHPErrorView::reportProblem( int level, const QString& fileName, int line, const QString& text) +{ + int markType = levelToMarkType( level ); + if ( markType != -1 && m_document && m_markIface && m_fileName == fileName ) { + m_markIface->addMark( line, markType ); + } + + QString msg = text; + msg = msg.replace( QRegExp("\n"), "" ); + + QString relFileName = fileName; + relFileName.remove(m_phpSupport->project()->projectDirectory()); + + KListView* list; + switch( level ) + { + case Error: + case ErrorNoSuchFunction: + case ErrorParse: + list = m_errorList; + m_tabBar->setCurrentTab(m_tabBar->tab(1)); + break; + + case Warning: + list = m_errorList; + break; + + case Todo: + list = m_todoList; + break; + + case Fixme: + list = m_fixmeList; + break; + + default: + list = NULL; + break; + } + + if (list) { + kdDebug(9018) << "PB " << msg << endl; + new ProblemItem( list, relFileName, QString::number( line + 1 ), 0, msg ); + } + + if (fileName == m_fileName) + new QListViewItem(m_currentList, levelToString( level ), QString::number( line + 1 ), 0, msg); +} + +void PHPErrorView::slotPartAdded( KParts::Part* part ) +{ + KTextEditor::MarkInterfaceExtension* iface = dynamic_cast( part ); + + if ( !iface ) + return; + + iface->setPixmap( KTextEditor::MarkInterface::markType07, SmallIcon("stop") ); +} + +void PHPErrorView::slotPartRemoved( KParts::Part* part ) +{ + kdDebug(9007) << "PHPErrorView::slotPartRemoved()" << endl; + if ( part == m_document ){ + m_document = 0; + } +} + +QString PHPErrorView::levelToString( int level ) const +{ + switch( level ) + { + case ErrorNoSuchFunction: + return QString( i18n("Undefined function") ); + + case ErrorParse: + return QString( i18n("Parse Error") ); + + case Error: + return QString( i18n("Error") ); + + case Warning: + return QString( i18n("Warning") ); + + case Todo: + return QString( i18n("Todo") ); + + case Fixme: + return QString( i18n("Fixme") ); + + default: + return QString::null; + } + +} + +int PHPErrorView::levelToMarkType( int level ) const +{ + switch( level ) + { + case ErrorNoSuchFunction: + case ErrorParse: + case Error: + return KTextEditor::MarkInterface::markType07; + + case Warning: + return -1; + + case Todo: + return -1; + + case Fixme: + return -1; + + default: + return -1; + } + +} + +#include "phperrorview.moc" diff --git a/languages/php/phperrorview.h b/languages/php/phperrorview.h new file mode 100644 index 00000000..bc8b0df5 --- /dev/null +++ b/languages/php/phperrorview.h @@ -0,0 +1,104 @@ +/* + Copyright (C) 2002 by Roberto Raggi + Copyright (C) 2005 by Nicolas Escuder + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef PHPERRORVIEW_H +#define PHPERRORVIEW_H + +#include +#include +#include +#include "phpfile.h" + +class PHPSupportPart; +class QTimer; +class QTabBar; +class QWidgetStack; +class QGridLayout; +class KDialogBase; +class Problem; +class KURL; + +namespace KParts{ + class Part; +} + +namespace KTextEditor{ + class MarkInterface; + class Document; +} + + +enum Errors +{ + Error = 0, + ErrorParse = 1, + ErrorNoSuchFunction = 2, + Warning = 3, + Todo = 4, + Fixme = 5 +}; + +class PHPErrorView: public QWidget { +Q_OBJECT +public: + PHPErrorView( PHPSupportPart* part, QWidget* parent=0, const char* name=0 ); + virtual ~PHPErrorView(); + + void removeAllProblems( const QString& filename ); + void reportProblem( int level, const QString& fileName, int line, const QString& text); + +private slots: + void slotPartAdded( KParts::Part* ); + void slotPartRemoved( KParts::Part* ); + void slotActivePartChanged( KParts::Part* ); + void slotSelected( QListViewItem* ); + void slotTabSelected( int tabindex ); + void slotFilter(); + +private: + QString levelToString( int level ) const; + int levelToMarkType( int level ) const; + void InitListView(KListView* listview); + void removeAllItems( QListView* listview, const QString& filename ); + void filterList(KListView* listview, const QString& level); + void updateCurrentWith(QListView* listview, const QString& level, const QString& filename); + void initCurrentList(); + +private: + QGridLayout* m_gridLayout; + QTabBar* m_tabBar; + QWidgetStack* m_widgetStack; + KListView* m_currentList; + KListView* m_errorList; + KListView* m_fixmeList; + KListView* m_warningList; + KListView* m_todoList; + KListView* m_filteredList; + KLineEdit* m_filterEdit; + + PHPSupportPart* m_phpSupport; + QGuardedPtr m_document; + KTextEditor::MarkInterface* m_markIface; + QTimer* m_timer; + QString m_fileName; + int m_active; + int m_delay; +}; + +#endif diff --git a/languages/php/phpfile.cpp b/languages/php/phpfile.cpp new file mode 100644 index 00000000..afd741bd --- /dev/null +++ b/languages/php/phpfile.cpp @@ -0,0 +1,639 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "phphtmlview.h" +#include "phperrorview.h" + +#include "phpfile.h" + +using namespace std; + +PHPFile::PHPFile(PHPSupportPart *phpSupport, const QString& fileName) +{ + m_fileinfo = new QFileInfo(fileName); + m_part = phpSupport; + modified = true; + inClass = FALSE; + inMethod = FALSE; + + /* + phpCheckProc = new KShellProcess("/bin/sh"); + connect(phpCheckProc, SIGNAL(receivedStdout (KProcess*, char*, int)), this, SLOT(slotReceivedPHPCheckStdout (KProcess*, char*, int))); + connect(phpCheckProc, SIGNAL(receivedStderr (KProcess*, char*, int)), this, SLOT(slotReceivedPHPCheckStderr (KProcess*, char*, int))); + connect(phpCheckProc, SIGNAL(processExited(KProcess*)), this, SLOT(slotPHPCheckExited(KProcess*))); + */ +} + +PHPFile::~PHPFile() +{ + if (m_fileinfo) + delete m_fileinfo; + +// delete phpCheckProc; +} + +QStringList PHPFile::getContents() +{ + return m_contents; +} + +QString PHPFile::fileName() { + return m_fileinfo->filePath(); +} + +QStringList PHPFile::readFromEditor() +{ + QStringList contents; + + kapp->lock(); + QPtrList parts( *m_part->partController()->parts() ); + QPtrListIterator it( parts ); + while( it.current() ){ + KTextEditor::Document* doc = dynamic_cast( it.current() ); + ++it; + + KTextEditor::EditInterface* editIface = dynamic_cast( doc ); + if ( !doc || !editIface || doc->url().path() != fileName() ) + continue; + + contents = QStringList::split("\n", editIface->text().ascii(), true); + break; + } + kapp->unlock(); + + return contents; +} + +QStringList PHPFile::readFromDisk() +{ + QStringList contents; + QFile f( fileName() ); + + if (f.open(IO_ReadOnly)) { + QTextStream stream( &f ); + QStringList list; + QString rawline; + while (!stream.eof()) { + rawline = stream.readLine(); + contents.append(rawline.stripWhiteSpace().local8Bit()); + } + f.close(); + } + return contents; +} + +bool PHPFile::isModified() { + return modified; +} + +void PHPFile::setModified(bool value) { + modified = value; +} + +void PHPFile::Analyse() { + + postEvent( new FileParseEvent( Event_StartParse, this->fileName() ) ); + + inClass = FALSE; + inMethod = FALSE; +/* + m_contents = readFromEditor(); + + if (m_contents.isEmpty()) +*/ + m_contents = readFromDisk(); + + ParseSource(); + + PHPCheck(); + modified = false; + + postEvent( new FileParseEvent( Event_EndParse, this->fileName() ) ); +} + +bool PHPFile::ParseClass(QString line, int lineNo) { + if (line.find("class ", 0, FALSE) == -1) + return FALSE; + + QRegExp Class("^[ \t]*(abstract|final|)[ \t]*class[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*(extends[ \t]*([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))?.*$"); + Class.setCaseSensitive(FALSE); + + if (Class.search(line) != -1) { + if (AddClass(Class.cap(2), Class.cap(4), lineNo) == FALSE) + return FALSE; + +/// @fixme Activate when it exists in ClassModel +// if (Class.cap(1).lower() == "abstract") +// SetClass("abstract"); + + return TRUE; + } + + return FALSE; +} + +bool PHPFile::ParseFunction(QString line, int lineNo) { + if (line.find("function", 0, FALSE) == -1) + return FALSE; + + QRegExp function("^[ \t]*(final|abstract|static|)[ \t]*(public|private|protected|)[ \t]*(static|)[ \t]*function[ \t&]*([_a-zA-Z\x7f-\xff][_a-zA-Z0-9\x7f-\xff]*)[ \t]*\\(([_a-zA-Z\x7f-\xff]*[_$, &'\\\"0-9A-Za-z\x7f-\xff\t-=]*)\\).*$"); + function.setCaseSensitive(FALSE); + + if (function.search(line) != -1) { + if (AddFunction(function.cap(4), function.cap(5), lineNo) == FALSE) + return FALSE; + + if (function.cap(3).lower() == "static" || function.cap(1).lower() == "static") + SetFunction("static"); + + if (function.cap(1).lower() == "abstract") { + SetFunction("abstract"); + CloseFunction( lineNo ); + return FALSE; + } + +/// @fixme Activate when it exists in FunctionModel +// if (function.cap(1).lower() == "final") +// SetFunction("final"); + + if (function.cap(2).lower() == "private") + SetFunction("private"); + + if (function.cap(2).lower() == "public" || function.cap(2).isEmpty()) + SetFunction("public"); + + if (function.cap(2).lower() == "protected") + SetFunction("protected"); + + return TRUE; + } + + return FALSE; +} + +bool PHPFile::ParseVariable(QString line, int lineNo) { + if (line.find("var") == -1 && line.find("public") == -1 && line.find("private") == -1 && line.find("protected") == -1) + return FALSE; + + QRegExp variable("^[ \t]*(var|public|private|protected|static)[ \t]*\\$([a-zA-Z_\x7f-\xff][0-9A-Za-z_\x7f-\xff]*)[ \t;=].*$"); + variable.setCaseSensitive(FALSE); + + if (variable.search(line) != -1) { + if (AddVariable(variable.cap(2), "", lineNo) == FALSE) + return FALSE; + + if (variable.cap(1).lower() == "private") + SetVariable( "private" ); + + if (variable.cap(1).lower() == "public" || variable.cap(1).lower() == "var") + SetVariable( "public" ); + + if (variable.cap(1).lower() == "protected") + SetVariable( "protected" ); + + if (variable.cap(1).lower() == "static") + SetVariable( "static" ); + + return TRUE; + } + + return FALSE; +} + +bool PHPFile::ParseThisMember(QString line, int lineNo) { + if (line.find("$this->", 0, FALSE) == -1) + return FALSE; + + QRegExp createthis; + createthis.setCaseSensitive(FALSE); + + createthis.setPattern("\\$this->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*([0-9]*)[ \t]*;"); + if (createthis.search(line) != -1) { + if (AddVariable(createthis.cap(1), "integer", lineNo, TRUE) == FALSE) + return FALSE; + return TRUE; + } + + if (line.find("true", 0, FALSE) != -1 || line.find("false", 0, FALSE) != -1) { + createthis.setPattern("\\$(this->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*(true|false)[ \t]*;"); + if (createthis.search(line) != -1) { + if (AddVariable(createthis.cap(1), "boolean", lineNo, TRUE) == FALSE) + return FALSE; + return TRUE; + } + } + + if (line.find("new", 0, FALSE) != -1) { + createthis.setPattern("\\$this->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t&]*new[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)"); + if (createthis.search(line) != -1) { + if (AddVariable(createthis.cap(1), createthis.cap(2), lineNo, TRUE) == FALSE) + return FALSE; + return TRUE; + } + } + + if (line.find("array", 0, FALSE) != -1) { + createthis.setPattern("\\$this->([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t&]*(new|)[ \t&]*(array)[ \t]*[\\(;]+"); + if (createthis.search(line) != -1) { + if (AddVariable(createthis.cap(1), "array", lineNo, TRUE) == FALSE) + return FALSE; + return TRUE; + } + } + + return FALSE; +} + +bool PHPFile::ParseMember(QString line, int lineNo) { + if (line.find("$", 0, FALSE) == -1) + return FALSE; + + /// @todo Ajouter plus de test .... + + QRegExp createmember; + createmember.setCaseSensitive(FALSE); + + createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*([0-9]*)[ \t]*;"); + if (createmember.search(line) != -1) { + if (AddVariable(createmember.cap(1), "integer", lineNo) == FALSE) + return FALSE; + return TRUE; + } + + createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*[\"']+(.*)[\"']+[ \t]*;"); + if (createmember.search(line) != -1) { + if (AddVariable(createmember.cap(1), "string", lineNo) == FALSE) + return FALSE; + return TRUE; + } + + if (line.find("true", 0, FALSE) != -1 || line.find("false", 0, FALSE) != -1) { + createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t]*(true|false)[ \t]*;"); + if (createmember.search(line) != -1) { + if (AddVariable(createmember.cap(1), "boolean", lineNo) == FALSE) + return FALSE; + return TRUE; + } + } + + if (line.find("new", 0, FALSE) != -1) { + createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t&]*new[ \t]+([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)"); + if (createmember.search(line) != -1) { + if (AddVariable(createmember.cap(1), createmember.cap(2), lineNo) == FALSE) + return FALSE; + return TRUE; + } + } + + if (line.find("array", 0, FALSE) != -1) { + createmember.setPattern("\\$([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)[ \t]*=[ \t&]*(new|)[ \t&]*(array)[ \t]*[\\(;]+"); + if (createmember.search(line) != -1) { + if (AddVariable(createmember.cap(1), "array", lineNo) == FALSE) + return FALSE; + return TRUE; + } + } + + return FALSE; +} + +bool PHPFile::ParseReturn(QString line, int lineNo) { + QString rettype; + + if (line.find("return", 0, FALSE) == -1) + return FALSE; + + QRegExp typeex; + typeex.setCaseSensitive(FALSE); + typeex.setPattern("return[ \t]*(\\(|)([a-zA-Z_\x7f-\xff$][a-zA-Z0-9_\x7f-\xff]*)(\\)|)[ \t]*;"); + + if (typeex.search(line) != -1) { + QString varname = typeex.cap(2).ascii(); + rettype = varname; + + if (varname.find("$") == 0) { + /// @todo search in variable + /* + varname = varname.mid(1); + + QValueList::ConstIterator it = m_vars.begin(); + while ( it != m_vars.end() ) { + Action *p = *it++; + + if (p->parent() == current && p->name() == varname) { + rettype = p->args(); + } + } + */ + } else if (varname == "true" || varname == "false") { + rettype = "boolean"; + } else if (varname == "null") { + rettype = "null"; + } + + if (rettype.find("$") == 0) + kdDebug(9018) << "ParseReturn value" << " " << rettype.latin1() << endl; + } + + SetFunction("result", rettype); + return TRUE; +} + +bool PHPFile::ParseTodo(QString line, int lineNo) { + if (line.find("todo", 0, FALSE) == -1) + return FALSE; + + QRegExp todo("/[/]+[ \t]*[@]*todo([ \t]*:[ \t]*|[ \t]*)[ \t]*(.*)$"); + todo.setCaseSensitive(FALSE); + + if (todo.search(line) != -1) { + AddTodo( todo.cap(2), lineNo ); + return TRUE; + } + + return FALSE; +} + +bool PHPFile::ParseFixme(QString line, int lineNo) { + if (line.find("fixme", 0, FALSE) == -1) + return FALSE; + + QRegExp fixme("/[/]+[ \t]*[@]*fixme([ \t]*:[ \t]*|[ \t]*)[ \t]*(.*)$"); + fixme.setCaseSensitive(FALSE); + + if (fixme.search(line) != -1) { + AddFixme( fixme.cap(2), lineNo ); + return TRUE; + } + + return FALSE; +} + +void PHPFile::ParseSource() { + QString line; + int lineNo = 0; + int bracketOpen = 0; + int bracketClose = 0; + int bracketFuncOpen = 0; + int bracketFuncClose = 0; + + QRegExp includere("^[ \t]*(include|require|include_once|require_once)[ \t]*(\\(|)[ \t]*[\"'](.*)[\"'][ \t]*(\\)|)[ \t]*;$"); + + includere.setCaseSensitive(FALSE); + + for ( QStringList::Iterator it = m_contents.begin(); it != m_contents.end(); ++it ) { + line = (*it).local8Bit(); + + if (!line.isNull()) { + if (line.find("include", 0, FALSE) != -1 || line.find("require", 0, FALSE) != -1) { + if (includere.search(line) != -1) { + QStringList include_path; + include_path = include_path.split(":", m_part->getIncludePath()); + include_path.append(URLUtil::directory(fileName()) + "/"); + include_path.append(""); + + QStringList list = includere.capturedTexts(); + + for ( QStringList::Iterator it = include_path.begin(); it != include_path.end(); ++it ) { + QString abso = URLUtil::canonicalPath(*it + "/" + list[3]); + if (!abso.isNull()) { + QString rel = URLUtil::relativePathToFile (m_part->project()->projectDirectory(), abso); + postEvent( new FileParseEvent( Event_AddFile, abso ) ); + } + } + } + } + + + if ( inMethod == TRUE ) { + bracketFuncOpen += line.contains("{"); + bracketFuncClose += line.contains("}"); + if (bracketFuncOpen == bracketFuncClose && bracketFuncOpen != 0 && bracketFuncClose != 0) { + CloseFunction( lineNo ); + } + } + + if ( inMethod == FALSE ) { + bracketOpen += line.contains("{"); + bracketClose += line.contains("}"); + if (bracketOpen == bracketClose && bracketOpen != 0 && bracketClose != 0 && inClass == TRUE) { + CloseClass( lineNo ); + } + } + + if ( inClass == FALSE ) { + if (ParseClass(line, lineNo) == TRUE) { + bracketOpen = line.contains("{"); + bracketClose = line.contains("}"); + } + } + + if ( inClass == TRUE ) { + ParseThisMember(line, lineNo); + } + + if (ParseFunction(line, lineNo) == TRUE) { + bracketFuncOpen = line.contains("{"); + bracketFuncClose = line.contains("}"); + } + + if ( inMethod == TRUE ) + ParseReturn(line, lineNo); + + ParseVariable(line, lineNo); + ParseMember(line, lineNo); + ParseTodo(line, lineNo); + ParseFixme(line, lineNo); + + ++lineNo; + } + } +} + +void PHPFile::PHPCheck() { +// int status = 0; + m_phpCheckOutput = ""; + +/// @todo try with kprocess in futur version actually this create zombie +/* + phpCheckProc->clearArguments(); + + *phpCheckProc << m_phpSupport->getExePath(); + *phpCheckProc << "-l -f" << KShellProcess::quote(fileName()); + + phpCheckProc->start(KProcess::DontCare, KProcess::All); +*/ + +/* + char buf[255]; + FILE *fd = popen(QString(m_phpSupport->getExePath() + " -l -f " + KShellProcess::quote(fileName())).ascii(), "r"); + while (!feof(fd)) { + memset(buf, 0, 255); + fgets(buf, 255, fd); + m_phpCheckOutput += buf; + } + pclose(fd); + + ParseStdout(m_phpCheckOutput); +*/ +} + +/* +void PHPFile::slotReceivedPHPCheckStdout (KProcess* proc, char* buffer, int buflen) { + kdDebug(9018) << "slotPHPExeStdout()" << endl; + m_phpCheckOutput += QString::fromLocal8Bit(buffer,buflen+1); +} + +void PHPFile::slotReceivedPHPCheckStderr (KProcess* proc, char* buffer, int buflen) { + kdDebug(9018) << "slotPHPExeStderr()" << endl; + m_phpCheckOutput += QString::fromLocal8Bit(buffer,buflen+1); +} + +void PHPFile::slotPHPCheckExited (KProcess* proc) { + kdDebug(v) << "slotPHPExeExited()" << endl; +} +*/ + +void PHPFile::ParseStdout(QString phpOutput) { + kdDebug(9018) << "ParseStdout()" << endl; + QRegExp parseError("^(|)Parse error(|): parse error, (.*) in (|)(.*)(|) on line (|)(.*)(|).*$"); + QRegExp undefFunctionError("^(|)Fatal error(|): Call to undefined function: (.*) in (|)(.*)(|) on line (|)(.*)(|).*$"); + QRegExp warning("^(|)Warning(|): (|)(.*)(|) in (.*) on line (|)(.*)(|).*$"); + QRegExp generalFatalError("^(|)Fatal error(|): (.*) in (|)(.*)(|) on line (|)(.*)(|).*$"); + + QStringList list = QStringList::split("\n", phpOutput); + QStringList::Iterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if (generalFatalError.search(*it) >= 0) { +// m_errorview->reportProblem(Error, parseError.cap(5), parseError.cap(8).toInt(), parseError.cap(3)); + } + if(parseError.search(*it) >= 0){ +// m_errorview->reportProblem(ErrorParse, parseError.cap(5), parseError.cap(8).toInt(), parseError.cap(3)); + } + if(undefFunctionError.search(*it) >= 0){ +// m_errorview->reportProblem(ErrorNoSuchFunction, parseError.cap(5), parseError.cap(8).toInt(), parseError.cap(3)); + } + if (warning.search(*it) >= 0){ +// m_errorview->reportProblem(ErrorNoSuchFunction, parseError.cap(6), parseError.cap(8).toInt(), parseError.cap(4)); + } + } + +} +/* +ClassDom PHPFile::classByName(QString filename, QString classname) { + QValueList CList; + QString abso = URLUtil::canonicalPath(filename); + ClassList classList = m_model->globalNamespace()->classList(); + + ClassList::Iterator classIt; + for (classIt = classList.begin(); classIt != classList.end(); ++classIt) { + ClassDom nClass = *classIt; + if (nClass->name().lower() == classname.lower() && nClass->fileName() == abso) + return nClass; + } + return NULL; +} + +QValueList PHPFile::classByName(QString classname) { + QValueList CList; + + ClassList classList = m_model->globalNamespace()->classList(); + + ClassList::Iterator classIt; + for (classIt = classList.begin(); classIt != classList.end(); ++classIt) { + ClassDom nClass = *classIt; + if (nClass->name().lower() == classname.lower()) + CList.append( nClass ); + } + return CList; +} +*/ + +void PHPFile::postEvent(FileParseEvent *event) { + KApplication::postEvent( m_part, event ); + usleep(100); +} + +bool PHPFile::AddClass(QString name, QString extends, int start) { + postEvent( new FileParseEvent( Event_AddClass, this->fileName(), name, extends, start ) ); + inClass = TRUE; + return TRUE; +} + +bool PHPFile::SetClass(QString arguments) { + postEvent( new FileParseEvent( Event_SetClass, this->fileName(), "", arguments ) ); + return TRUE; +} + +bool PHPFile::CloseClass(int end) { + postEvent( new FileParseEvent( Event_CloseClass, this->fileName(), end ) ); + inClass = FALSE; + return TRUE; +} + +bool PHPFile::AddFunction(QString name, QString arguments, int start) { + postEvent( new FileParseEvent( Event_AddFunction, this->fileName(), name, arguments, start ) ); + inMethod = TRUE; + return TRUE; +} + +bool PHPFile::SetFunction(QString name, QString arguments) { + postEvent( new FileParseEvent( Event_SetFunction, this->fileName(), name, arguments ) ); + return TRUE; +} + +bool PHPFile::CloseFunction(int end) { + postEvent( new FileParseEvent( Event_CloseFunction, this->fileName(), end ) ); + inMethod = FALSE; + return TRUE; +} + +bool PHPFile::AddVariable(QString name, QString type, int position, bool classvar) { + postEvent( new FileParseEvent( Event_AddVariable, this->fileName(), name, type, position, classvar ) ); + return TRUE; +} + +bool PHPFile::SetVariable(QString arguments) { + postEvent( new FileParseEvent( Event_SetVariable, this->fileName(), "", arguments ) ); + return TRUE; +} + +bool PHPFile::AddTodo(QString arguments, int position) { + postEvent( new FileParseEvent( Event_AddTodo, this->fileName(), "", arguments, position ) ); + inClass = TRUE; + return TRUE; +} + +bool PHPFile::AddFixme(QString arguments, int position) { + postEvent( new FileParseEvent( Event_AddFixme, this->fileName(), "", arguments, position ) ); + inClass = TRUE; + return TRUE; +} + +#include "phpfile.moc" diff --git a/languages/php/phpfile.h b/languages/php/phpfile.h new file mode 100644 index 00000000..cb1573f3 --- /dev/null +++ b/languages/php/phpfile.h @@ -0,0 +1,119 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef PHPFILE_H +#define PHPFILE_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "phpsupportpart.h" +#include "phperrorview.h" +#include "phpparser.h" +#include "phpsupport_event.h" + +/** +@author Escuder Nicolas +*/ +class PHPFile : public QObject { +Q_OBJECT + +public: + PHPFile(PHPSupportPart *phpSupport, const QString& fileName); + ~PHPFile(); + + QStringList getContents(); + + bool isModified(); + void setModified(bool value); + QString fileName(); + void Analyse(); + void ParseStdout(QString phpOutput); +/* + ClassDom classByName(QString filename, QString classname); + QValueList classByName(QString classname); +*/ + +/* +private slots: + void slotReceivedPHPCheckStderr (KProcess* proc, char* buffer, int buflen); + void slotReceivedPHPCheckStdout (KProcess* proc, char* buffer, int buflen); + void slotPHPCheckExited (KProcess* proc); +*/ +private: + QStringList readFromEditor(); + QStringList readFromDisk(); + + bool ParseClass(QString line, int lineNo); + bool ParseFunction(QString line, int lineNo); + bool ParseVariable(QString line, int lineNo); + + bool ParseThisMember(QString line, int lineNo); + bool ParseMember(QString line, int lineNo); + bool ParseReturn(QString line, int lineNo); + bool ParseTodo(QString line, int lineNo); + bool ParseFixme(QString line, int lineNo); + + void ParseSource(); + void PHPCheck(); + + void postEvent(FileParseEvent *event); + + bool AddClass(QString name, QString extends, int start); + bool SetClass(QString arguments); + bool CloseClass(int end); + + bool AddFunction(QString name, QString arguments, int start); + bool SetFunction(QString name, QString arguments = ""); + bool CloseFunction(int end); + + bool AddVariable(QString name, QString type, int position, bool classvar = FALSE); + bool SetVariable(QString arguments); + + bool AddTodo(QString arguments, int position); + bool AddFixme(QString arguments, int position); + + PHPSupportPart *m_part; + + bool modified; + + bool inClass; + bool inMethod; + + QFileInfo* m_fileinfo; + QStringList m_contents; + QString m_phpCheckOutput; +// KShellProcess* phpCheckProc; +}; + +#endif diff --git a/languages/php/phphtmlview.cpp b/languages/php/phphtmlview.cpp new file mode 100644 index 00000000..d21a6fa0 --- /dev/null +++ b/languages/php/phphtmlview.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** + phphtmlview.cpp - description + ------------------- + begin : Sat May 26 2001 + copyright : (C) 2001 by + email : + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "phphtmlview.h" + +#include "phpsupportpart.h" +#include "kdevpartcontroller.h" + +PHPHTMLView::PHPHTMLView(PHPSupportPart *part):m_part(part) { + setOptions(CanOpenInNewWindow); +} +PHPHTMLView::~PHPHTMLView(){ +} + +void PHPHTMLView::slotDuplicate( ) +{ + m_part->partController()->showDocument(url(), true); +} + +void PHPHTMLView::slotOpenInNewWindow( const KURL & url ) +{ + m_part->partController()->showDocument(url, true); +} + +#include "phphtmlview.moc" diff --git a/languages/php/phphtmlview.h b/languages/php/phphtmlview.h new file mode 100644 index 00000000..e135cfa7 --- /dev/null +++ b/languages/php/phphtmlview.h @@ -0,0 +1,42 @@ +/*************************************************************************** + phphtmlview.h - description + ------------------- + begin : Sat May 26 2001 + copyright : (C) 2001 by + email : + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef PHPHTMLVIEW_H +#define PHPHTMLVIEW_H + +#include + +/** + *@author + */ +class PHPSupportPart; + +class PHPHTMLView : public KDevHTMLPart { +Q_OBJECT +public: + PHPHTMLView(PHPSupportPart *part); + ~PHPHTMLView(); + +protected slots: + virtual void slotDuplicate(); + virtual void slotOpenInNewWindow(const KURL &url); + +private: + PHPSupportPart *m_part; +}; + +#endif diff --git a/languages/php/phpinfodlg.ui b/languages/php/phpinfodlg.ui new file mode 100644 index 00000000..77de8304 --- /dev/null +++ b/languages/php/phpinfodlg.ui @@ -0,0 +1,87 @@ + +PHPInfoDlg + + + PHPInfoDlg + + + + 0 + 0 + 412 + 301 + + + + PHP Information + + + + unnamed + + + + php_edit + + + + + ok_button + + + &OK + + + true + + + + + Spacer3 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + Spacer4 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + + + ok_button + clicked() + PHPInfoDlg + accept() + + + + kdialog.h + + + + diff --git a/languages/php/phpnewclassdlg.cpp b/languages/php/phpnewclassdlg.cpp new file mode 100644 index 00000000..f17034db --- /dev/null +++ b/languages/php/phpnewclassdlg.cpp @@ -0,0 +1,123 @@ +/*************************************************************************** + phpnewclassdlg.cpp - description + ------------------- + begin : Sat Aug 11 2001 + copyright : (C) 2001 by Sandy Meier + email : smeier@kdevelop.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "phpnewclassdlg.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +PHPNewClassDlg::PHPNewClassDlg(const QStringList& baseClassNames,const QString& directory,QWidget *parent, const char *name) : PHPNewClassDlgBase(parent,name,true) { + m_filenameModified = false; + KCompletion *comp = new KCompletion(); + comp->setItems(baseClassNames); + m_dirEdit->setText(directory); + + // load the class template if available + QString templateFile = KGlobal::instance()->dirs()->findResource("data","kdevphpsupport/newclasstemplate.txt"); + if(!templateFile.isNull()){ + QFile file(templateFile); + QTextStream stream(&file); + if(file.open(IO_ReadOnly)){ + m_classTemplate->setText(stream.read()); + file.close(); + } + } + + + m_baseClassEdit->setCompletionObject( comp ); /// @todo change it to KLineEdit + connect(m_baseClassEdit,SIGNAL(returnPressed(const QString&)),comp,SLOT(addItem(const QString&))); + connect(m_classNameEdit,SIGNAL(textChanged(const QString&)), + this,SLOT(classNameTextChanged(const QString&))); + connect(m_fileNameEdit,SIGNAL(textChanged(const QString&)), + this,SLOT(fileNameTextChanged(const QString&))); + connect(m_dirButton,SIGNAL(clicked()), + this,SLOT(slotDirButtonClicked())); +} +PHPNewClassDlg::~PHPNewClassDlg(){ +} + +void PHPNewClassDlg::slotDirButtonClicked(){ + QString dir = KFileDialog::getExistingDirectory(m_dirEdit->text(),this); + if(!dir.isEmpty()){ + m_dirEdit->setText(dir); + } +} +void PHPNewClassDlg::classNameTextChanged(const QString& str){ + if(!m_filenameModified){ + m_fileNameEdit->setText(str.lower() + ".inc"); + } +} + +void PHPNewClassDlg::fileNameTextChanged(const QString&){ + if(m_fileNameEdit->hasFocus()){ + m_filenameModified = true; + } +} +void PHPNewClassDlg::accept(){ + PHPNewClassDlgBase::accept(); // hide the dialog + + QString text = m_classTemplate->text(); + QString classDir = m_dirEdit->text(); + if(!classDir.endsWith("/")) classDir += "/"; // append / + QString absFileName = classDir + m_fileNameEdit->text(); + + // save the template for the next time + QString templateDir = KGlobal::instance()->dirs()->saveLocation("data") + "/kdevphpsupport/"; + QString templateFile = templateDir + "newclasstemplate.txt"; + QDir dir(templateDir); + if(!dir.exists()){ + if(!dir.mkdir(templateDir)){ + kdWarning() << "Error on creating directory for the classtemplate" << templateDir << endl; + } + } + QFile file(templateFile); + QTextStream stream(&file); + + if(file.open(IO_WriteOnly)){ + stream << text; // write + file.close(); + } + + // generate the sourcecode for the class + if(m_baseClassEdit->text().isEmpty()){ + text = text.replace(QRegExp("extends BASECLASS"),""); + text = text.replace(QRegExp("BASECLASS\\:\\:BASECLASS\\(\\);"),""); + }else{ + text = text.replace(QRegExp("BASECLASS"),m_baseClassEdit->text()); + } + text = text.replace(QRegExp("CLASSNAME"),m_classNameEdit->text()); + text = text.replace(QRegExp("FILENAME"),m_fileNameEdit->text().upper()); + text = text.replace(QRegExp("AUTHOR"),"not implemented"); + + file.setName(absFileName); + if(file.open(IO_WriteOnly)){ + stream << text; // write + file.close(); + } +} + +#include "phpnewclassdlg.moc" diff --git a/languages/php/phpnewclassdlg.h b/languages/php/phpnewclassdlg.h new file mode 100644 index 00000000..d94bfffb --- /dev/null +++ b/languages/php/phpnewclassdlg.h @@ -0,0 +1,42 @@ +/*************************************************************************** + phpnewclassdlg.h - description + ------------------- + begin : Sat Aug 11 2001 + copyright : (C) 2001 by Sandy Meier + email : smeier@kdevelop.org + ***************************************************************************/ + +/*************************************************************************** + * * + * 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 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef PHPNEWCLASSDLG_H +#define PHPNEWCLASSDLG_H + +#include +#include "phpnewclassdlgbase.h" + +/** + *@author Sandy Meier + */ + +class PHPNewClassDlg : public PHPNewClassDlgBase { + Q_OBJECT +public: + PHPNewClassDlg(const QStringList& baseClassNames,const QString& directory,QWidget *parent=0, const char *name=0); + ~PHPNewClassDlg(); + protected slots: + void classNameTextChanged(const QString&); + void fileNameTextChanged(const QString&); + void accept(); + void slotDirButtonClicked(); + protected: + bool m_filenameModified; +}; + +#endif diff --git a/languages/php/phpnewclassdlgbase.ui b/languages/php/phpnewclassdlgbase.ui new file mode 100644 index 00000000..5b4df7c1 --- /dev/null +++ b/languages/php/phpnewclassdlgbase.ui @@ -0,0 +1,201 @@ + +PHPNewClassDlgBase + + + m_ClassDLG + + + + 0 + 0 + 439 + 386 + + + + New Class + + + + unnamed + + + + TextLabel1 + + + Class &name: + + + m_classNameEdit + + + + + Spacer1 + + + Horizontal + + + Expanding + + + + 20 + 20 + + + + + + m_okButton + + + &OK + + + true + + + + + m_cancelButton + + + &Cancel + + + + + m_baseClassEdit + + + + + m_classNameEdit + + + + + TextLabel2 + + + &Base class: + + + m_baseClassEdit + + + + + TextLabel4 + + + Class &template: + + + m_classTemplate + + + + + TextLabel1_2 + + + &Directory: + + + m_dirEdit + + + + + TextLabel3 + + + &File name: + + + m_fileNameEdit + + + + + m_dirButton + + + TabFocus + + + ... + + + + + m_fileNameEdit + + + + + m_dirEdit + + + + + m_classTemplate + + + <?php +if (!defined("FILENAME")){ +define("FILENAME",0); +/* +* @author AUTHOR +*/ + +class CLASSNAME extends BASECLASS { + //constructor + function CLASSNAME(){ + BASECLASS::BASECLASS(); + } + } +} +?> + + + + + + + m_okButton + clicked() + m_ClassDLG + accept() + + + m_cancelButton + clicked() + m_ClassDLG + reject() + + + + m_classNameEdit + m_baseClassEdit + m_fileNameEdit + m_dirEdit + m_dirButton + m_classTemplate + m_okButton + m_cancelButton + + + klineedit.h + kdialog.h + + + + + klineedit.h + + diff --git a/languages/php/phpparser.cpp b/languages/php/phpparser.cpp new file mode 100644 index 00000000..b13c5479 --- /dev/null +++ b/languages/php/phpparser.cpp @@ -0,0 +1,160 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "phpparser.h" +#include "phpsupportpart.h" +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include + +#include "phpsupport_event.h" + +using namespace std; + +PHPParser::PHPParser(PHPSupportPart *part){ + m_part = part; + m_close = false; +} + +PHPParser::~PHPParser(){ + removeAllFiles(); +} + +bool PHPParser::hasFile( const QString& fileName ) +{ +// kdDebug(9018) << "hasFile " << fileName.latin1() << endl; + QString abso = URLUtil::canonicalPath(fileName); + QMap::Iterator it = m_files.find(abso); + + if ( it == m_files.end() ) + return false; + return true; +} + +void PHPParser::addFile( const QString& fileName ) +{ + QString abso = URLUtil::canonicalPath(fileName); + + if ( hasFile(abso) ) + return; + + kdDebug(9018) << "addFile " << fileName.latin1() << endl; + + QFileInfo fi( abso ); + if ((fi.extension().contains("inc") || fi.extension().contains("php") || fi.extension().contains("html") || fi.extension().contains("php3") || !fi.extension()) && !fi.extension().contains("~")) { + m_files.insert(abso, new PHPFile(m_part, abso)); + } +} + +void PHPParser::removeFile( const QString& fileName ) +{ +// kdDebug(9018) << "removeFile " << fileName.latin1() << endl; + QString abso = URLUtil::canonicalPath(fileName); + QMap::Iterator it = m_files.find(abso); + + if ( it != m_files.end()) { + PHPFile *file = it.data(); + m_files.remove( abso ); + delete( file ); + file = 0; + } +} + +void PHPParser::removeAllFiles() +{ + kdDebug(9018) << "removeAllFiles" << endl; + QMap::Iterator it = m_files.begin(); + + while( it != m_files.end() ){ + PHPFile * file = it.data(); + ++it; + delete( file ); + file = 0; + } + m_files.clear(); +} + +void PHPParser::reparseFile( const QString& fileName ) +{ + kdDebug(9018) << "reparseFile" << endl; + QString abso = URLUtil::canonicalPath(fileName); + QMap::Iterator it = m_files.find(abso); + + if ( it != m_files.end()) { + PHPFile *file = it.data(); + file->setModified(true); + file = 0; + } + m_canParse.wakeAll(); +} + +void PHPParser::run() { + kdDebug(9018) << "run thread " << QThread::currentThread() << endl; + QMap::Iterator it; + + while ( !m_close ) { + m_canParse.wait(); + + if ( m_close ) + break; + + it = m_files.begin(); + + while( it != m_files.end() ){ + PHPFile * file = it.data(); + if (!m_close) { + if ( file->isModified() ) { + file->Analyse(); + it = m_files.begin(); + } else { + ++it; + } + file = 0; + } else { + it = m_files.end(); + } + } + } +} + +void PHPParser::close() +{ + kdDebug(9018) << "closing thread" << endl; + m_close = true; + m_canParse.wakeAll(); + + while (running()) { + kapp->processEvents(); + } +} + +void PHPParser::startParse() { + kdDebug(9018) << "startParse" << endl; + m_canParse.wakeAll(); +} diff --git a/languages/php/phpparser.h b/languages/php/phpparser.h new file mode 100644 index 00000000..c5d7e378 --- /dev/null +++ b/languages/php/phpparser.h @@ -0,0 +1,73 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef PHPPARSER_H +#define PHPPARSER_H + +#include + +#if QT_VERSION < 0x030100 +#include +#else +#include +#endif + +#include + +#include +#include +#include + +#include "phpfile.h" + +class KDevCore; +class PHPSupportPart; + +/** + *@author Sandy Meier + */ + +class PHPParser: public QThread { + +public: + PHPParser(PHPSupportPart *part); + ~PHPParser(); + + void addFile( const QString& fileName ); + bool hasFile( const QString& fileName ); + void reparseFile( const QString& fileName ); + void removeFile( const QString& fileName ); + void removeAllFiles(); + + void run(); + void close(); + void startParse(); + +private: + CodeModel* m_model; + KDevCore* m_core; + PHPSupportPart* m_part; + + QMutex m_mutex; + QWaitCondition m_canParse; + bool m_close; + QMap m_files; +}; + + +#endif diff --git a/languages/php/phpsupport_event.h b/languages/php/phpsupport_event.h new file mode 100644 index 00000000..4a1a175b --- /dev/null +++ b/languages/php/phpsupport_event.h @@ -0,0 +1,110 @@ +/* + Copyright (C) 2003 by Roberto Raggi + Copyright (C) 2005 by Nicolas Escuder + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __phpsupport_events_h +#define __phpsupport_events_h + +#include +#include + +#if QT_VERSION < 0x030100 +#include +#else +#include +#endif + +enum +{ + Event_AddFile = QEvent::User + 1000, + Event_StartParse, + Event_EndParse, + Event_AddClass, + Event_SetClass, + Event_CloseClass, + Event_AddFunction, + Event_SetFunction, + Event_CloseFunction, + Event_AddVariable, + Event_SetVariable, + Event_AddTodo, + Event_AddFixme +}; + +class FileParseEvent: public QCustomEvent +{ +public: + FileParseEvent(long event, const QString& fileName ) + : QCustomEvent(event), m_fileName( fileName ) + { + m_name = ""; + m_arguments = ""; + m_position = 0; + m_global = FALSE; + } + + FileParseEvent(long event, const QString& fileName, int position ) + : QCustomEvent(event), m_fileName( fileName ), m_position( position ) + { + m_name = ""; + m_arguments = ""; + m_global = FALSE; + } + + FileParseEvent(long event, const QString& fileName, const QString& name, const QString& arguments ) + : QCustomEvent(event), m_fileName( fileName ), m_name( name ), m_arguments( arguments ) + { + m_position = 0; + m_global = FALSE; + } + + FileParseEvent(long event, const QString& fileName, const QString& name, const QString& arguments, int position ) + : QCustomEvent(event), m_fileName( fileName ), m_name( name ), m_arguments( arguments ), m_position( position ) + { + m_global = FALSE; + } + + FileParseEvent(long event, const QString& fileName, const QString& name, const QString& arguments, int position, bool global ) + : QCustomEvent(event), m_fileName( fileName ), m_name( name ), m_arguments( arguments ), m_position( position ), m_global( global ) + { + } + + ~FileParseEvent() + { + } + + QString fileName() const { return m_fileName; } + QString name() const { return m_name; } + QString arguments() const { return m_arguments; } + int posititon() const { return m_position; } + bool global() const { return m_global; } + +private: + QString m_fileName; + QString m_name; + QString m_arguments; + QString m_accesstype; + int m_position; + bool m_global; + +private: + FileParseEvent( const FileParseEvent& source ); + void operator = ( const FileParseEvent& source ); +}; + +#endif // __phpsupport_events_h diff --git a/languages/php/phpsupportpart.cpp b/languages/php/phpsupportpart.cpp new file mode 100644 index 00000000..4c4de794 --- /dev/null +++ b/languages/php/phpsupportpart.cpp @@ -0,0 +1,751 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + Copyright (C) 2001 by smeier@kdevelop.org + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "phpsupportpart.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "phpconfigdata.h" +#include "phpconfigwidget.h" +#include "phpcodecompletion.h" +#include "phpparser.h" +#include "phpnewclassdlg.h" + + +#include "phphtmlview.h" +#include "phperrorview.h" + +#include "phpsupport_event.h" + +using namespace std; + +static const KDevPluginInfo data("kdevphpsupport"); +K_EXPORT_COMPONENT_FACTORY( libkdevphpsupport, PHPSupportFactory( data ) ) + +PHPSupportPart::PHPSupportPart(QObject *parent, const char *name, const QStringList &) + : KDevLanguageSupport(&data, parent, name ? name : "PHPSupportPart") +{ + m_htmlView = 0; + m_parser = 0; + phpExeProc = 0; + setInstance(PHPSupportFactory::instance()); + + setXMLFile("kdevphpsupport.rc"); + + connect( core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()) ); + connect( core(), SIGNAL(projectClosed()), this, SLOT(projectClosed()) ); + connect( partController(), SIGNAL(savedFile(const KURL&)), + this, SLOT(savedFile(const KURL&)) ); + connect( core(), SIGNAL(projectConfigWidget(KDialogBase*)), + this, SLOT(projectConfigWidget(KDialogBase*)) ); + + KAction *action; + + action = new KAction( i18n("&Run"), "exec",Key_F9, + this, SLOT(slotRun()), + actionCollection(), "build_execute" ); + action->setToolTip(i18n("Run")); + action->setWhatsThis(i18n("Run

Executes script on a terminal or a webserver.")); + + action = new KAction( i18n("&New Class..."),0, + this, SLOT(slotNewClass()), + actionCollection(), "project_new_class" ); + action->setToolTip(i18n("New class")); + action->setWhatsThis(i18n("New class

Runs New Class wizard.")); + + m_phpErrorView = new PHPErrorView(this, 0, "phpErrorWidget"); + m_phpErrorView->setIcon( SmallIcon("info") ); + + QWhatsThis::add(m_phpErrorView, i18n("PHP problems

This view shows PHP parser warnings, errors, and fatal errors.")); + mainWindow()->embedOutputView(m_phpErrorView, i18n("Problems"), i18n("Problems")); + + phpExeProc = new KShellProcess("/bin/sh"); + connect( phpExeProc, SIGNAL(receivedStdout (KProcess*, char*, int)), + this, SLOT(slotReceivedPHPExeStdout (KProcess*, char*, int))); + connect( phpExeProc, SIGNAL(receivedStderr (KProcess*, char*, int)), + this, SLOT(slotReceivedPHPExeStderr (KProcess*, char*, int))); + connect( phpExeProc, SIGNAL(processExited(KProcess*)), + this, SLOT(slotPHPExeExited(KProcess*))); + + m_htmlView = new PHPHTMLView(this); + mainWindow()->embedOutputView(m_htmlView->view(), i18n("PHP"), i18n("PHP")); + connect( m_htmlView, SIGNAL(started(KIO::Job*)), + this, SLOT(slotWebJobStarted(KIO::Job*))); + + configData = new PHPConfigData(projectDom()); + connect( configData, SIGNAL(configStored()), + this, SLOT(slotConfigStored())); + + m_codeCompletion = new PHPCodeCompletion(this, configData); + + new KAction(i18n("Complete Text"), CTRL+Key_Space, m_codeCompletion, SLOT(cursorPositionChanged()), actionCollection(), "edit_complete_text"); + + connect( partController(), SIGNAL(activePartChanged(KParts::Part*)), + this, SLOT(slotActivePartChanged(KParts::Part *))); + connect( this, SIGNAL(fileParsed( PHPFile* )), this, SLOT(slotfileParsed( PHPFile* ))); +} + +PHPSupportPart::~PHPSupportPart() +{ + LastClass = NULL; + LastMethod = NULL; + LastVariable = NULL; + + if ( m_parser ) { + m_parser->close() ; + delete( m_parser ); + m_parser = NULL; + } + + if ( m_phpErrorView ) { + mainWindow()->removeView( m_phpErrorView ); + delete( m_phpErrorView ); + m_phpErrorView = NULL; + } + + kdDebug(9018) << "remove codeCompletition" << endl; + if ( m_codeCompletion ) + delete( m_codeCompletion ); + + kdDebug(9018) << "remove configData" << endl; + if ( configData ) + delete( configData ); + + if ( m_htmlView ) { + kdDebug(9018) << "remove htmlView" << endl; + mainWindow()->removeView( m_htmlView->view() ); + delete( m_htmlView ); + m_htmlView = NULL; + } + + kdDebug(9018) << "remove phpExec" << endl; + if ( phpExeProc ) + delete( phpExeProc ); + + kdDebug(9018) << "finish" << endl; +} + +void PHPSupportPart::slotActivePartChanged(KParts::Part *part) { + kdDebug(9018) << "enter slotActivePartChanged" << endl; + if (!part || !part->widget()) + return; + m_editInterface = dynamic_cast(part); + if (m_editInterface) { // connect to the editor + disconnect(part, 0, this, 0 ); // to make sure that it is't connected twice + if (configData->getRealtimeParsing()) { + connect(part,SIGNAL(textChanged()),this,SLOT(slotTextChanged())); + } + m_codeCompletion->setActiveEditorPart(part); + } + kdDebug(9018) << "exit slotActivePartChanged" << endl; +} + +void PHPSupportPart::slotTextChanged() { + kdDebug(9018) << "enter text changed" << endl; + + KParts::ReadOnlyPart *ro_part = dynamic_cast(partController()->activePart()); + if (!ro_part) + return; + + QString fileName = ro_part->url().directory() + "/" + ro_part->url().fileName(); + + if (m_parser) { + if (m_parser->hasFile( fileName )) + m_parser->reparseFile( fileName ); + } +} + +void PHPSupportPart::slotConfigStored() { + // fake a changing, this will read the configuration again and install the connects + slotActivePartChanged(partController()->activePart()); +} + +void PHPSupportPart::projectConfigWidget(KDialogBase *dlg) { + QVBox *vbox = dlg->addVBoxPage(i18n( "PHP Specific" ), i18n("PHP Settings"), BarIcon( "source", KIcon::SizeMedium )); + PHPConfigWidget* w = new PHPConfigWidget(configData,vbox, "php config widget"); + connect( dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); +} + +void PHPSupportPart::slotNewClass() { + QStringList classNames = sortedNameList( codeModel()->globalNamespace()->classList() ); + PHPNewClassDlg dlg(classNames,project()->projectDirectory()); + dlg.exec(); + } + +void PHPSupportPart::slotRun() { + configData = new PHPConfigData(projectDom()); + if (validateConfig()) { + mainWindow()->raiseView(m_htmlView->view()); + PHPConfigData::InvocationMode mode = configData->getInvocationMode() ; + if (mode == PHPConfigData::Web) { + executeOnWebserver(); + } + else if (mode == PHPConfigData::Shell) { + executeInTerminal(); + } + } +} + +bool PHPSupportPart::validateConfig() { + if (!configData->validateConfig()) { + KMessageBox::information(0,i18n("There is no configuration for executing a PHP file.\nPlease set the correct values in the next dialog.")); + KDialogBase dlg(KDialogBase::TreeList, i18n("Customize PHP Mode"), + KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, 0, + "php config dialog"); + + QVBox *vbox = dlg.addVBoxPage(i18n("PHP Settings")); + PHPConfigWidget* w = new PHPConfigWidget(configData,vbox, "php config widget"); + connect( &dlg, SIGNAL(okClicked()), w, SLOT(accept()) ); + dlg.exec(); + } + if (configData->validateConfig()) { + return true; + } + return false; +} + +void PHPSupportPart::executeOnWebserver() { + // Save all files once + if (partController()->saveAllFiles()==false) + return; //user cancelled + + // Figure out the name of the remote file + QString weburl = configData->getWebURL(); + QString file = getExecuteFile(); + + // Force KHTMLPart to reload the page + KParts::BrowserExtension* be = m_htmlView->browserExtension(); + if (be) { + KParts::URLArgs urlArgs( be->urlArgs() ); + urlArgs.reload = true; + be->setURLArgs( urlArgs ); + } + + // Acutally do the request + m_phpExeOutput=""; + m_htmlView->openURL(KURL(weburl + file)); + m_htmlView->show(); +} + +QString PHPSupportPart::getExecuteFile() { + QString file; + PHPConfigData::StartupFileMode mode = configData->getStartupFileMode(); + + QString weburl = configData->getWebURL(); + if (mode == PHPConfigData::Current) { + KParts::ReadOnlyPart *ro_part = dynamic_cast(partController()->activePart()); + if (ro_part) { + if ( configData->getInvocationMode() == PHPConfigData::Web ) + file = URLUtil::relativePath( project()->projectDirectory(), ro_part->url().path() ); + else + file = ro_part->url().path(); + } + } + if (mode == PHPConfigData::Default) { + file = configData->getStartupFile(); + } + return file; +} + +void PHPSupportPart::slotWebJobStarted(KIO::Job* job) { + if (job && job->className() == QString("KIO::TransferJob")) { + kdDebug(9018) << endl << "job started" << job->progressId(); + KIO::TransferJob *tjob = static_cast(job); + connect( tjob, SIGNAL(data(KIO::Job*, const QByteArray&)), + this, SLOT(slotWebData(KIO::Job*, const QByteArray&))); + connect( tjob, SIGNAL(result(KIO::Job*)), + this, SLOT(slotWebResult(KIO::Job*))); + } +} + +void PHPSupportPart::slotWebData(KIO::Job* /*job*/,const QByteArray& data) { + kdDebug(9018) << "slotWebData()" << endl; + QString strData(data); + m_phpExeOutput += strData; +} + +void PHPSupportPart::slotWebResult(KIO::Job* /*job*/) { + kdDebug(9018) << "slotWebResult()" << endl; + QString file = getExecuteFile(); + PHPFile *pfile = new PHPFile(this, file); + pfile->ParseStdout(m_phpExeOutput); + delete pfile; +} + +void PHPSupportPart::executeInTerminal() { + kdDebug(9018) << "slotExecuteInTerminal()" << endl; + + // Save all files once + if (partController()->saveAllFiles()==false) + return; //user cancelled + + QString file = getExecuteFile(); + + if (m_htmlView == 0) { + m_htmlView = new PHPHTMLView(this); + mainWindow()->embedOutputView(m_htmlView->view(), i18n("PHP"), i18n("PHP") ); + } + + m_htmlView->show(); + m_htmlView->begin(); + + m_phpExeOutput = ""; + phpExeProc->clearArguments(); + *phpExeProc << configData->getPHPExecPath(); + *phpExeProc << "-f"; + + *phpExeProc << KShellProcess::quote(file); + kdDebug(9018) << "" << file.latin1() << endl; + phpExeProc->start(KProcess::NotifyOnExit,KProcess::All); + + // core()->gotoDocumentationFile(KURL("http://www.php.net")); +} + +void PHPSupportPart::slotReceivedPHPExeStdout (KProcess* /*proc*/, char* buffer, int buflen) { + kdDebug(9018) << "slotPHPExeStdout()" << endl; + m_phpExeOutput += QString::fromLocal8Bit(buffer,buflen+1); + + QString buf = buffer; + if (configData->getInvocationMode() == PHPConfigData::Shell) + buf.replace("\n", "
"); + m_htmlView->write(buf); +} + +void PHPSupportPart::slotReceivedPHPExeStderr (KProcess* /*proc*/, char* buffer, int buflen) { + kdDebug(9018) << "slotPHPExeStderr()" << endl; + m_phpExeOutput += QString::fromLocal8Bit(buffer,buflen+1); + + QString buf = buffer; + if (configData->getInvocationMode() == PHPConfigData::Shell) + buf.replace("\n", "
"); + m_htmlView->write(buf); +} + +void PHPSupportPart::slotPHPExeExited (KProcess* /*proc*/) { + kdDebug(9018) << "slotPHPExeExited()" << endl; + m_htmlView->end(); + QString file = getExecuteFile(); + PHPFile *pfile = new PHPFile(this, file); + pfile->ParseStdout(m_phpExeOutput); + delete pfile; +} + +void PHPSupportPart::projectOpened() +{ + kdDebug(9018) << "projectOpened()" << endl; + + connect( project(), SIGNAL(addedFilesToProject(const QStringList &)), + this, SLOT(addedFilesToProject(const QStringList &)) ); + connect( project(), SIGNAL(removedFilesFromProject(const QStringList &)), + this, SLOT(removedFilesFromProject(const QStringList &)) ); + + if (!m_parser) { + m_parser = new PHPParser( this ); + m_parser->start(); + } + + // We want to parse only after all components have been + // properly initialized + QTimer::singleShot(500, this, SLOT( initialParse() ) ); +} + +void PHPSupportPart::initialParse( ) +{ + // For debugging + if ( !project( ) ) + { + // messagebox ? + kdDebug( 9018 ) << "No project" << endl; + return ; + } + + parseProject( ); + return ; +} + +void PHPSupportPart::projectClosed() +{ + kdDebug(9018) << "projectClosed()" << endl; + + if (m_parser) { + m_parser->close() ; + delete( m_parser ); + m_parser = 0; + } +} + +bool PHPSupportPart::parseProject() +{ + kdDebug(9018) << "parseProject()" << endl; + mainWindow() ->statusBar() ->message( i18n( "Updating..." ) ); + + kapp->setOverrideCursor( waitCursor ); + + _jd = new JobData; + + _jd->files = project()->allFiles(); + + QProgressBar* bar = new QProgressBar( _jd->files.count( ), mainWindow( ) ->statusBar( ) ); + bar->setMinimumWidth( 120 ); + bar->setCenterIndicator( true ); + mainWindow()->statusBar()->addWidget( bar ); + bar->show(); + + _jd->progressBar = bar; + _jd->it = _jd->files.begin(); + _jd->dir.setPath( project()->projectDirectory() ); + + QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) ); + return TRUE; +} + +void PHPSupportPart::slotParseFiles() +{ + kdDebug(9018) << "slotParseFiles()" << endl; + + kapp->lock(); + + if ( _jd->it != _jd->files.end() ) + { + _jd->progressBar->setProgress( _jd->progressBar->progress() + 1 ); + + QFileInfo fileInfo( _jd->dir, *( _jd->it ) ); + + if ( fileInfo.exists() && fileInfo.isFile() && fileInfo.isReadable() ) + { + QString absFilePath = URLUtil::canonicalPath( fileInfo.absFilePath() ); + +// if ( isValidSource( absFilePath ) ) + { + if (m_parser) + m_parser->addFile( absFilePath ); + } + + ++( _jd->it ); + } + QTimer::singleShot( 0, this, SLOT( slotParseFiles() ) ); + } + else // finished or interrupted + { + kapp->restoreOverrideCursor(); + mainWindow()->statusBar()->removeWidget( _jd->progressBar ); + mainWindow()->statusBar()->message( i18n( "Done" ), 2000 ); + + emit updatedSourceInfo(); + if (m_parser) + m_parser->startParse(); + + delete _jd; + _jd = 0; + } + + kapp->unlock(); +} + +void PHPSupportPart::addedFilesToProject(const QStringList &fileList) +{ + kdDebug(9018) << "addedFilesToProject()" << endl; + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + QFileInfo fileInfo( project()->projectDirectory(), *it ); + if (m_parser) { + m_parser->addFile( fileInfo.absFilePath() ); + emit addedSourceInfo( fileInfo.absFilePath() ); + } + } +} + +void PHPSupportPart::removedFilesFromProject(const QStringList &fileList) +{ + kdDebug(9018) << "removedFilesFromProject()" << endl; + + QStringList::ConstIterator it; + + for ( it = fileList.begin(); it != fileList.end(); ++it ) + { + QFileInfo fileInfo( project()->projectDirectory(), *it ); + QString path = fileInfo.absFilePath(); + if ( codeModel()->hasFile(path) ) { + emit aboutToRemoveSourceInfo( path ); + codeModel()->removeFile( codeModel()->fileByName(path) ); + } + } +} + +void PHPSupportPart::savedFile(const KURL &fileName) +{ + kdDebug(9018) << "savedFile()" << fileName.fileName() << endl; +/// @fixme when activated could cause stop +/* + if (m_parser) { + if (m_parser->hasFile( fileName.path() )) { + m_parser->reparseFile( fileName.path() ); + } + } +*/ +} + +QString PHPSupportPart::getIncludePath() +{ + return configData->getPHPIncludePath(); +} + +QString PHPSupportPart::getExePath() +{ + return configData->getPHPExecPath(); +} + +KDevLanguageSupport::Features PHPSupportPart::features() +{ + return Features(Classes | Functions); +} + +KMimeType::List PHPSupportPart::mimeTypes( ) +{ + KMimeType::List list; + KMimeType::Ptr mime = KMimeType::mimeType( "application/x-php" ); + if ( mime ) + list << mime; + + mime = KMimeType::mimeType( "text/plain" ); + if ( mime ) + list << mime; + return list; +} + +void PHPSupportPart::customEvent( QCustomEvent* ev ) +{ +// kdDebug(9018) << "phpSupportPart::customEvent(" << ev->type() << ") " << QThread::currentThread() << endl; + + if ( ev->type() < Event_AddFile || ev->type() > Event_AddFixme ) + return; + + kapp->lock(); + + FileParseEvent* event = (FileParseEvent*) ev; + NamespaceDom ns = codeModel()->globalNamespace(); + FileDom m_file = codeModel()->fileByName( event->fileName() ); + + if (!m_file) { + m_file = codeModel()->create(); + m_file->setName( event->fileName() ); + codeModel()->addFile( m_file ); + } + + switch (int(ev->type())) { + case Event_AddFile: + m_parser->addFile( event->fileName() ); + break; + + case Event_StartParse: +// kdDebug(9018) << "StartParse " << event->fileName() << endl; + LastClass = NULL; + LastMethod = NULL; + LastVariable = NULL; + if ( codeModel()->hasFile( event->fileName() ) ) { + emit aboutToRemoveSourceInfo( event->fileName() ); + codeModel()->removeFile( codeModel()->fileByName( event->fileName() ) ); + emit removedSourceInfo( event->fileName() ); + } + ErrorView()->removeAllProblems( event->fileName() ); + break; + + case Event_AddClass: + { +// kdDebug(9018) << "AddClass " << event->name() << endl; + ClassDom nClass = codeModel()->create(); + nClass->setFileName( event->fileName() ); + nClass->setName( event->name() ); + nClass->setStartPosition( event->posititon(), 0); + + m_file->addClass( nClass ); + if ( event->arguments().isEmpty() != TRUE ) + nClass->addBaseClass( event->arguments() ); + + ns->addClass( nClass ); + LastClass = nClass; + } + break; + + case Event_CloseClass: + if ( LastClass != NULL ) { +// kdDebug(9018) << "CloseClass " << LastClass->name() << endl; + LastClass->setEndPosition( event->posititon(), 0 ); + LastClass = NULL; + LastMethod = NULL; + LastVariable = NULL; + } + break; + + case Event_AddFunction: + { +// kdDebug(9018) << "AddFunction " << event->name() << endl; + FunctionDom nMethod = codeModel()->create(); + nMethod->setFileName( event->fileName() ); + nMethod->setName( event->name() ); + nMethod->setStartPosition( event->posititon(), 0 ); + + ArgumentDom nArgument; + nArgument = codeModel()->create(); + nArgument->setType(event->arguments().stripWhiteSpace().local8Bit()); + nMethod->addArgument( nArgument ); + + if (LastClass != NULL) { + LastClass->addFunction(nMethod); + } else { + ns->addFunction(nMethod); + } + LastMethod = nMethod; + } + break; + + case Event_SetFunction: + if ( LastMethod != NULL ) { +// kdDebug(9018) << "SetFunction " << LastMethod->name() << " " << event->name() << endl; + if ( event->name() == "static" ) + LastMethod->setStatic(true); + else if ( event->name() == "abstract" ) + LastMethod->setAbstract(true); + else if ( event->name() == "private" ) + LastMethod->setAccess(FunctionModel::Private); + else if ( event->name() == "public" ) + LastMethod->setAccess(FunctionModel::Public); + else if ( event->name() == "protected" ) + LastMethod->setAccess(FunctionModel::Protected); + else if ( event->name() == "result" ) { + QString ret = ""; + if (event->arguments().lower() == "$this" && LastClass ) { + ret = LastClass->name(); + } + LastMethod->setResultType(ret); + } + } + break; + + case Event_CloseFunction: + if ( LastMethod != NULL ) { +// kdDebug(9018) << "CloseFunction " << LastMethod->name() << endl; + LastMethod->setEndPosition( event->posititon(), 0 ); + LastMethod = NULL; + LastVariable = NULL; + } + break; + + case Event_AddVariable: + { + VariableDom nVariable = codeModel()->create(); + + nVariable->setFileName( event->fileName() ); + nVariable->setName( event->name() ); + nVariable->setStartPosition( event->posititon(), 0 ); + nVariable->setAccess(VariableModel::Public); + + if ( event->arguments().isEmpty() != TRUE ) + nVariable->setType( event->arguments() ); + + if ( LastClass != NULL && ( LastMethod == NULL || event->global() == TRUE ) ) { +// kdDebug(9018) << "AddVariable To Class " << LastClass->name() << " " << nVariable->name() << endl; + LastClass->addVariable(nVariable); + } else { + if ( LastMethod != NULL ) { + kdDebug(9018) << "AddVariable " << LastMethod->name() << " " << nVariable->name() << endl; + } else { + ns->addVariable(nVariable); + } + } + LastVariable = nVariable; + } + break; + + case Event_SetVariable: + if ( LastVariable != NULL ) { +// kdDebug(9018) << "SetVariable " << LastVariable->name() << " " << event->arguments() << endl; + if ( event->arguments() == "static" ) + LastVariable->setStatic(true); + else if ( event->arguments() == "private" ) + LastVariable->setAccess(FunctionModel::Private); + else if ( event->arguments() == "public" ) + LastVariable->setAccess(FunctionModel::Public); + else if ( event->arguments() == "protected" ) + LastVariable->setAccess(FunctionModel::Protected); + } + break; + + case Event_AddTodo: + ErrorView()->reportProblem(Todo, event->fileName(), event->posititon(), event->arguments()); + break; + + case Event_AddFixme: + ErrorView()->reportProblem(Fixme, event->fileName(), event->posititon(), event->arguments()); + break; + + case Event_EndParse: +// kdDebug(9018) << "EndParse " << event->fileName() << endl; + emit addedSourceInfo( event->fileName() ); + break; + + } + + kapp->unlock(); + kapp->processEvents(); +} + +PHPErrorView *PHPSupportPart::ErrorView( ) { + return m_phpErrorView; +} + +PHPParser *PHPSupportPart::Parser( ) { + return m_parser; +} + +#include "phpsupportpart.moc" diff --git a/languages/php/phpsupportpart.h b/languages/php/phpsupportpart.h new file mode 100644 index 00000000..83478283 --- /dev/null +++ b/languages/php/phpsupportpart.h @@ -0,0 +1,133 @@ +/* + Copyright (C) 2005 by Nicolas Escuder + Copyright (C) 2001 by smeier@kdevelop.org + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + version 2, License as published by the Free Software Foundation. + + This library 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _PHPSUPPORTPART_H_ +#define _PHPSUPPORTPART_H_ + +#include +#include +#include + +#include +#include "kdevlanguagesupport.h" +#include +#include + +#include + +class QStringList; +class PHPHTMLView; +class KShellProcess; +class KProcess; +class PHPErrorView; +class PHPConfigData; +class PHPCodeCompletion; +class PHPParser; +class PHPFile; + +class PHPSupportPart : public KDevLanguageSupport +{ + Q_OBJECT + +public: + PHPSupportPart( QObject *parent, const char *name, const QStringList & ); + ~PHPSupportPart(); + + PHPErrorView *ErrorView(); + PHPParser *Parser( ) ; + + QString getIncludePath(); + QString getExePath(); + + void emitFileParsed( PHPFile *file ); + virtual void customEvent( QCustomEvent* ev ); + +protected: + virtual Features features(); + virtual KMimeType::List mimeTypes(); + +private slots: + void projectOpened(); + void projectClosed(); + void savedFile(const KURL &fileName); + void addedFilesToProject(const QStringList &fileList); + void removedFilesFromProject(const QStringList &fileList); + void slotRun(); + void slotNewClass(); + void projectConfigWidget(KDialogBase *dlg); + void slotReceivedPHPExeStderr (KProcess* proc, char* buffer, int buflen); + void slotReceivedPHPExeStdout (KProcess* proc, char* buffer, int buflen); + void slotPHPExeExited (KProcess* proc); + void slotWebData(KIO::Job* job,const QByteArray& data); + void slotWebResult(KIO::Job* job); + void slotWebJobStarted(KIO::Job* job); + + // Internal + void initialParse(); + void slotParseFiles(); + bool parseProject(); + + void slotActivePartChanged(KParts::Part *part); + void slotTextChanged(); + /* the configuration was written, mostly after a config dialog call + -> reorder connects + */ + void slotConfigStored(); + +private: + QString getExecuteFile(); + void executeOnWebserver(); + void executeInTerminal(); + bool validateConfig(); + + PHPHTMLView* m_htmlView; + PHPErrorView* m_phpErrorView; + KShellProcess* phpExeProc; + QString m_phpExeOutput; + PHPConfigData* configData; + PHPCodeCompletion* m_codeCompletion; + PHPParser* m_parser; + KTextEditor::EditInterface *m_editInterface; + + struct JobData + { + QDir dir; + QGuardedPtr progressBar; + QStringList::Iterator it; + QStringList files; + QMap< QString, QPair > pcs; + QDataStream stream; + QFile file; + + ~JobData() + { + delete progressBar; + } + }; + + JobData * _jd; + + ClassDom LastClass; + FunctionDom LastMethod; + VariableDom LastVariable; +}; + +typedef KDevGenericFactory PHPSupportFactory; + +#endif diff --git a/languages/php/phptemplates b/languages/php/phptemplates new file mode 100644 index 00000000..3be3d265 --- /dev/null +++ b/languages/php/phptemplates @@ -0,0 +1,4 @@ + + +