本文整理汇总了PHP中rmdir_recursive函数的典型用法代码示例。如果您正苦于以下问题:PHP rmdir_recursive函数的具体用法?PHP rmdir_recursive怎么用?PHP rmdir_recursive使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rmdir_recursive函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
function tearDown()
{
$this->clearFilesInDirectory('custom/history/modules/Accounts/metadata');
foreach ($this->modules as $module) {
if (!$this->has_dir[$module]) {
rmdir_recursive("custom/modules/{$module}");
} else {
$files = array('editviewdefs', 'detailviewdefs');
foreach ($files as $file) {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php.bak")) {
copy("custom/modules/{$module}/metadata/{$file}.php.bak", "custom/modules/{$module}/metadata/{$file}.php");
unlink("custom/modules/{$module}/metadata/{$file}.php.bak");
} else {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php")) {
unlink("custom/modules/{$module}/metadata/{$file}.php");
}
}
if (file_exists("custom/modules/{$module}/metadata/{$module}.php.suback.bak")) {
copy("custom/modules/{$module}/metadata/{$file}.php.suback.bak", "custom/modules/{$module}/metadata/{$file}.php.suback.php");
unlink("custom/modules/{$module}/metadata/{$file}.php.suback.bak");
} else {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php.suback.php")) {
unlink("custom/modules/{$module}/metadata/{$file}.php.suback.php");
}
}
}
}
}
//foreach
}
示例2: clean_dir
function clean_dir($opts, $pipe = false, $cmd = __FUNCTION__)
{
# set prefix
$prefix = 'clean_dir';
# merge opts
$opts = merge_opts($opts, $pipe, 'dir');
# get clearn dir opt
$clean_dir = get_opt($prefix, $opts, 'clean_dir', true);
if (!check_opt_set_type($cmd, $clean_dir, 'clean_dir', 'boolean')) {
return false;
}
if ($clean_dir === false) {
return true;
}
# get dir opt
$dir = get_opt($prefix, $opts, 'dir');
if (!check_opt_set_type($cmd, $dir, 'dir', 'string')) {
return false;
}
# clean directory
debug_echo($cmd, "cleaning local dir : {$dir}");
if (!rmdir_recursive($dir)) {
return error($cmd, "could not clean local dir : {$dir}");
}
return true;
}
示例3: destroy
/**
* Destroy the entire index.
*/
public function destroy()
{
$this->index = null;
if (is_dir($this->indexPath)) {
rmdir_recursive($this->indexPath);
}
}
示例4: testWsdlNavService
public function testWsdlNavService()
{
if (file_exists($this->genDir)) {
rmdir_recursive($this->genDir);
}
mkdir($this->genDir . "/public/schemas", 0777, true);
$service = new services\NavService();
$this->tclass->setService($service);
$this->tclass = $this->tclass->getImplementation($service);
$this->tclass->setLocation("http://mylocation.com/soap/");
$this->tclass->setSchemasPath("../resources/ContactWsdl");
$this->tclass->setPublicPath(realpath($this->genDir . "/public/schemas"));
$this->tclass->setPublicUrl("/schemas");
$this->tclass->setDebug(true);
$schemas = array("CodeList_CurrencyCode_ISO_7_04.xsd", "CodeList_LanguageCode_ISO_7_04.xsd", "CodeList_MIMEMediaTypeCode_IANA_7_04.xsd", "CodeList_UnitCode_UNECE_7_04.xsd", "ContactCompany.xsd", "ContactPerson.xsd", "UBL-CommonAggregateComponents-2.0.xsd", "UBL-CommonBasicComponents-2.0.xsd", "UBL-QualifiedDatatypes-2.0.xsd", "UnqualifiedDataTypeSchemaModule-2.0.xsd");
$wsdl = $this->tclass->toXml();
//print_r($wsdl);
//file_put_contents($this->expDir."/NavService.wsdl", $wsdl);
$expected = file_get_contents($this->expDir . "/NavService.wsdl");
$this->assertEquals($expected, $wsdl);
foreach ($schemas as $schema) {
$exp = file_get_contents($this->expDir . "/public/schemas/" . $schema);
$act = file_get_contents($this->genDir . "/public/schemas/" . $schema);
$this->assertEquals($exp, $act);
}
if (file_exists($this->genDir)) {
rmdir_recursive($this->genDir);
}
}
示例5: tearDown
function tearDown()
{
foreach ($this->modules as $module) {
if (!$this->has_dir[$module]) {
rmdir_recursive("custom/modules/{$module}");
} else {
$files = array('searchdefs');
foreach ($files as $file) {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php.bak")) {
copy("custom/modules/{$module}/metadata/{$file}.php.bak", "custom/modules/{$module}/metadata/{$file}.php");
unlink("custom/modules/{$module}/metadata/{$file}.php.bak");
} else {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php")) {
unlink("custom/modules/{$module}/metadata/{$file}.php");
}
}
if (file_exists("custom/modules/{$module}/metadata/{$module}.php.suback.bak")) {
copy("custom/modules/{$module}/metadata/{$file}.php.suback.bak", "custom/modules/{$module}/metadata/{$file}.php.suback.php");
unlink("custom/modules/{$module}/metadata/{$file}.php.suback.bak");
} else {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php.suback.php")) {
unlink("custom/modules/{$module}/metadata/{$file}.php.suback.php");
}
}
}
}
}
//foreach
}
示例6: tearDown
public function tearDown()
{
parent::tearDown();
if (is_dir($this->indexPath)) {
rmdir_recursive($this->indexPath);
}
}
示例7: teardownFiles
public static function teardownFiles()
{
foreach (self::$modules as $module) {
if (!self::$has_dir[$module]) {
rmdir_recursive("custom/modules/{$module}");
} else {
foreach (self::$files as $file) {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php.bak")) {
copy("custom/modules/{$module}/metadata/{$file}.php.bak", "custom/modules/{$module}/metadata/{$file}.php");
unlink("custom/modules/{$module}/metadata/{$file}.php.bak");
} else {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php")) {
unlink("custom/modules/{$module}/metadata/{$file}.php");
}
}
if (file_exists("custom/modules/{$module}/metadata/{$module}.php.suback.bak")) {
copy("custom/modules/{$module}/metadata/{$file}.php.suback.bak", "custom/modules/{$module}/metadata/{$file}.php.suback.php");
unlink("custom/modules/{$module}/metadata/{$file}.php.suback.bak");
} else {
if (file_exists("custom/modules/{$module}/metadata/{$file}.php.suback.php")) {
unlink("custom/modules/{$module}/metadata/{$file}.php.suback.php");
}
}
}
}
}
//foreach
}
示例8: tearDown
public function tearDown()
{
if (is_dir("custom/modules/{$this->_moduleName}")) {
rmdir_recursive("custom/modules/{$this->_moduleName}");
}
unset($GLOBALS['dashletStrings']);
}
示例9: remove
public function remove($slug)
{
if (empty($slug)) {
$this->templatemanager->notify_next("Plugin not defined!");
} else {
$pl = PluginManager::plugin($slug);
$pl->uninstall();
@rmdir_recursive('./iu-resources/plugins/' . $slug);
}
redirect('administration/plugins');
}
示例10: fire
public function fire()
{
if (!$this->option('verbose')) {
$this->output = new NullOutput();
}
if ($result = rmdir_recursive(Config::get('laravel-lucene-search.index.path'))) {
$this->info('Search index is cleared.');
} else {
$this->comment('There is nothing to clear..');
}
}
示例11: testDisplayWithClassicCustomView
public function testDisplayWithClassicCustomView()
{
$view = $this->getMock('ViewClassic', array('includeClassicFile'));
$view->module = 'testmodule' . mt_rand();
$view->action = 'testaction' . mt_rand();
sugar_mkdir("custom/modules/{$view->module}", null, true);
sugar_touch("custom/modules/{$view->module}/{$view->action}.php");
$return = $view->display();
rmdir_recursive("custom/modules/{$view->module}");
$this->assertTrue($return);
}
示例12: tearDown
public function tearDown()
{
if (is_dir("modules/{$this->_moduleName}")) {
rmdir_recursive("modules/{$this->_moduleName}");
}
if (is_dir("custom/modules/{$this->_moduleName}")) {
rmdir_recursive("custom/modules/{$this->_moduleName}");
}
unset($GLOBALS['dashletStrings']);
$GLOBALS['current_language'] = $GLOBALS['sugar_config']['default_language'];
}
示例13: tearDown
public function tearDown()
{
parent::tearDown();
if ($this->packageExists) {
//Copy original contents back in
copy_recursive('custom/modules/' . $this->package . '_bak', 'custom/modules/' . $this->package);
rmdir_recursive('custom/modules/' . $this->package . '_bak');
} else {
rmdir_recursive('custom/modules/' . $this->package);
}
unset($_SESSION['avail_modules'][$this->package]);
}
示例14: setUp
public function setUp()
{
if (!function_exists('imagecreatetruecolor')) {
$this->markTestSkipped('imagecreatetruecolor function not found. skipping test');
return;
}
$this->useSprites = $GLOBALS['sugar_config']['use_sprites'];
$GLOBALS['sugar_config']['use_sprites'] = true;
if (file_exists('cache/sprites')) {
rmdir_recursive('cache/sprites');
}
}
示例15: testSavePHPBindings
public function testSavePHPBindings()
{
if (file_exists($this->generatedDir . "/bindings")) {
rmdir_recursive($this->generatedDir . "/bindings");
}
//$this->tclass->saveClasses($this->expectedDir."/bindings", true);
$this->tclass->saveClasses($this->generatedDir . "/bindings", true);
$this->assertDirContentsEquals($this->expectedDir . "/bindings", $this->generatedDir . "/bindings");
if (file_exists($this->generatedDir . "/bindings")) {
rmdir_recursive($this->generatedDir . "/bindings");
}
}