當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。