Note:
Don't use Skeleton from CVS. Use Skeleton from horde git as outlined below.
There is currently no usable version of skeleton which is tagged FRAMEWORK_3. An older revision of the CVS HEAD version may work though.
git clone --depth 1 git://github.com/horde/horde.git
cd horde
cp -R skeleton/ /your/install/path/to/horde/
#!/usr/bin/php -q
function analysedir( $path_, $list_ )
{
// Read dir
$handle = opendir($path_);
while (false !== ($file = readdir($handle)))
{
if( $file!='.' && $file!='..')
{
$file = $path_ . DIRECTORY_SEPARATOR . $file;
//echo "$filen";
if( !is_dir( $file ) ) // If File: Append
{
$list_[count($list_)]=$file;
}
else // If Folder: scan recursively
{
$list_ += analysedir($file, $list_ );
}
}
} // While END
return $list_;
}
function substitute_skeleton( $filename, $modulname )
{
$prjUC=strtoupper(trim($modulname));
$prjLC=strtolower($prjUC);
$prjMC=substr($prjUC, 0, 1) . substr($prjLC, 1, strlen($prjLC)-1);
$filehandle=fopen(trim($filename), 'r');
$file=fread($filehandle, filesize($filename));
fclose($filehandle);
$newfile=str_replace(array('SKELETON', 'Skeleton', 'skeleton'), array($prjUC, $prjMC, $prjLC), $file);
$filehandle=fopen(trim($filename), 'w');
fwrite($filehandle, $newfile);
fclose($filehandle);
}
function help()
{
echo "projectrename.php </path/to/skeleton-folder/> n";
}
//
// ------------------- Main-Code --------------------
//
if (count($_SERVER['argv'])==3)
{
// Preparation
$list = array();
$path = trim($_SERVER[argv][1]);
$modul = trim($_SERVER[argv][2]);
// Fetch Filelist
$list = analysedir( $path, $list );
// Modify each File
foreach( $list as $file )
{
//echo $modul.": ".$file."n";
substitute_skeleton( $file, $modul );
}
}
else
help();
?>
projectrename.php /path/to/skeleton/Checkout/ modulname
3.1:
Edit your Name into all files, for example with this snippet under bash (Unix, Linux or Windows with cygwin):
find ./ -type f -exec sed -i 's/Your Name you@example.com/Me Myself me@myselfandi.com/g' {} ;
3.2 Rename
mv horde/appname/test/Skeleton horde/appname/test/Appname
and
mv horde/appname/locale/skeleton.pot horde/appname/locale/appname.pot
mv /path/to/modulename/lib/Skeleton.php /path/to/modulename/lib/Modulename.php
mkdir /path/to/modulename/themes/graphics
http://spriggs.org.uk/projects/horde_dev/fitlog/themes/graphics/fitlog.png
(The link doesn't work for me anymore, try this one:)
http://groupware.ralf-lang.de/ajaxadmin/themes/graphics/ajaxadmin.png
+++ registry.d example for horde 3
applications['modulename'] = array(
'fileroot' => dirname(__FILE__) . '/../../modulename',
'webroot' => $this->applications['horde']['webroot'] . '/modulename',
'name' => _("A description of your module"),
'status' => 'active',
'menu_parent' => 'horde'
);
+++ registry.de example for horde 4
applications['tickplug'] = array(
'name' => _("Tickplug"),
'provides' => array(
'Tickets/Import'
)
// This is sufficient. More options possible if needed
);
OK, so you now have your first module. Now, you need to populate it with content. This will be the subject of the next section: PopulatingYourFirstModule