[commits] [Wiki] changed: Doc/Dev/ConversionH4
Jan Schneider
jan at horde.org
Tue Apr 26 09:37:46 UTC 2011
jan Tue, 26 Apr 2011 09:37:46 +0000
Modified page: http://wiki.horde.org/Doc/Dev/ConversionH4
New Revision: 1.17
Change log: Merge Doc/Horde4Conversion
@@ -20,8 +20,18 @@
++ Autoloading
Convert files/libraries to be able to be autoloaded.
Remove require/include calls within the code.
+
+++ Class naming
+
+All (framework) classes must be prefixed with Horde_ to allow
autoloading of the files. When converting from Horde 3 format (e.g.
Foo class) to Horde 4 format (e.g. Horde_Foo), the following commands
are useful to convert all files automatically:
+
+<code>
+find . -type f \( ! -wholename "./.git/*" ! -name "CHANGES" \) |
xargs grep -l '[] (!)]Foo::' | xargs sed -i -r -e 's/([\
\(\^\!\)])Foo::/\1Horde_Foo::/g'
+find . -type f \( ! -wholename "./.git/*" ! -name "CHANGES" \) |
xargs grep -l '&Foo::' | xargs sed -i -r -e 's/&Foo::/Horde_Foo::/g'
+find . -type f \( ! -wholename "./.git/*" ! -name "CHANGES" \) |
xargs grep -l '^Foo::' | xargs sed -i -r -e 's/^Foo::/Horde_Foo::/g'
+</code>
++ CLI
Use Horde_Registry::appInit(), with the 'cli' option, to initialize
CLI scripts.
More information about the commits
mailing list