本文整理汇总了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('');
}
示例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()));
}
示例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'));
}
示例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'));
}
示例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('');
}
}
示例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;
}
示例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;
}
示例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('');
}
示例9: tearDownAfterClass
public static function tearDownAfterClass()
{
// kill the database
f::remove(self::$database);
}
示例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'));
}
示例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'));
}
示例12: remove
/**
* Remove an item from the cache
*
* @param string $key
* @return boolean
*/
public function remove($key)
{
return f::remove($this->file($key));
}
示例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');
}
}
示例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;
示例15: remove
static function remove($file)
{
f::remove(self::$file);
}