Error installing SonataMediaBundle on Symfony CMF - symfony-cmf

I try install SonataMediaBundle with Symfony CMF Sandbox and have this exception after install
Catchable fatal error:
Argument 2 passed to Sonata\CoreBundle\Model\BaseManager::__construct()
must implement interface Doctrine\Common\Persistence\ManagerRegistry,
instance of Sonata\DoctrinePHPCRAdminBundle\Model\ModelManager given,
called in cmf-sandbox/app/cache/dev/appDevDebugProjectContainer.php on line 7986
and defined in cmf-sandbox/vendor/sonata-project/core-bundle/Model/BaseManager.php on line 41
It seems like version collision, but bundles pack was installed via composer with no conflicts, also I try to install older/newer versions, but no result.
I try phpcr and mongodb, is the same.
composer.json:
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"twig/extensions": "~1.0",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"symfony-cmf/symfony-cmf": "1.1.*",
"symfony-cmf/simple-cms-bundle": "1.1.*",
"symfony-cmf/search-bundle": "1.0.*",
"symfony-cmf/create-bundle": "1.1.*",
"symfony-cmf/seo-bundle":"1.0.*",
"jackalope/jackalope-doctrine-dbal": "1.1.*",
"jackalope/jackalope-jackrabbit": "1.1.*",
"doctrine/doctrine-bundle": "1.2.*",
"doctrine/data-fixtures": "1.0.*",
"doctrine/doctrine-cache-bundle": "1.0.*",
"sonata-project/cache-bundle": "2.1.*",
"sonata-project/doctrine-phpcr-admin-bundle": "1.1.*",
"sonata-project/jquery-bundle": "1.8.3",
"symfony-cmf/block-bundle": "1.1.*",
"eko/feedbundle": "1.0.*",
"lunetics/locale-bundle": "2.2.*",
"liip/imagine-bundle": "0.21.*",
"wjzijderveld/check-bundles": "1.0.*",
"helios-ag/fm-elfinder-bundle": "1.4.*",
"sonata-project/media-bundle": "2.3.*#dev"
config.yml:
# cmf configuration
doctrine_phpcr:
# configure the PHPCR session
session:
backend: %phpcr_backend%
workspace: %phpcr_workspace%
username: %phpcr_user%
password: %phpcr_pass%
# enable the ODM layer
odm:
auto_mapping: true
mappings:
SonataMediaBundle:
prefix: Sonata\MediaBundle\PHPCR
auto_generate_proxy_classes: %kernel.debug%
locales:
en:
- de
- fr
sonata_media:
default_context: default
db_driver: doctrine_phpcr #doctrine_orm # or doctrine_mongodb
contexts:
default: # the default context is mandatory
providers:
- sonata.media.provider.dailymotion
- sonata.media.provider.youtube
- sonata.media.provider.image
- sonata.media.provider.file
formats:
small: { width: 100 , quality: 70}
big: { width: 500 , quality: 70}
cdn:
server:
path: /uploads/media # http://media.sonata-project.org/
filesystem:
local:
directory: %kernel.root_dir%/../web/uploads/media
create: false

Its a bit tricky to get the right versions of the Sonata Bundles, we just released 1.1 and tried to improve things a bit there by making the dependencies a bit more explicit. Can you try again?

Related

Antd_dayjs_vite_plugin : TypeError: (0 , import_antd_dayjs_vite_plugin.default) is not a function

At the beginning I got a problem with the french date in the antd calendar. I use vite so I install the antd_dayjs_vite_plugin to switch from Moment.js to Day.js. It worked well but this morning the vite build process is in error. I tried to update the antd_dayjs_vite_plugin version (was 1.1.4) and now I got the same problem when I try to lunch a yarn dev as you can see :
$ yarn dev
yarn run v1.22.15
$ vite
failed to load config from vite.config.ts
error when starting dev server:
TypeError: (0 , import_antd_dayjs_vite_plugin.default) is not a function [...]
Here is the code in vite.config.ts :
import reactRefresh from '#vitejs/plugin-react-refresh';
import antdDayjs from 'antd-dayjs-vite-plugin';
import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [reactRefresh(), antdDayjs()],
server: {
host: process.env.HOST || '127.0.0.1',
},
resolve: {
alias: [{ find: '#', replacement: '/src' }],
},
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
},
build: {
commonjsOptions: {
transformMixedEsModules: true,
},
},
});
The problem also appears in antd-dayjs-vite-plugin 1.1.4 version or the 1.2.2. I also already tried to update vite to 3.1 (was in 2.5).
I don't understand the code seems to be exactly the same as the usage in the Readme package.
Thanks in advance for your help. 🙏🏻
Seams that a default export is expected by vite.js (tried to replace import statement with import {antdDayjs} from 'antd-dayjs-vite-plugin'; without success)
I was able to create a workaround using patch-package with the below steps:
modifiy node_modules/antd-dayjs-vite-plugin/dist-node/index.js
at the very end of that file, add exports.default = antdDayjs;
create a patch for antd-dayjs-vite-plugin
ensure you have the postinstall script (refer to patch-package doc)

How to use the SFTP drivers in october CMS

