![]() |
Re: PHP Inspection Unit
Zitat:
Ahja, habe gerade den Thread Deines Programmes gelesen und da bin ich auf Folgendes gestoßen: Zitat:
Werde den auch noch beheben. mfG mirage228 |
Re: PHP Inspection Unit
Zitat:
mfg, mh166 |
Re: PHP Inspection Unit
Zitat:
Also mit der neuen Version bin ich weitesgehend fertig, morgen früh lade ich es dann hoch - falls ihr nichts zu beanstanden habt :) mfG mirage228 |
Re: PHP Inspection Unit
Hi,
Jetzt gibt es wieder was Spannendes, mit Spiel und Schokolade :mrgreen: - Es ist die Version 1.9 :) Folgende Fehler habe ich berichtigt:
Die Downloads befinden sich, wie immer, im ersten Beitrag :) mfG mirage228 |
Re: PHP Inspection Unit
Guten Tag,
Also die version gefällt mir jetzt :) Werde es noch weiter Testen mal schauen. mfg, DSeven |
Re: PHP Inspection Unit
Guten Tag,
So habe einen Fehler gefunden. Undzwar funktioniert FindEntityAt immernoch nicht richtig. Ich bekomme im folgenden Code bei der aller letzten Funktion, die Funktion test ein nil zurück.
Code:
Ahja und hier der link zu den globalen Konstanten:
<?php
include('FJ'); class sql { // Variablen werden Deklariert var $server; var $user; var $pw; var $db; var $query; var $result; var $zaehler; // Funktion um eine Verbindung mit MySQL zu erstellen // und eine Datenbank auszuwählen function sql ($sql_server, $sql_user, $sql_pw, $sql_db) { // Variablen werden gesetzt // um sie in der class zu benutzen $this ->server = $sql_server; $this ->user = $sql_user; $this ->pw = $sql_pw; $this ->db = $sql_db; // Verbindung wird gesetzt Handle an Variable übergeben $connect = @mysql_connect($this ->server, $this ->user, $this ->pw); // Verbindung wird überprüft if (!($connect)) { // Falls keine Verbindung hergestellt werden konnte // wird ein Hinweis angezeigt echo "Keine News"; // exit; } else { // Falls Verbindung erfolgreich // wird die Datenbank ausgewählt @mysql_select_db($this ->db); return true; } } // Funktion zum verarbeiten von querys function myquery($query) { $this ->query = mysql_query($query); If ($this ->query) return True; else return False; } // Funktion zur leichteren Handhabung von // mysql_fetch Array function fetchArray($query) { $this ->query = mysql_query($query); $this ->result = mysql_fetch_array($this ->query); return $this ->result; } // Funktion zum auslesen des ganzen // Inhaltes protected function fetchMultiple($query) { $this ->query = @mysql_query($query); $this ->zaehler = 0; while ($this ->result = mysql_fetch_array($this ->query)) { $this->result_multiple[$this->zaehler] = array($this->result); $this->zaehler++; } return $this->result_multiple; } // MySQL Verbindung wird geschlossen private function close() { if (@mysql_close()) return True; else return False; } } ?> <?php class BaseClass { function __construct() { print "In BaseClass constructor\n"; } } class SubClass extends BaseClass { function __construct() { parent::__construct(); print "In SubClass constructor\n"; } } $obj = new BaseClass(); $obj = new SubClass(); ?> <?php class MyClass { public $public = "MyClass::public!\n"; protected $protected = "MyClass::Protected!\n"; protected $protected2 = "MyClass::Protected2!\n"; private $private = "MyClass::private!\n"; function printHello() { print "MyClass::printHello() " . $this->private; print "MyClass::printHello() " . $this->protected; print "MyClass::printHello() " . $this->protected2; } } class MyClass2 extends MyClass { protected $protected = "MyClass2::protected!\n"; function printHello() { MyClass::printHello(); print "MyClass2::printHello() " . $this->public; print "MyClass2::printHello() " . $this->protected; print "MyClass2::printHello() " . $this->protected2; /* Will result in a Fatal Error: */ //print "MyClass2::printHello() " . $this->private; /* Fatal Error */ } } $obj = new MyClass(); print "Main:: " . $obj->public; //print $obj->private; /* Fatal Error */ //print $obj->protected; /* Fatal Error */ //print $obj->protected2; /* Fatal Error */ $obj->printHello(); /* Should print */ $obj2 = new MyClass2(); print "Main:: " . $obj2->private; /* Undefined */ //print $obj2->protected; /* Fatal Error */ //print $obj2->protected2; /* Fatal Error */ $obj2->printHello(); ?> <?php abstract class AbstractClass { /* Force Extending class to define this method */ abstract protected function getValue(); /* Common method */ public function print2() { print $this->getValue(); } } class ConcreteClass1 extends AbstractClass { protected function getValue() { return "ConcreteClass1"; } } class ConcreteClass2 extends AbstractClass { protected function getValue() { return "ConcreteClass2"; } } $class1 = new ConcreteClass1; $class1->print2(); $class2 = new ConcreteClass2; $class2->print2(); ?> <?php interface ITemplate { public function setVariable($name, $var); public function getHtml($template); } class Template implements ITemplate { private $vars = array(); public function setVariable($name, $var) { $this->vars[$name] = $var; } public function getHtml($template) { foreach($this->vars as $name => $value) { $template = str_replace('{'.$name.'}', $value, $template); } return $template; } } ?> <?php class Setter { public $n; private $x = array("a" => 1, "b" => 2, "c" => 3); function __get($nm) { print "Getting [$nm]\n"; if (isset($this->x[$nm])) { $r = $this->x[$nm]; print "Returning: $r\n"; return $r; } else { print "Nothing!\n"; } } function __set($nm, $val) { print "Setting [$nm] to $val\n"; if (isset($this->x[$nm])) { $this->x[$nm] = $val; print "OK!\n"; } else { print "Not OK!\n"; } } } $foo = new Setter(); $foo->n = 1; $foo->a = 100; $foo->a++; $foo->z++; var_dump($foo); $sql = new sql('hallo1', 'hallo2', 'hallo3'); echo('Fjhgjghhjfghjfg'); function test($ein_test) { } ?> ![]() PHPEdit erkennt auf diese weise definierte Konstanten. mfg, DSeven |
Re: PHP Inspection Unit
Hi,
habe den Fehler gefunden. :? Es ist der selbe Fehler, den ich schon bei TPHPClassMethod behoben hatte :wall: - aber bei TPHPMethod hab ichs vergessen :oops: Das mit den defines habe ich auch noch mit mit hineingebracht :) Zudem habe ich eine kleinen Fehler bei den Includes behoben (habe das [^$] durch eine Assertion ersetzt (?<!\$) - Damit liefs bei mir auch etwas schneller :) ) Der Download der verbesserten Version ist im ersten Beitrag zu finden 8) mfG mirage228 |
Re: PHP Inspection Unit
Warum ist bei Konstanten kein "TextPos" verfügbar, fände gut, wenn das mit angegeben wird ;)
|
Re: PHP Inspection Unit
Zitat:
mfG mirage228 |
Re: PHP Inspection Unit
Hm, stimmt. Delphi hatte es nicht in der Liste aufgeführt (die spinnt manchmal), daher dachte ich es geht net. Aber was anderes. Aus irgend einem Grund ist "ConstantCount" immer 0. Woran kann das liegen?
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:50 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz