当前位置: 首页>>代码示例>>PHP>>正文


PHP Ak::directory_delete方法代码示例

本文整理汇总了PHP中Ak::directory_delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Ak::directory_delete方法的具体用法?PHP Ak::directory_delete怎么用?PHP Ak::directory_delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ak的用法示例。


在下文中一共展示了Ak::directory_delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_should_update_plugin

 function test_should_update_plugin()
 {
     Ak::directory_delete(AK_PLUGINS_DIR.DS.'acts_as_versioned'.DS.'lib');
     $this->assertFalse(file_exists(AK_PLUGINS_DIR.DS.'acts_as_versioned'.DS.'lib'.DS.'ActsAsVersioned.php'));
     $this->PluginManager->updatePlugin('acts_as_versioned');
     $this->assertTrue(file_exists(AK_PLUGINS_DIR.DS.'acts_as_versioned'.DS.'lib'.DS.'ActsAsVersioned.php'));
 }
开发者ID:joeymetal,项目名称:v1,代码行数:7,代码来源:AkPluginManager.php

示例2: clearAll

 public function clearAll()
 {
     if (AK_LOG_EVENTS) {
         $Logger =& Ak::getLogger();
         $Logger->message('Clearing all database settings from cache');
     }
     Ak::directory_delete(AkDbSchemaCache::getCacheDir());
 }
开发者ID:joeymetal,项目名称:v1,代码行数:8,代码来源:AkDbSchemaCache.php

示例3: Test_directory_delete

 function Test_directory_delete()
 {
     $this->assertFalse(!Ak::directory_delete('ak_test_folder'));
     $this->assertFalse(Ak::directory_delete('../../'));
     $this->assertFalse(Ak::directory_delete('..\\..\\'));
     $this->assertFalse(Ak::directory_delete(' '));
     $this->assertFalse(Ak::directory_delete('/'));
     $this->assertFalse(Ak::directory_delete('./'));
 }
开发者ID:joeymetal,项目名称:v1,代码行数:9,代码来源:_Ak_file_functions.php

示例4: directory_delete

 function directory_delete($dir_name, $options = array())
 {
     $default_options = array('ftp' => defined('AK_DELETE_FILES_USING_FTP') && AK_DELETE_FILES_USING_FTP, 'base_path' => AK_BASE_DIR);
     $options = array_merge($default_options, $options);
     $sucess = true;
     $dir_name = Ak::_getRestrictedPath($dir_name, $options);
     if (empty($dir_name)) {
         return false;
     }
     if ($options['ftp']) {
         require_once AK_LIB_DIR . DS . 'AkFtp.php';
         return AkFtp::delete($dir_name);
     } else {
         $items = glob($options['base_path'] . DS . $dir_name . "/*");
         $hidden_items = glob($options['base_path'] . DS . $dir_name . "/.*");
         $fs_items = $items || $hidden_items ? array_merge((array) $items, (array) $hidden_items) : false;
         if ($fs_items) {
             $items_to_delete = array('directories' => array(), 'files' => array());
             foreach ($fs_items as $fs_item) {
                 if ($fs_item[strlen($fs_item) - 1] != '.') {
                     $items_to_delete[is_dir($fs_item) ? 'directories' : 'files'][] = $fs_item;
                 }
             }
             foreach ($items_to_delete['files'] as $file) {
                 Ak::file_delete($file, $options);
             }
             foreach ($items_to_delete['directories'] as $directory) {
                 $sucess = $sucess ? Ak::directory_delete($directory, $options) : $sucess;
             }
         }
         return $sucess ? @rmdir($options['base_path'] . DS . $dir_name) : $sucess;
     }
 }
开发者ID:joeymetal,项目名称:v1,代码行数:33,代码来源:Ak.php

示例5: directory_delete

 function directory_delete($dir_name, $options = array())
 {
     $default_options = array('ftp' => defined('AK_DELETE_FILES_USING_FTP') && AK_DELETE_FILES_USING_FTP, 'base_path' => AK_BASE_DIR);
     $options = array_merge($default_options, $options);
     $sucess = true;
     $dir_name = str_replace('..', '', rtrim($dir_name, '\\/. '));
     if ($dir_name == '') {
         return false;
     }
     $dir_name = trim(str_replace($options['base_path'], '', $dir_name), DS);
     if ($options['ftp']) {
         require_once AK_LIB_DIR . DS . 'AkFtp.php';
         $dir_name = trim(str_replace(array(DS, '//'), array('/', '/'), $dir_name), '/');
         return AkFtp::delete($dir_name);
     } else {
         if ($fs_items = glob($options['base_path'] . DS . $dir_name . "/*")) {
             $items_to_delete = array('directories' => array(), 'files' => array());
             foreach ($fs_items as $fs_item) {
                 $items_to_delete[is_dir($fs_item) ? 'directories' : 'files'][] = $fs_item;
             }
             foreach ($items_to_delete['files'] as $file) {
                 Ak::file_delete($file, $options);
             }
             foreach ($items_to_delete['directories'] as $directory) {
                 $sucess = $sucess ? Ak::directory_delete($directory, $options) : $sucess;
             }
             return $sucess;
         }
         return rmdir($options['base_path'] . DS . $dir_name);
     }
 }
开发者ID:joeymetal,项目名称:v1,代码行数:31,代码来源:Ak.php

示例6: test_remove_plugin

 function test_remove_plugin()
 {
     Ak::directory_delete(AK_PLUGINS_DIR . DS . 'acts_as_versioned');
 }
开发者ID:joeymetal,项目名称:v1,代码行数:4,代码来源:AkPluginManager.php

示例7: test_should_delete_nested_directories_when_include_hidden_files

 public function test_should_delete_nested_directories_when_include_hidden_files()
 {
     $tmp_dir = AK_TMP_DIR . DS . Ak::randomString();
     $hidden_tmp_dir = $tmp_dir . DS . '.hidden';
     Ak::make_dir($tmp_dir, array('base_path' => AK_TMP_DIR));
     Ak::make_dir($tmp_dir . DS . '.hidden', array('base_path' => AK_TMP_DIR));
     $this->assertTrue(is_dir($hidden_tmp_dir), 'Could not create test directory ' . $hidden_tmp_dir);
     $this->assertTrue(Ak::directory_delete($tmp_dir, array('base_path' => AK_TMP_DIR)));
     clearstatcache();
     $this->assertFalse(is_dir($tmp_dir));
 }
开发者ID:joeymetal,项目名称:v1,代码行数:11,代码来源:_Ak_file_functions.php

示例8: uninstallPlugin

    /**
     * Uninstalls an existing plugin
     * 
     * Plugins can have an Akelos installer at located at "plugin_name/installer/plugin_name_installer.php"
     * If the installer is available, it will run the "PluginNameInstaller::uninstall()" method, which will trigger
     * all the down_* methods for the installer.
     * 
     * @param  string  $plugin_name Plugin name
     * @return void  
     * @access public
     */
    function uninstallPlugin($plugin_name)
    {
        $plugin_name = Ak::sanitize_include($plugin_name, 'high');
        $this->_runInstaller($plugin_name, 'uninstall');
        Ak::directory_delete(AK_PLUGINS_DIR.DS.$plugin_name);

        if($this->_shouldUseSvnExternals()){
            $this->_uninstallExternals($plugin_name);
        }
    }
开发者ID:joeymetal,项目名称:v1,代码行数:21,代码来源:AkPluginManager.php

示例9: test_should_delete_nested_directories_when_include_hidden_files

 function test_should_delete_nested_directories_when_include_hidden_files()
 {
     $dir_name = AK_TMP_DIR . Ak::randomString();
     Ak::make_dir($dir_name);
     Ak::make_dir($dir_name . DS . '.hidden');
     $this->assertTrue(is_dir($dir_name), 'Could not create test directory ' . $dir_name);
     $this->assertTrue(Ak::directory_delete($dir_name));
     clearstatcache();
     $this->assertFalse(is_dir($dir_name));
 }
开发者ID:joeymetal,项目名称:v1,代码行数:10,代码来源:_Ak_file_functions.php


注:本文中的Ak::directory_delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。