* finish task#481.

This commit is contained in:
wangchunsheng
2011-10-25 01:54:20 +00:00
parent eaa1c21312
commit 28957fca2f
2 changed files with 26 additions and 8 deletions
+17 -2
View File
@@ -315,6 +315,21 @@ class extensionModel extends model
return $license;
}
/**
* Get hook file for install or uninstall.
*
* @param string $extension
* @param string $hook preinstall|postinstall|preuninstall|postuninstall
* @access public
* @return string|bool
*/
public function getHookFile($extension, $hook)
{
$hookFile = "ext/$extension/hook/$hook.php";
if(file_exists($hookFile)) return $hookFile;
return false;
}
/**
* Get the install db file.
*
@@ -382,7 +397,7 @@ class extensionModel extends model
$pathes = $this->getPathesFromPackage($extension);
foreach($pathes as $path)
{
if($path == 'db' or $path == 'doc') continue;
if($path == 'db' or $path == 'doc' or $path == 'hook') continue;
$path = $appRoot . $path;
if(is_dir($path))
{
@@ -492,7 +507,7 @@ class extensionModel extends model
foreach($pathes as $path)
{
if($path == 'db' or $path == 'doc' or $path == '..' or $path == '.') continue;
if($path == 'db' or $path == 'doc' or $path == 'hook' or $path == '..' or $path == '.') continue;
$copiedFiles = $this->classFile->copyDir($extensionDir . $path, $appRoot . $path);
}
foreach($copiedFiles as $key => $copiedFile)