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


PHP f::remove方法代码示例

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


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

示例1: delete

 protected function delete($name, $output)
 {
     if ($file = f::resolve($this->root() . DS . $name, ['yaml', 'yml', 'php'])) {
         f::remove($file);
     }
     $output->writeln('<comment>The "' . $name . '" blueprint has been deleted!</comment>');
     $output->writeln('');
 }
开发者ID:getkirby,项目名称:cli,代码行数:8,代码来源:Blueprint.php

示例2: testRebuild

 public function testRebuild()
 {
     $a = $this->library->create('test');
     $b = $this->library->create('test');
     // delete the index
     f::remove($this->library->root() . DS . 'library.sqlite');
     $this->library->rebuild();
     $this->assertEquals(2, $this->library->count());
     $this->assertInstanceOf('Library\\Item', $this->library->find($b->id()));
 }
开发者ID:Zegnat,项目名称:library,代码行数:10,代码来源:LibraryTest.php

示例3: delete

 public function delete($username)
 {
     $user = $this->user($username);
     if (!$user) {
         return response::error(l('users.avatar.delete.error.missing'));
     }
     if ($avatar = $user->avatar()) {
         if (f::remove($avatar->root())) {
             return response::success(l('users.avatar.delete.success'));
         }
     }
     return response::error(l('users.avatar.delete.error'));
 }
开发者ID:kompuser,项目名称:panel,代码行数:13,代码来源:avatars.php

示例4: delete

 public function delete($username)
 {
     $user = $this->user($username);
     if (!$user) {
         return response::error(l('users.avatar.delete.error.missing'));
     }
     if (!site()->user()->isAdmin() and !$user->isCurrent()) {
         return response::error('You are not allowed to delete the avatar of this user');
     }
     if ($avatar = $user->avatar()) {
         if (f::remove($avatar->root())) {
             return response::success(l('users.avatar.delete.success'));
         }
     }
     return response::error(l('users.avatar.delete.error'));
 }
开发者ID:williampan,项目名称:w,代码行数:16,代码来源:avatars.php

示例5: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($this->isInstalled() === false) {
         throw new RuntimeException('Invalid Kirby installation');
     }
     $helper = $this->getHelper('question');
     $question = new ConfirmationQuestion('<info>Do you really want to uninstall Kirby? (y/n)</info>' . PHP_EOL . 'leave blank to cancel: ', false);
     if ($helper->ask($input, $output, $question)) {
         // load kirby
         $this->bootstrap();
         f::remove($this->dir() . DS . 'index.php');
         f::remove($this->dir() . DS . '.htaccess');
         f::remove($this->dir() . DS . '.gitignore');
         f::remove($this->dir() . DS . 'license.md');
         f::remove($this->dir() . DS . 'readme.md');
         dir::remove($this->dir() . DS . 'kirby');
         dir::remove($this->dir() . DS . 'panel');
         dir::remove($this->dir() . DS . 'thumbs');
         $output->writeln('<comment>Kirby has been uninstalled!</comment>');
         $output->writeln('');
     }
 }
开发者ID:getkirby,项目名称:cli,代码行数:22,代码来源:Uninstall.php

示例6: delete

 public function delete()
 {
     // delete the meta file
     f::remove($this->textfile());
     if (!f::remove($this->root())) {
         throw new Exception('The file could not be deleted');
     }
     cache::flush();
     return true;
 }
开发者ID:madebypost,项目名称:Gulp-Neat-KirbyCMS,代码行数:10,代码来源:file.php

示例7: delete

 public function delete()
 {
     foreach ($this->site->languages() as $lang) {
         // delete the meta file for each language
         f::remove($this->textfile($lang->code()));
     }
     parent::delete();
     return true;
 }
开发者ID:robinandersen,项目名称:robin,代码行数:9,代码来源:file.php

