本文整理汇总了PHP中sotf_Utils::erase方法的典型用法代码示例。如果您正苦于以下问题:PHP sotf_Utils::erase方法的具体用法?PHP sotf_Utils::erase怎么用?PHP sotf_Utils::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sotf_Utils
的用法示例。
在下文中一共展示了sotf_Utils::erase方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
function delete()
{
if (!$this->isLocal()) {
raiseError("Can delete only local stations");
}
// delete files from the repository
debug("deleting: ", $this->getDir());
sotf_Utils::erase($this->getDir());
// delete from sql db
return parent::delete();
}
示例2: delete
function delete()
{
global $db;
if ($this->isLocal()) {
// delete files from the repository
debug("deleting: ", $this->getDir());
sotf_Utils::erase($this->getDir());
// delete from sql db
// somehow foreign keys do not work in this case, so let's do it by hand:
$db->query("DELETE FROM sotf_object_roles WHERE object_id='" . $this->id . "'");
}
return parent::delete();
}
示例3: erase
/**
* Deletes a file or directory, even if directory is not empty.
*
* @param string $file File or directory to be deleted
*/
function erase($file)
{
if (is_dir($file)) {
$handle = opendir($file);
while ($filename = readdir($handle)) {
if ($filename != "." && $filename != "..") {
sotf_Utils::erase($file . "/" . $filename);
}
}
closedir($handle);
rmdir($file);
} else {
unlink($file);
}
}
示例4: delete
/**
* sotfShow::delete()
*
* purpose: to delete data from the tables
*
* @return (bool)
*/
function delete()
{
if (!$this->isLocal()) {
error("Can delete only local stations");
return false;
}
// delete files from the repository
sotf_Utils::erase($this->getDir());
// delete programmes of the station
// TODO getallprogrammes: call delete
// delete user permissions
$this->db->query("DELETE FROM sotf_user_group WHERE station = '" . $this->id . "'");
// propagate deletion to other nodes
$data = array('what' => 'station', 'del_time' => db_Wrap::getTimestampTZ(), 'node' => $GLOBALS['nodeId']);
sotf_Base::saveDataWithId("sotf_deletions", 'id', $this->id, $data);
// delete station description
return parent::delete("sotf_stations", "station");
}
示例5: erase
/**
* Deletes a file or directory, even if directory is not empty.
*
* @param string $file File or directory to be deleted
*/
function erase($file)
{
if (is_dir($file)) {
$handle = opendir($file);
while ($filename = readdir($handle)) {
if ($filename != "." && $filename != "..") {
sotf_Utils::erase($file . "/" . $filename);
}
}
closedir($handle);
if (!rmdir($file)) {
logger("Could not delete dir", $file);
}
} else {
if (!unlink($file)) {
logger("Could not delete file", $file);
}
}
}
示例6: realpath
$phpDirFiles[] = realpath($file);
}
}
closedir($dir);
}
if ($dir = opendir($config['classdir'])) {
while (($file = readdir($dir)) !== false) {
if (preg_match("/\\.class\\.php\$/", $file)) {
$phpClassFiles[] = $config['classdir'] . "/{$file}";
}
}
closedir($dir);
}
$script = realpath("{$phpdocgendir}/phpdocgen.pl");
if (is_dir($docdir)) {
sotf_Utils::erase($docdir);
}
?>
<html>
<head>
<title>Documentation generation</title>
</head>
<body>
<p><b>Target dir</b>: <?php
echo $docdir;
?>
</p>
<p><b>phpdocgen output</b>:</p>
<pre>
<?php
passthru("{$perl} {$script} --output={$docdir} --defpack=StreamOnTheFly " . " " . implode(" ", $phpClassFiles) . " 2>&1");