[ANN] Pfw_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

[ANN] Pfw_XH

Post by cmb » Fri May 27, 2016 11:30 pm

Hello everybody!

I have just released Pfw_XH 0.1.0.

Pfw_XH is a plugin framework for CMSimple_XH packaged as a CMSimple_XH plugin. For now it has no value for end-users. As it is an early alpha version, it is intended for plugin developers only who are encouraged to have a look at it (don't use it for any production code, though) and to provide feedback, particularly suggestions for improvement, bug fixes, additional documention etc, and of course to ask questions. Feel free to do this on its Github project page (pull requests are especially welcome) or here in the forum.

You can read the documentation online, if you don't want to download the SDK right away. I suggest that after reading the introduction, you head to the Quickstart Guide which is supposed to show you the basics.

As I have mentioned in the introduction of the documentation, I'm planning to follow semantic versioning for Pfw_XH, which means (amongst others) that you (and me!) really shouldn't use Pfw_XH for published plugins until it has reached GA (i.e. version 1.0.0). As I consider Pfw_XH a major improvement for plugin development[1] I intend to push the plugin framework to GA as soon as possible (hopefully a few months at most[2]). Hence, don't expect lots of tools and library services to be added before 1.0.0 (even though I see the need, and I've already got some drafts and ideas lying around), because these still can be added in following minor versions.

One of my tasks within the next weeks and months will be to apply the plugin framework to some of my existing plugins (in feature branches!) to assess its usefulness and to find parts which need improvements (up until now I have only done some quick experiments). You are encouraged to do this too, and of course, to provide feedback about your experiences.

[1] While Pfw_XH is not supposed to be(come) a RAD tool, I nonetheless expect that plugin development can be clearly accelerated. The main focus, however, is on offering a tool to produce more reliable and maintainable plugins.
[2] That might heavily depend on your contributions.
Christoph M. Becker – Plugins for CMSimple_XH

lck
Posts: 2963
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: [ANN] Pfw_XH

Post by lck » Sun May 29, 2016 3:00 pm

Hallo Christoph,
cmb wrote:For now it has no value for end-users. As it is an early alpha version, it is intended for plugin developers only who are encouraged to have a look at it
ich kann mit dem Plugin zwar nicht wirklich was anfangen, aber es juckte mich doch es mal anzutesten und nätürlich bin ich schon am Anfang gescheitert :)
To create a new plugin open a console window and cd to the plugins/ folder. Then do

php pfw-sdk\pfw.phar -g foo
Erst dachte ich, mit "console" wäre die Browser-Console gemeint, Irrtum.
Dann dachte ich an die Windows Eingabeaufforderung cmd (Win-Taste + R)
Also, per cd zum plugins-Verzeichnis gewechselt und obigen Code eingefügt und los, Konsole sagte nein:
Der Befehl "php" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
[1]Anscheinend ist in deiner Windows Umgebungsvariable der Path zu php eingetragen oder siehe [2], bei mir nicht, da ich Xampp nicht installiert habe. Mit der Angabe des kompletten Pfades zu php funktionierte es dann.

Code: Select all

D:\xampp\php\php pfw-sdk\pfw.phar -g foo
[1]Es gibt aber noch eine Shell-Konsole im "Xampp Control-Panel", dort klappt es auch ohne den kompletten Pfad zu php, darauf kommt man natürlich immer zuletzt ;)

[3] Was mir als Laien aufgefallen ist, dass in allen erzeugten php-Dateien das abschließende ?> fehlt. Naja, hat bestimmt einen tieferen Sinn.
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [ANN] Pfw_XH

Post by cmb » Sun May 29, 2016 4:46 pm

Hallo Ludwig!

Danke fürs Antesten und das Feedback.
lck wrote:Erst dachte ich, mit "console" wäre die Browser-Console gemeint, Irrtum.
Dann dachte ich an die Windows Eingabeaufforderung cmd (Win-Taste + R)
Genau, die ist unter Windows zu verwenden. Grundsätzlich sollte pfw.phar aber auch unter anderen Betriebssystemen laufen (hab ich allerdings noch nicht getestet). Dummerweise gibt es da wohl keine plattformübergreifende Terminologie, wie man das nennt: shell, command line (shell), terminal, sind wohl nicht unüblich. "Eingabeaufforderung" kenne ich nur unter WIndows. Auf jeden Fall sollte ich da aber mit einer Fußnote nachbessern.
lck wrote:Es gibt aber noch eine Shell-Konsole im "Xampp Control-Panel", dort klappt es auch ohne den kompletten Pfad zu php, darauf kommt man natürlich immer zuletzt ;)
Die verwende ich i.d.R. auch, denn tatsächlich wird dort der PHP-Ordner automatisch zum PATH hinzugefügt (obwohl ich auch ein PHP generell im PATH habe). Ich vermute allerdings, dass die meisten Pluginentwickler da ihre eigenen Techniken haben, so dass ich einfach mal voraussetze, dass PHP im PATH ist (oder der Entwickler das schnell ändern kann).
lck wrote:Was mir als Laien aufgefallen ist, dass in allen erzeugten php-Dateien das abschließende ?> fehlt. Naja, hat bestimmt einen tieferen Sinn.
In PHP-Code-Dateien auf das abschließende ?> zu verzichten ist eigentlich schon lange gängige Praxis, und wird auch im PHP-Handbuch mit Begründung empfohlen:
If a file is pure PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because PHP will start output buffering when there is no intention from the programmer to send any output at that point in the script.
Bisher habe ich das ?> immer geschrieben, weil es vom PEAR-Coding-Standard so gefordert wird. Aber offensichtlich ist der PEAR-Coding-Standard nicht mehr up-to-date, und so habe ich mich nach einem anderen umgeschaut und bin bei PSR-2 gelandet, aber dort ist das abschließende ?> ausdrücklich verboten. Also lass ich es jetzt einfach weg.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: [ANN] Pfw_XH

Post by cmb » Fri Nov 17, 2017 11:40 am

Hi everybody!

Pfw_XH 0.2.0 has just been released.

Sometimes it is necessary to take a step back, before you can move forward. Pfw_XH 0.2.0 does this, because it appears that otherwise Pfw_XH would have been stuck forever. I'm planning to release several plugins which actually use Pfw_XH in the coming weeks, and to develop Pfw_XH further in parallel to these other plugins. I anticipate several BC breaks (technically, these would not be BC breaks according to SemVer, since Pfw_XH is not stable yet), so it is not recommended that other developers also publish plugins using Pfw_XH for now. Nonetheless, other developers are encouraged to have a look at Pfw_XH and maybe to play around with it a bit, and to provide feedback!

Anyhow, end-users can ignore Pfw_XH until they want to install a plugin which requires Pfw_XH.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply