Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Nov 16, 2021
1 parent 505b090 commit 6cf113b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
Expand Up @@ -37,7 +37,7 @@ private function moveBlockDataAnchorToBlockTunesAnchor(): void

foreach ($pages as $page) {
if (($jsonContent = json_decode($page->getMainContent(), true)) !== null
&& \is_array($jsonContent) && isset($jsonContent['blocks'])) {
&& \is_array($jsonContent) && isset($jsonContent['blocks'])) {
$contentHasChanged = false;
foreach ($jsonContent['blocks'] as $blockKey => $block) {
if (! isset($block['data']) || ! isset($block['data']['anchor'])) {
Expand All @@ -63,16 +63,12 @@ private function moveBlockDataAnchorToBlockTunesAnchor(): void
}
}

/*
if (! class_exists(PostAutoloadDump::class)) { // we are debugging from monorepo
require_once 'packages/installer/src/PostInstall.php';
require_once 'packages/installer/src/PostAutoloadDump.php';
/***/
if (! class_exists(PostAutoloadDump::class)) {
require_once 'vendor/autoload.php';
}

$kernel = PostAutoloadDump::getKernel();
/** @var class-string<PageInterface> $pageClass *
$pageClass = $kernel->getContainer()->getParameter('pw.entity_page');
$entityManager = $kernel->getContainer()->get('doctrine.orm.default_entity_manager');
(new Update795())->run();


*/
/**/
File renamed without changes.
14 changes: 14 additions & 0 deletions packages/docs/content/upgrade.md
Expand Up @@ -11,6 +11,20 @@ Run `composer update` and the job is done (almost).

If you are doing a major upgrade, find the upgrade guide down there.

## To 0.0.800

- Update doctrine

```
php bin/console make:migration && php bin/console doctrine:migrations:migrate
```

- Update main content's block

```
php vendor/pushword/admin-block-editor/src/Installer/Update795.php~
```

## To 0.0.728

- Update stylesheets
Expand Down
8 changes: 2 additions & 6 deletions packages/installer/src/PostAutoloadDump.php
Expand Up @@ -28,9 +28,7 @@ private static function runUpdate(string $package): void

$scriptsToRun = self::scanDir('vendor/pushword/'.$package.'/src/Installer');
foreach ($scriptsToRun as $i => $script) {
if (! file_exists($isInstalledFile = 'var/installer/'.md5($package.$script))
&& 'install' !== basename($script, '.php')
) {
if (! file_exists($isInstalledFile = 'var/installer/'.md5($package.$script))) {
echo '~ Executing '.$package.' update ('.$i++.').'.\chr(10);
$className = '\\Pushword\\'.$package.'\\Installer\\'.basename($script, '.php');
(new $className())->run(); // @phpstan-ignore-line
Expand All @@ -50,9 +48,7 @@ public static function getKernel(): Kernel
return self::$kernel;
}

if (! class_exists(Kernel::class)) {
include 'vendor/autoload.php';
}
require_once 'vendor/autoload.php';

(new Dotenv())->loadEnv(file_exists('.env') ? '.env' : 'packages/skeleton/.env');
if (class_exists(Debug::class)) {
Expand Down

0 comments on commit 6cf113b

Please sign in to comment.