示例8: delete

 protected function delete($name, $output)
 {
     f::remove($this->root() . DS . $name . '.php');
     $output->writeln('<comment>The "' . $name . '" controller has been deleted!</comment>');
     $output->writeln('');
 }
开发者ID:getkirby,项目名称:cli,代码行数:6,代码来源:Controller.php

示例9: tearDownAfterClass

 public static function tearDownAfterClass()
 {
     // kill the database
     f::remove(self::$database);
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:5,代码来源:DbTest.php

示例10: deleteFile

 static function deleteFile()
 {
     global $page;
     $filename = get('filename');
     $file = $page->files()->find($filename);
     if (!$file) {
         return array('status' => 'error', 'msg' => l::get('files.delete.errors.notfound'));
     }
     if (!f::remove($file->root())) {
         return array('status' => 'error', 'msg' => l::get('files.delete.errors.permissions'));
     }
     self::killCache();
     return array('status' => 'success', 'msg' => l::get('files.delete.success'));
 }
开发者ID:nilshendriks,项目名称:kirbycms-panel,代码行数:14,代码来源:data.php

示例11: deleteFile

 static function deleteFile()
 {
     global $page;
     $filename = get('filename');
     $file = $page->files()->find($filename);
     if (!$file) {
         return array('status' => 'error', 'msg' => l::get('files.delete.errors.notfound'));
     }
     if (!f::remove($file->root())) {
         return array('status' => 'error', 'msg' => l::get('files.delete.errors.permissions'));
     }
     // remove the meta file
     $meta = dirname($file->root()) . '/' . $file->filename() . '.' . c::get('content.file.extension', 'txt');
     f::remove($meta);
     if (c::get('lang.support')) {
         // delete each translated meta file
         foreach (c::get('lang.available') as $lang) {
             $meta = dirname($file->root()) . '/' . $file->filename() . '.' . $lang . '.' . c::get('content.file.extension', 'txt');
             f::remove($meta);
         }
     }
     self::killCache();
     return array('status' => 'success', 'msg' => l::get('files.delete.success'));
 }
开发者ID:codecuts,项目名称:lanningsmith-website,代码行数:24,代码来源:data.php

示例12: remove

 /**
  * Remove an item from the cache
  *
  * @param string $key
  * @return boolean
  */
 public function remove($key)
 {
     return f::remove($this->file($key));
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:10,代码来源:file.php

示例13: detach

 public function detach($filename)
 {
     $filename = f::safeName($filename);
     if ($filename == 'item.yaml') {
         throw new Exception('The item.yaml file cannot be removed');
     }
     if (!f::remove($this->root() . DS . $filename)) {
         throw new Exception('The file cannot be removed');
     }
 }
开发者ID:Zegnat,项目名称:library,代码行数:10,代码来源:item.php

示例14: print_r

<?php

/* print_r($_POST);
print_r($_FILES);
die(); */
require_once dirname(__FILE__) . '/libs/secure_upload.php';
require_once dirname(__FILE__) . '/libs/smush.php';
$options = array('field' => 'uploads', 'path' => dirname(__FILE__) . '/demo/img');
$r = secure_upload($options);
if ($r['success']) {
    foreach ($r['success'] as $k => $file) {
        $o = smush_file($options['path'] . '/' . str_replace('..', '.', $file['filename']));
        f::remove($options['path'] . '/' . str_replace('..', '.', $file['filename']));
        if ($o && !$o['error']) {
            $r['success'][$k]['filename'] = $file['filename'] . ' - optimized :' . $o['percent'] . '%';
        } else {
            $r['success'][$k]['filename'] = $file['filename'] . ' - ' . print_r($o, true);
        }
    }
}
echo json_encode($r);
die;
开发者ID:o-github-o,项目名称:jQuery-Ajax-Upload,代码行数:22,代码来源:upload.php

示例15: remove

 static function remove($file)
 {
     f::remove(self::$file);
 }
开发者ID:narrenfrei,项目名称:kirbycms,代码行数:4,代码来源:cache.php


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