Within octoberCMS there's a plugin called Drivers to install some third party drivers for storage; I want to use the SFTP drivers from FlySystem. I've adjusted the composer file of the driver plugin and added the flysystem;
"require": {
"php": ">=7.0",
"composer/installers": "~1.0",
"aws/aws-sdk-php": "~3.0",
"pda/pheanstalk": "~3.0",
"iron-io/iron_mq": "~1.5",
"predis/predis": "~1.0",
"phpseclib/phpseclib": "~2.0",
"league/flysystem-rackspace": "~1.0",
"league/flysystem-aws-s3-v3": "~1.0",
"guzzlehttp/guzzle": "~6.3",
"league/flysystem-sftp":"~1.0"
},
After installing the plugin the vendor folder contains also the flysystem-sftp files, but when I add an sftp record to the filesystems.php file in the config folder like
'sftp' => [
'driver' => 'sftp',
'host' => 'myftp.mydomain.com',
'username' => '########',
'password' => '########',
'port' => '21',
'passive' => 'true',
],
October gives an error: "Driver [sftp] is not supported", when I try to use it. Is there any one who can help me further?

Not able to find curator.yml (elasticsearch-curator) in linux

Official site of elasticsearch says the default config file exists in /home/username/.curator/curator.yml
https://www.elastic.co/guide/en/elasticsearch/client/curator/current/command-line.html
But there is no such folder.
Also, I tried creating curator.yml and give path using --config option. But, it throws me error
curator --config ./curator.yml
Error: no such option: --config
Installation was done using apt
sudo apt-get update && sudo apt-get install elasticsearch-curator
Help me create a config file as I want to delete my log-indexes
Please note that the documentation does not say it that file exists after creation, it says:
If --config and CONFIG.YML are not provided, Curator will look in ~/.curator/curator.yml for the configuration file.
The file must be created by the end user.
Also, if you installed via:
sudo apt-get update && sudo apt-get install elasticsearch-curator
but did not add the official Elastic repository for Curator, then you installed an older version. Please check which version you are running with:
$ curator --version
curator, version 5.4.1
If you do not see the current version (5.4.1 at the time this answer was added), then you do not have the appropriate repository installed.
The official documentation provides an example client configuration file here.
There are also many examples of action files in the examples
Yes, one needs to create both the curator.yml as well as action.yml files.
Since I am on centos 7, I happened to install curator from RPM, and in its default /opt/elastic-curator' I could follow up this good blog (but badly formatted!) : https://anchormen.nl/blog/big-data-services/monitoring-aws-redshift-with-elasticsearch/ to ge the files as follows(you may modify according to your needs) :
curator.yml
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
client:
hosts:
- <host1>
- <host2, likewise upto hostN >
port: 9200
url_prefix:
use_ssl: False
certificate:
client_cert:
client_key:
ssl_no_validate: False
http_auth:
timeout: 30
master_only: False
logging:
loglevel: INFO
logfile: /var/log/curator.log
logformat: default
blacklist: []
and an action.yml as follows :
---
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
1:
action: rollover
description: Rollover the index associated with index 'name', which should be in the form of prefix-000001 (or similar),or prefix-YYYY.MM.DD-1.
options:
disable_action: False
name: redshift_metrics_daily
conditions:
max_age: 1d
extra_settings:
index.number_of_shards: 2
index.number_of_replicas: 1
2:
action: rollover
description: Rollover the index associated with index 'name' , which should be in the form of prefix-000001 (or similar), or prefix-YYYY.MM.DD-1.
options:
disable_action: False
name: redshift_query_metadata_daily
conditions:
max_age: 1d
extra_settings:
index.number_of_shards: 2
index.number_of_replicas: 1

Requirejs optimizer. Exclude all dependencies

I'm using requireJS in Rails application with requirejs-rails gem. What I'm trying to achieve is to create several bundles which contain common code. For example libs_a, libs_b, libs_c, ... Then for some pages of the application create own bundles which contain modules related only to those pages. Problem is that all common modules should be listed for each page to exclude them from optimized files, like:
# config/requirejs.yml
modules:
# in 'libs' all dependencies should be included
- name: 'libs_a'
...
- name: 'libs_b'
...
- name: 'libs_c'
...
# in 'pages' all dependencies should be excluded since all of them are already in 'libs'
- name: 'page_a'
include: ['a1', 'a2', 'a3', ...]
exclude: ['libs_a', 'libs_b', 'libs_c', ...]
- name: 'page_b'
include: ['b1', 'b2', 'b3', ...]
exclude: ['libs_a', 'libs_b', 'libs_c', ...]
bundles:
libs_a: [...]
libs_b: [...]
libs_c: [...]
...
With large number of modules it becomes a bit cumbersome. As I understood there is no option to include in optimized file only those modules which are listed in build config and skip all dependencies. So that repeating exclude: ['libs_a',...] could be avoided. How do you solve such problem?
Just an idea - It should be possible to define build config as a .js file. If you do that, you will be able to include simple logic to amend config with excluded libraries.

using tcpdf in zend framework 2

my composer.json file look like this
.....
"require": {
"php": ">=5.5",
"zendframework/zendframework": "2.5.1",
"doctrine/doctrine-orm-module": "0.7.*",
"zendframework/zend-developer-tools": "dev-master",
"zendframework/zftool": "dev-master",
"tecnickcom/tcpdf" : "dev-master"
}...
and now updating composer updaing the tcpdf directory and download all the files but i am unable to create new instance by new tcpdf(); or with new \tcpdf();
the error says
Class '\tcpdf' not found in S:\xampp...

Resources