Browse Source

Fix content migration

pull/255/head
Danang Probo Sayekti 10 years ago
parent
commit
881aa37dcf
3 changed files with 11 additions and 11 deletions
  1. +9
    -1
      system/admin/views/clear-cache.html.php
  2. +2
    -3
      system/admin/views/updated-to.html.php
  3. +0
    -7
      system/htmly.php

+ 9
- 1
system/admin/views/clear-cache.html.php View File

@ -1,12 +1,20 @@
<?php
$files = array();
$draft = array();
$files = glob('content/*/blog/*.md', GLOB_NOSORT);
$draft = glob('content/*/draft/*.md', GLOB_NOSORT);
if (!empty($files) || !empty($draft)) {
migrate_old_content();
}
rebuilt_cache('all');
foreach (glob('cache/page/*.cache', GLOB_NOSORT) as $file) {
unlink($file);
}
echo 'All cache has been deleted!';
?>

+ 2
- 3
system/admin/views/updated-to.html.php View File

@ -1,5 +1,4 @@
<h3>Updated to<h3>
<h2>[<?php echo $info['tag_name']; ?>] <?php echo $info['name']; ?></h2>
<p><?php echo \Michelf\MarkdownExtra::defaultTransform($info['body']); ?></p>
<h2>[<?php echo $info['tag_name']; ?>] <?php echo $info['name']; ?></h2>
<p><?php echo \Michelf\MarkdownExtra::defaultTransform($info['body']); ?></p>
<?php require_once "system/upgrade/run.php"; ?>

+ 0
- 7
system/htmly.php View File

@ -1251,19 +1251,12 @@ get('/admin/update', function () {
// Show the update now link
get('/admin/update/now/:csrf', function ($CSRF) {
$files = array();
$draft = array();
$files = glob('content/*/blog/*.md', GLOB_NOSORT);
$draft = glob('content/*/draft/*.md', GLOB_NOSORT);
$proper = is_csrf_proper($CSRF);
$updater = new \Kanti\HubUpdater(array(
'name' => 'danpros/htmly',
'prerelease' => !!config("prerelease"),
));
if (login() && $proper && $updater->able()) {
if (!empty($files) || !empty($draft)) {
migrate_old_content();
}
$updater->update();
config('views.root', 'system/admin/views');
render('updated-to', array(


Loading…
Cancel
Save