Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@

# Documentation
/docs/_build/*

# IDE
.idea
src/Resources/public
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Then, override the bundle's configuration to point to the new CKEditor path:
fos_ck_editor:
# ...
base_path: "build/ckeditor"
js_path: "build/ckeditor/ckeditor.js"
js_path: "build/ckeditor/ckeditor5.js"

Finally, run encore command:

Expand Down
10 changes: 5 additions & 5 deletions docs/usage/ckeditor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ the bundle, you can use a custom path (absolute):
CKEditor Release
~~~~~~~~~~~~~~~~

You can choose which CKEditor release (full, standard or basic) to download:
You can choose which CKEditor release (classic, ballon, ballon-block, inline, document) to download:

.. code-block:: bash

$ php bin/console ckeditor:install --release=basic
$ php bin/console ckeditor:install --release=classic

CKEditor Custom Build
~~~~~~~~~~~~~~~~~~~~~

It's also possible to use custom build generated using CKEditor online builder:
https://ckeditor.com/cke4/builder. Download ZIP archive from CKEditor website
and use your custom build ID from `build-config.js` file:
https://ckeditor.com/ckeditor-5/online-builder/. Download ZIP archive from CKEditor website
and use your custom build ID from zip filename:

.. code-block:: bash

Expand All @@ -79,7 +79,7 @@ If your want a specific CKEditor version, you can use:

.. code-block:: bash

$ php bin/console ckeditor:install --tag=4.6.0
$ php bin/console ckeditor:install --tag=41.0.0

Silence Progress bars
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions docs/usage/version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ in your configuration or in your widget:
# app/config/config.yml
fos_ck_editor:
base_path: "ckeditor"
js_path: "ckeditor/ckeditor.js"
js_path: "ckeditor/ckeditor5.js"

.. code-block:: php

$builder->add('field', 'ckeditor', [
'base_path' => 'ckeditor',
'js_path' => 'ckeditor/ckeditor.js',
'js_path' => 'ckeditor/ckeditor5.js',
]);

.. note::
Expand Down
7 changes: 5 additions & 2 deletions src/Builder/JsonBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function setValues(array $values, ?string $pathPrefix = null): self
foreach ($values as $key => $value) {
$path = sprintf('%s[%s]', $pathPrefix, $key);

if (\is_array($value) && !empty($value)) {
if (is_array($value) && !empty($value)) {
$this->setValues($value, $path);
} else {
$this->setValue($path, $value);
Expand Down Expand Up @@ -123,7 +123,10 @@ public function build(): string

$json = json_encode($values, $this->jsonEncodeOptions);

\assert(\is_string($json));
assert(is_string($json));

// Replace quoted CKEDITOR.* strings
$json = preg_replace('/"CKEDITOR\.([^"]+)"/', 'CKEDITOR.$1', $json);

return str_replace(
array_keys($this->escapes),
Expand Down
28 changes: 12 additions & 16 deletions src/Command/CKEditorInstallerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ protected function configure(): void
'release',
null,
InputOption::VALUE_OPTIONAL,
'CKEditor release (basic, standard, full or custom)'
'CKEditor release (regular, premium)'
)
->addOption(
'custom-build-id',
'user-interface',
null,
InputOption::VALUE_OPTIONAL,
'CKEditor custom build ID'
'CKEditor user interface (classic, balloon, balloon-block, bottom-toolbar, inline, document, button-grouping)'
)
->addOption('tag', null, InputOption::VALUE_OPTIONAL, 'CKEditor tag (x.y.z or latest)')
->addOption(
Expand All @@ -82,30 +82,26 @@ protected function configure(): void
The <info>%command.name%</info> command install CKEditor in your application:

<info>php %command.full_name%</info>

You can install it at a specific path (absolute):

<info>php %command.full_name% path</info>

You can install a specific release (basic, standard or full):

<info>php %command.full_name% --release=full</info>

You can install a specific version:
You can install a specific release (regular, premium):

<info>php %command.full_name% --tag=4.7.0</info>
<info>php %command.full_name% --release=regular</info>

You can install custom build generated on https://ckeditor.com/cke4/builder:
You can install a specific version:

<info>php %command.full_name% --release=custom --custom-build-id=574a82a0d3e9226d94b0e91d10eaa372</info>
<info>php %command.full_name% --tag=46.0.1</info>

If there is a previous CKEditor installation detected,
If there is a previous CKEditor installation detected,
you can control how it should be handled in non-interactive mode:

<info>php %command.full_name% --clear=drop</info>
<info>php %command.full_name% --clear=keep</info>
<info>php %command.full_name% --clear=skip</info>

You can exclude path(s) when extracting CKEditor:

<info>php %command.full_name% --exclude=samples --exclude=adapters</info>
Expand Down Expand Up @@ -140,8 +136,8 @@ private function createOptions(InputInterface $input, OutputInterface $output):
$options['release'] = $input->getOption('release');
}

if ($input->hasOption('custom-build-id')) {
$options['custom_build_id'] = $input->getOption('custom-build-id');
if ($input->hasOption('user-interface')) {
$options['user_interface'] = $input->getOption('user-interface');
}

if ($input->hasOption('tag')) {
Expand Down
Loading
Loading