Magento 2 update dont start "rejected by your constraint" - composer-php
I cant update my Magento 2.3.6 Installation. composer update responds with
composer update
Loading composer repositories with package information
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
The requested package magento/product-community-edition ^2.4.0 exists as magento/product-community-edition[2.3.6] but these are rejected by your constraint.
I tried several variants ("2.4.2", "^2.4", "~2.4") of demanding 2.4.2 and every variant had the same result. On which constraint does the Error refer?
This is my composer.json
{
"name": "magento/magento2ce",
"description": "Magento 2 (Open Source)",
"type": "project",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"config": {
"preferred-install": "dist",
"sort-packages": true
},
"require": {
"clever/magento2": "2.4.2",
"magenerds/germanlaw": "1.2.1.1",
"magenerds/language-de_de": "^1.0",
"magento/product-community-edition": "^2.4.0",
"mageplaza/module-core": "^1.4",
"mageworx/module-giftcards": "^2.8",
"payone-gmbh/magento-2": "^2.7",
"trustedshops/trustedshops": "1.0.4",
"php": "~7.3.0||~7.4.0",
"ext-bcmath": "*",
"ext-ctype": "*",
"ext-curl": "*",
"ext-dom": "*",
"ext-gd": "*",
"ext-hash": "*",
"ext-iconv": "*",
"ext-intl": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-pdo_mysql": "*",
"ext-simplexml": "*",
"ext-soap": "*",
"ext-xsl": "*",
"ext-zip": "*",
"lib-libxml": "*",
"colinmollenhour/cache-backend-file": "~1.4.1",
"colinmollenhour/cache-backend-redis": "~1.10",
"colinmollenhour/credis": "~1.10",
"colinmollenhour/php-redis-session-abstract": "~1.4.0",
"composer/composer": "^1.9 || ^2.0",
"elasticsearch/elasticsearch": "~7.11.0",
"guzzlehttp/guzzle": "^6.3.3",
"laminas/laminas-captcha": "^2.10",
"laminas/laminas-code": "~3.3",
"laminas/laminas-crypt": "~3.3",
"laminas/laminas-db": "^2.12.0",
"laminas/laminas-dependency-plugin": "^2.1.0",
"laminas/laminas-di": "^3.2.0",
"laminas/laminas-eventmanager": "^3.0.0",
"laminas/laminas-feed": "^2.13.0",
"laminas/laminas-filter": "^2.11",
"laminas/laminas-http": "^2.6.0",
"laminas/laminas-i18n": "^2.7.3",
"laminas/laminas-json": "^3.2.0",
"laminas/laminas-mail": "^2.9.0",
"laminas/laminas-mime": "^2.8.0",
"laminas/laminas-modulemanager": "^2.7",
"laminas/laminas-mvc": "^3.2.0",
"laminas/laminas-server": "^2.6.1",
"laminas/laminas-servicemanager": "^3.6.0",
"laminas/laminas-session": "^2.10",
"laminas/laminas-soap": "^2.9.0",
"laminas/laminas-stdlib": "^3.2.1",
"laminas/laminas-text": "^2.6.0",
"laminas/laminas-uri": "^2.5.1",
"laminas/laminas-validator": "^2.6.0",
"laminas/laminas-view": "~2.12.0",
"league/flysystem": "^2.0",
"league/flysystem-aws-s3-v3": "^2.0",
"magento/composer": "1.6.0",
"magento/magento-composer-installer": ">=0.1.11",
"magento/zendframework1": "~1.14.2",
"monolog/monolog": "^1.17",
"paragonie/sodium_compat": "^1.6",
"pelago/emogrifier": "^5.0.0",
"php-amqplib/php-amqplib": "~2.10.0",
"phpseclib/mcrypt_compat": "1.0.8",
"phpseclib/phpseclib": "2.0.*",
"ramsey/uuid": "~3.8.0",
"symfony/console": "~4.4.0",
"symfony/event-dispatcher": "~4.4.0",
"symfony/process": "~4.4.0",
"tedivm/jshrink": "~1.4.0",
"tubalmartin/cssmin": "4.1.1",
"webonyx/graphql-php": "^0.13.8",
"wikimedia/less.php": "^3.0.0",
"web-token/jwt-framework": "^v2.2.7"
},
"require-dev": {
"allure-framework/allure-phpunit": "~1.2.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"friendsofphp/php-cs-fixer": "~2.18.1",
"lusitanian/oauth": "~0.8.10",
"magento/magento-coding-standard": "*",
"magento/magento2-functional-testing-framework": "^3.0",
"pdepend/pdepend": "~2.7.1",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.8.0",
"phpstan/phpstan": "^0.12.77",
"phpunit/phpunit": "^9",
"sebastian/phpcpd": "~5.0.0",
"squizlabs/php_codesniffer": "~3.5.4"
},
"suggest": {
"ext-pcntl": "Need for run processes in parallel mode"
},
"replace": {
"magento/module-marketplace": "*",
"magento/module-admin-analytics": "*",
"magento/module-admin-notification": "*",
"magento/module-advanced-pricing-import-export": "*",
"magento/module-amqp": "*",
"magento/module-amqp-store": "*",
"magento/module-analytics": "*",
"magento/module-asynchronous-operations": "*",
"magento/module-authorization": "*",
"magento/module-advanced-search": "*",
"magento/module-backend": "*",
"magento/module-backup": "*",
"magento/module-bundle": "*",
"magento/module-bundle-graph-ql": "*",
"magento/module-bundle-import-export": "*",
"magento/module-cache-invalidate": "*",
"magento/module-captcha": "*",
"magento/module-cardinal-commerce": "*",
"magento/module-catalog": "*",
"magento/module-catalog-customer-graph-ql": "*",
"magento/module-catalog-analytics": "*",
"magento/module-catalog-import-export": "*",
"magento/module-catalog-inventory": "*",
"magento/module-catalog-inventory-graph-ql": "*",
"magento/module-catalog-rule": "*",
"magento/module-catalog-rule-graph-ql": "*",
"magento/module-catalog-rule-configurable": "*",
"magento/module-catalog-search": "*",
"magento/module-catalog-url-rewrite": "*",
"magento/module-catalog-widget": "*",
"magento/module-checkout": "*",
"magento/module-checkout-agreements": "*",
"magento/module-checkout-agreements-graph-ql": "*",
"magento/module-cms": "*",
"magento/module-cms-url-rewrite": "*",
"magento/module-compare-list-graph-ql": "*",
"magento/module-config": "*",
"magento/module-configurable-import-export": "*",
"magento/module-configurable-product": "*",
"magento/module-configurable-product-sales": "*",
"magento/module-contact": "*",
"magento/module-cookie": "*",
"magento/module-cron": "*",
"magento/module-currency-symbol": "*",
"magento/module-customer": "*",
"magento/module-customer-analytics": "*",
"magento/module-customer-downloadable-graph-ql": "*",
"magento/module-customer-import-export": "*",
"magento/module-deploy": "*",
"magento/module-developer": "*",
"magento/module-dhl": "*",
"magento/module-directory": "*",
"magento/module-directory-graph-ql": "*",
"magento/module-downloadable": "*",
"magento/module-downloadable-graph-ql": "*",
"magento/module-downloadable-import-export": "*",
"magento/module-eav": "*",
"magento/module-elasticsearch": "*",
"magento/module-elasticsearch-6": "*",
"magento/module-elasticsearch-7": "*",
"magento/module-email": "*",
"magento/module-encryption-key": "*",
"magento/module-fedex": "*",
"magento/module-gift-message": "*",
"magento/module-gift-message-graph-ql": "*",
"magento/module-google-adwords": "*",
"magento/module-google-analytics": "*",
"magento/module-google-optimizer": "*",
"magento/module-graph-ql": "*",
"magento/module-graph-ql-cache": "*",
"magento/module-catalog-graph-ql": "*",
"magento/module-catalog-cms-graph-ql": "*",
"magento/module-catalog-url-rewrite-graph-ql": "*",
"magento/module-configurable-product-graph-ql": "*",
"magento/module-customer-graph-ql": "*",
"magento/module-eav-graph-ql": "*",
"magento/module-swatches-graph-ql": "*",
"magento/module-tax-graph-ql": "*",
"magento/module-url-rewrite-graph-ql": "*",
"magento/module-cms-url-rewrite-graph-ql": "*",
"magento/module-weee-graph-ql": "*",
"magento/module-cms-graph-ql": "*",
"magento/module-grouped-import-export": "*",
"magento/module-grouped-product": "*",
"magento/module-grouped-catalog-inventory": "*",
"magento/module-grouped-product-graph-ql": "*",
"magento/module-import-export": "*",
"magento/module-indexer": "*",
"magento/module-instant-purchase": "*",
"magento/module-integration": "*",
"magento/module-layered-navigation": "*",
"magento/module-login-as-customer": "*",
"magento/module-login-as-customer-admin-ui": "*",
"magento/module-login-as-customer-api": "*",
"magento/module-login-as-customer-assistance": "*",
"magento/module-login-as-customer-frontend-ui": "*",
"magento/module-login-as-customer-graph-ql": "*",
"magento/module-login-as-customer-log": "*",
"magento/module-login-as-customer-quote": "*",
"magento/module-login-as-customer-page-cache": "*",
"magento/module-login-as-customer-sales": "*",
"magento/module-media-content": "*",
"magento/module-media-content-api": "*",
"magento/module-media-content-catalog": "*",
"magento/module-media-content-cms": "*",
"magento/module-media-gallery": "*",
"magento/module-media-gallery-api": "*",
"magento/module-media-gallery-ui": "*",
"magento/module-media-gallery-ui-api": "*",
"magento/module-media-gallery-integration": "*",
"magento/module-media-gallery-synchronization": "*",
"magento/module-media-gallery-synchronization-api": "*",
"magento/module-media-content-synchronization": "*",
"magento/module-media-content-synchronization-api": "*",
"magento/module-media-content-synchronization-catalog": "*",
"magento/module-media-content-synchronization-cms": "*",
"magento/module-media-gallery-synchronization-metadata": "*",
"magento/module-media-gallery-metadata": "*",
"magento/module-media-gallery-metadata-api": "*",
"magento/module-media-gallery-catalog-ui": "*",
"magento/module-media-gallery-cms-ui": "*",
"magento/module-media-gallery-catalog-integration": "*",
"magento/module-media-gallery-catalog": "*",
"magento/module-media-gallery-renditions": "*",
"magento/module-media-gallery-renditions-api": "*",
"magento/module-media-storage": "*",
"magento/module-message-queue": "*",
"magento/module-msrp": "*",
"magento/module-msrp-configurable-product": "*",
"magento/module-msrp-grouped-product": "*",
"magento/module-multishipping": "*",
"magento/module-mysql-mq": "*",
"magento/module-new-relic-reporting": "*",
"magento/module-newsletter": "*",
"magento/module-newsletter-graph-ql": "*",
"magento/module-offline-payments": "*",
"magento/module-offline-shipping": "*",
"magento/module-page-cache": "*",
"magento/module-payment": "*",
"magento/module-paypal": "*",
"magento/module-paypal-captcha": "*",
"magento/module-paypal-graph-ql": "*",
"magento/module-persistent": "*",
"magento/module-product-alert": "*",
"magento/module-product-video": "*",
"magento/module-quote": "*",
"magento/module-quote-analytics": "*",
"magento/module-quote-bundle-options": "*",
"magento/module-quote-configurable-options": "*",
"magento/module-quote-downloadable-links": "*",
"magento/module-quote-graph-ql": "*",
"magento/module-related-product-graph-ql": "*",
"magento/module-release-notification": "*",
"magento/module-reports": "*",
"magento/module-require-js": "*",
"magento/module-review": "*",
"magento/module-review-graph-ql": "*",
"magento/module-review-analytics": "*",
"magento/module-robots": "*",
"magento/module-rss": "*",
"magento/module-rule": "*",
"magento/module-sales": "*",
"magento/module-sales-analytics": "*",
"magento/module-sales-graph-ql": "*",
"magento/module-sales-inventory": "*",
"magento/module-sales-rule": "*",
"magento/module-sales-sequence": "*",
"magento/module-sample-data": "*",
"magento/module-search": "*",
"magento/module-security": "*",
"magento/module-send-friend": "*",
"magento/module-send-friend-graph-ql": "*",
"magento/module-shipping": "*",
"magento/module-sitemap": "*",
"magento/module-store": "*",
"magento/module-store-graph-ql": "*",
"magento/module-swagger": "*",
"magento/module-swagger-webapi": "*",
"magento/module-swagger-webapi-async": "*",
"magento/module-swatches": "*",
"magento/module-swatches-layered-navigation": "*",
"magento/module-tax": "*",
"magento/module-tax-import-export": "*",
"magento/module-theme": "*",
"magento/module-theme-graph-ql": "*",
"magento/module-translation": "*",
"magento/module-ui": "*",
"magento/module-ups": "*",
"magento/module-url-rewrite": "*",
"magento/module-user": "*",
"magento/module-usps": "*",
"magento/module-variable": "*",
"magento/module-vault": "*",
"magento/module-vault-graph-ql": "*",
"magento/module-version": "*",
"magento/module-webapi": "*",
"magento/module-webapi-async": "*",
"magento/module-webapi-security": "*",
"magento/module-weee": "*",
"magento/module-widget": "*",
"magento/module-wishlist": "*",
"magento/module-wishlist-graph-ql": "*",
"magento/module-wishlist-analytics": "*",
"magento/theme-adminhtml-backend": "*",
"magento/theme-frontend-blank": "*",
"magento/theme-frontend-luma": "*",
"magento/language-de_de": "*",
"magento/language-en_us": "*",
"magento/language-es_es": "*",
"magento/language-fr_fr": "*",
"magento/language-nl_nl": "*",
"magento/language-pt_br": "*",
"magento/language-zh_hans_cn": "*",
"magento/framework": "*",
"magento/framework-amqp": "*",
"magento/framework-bulk": "*",
"magento/framework-message-queue": "*",
"trentrichardson/jquery-timepicker-addon": "1.4.3",
"components/jquery": "1.11.0",
"blueimp/jquery-file-upload": "5.6.14",
"components/jqueryui": "1.10.4",
"twbs/bootstrap": "3.1.0",
"tinymce/tinymce": "3.4.7",
"magento/module-tinymce-3": "*",
"magento/module-csp": "*",
"magento/module-aws-s3": "*",
"magento/module-remote-storage": "*",
"magento/module-jwt-framework-adapter": "*"
},
"conflict": {
"gene/bluefoot": "*"
},
"extra": {
"component_paths": {
"trentrichardson/jquery-timepicker-addon": "lib/web/jquery/jquery-ui-timepicker-addon.js",
"components/jquery": [
"lib/web/jquery.js",
"lib/web/jquery/jquery.min.js",
"lib/web/jquery/jquery-migrate.js"
],
"blueimp/jquery-file-upload": "lib/web/jquery/fileUploader",
"components/jqueryui": [
"lib/web/jquery/jquery-ui.js"
],
"twbs/bootstrap": [
"lib/web/jquery/jquery.tabs.js"
],
"tinymce/tinymce": "lib/web/tiny_mce_4"
}
},
"autoload": {
"psr-4": {
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
"Magento\\Setup\\": "setup/src/Magento/Setup/",
"Magento\\": "app/code/Magento/"
},
"psr-0": {
"": [
"app/code/",
"generated/code/"
]
},
"files": [
"app/etc/NonComposerComponentRegistration.php"
],
"exclude-from-classmap": [
"**/dev/**",
"**/update/**",
"**/Test/**"
]
},
"autoload-dev": {
"psr-4": {
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/",
"Magento\\PhpStan\\": "dev/tests/static/framework/Magento/PhpStan/"
}
},
"prefer-stable": true
}
What is the Problem here?
Upgrade your composer to the latest version and update the specified packages to match your environment
Related
Find adjacents in bidimensional array
I have a 2d array like this. [ ["+", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "+"], ["|", "*", "*", " ", " ", "*", " ", " ", " ", " ", "*", "*", "*", "*", "*", "*", "*", "*", " ", "*", " ", "|"], ["|", " ", "*", "*", "*", "*", " ", " ", " ", " ", "*", "*", " ", " ", "*", "*", " ", "*", " ", "*", " ", "|"], ["|", "*", " ", "*", " ", " ", " ", " ", "*", " ", "*", " ", "*", "*", "*", " ", "*", "*", "*", " ", "*", "|"], ["|", "*", "*", " ", " ", "*", " ", " ", "*", "*", "*", " ", "*", " ", "*", "*", " ", "*", "*", " ", " ", "|"], ["|", "*", " ", " ", " ", "*", " ", "*", " ", " ", " ", "*", "*", "*", "*", "*", " ", " ", " ", "*", "*", "|"], ["|", " ", " ", " ", " ", " ", "*", " ", "*", " ", " ", " ", "*", " ", " ", " ", " ", " ", "*", " ", " ", "|"], ["|", "*", "*", " ", "*", "*", "*", " ", "*", " ", " ", "*", "*", "*", "*", " ", "*", " ", " ", "*", " ", "|"], ["|", " ", "*", " ", "*", "*", "*", "*", " ", " ", " ", "*", "*", " ", " ", " ", " ", "*", " ", "*", "*", "|"], ["|", " ", "*", " ", " ", "*", " ", " ", "*", " ", "*", "*", "*", " ", "*", " ", "*", " ", " ", " ", "*", "|"], ["|", " ", "*", "*", "*", "*", " ", " ", " ", " ", "*", "*", " ", "*", "*", "*", " ", " ", " ", "*", "*", "|"], ["|", " ", " ", "*", "*", " ", "*", "*", "*", " ", " ", " ", " ", " ", " ", "*", "*", " ", " ", " ", " ", "|"], ["|", "*", " ", "*", "*", " ", "*", " ", "*", "*", " ", " ", " ", "*", " ", "*", "*", "*", " ", " ", " ", "|"], ["|", " ", " ", " ", "*", " ", "*", " ", "*", " ", "*", " ", " ", " ", " ", " ", " ", "*", "*", " ", " ", "|"], ["|", "*", " ", "*", " ", "*", " ", "*", " ", " ", " ", "*", " ", "*", "*", " ", "*", "*", "*", "*", "*", "|"], ["|", " ", " ", " ", "*", " ", "*", "*", "*", "*", "*", "*", " ", " ", "*", " ", " ", "*", "*", " ", "*", "|"], ["|", "*", "*", "*", "*", "*", " ", " ", " ", "*", " ", "*", " ", "*", "*", " ", "*", "*", " ", " ", "*", "|"], ["|", "*", " ", " ", " ", "*", "*", "*", "*", " ", " ", "*", " ", "*", " ", "*", " ", "*", " ", "*", "*", "|"], ["|", "*", " ", "*", "*", "*", "*", "*", "*", " ", "*", "*", "*", "*", " ", " ", " ", "*", " ", " ", " ", "|"], ["|", " ", " ", "*", " ", " ", "*", "*", " ", " ", " ", "*", " ", "*", "*", " ", " ", " ", " ", " ", "*", "|"], ["|", " ", "*", " ", " ", " ", "*", "*", "*", "*", "*", "*", "*", "*", "*", "*", "*", " ", " ", " ", "*", "|"], ["+", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "+"] ] and i need to find the number of bombs that are near each "*" as shown in the image below. Im doing this to get indexes but i dont know how to get the adjacents. #array_map.each_index do |i| subarray = #array_map[i] subarray.each_index do |x| puts String(i) << " " << String(x) << "... " << #array_map[i][x] end end
minefield = [ ["+", "-", "-", "-", "-", "-", "-", "-"], ["|", "*", "*", " ", " ", "*", " ", " "], ["|", " ", "*", "*", "*", "*", " ", " "], ["|", "*", " ", "*", " ", " ", " ", " "], ["|", "*", "*", " ", " ", "*", " ", " "], ["|", "*", " ", " ", " ", "*", " ", "*"], ["|", " ", " ", " ", " ", " ", "*", " "] ] last_row = minefield.size-1 #=> 6 last_col = minefield.first.size-1 #=> 7 adj_cols = (0..last_col).each_with_object({}) do |j,h| h[j] = ([j-1, 0].max..[j+1, last_col].min).to_a end #=> {0=>[0, 1], 1=>[0, 1, 2], 2=>[1, 2, 3], 3=>[2, 3, 4], 4=>[3, 4, 5], # 5=>[4, 5, 6], 6=>[5, 6, 7], 7=>[6, 7]} arr = (0..last_row).each_with_object(minefield.dup.map(&:dup)) do |i,a| adj_rows = ([i-1, 0].max..[i+1, last_row].min).to_a (0..last_col).each do |j| next unless a[i][j] == ' ' a[i][j] = adj_rows.product(adj_cols[j]).count do |r,c| minefield[r][c] == '*' end.to_s end end arr.each { |row| p row } displays ["+", "-", "-", "-", "-", "-", "-", "-"] ["|", "*", "*", "4", "4", "*", "2", "0"] ["|", "4", "*", "*", "*", "*", "2", "0"] ["|", "*", "6", "*", "5", "3", "2", "0"] ["|", "*", "*", "2", "3", "*", "3", "1"] ["|", "*", "3", "1", "2", "*", "4", "*"] ["|", "1", "1", "0", "1", "2", "*", "2"] See Array#product. adj_cols is a hash that gives an array of column indices to identify adjacent positions for each column index. It makes sense to do this once at the beginning rather than repeat the calculation for each element (row) of minefield. The array to be returned is initialized to minefield.dup.map(&:dup) so that minefield will not be mutated (modified). Here's an example calculation. i = 3 adj_rows = ([i-1, 0].max..[i+1, last_row].min).to_a #=> ([2, 0].max..[4, 6].min).to_a #=> (2..4).to_a #=> [2, 3, 4] j = 4 a = adj_cols[j] #=> [3, 4, 5] b = adj_rows.product(a) #=> [[2, 3], [2, 4], [2, 5], # [3, 3], [3, 4], [3, 5], # [4, 3], [4, 4], [4, 5]] b.count { |r,c| minefield[r][c] == '*' } #=> 5 Note that b includes [3, 4], which we know equals ' '. It does no harm to leave it in the count operation, however, as minefield[r][c] == '*' #=> false). We could alternatively write: b = adj_rows.product(a) - [[i, j]] #=> [[2, 3], [2, 4], [2, 5], # [3, 3], [3, 5], # [4, 3], [4, 4], [4, 5]] Here's a second example (that would apply if minefield[0][4] #=> ' '). i = 0 j = 4 adj_rows = ([i-1, 0].max..[i+1, last_row].min).to_a #=> [0, 1] j = 4 a = adj_cols[j] #=> [3, 4, 5] b = adj_rows.product(a) #=> [[0, 3], [0, 4], [0, 5], # [1, 3], [1, 4], [1, 5]] For the minefield array given in the question the return value is as follows. ["+", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "+"] ["|", "*", "*", "4", "4", "*", "2", "0", "0", "2", "*", "*", "*", "*", "*", "*", "*", "*", "4", "*", "2", "|"] ["|", "4", "*", "*", "*", "*", "2", "1", "1", "4", "*", "*", "6", "7", "*", "*", "7", "*", "6", "*", "3", "|"] ["|", "*", "6", "*", "5", "3", "2", "2", "*", "6", "*", "6", "*", "*", "*", "6", "*", "*", "*", "4", "*", "|"] ["|", "*", "*", "2", "3", "*", "3", "3", "*", "*", "*", "6", "*", "8", "*", "*", "5", "*", "*", "5", "3", "|"] ["|", "*", "3", "1", "2", "*", "4", "*", "4", "4", "3", "*", "*", "*", "*", "*", "3", "3", "4", "*", "*", "|"] ["|", "3", "3", "2", "3", "5", "*", "5", "*", "2", "2", "5", "*", "7", "5", "4", "2", "2", "*", "4", "3", "|"] ["|", "*", "*", "4", "*", "*", "*", "6", "*", "2", "2", "*", "*", "*", "*", "2", "*", "3", "4", "*", "3", "|"] ["|", "4", "*", "5", "*", "*", "*", "*", "3", "3", "4", "*", "*", "6", "3", "4", "3", "*", "3", "*", "*", "|"] ["|", "3", "*", "6", "6", "*", "5", "3", "*", "3", "*", "*", "*", "5", "*", "4", "*", "2", "3", "5", "*", "|"] ["|", "2", "*", "*", "*", "*", "4", "4", "3", "4", "*", "*", "4", "*", "*", "*", "4", "2", "1", "*", "*", "|"] ["|", "2", "5", "*", "*", "6", "*", "*", "*", "4", "3", "2", "3", "3", "6", "*", "*", "3", "2", "2", "2", "|"] ["|", "*", "3", "*", "*", "6", "*", "7", "*", "*", "2", "1", "1", "*", "3", "*", "*", "*", "3", "1", "0", "|"] ["|", "2", "4", "4", "*", "5", "*", "5", "*", "4", "*", "2", "3", "3", "4", "4", "6", "*", "*", "4", "2", "|"] ["|", "*", "2", "*", "4", "*", "5", "*", "5", "5", "5", "*", "3", "*", "*", "3", "*", "*", "*", "*", "*", "|"] ["|", "3", "5", "5", "*", "5", "*", "*", "*", "*", "*", "*", "5", "5", "*", "5", "5", "*", "*", "6", "*", "|"] ["|", "*", "*", "*", "*", "*", "6", "6", "6", "*", "6", "*", "5", "*", "*", "4", "*", "*", "5", "5", "*", "|"] ["|", "*", "6", "5", "7", "*", "*", "*", "*", "4", "5", "*", "7", "*", "5", "*", "5", "*", "4", "*", "*", "|"] ["|", "*", "4", "*", "*", "*", "*", "*", "*", "3", "*", "*", "*", "*", "5", "2", "3", "*", "3", "3", "3", "|"] ["|", "2", "4", "*", "4", "5", "*", "*", "6", "5", "6", "*", "8", "*", "*", "4", "3", "2", "1", "2", "*", "|"] ["|", "1", "*", "2", "1", "2", "*", "*", "*", "*", "*", "*", "*", "*", "*", "*", "*", "1", "0", "2", "*", "|"] ["+", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-", "+"]
This would work: minefield = [ ["+", "-", "-", "-", "-", "-", "+"], ["|", "*", "*", "*", "*", "*", "|"], ["|", "*", " ", "*", "*", " ", "|"], ["|", " ", " ", " ", "*", " ", "|"], ["|", "*", " ", "*", "*", "*", "|"], ["|", "*", "*", "*", " ", " ", "|"], ["+", "-", "-", "-", "-", "-", "+"] ] minefield.each_with_index do |row, y| row.each_with_index do |item, x| next unless item == '*' (y - 1).upto(y + 1) do |j| (x - 1).upto(x + 1) do |i| next if minefield[j][i] =~ /[*|+-]/ minefield[j][i] = minefield[j][i].to_i.succ.to_s end end end end It traverses the minefield array, skipping everything but bombs (next unless item == '*'). Once we encounter a bomb, we traverse its surroundings, skipping any special fields like *, |, +, or -. (this will also skip the bomb itself) And since bombs don't occur on the minefield's border, we can omit bounds checking. For the remaining surrounding fields (i.e. blanks and numeric strings), we convert that field to integer (so " " becomes 0), add 1 (via succ), convert it back to string and re-assign it to the field: (succ also works on strings, but we have to handle " " anyway) # blank # numeric minefield[j][i] #=> " " # "1" .to_i #=> 0 # 1 .succ #=> 1 # 2 .to_s #=> "1" # "2" In the end, the blank fields have been replaced by the bomb counts: [ ["+", "-", "-", "-", "-", "-", "+"], ["|", "*", "*", "*", "*", "*", "|"], ["|", "*", "5", "*", "*", "4", "|"], ["|", "2", "4", "5", "*", "4", "|"], ["|", "*", "5", "*", "*", "*", "|"], ["|", "*", "*", "*", "4", "2", "|"], ["+", "-", "-", "-", "-", "-", "+"] ]
Generate barcode image works local but not on the server (Symfony 4)
I want to generate barcodes in my application. When I run the code locally php bin/console server:run 0.0.0.0 on my Windows PC, it works like a charm, but when I push it to my Git repository and pull it on my Apache2 Server an test it there, I get black bars. The composer.json files are the same and the PHP Version also (PHP 7.4.7) I am working with Symfony 4 and picqer/php-barcode-generator (https://github.com/picqer/php-barcode-generator). In the controller: $barcodeList[$barcode->getId()]['img'] = base64_encode($generator->getBarcode(intval($barcode->getValue()), $generator::TYPE_EAN_13, 1, 25)); In the template: <img src="data:image/png;base64,{{ barcode.img }}" > Example of the result on my local PC: data:image/png;base64,/9j/4AAQSkZJRgABAQEAYABgAAD//gA+Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJSkcgSlBFRyB2OTApLCBkZWZhdWx0IHF1YWxpdHkK/9sAQwAIBgYHBgUIBwcHCQkICgwUDQwLCwwZEhMPFB0aHx4dGhwcICQuJyAiLCMcHCg3KSwwMTQ0NB8nOT04MjwuMzQy/9sAQwEJCQkMCwwYDQ0YMiEcITIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy/8AAEQgAGQBfAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+v/aAAwDAQACEQMRAD8ATUf+TevEf/cK/wDSTT66DxD/AMgPwn/2UCT/ANLbquf1H/k3rxH/ANwr/wBJNProPEP/ACA/Cf8A2UCT/wBLbqgDgPGX/JFbb/sK6b/6aIa3/Fv/ACM/w6/7GvU//TktYHjL/kitt/2FdN/9NENb/i3/AJGf4df9jXqf/pyWgDoPBv8AyHLn/soGpf8ApFNXAeBP+Pvw1/2CrX/0/rXf+Df+Q5c/9lA1L/0imrgPAn/H34a/7BVr/wCn9aADw9/yHPFn/ZP4/wD0ita3/CX/ACM/xF/7GvTP/Tk1YHh7/kOeLP8Asn8f/pFa1v8AhL/kZ/iL/wBjXpn/AKcmoAwPBv8AyRW5/wCwrqX/AKaJqPGX/IDtv+yf6b/6Ww0eDf8Akitz/wBhXUv/AE0TUeMv+QHbf9k/03/0thoA373/AJp9/wByx/7eVgXn/JBdG/7BV/8A+nS0rfvf+aff9yx/7eVgXn/JBdG/7BV//wCnS0oA39R/5N68R/8AcK/9JNProPEP/ID8J/8AZQJP/S26rn9R/wCTevEf/cK/9JNProPEP/ID8J/9lAk/9LbqgDgPGX/JFbb/ALCum/8Apohrf8W/8jP8Ov8Asa9T/wDTktYHjL/kitt/2FdN/wDTRDW/4t/5Gf4df9jXqf8A6cloA6Dwb/yHLn/soGpf+kU1cB4E/wCPvw1/2CrX/wBP613/AIN/5Dlz/wBlA1L/ANIpq4DwJ/x9+Gv+wVa/+n9aADw9/wAhzxZ/2T+P/wBIrWt/wl/yM/xF/wCxr0z/ANOTVgeHv+Q54s/7J/H/AOkVrW/4S/5Gf4i/9jXpn/pyagDA8G/8kVuf+wrqX/pomo8Zf8gO2/7J/pv/AKWw0eDf+SK3P/YV1L/00TUeMv8AkB23/ZP9N/8AS2GgDfvf+aff9yx/7eVgXn/JBdG/7BV//wCnS0rfvf8Amn3/AHLH/t5WBef8kF0b/sFX/wD6dLSgD//Z Result on my Apache Server: data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/wAALCAAZAF8BAREA/8QAFQABAQAAAAAAAAAAAAAAAAAAAAn/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/9oACAEBAAA/AJVAAAAAAAAAAAAAAAA//9k= composer.json { "type": "project", "license": "proprietary", "require": { "php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", "doctrine/doctrine-bundle": "*", "doctrine/doctrine-migrations-bundle": "^2.0", "doctrine/orm": "*", "dompdf/dompdf": "^0.8.3", "endroid/qr-code-bundle": "^3.3", "phpoffice/phpspreadsheet": "^1.11", "picqer/php-barcode-generator": "^2.0", "sensio/framework-extra-bundle": "^5.3", "sensiolabs/security-checker": "^5.0", "symfony/apache-pack": "^1.0", "symfony/asset": "4.3.*", "symfony/console": "4.3.*", "symfony/dotenv": "4.3.*", "symfony/flex": "^1.1", "symfony/form": "4.3.*", "symfony/framework-bundle": "4.3.*", "symfony/maker-bundle": "^1.11", "symfony/orm-pack": "^1.0", "symfony/security-bundle": "4.3.*", "symfony/serializer-pack": "^1.0", "symfony/swiftmailer-bundle": "^3.2", "symfony/twig-bundle": "4.3.*", "symfony/validator": "4.3.*", "symfony/web-server-bundle": "4.3.*", "symfony/yaml": "4.3.*", "twig/extensions": "^1.5" }, "config": { "preferred-install": { "*": "dist" }, "sort-packages": true }, "autoload": { "psr-4": { "App\\": "src/" } }, "autoload-dev": { "psr-4": { "App\\Tests\\": "tests/" } }, "replace": { "paragonie/random_compat": "2.*", "symfony/polyfill-ctype": "*", "symfony/polyfill-iconv": "*", "symfony/polyfill-php71": "*", "symfony/polyfill-php70": "*", "symfony/polyfill-php56": "*" }, "scripts": { "auto-scripts": { "cache:clear": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd", "security-checker security:check": "script" }, "post-install-cmd": [ "#auto-scripts" ], "post-update-cmd": [ "#auto-scripts" ] }, "conflict": { "symfony/symfony": "*" }, "extra": { "symfony": { "allow-contrib": false, "require": "4.3.*" } }, "require-dev": { "symfony/profiler-pack": "^1.0", "symfony/console": "^4.3" } }
Error in messenger during composer update symfony
I am trying to update my symfony installation from 4.1.7 but I receive the following error in my console: In MessenegerPass.php line 279: Invalid middleware: service "allow_no_handler" not found. Here is my composer.json { "type": "project", "license": "proprietary", "require": { "php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", "msgphp/user": "^0.7.0", "msgphp/user-bundle": "^0.7.0", "oneup/uploader-bundle": "^2.1", "sensio/framework-extra-bundle": "^5.2", "symfony/apache-pack": "^1.0", "symfony/asset": "4.2.*", "symfony/console": "4.2.*", "symfony/expression-language": "4.2.*", "symfony/flex": "^1.6", "symfony/form": "4.2.*", "symfony/framework-bundle": "4.2.*", "symfony/messenger": "4.2.*", "symfony/monolog-bundle": "^3.5", "symfony/orm-pack": "^1.0", "symfony/process": "4.2.*", "symfony/security-bundle": "4.2.*", "symfony/serializer-pack": "*", "symfony/swiftmailer-bundle": "^3.1", "symfony/twig-bundle": "4.2.*", "symfony/validator": "4.2.*", "symfony/web-link": "4.2.*", "symfony/yaml": "4.2.*" }, "require-dev": { "symfony/debug-pack": "*", "symfony/dotenv": "4.2.*", "symfony/maker-bundle": "^1.9", "symfony/profiler-pack": "*", "symfony/test-pack": "*", "symfony/web-server-bundle": "4.2.*" }, "config": { "preferred-install": { "*": "dist" }, "sort-packages": true }, "autoload": { "psr-4": { "App\\": "src/" } }, "autoload-dev": { "psr-4": { "App\\Tests\\": "tests/" } }, "replace": { "paragonie/random_compat": "2.*", "symfony/polyfill-ctype": "*", "symfony/polyfill-iconv": "*", "symfony/polyfill-php71": "*", "symfony/polyfill-php70": "*", "symfony/polyfill-php56": "*" }, "scripts": { "auto-scripts": { "cache:clear": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd" }, "post-install-cmd": [ "#auto-scripts" ], "post-update-cmd": [ "#auto-scripts" ] }, "conflict": { "symfony/symfony": "*" }, "extra": { "symfony": { "allow-contrib": false, "require": "4.2.*" } }, "minimum-stability": "dev", "prefer-stable": true } messsenger.yaml # see https://github.com/symfony/recipes/blob/master/symfony/messenger/4.1/config/packages/messenger.yaml framework: messenger: transports: # Uncomment the following line to enable a transport named "amqp" # amqp: '%env(MESSENGER_TRANSPORT_DSN)%' routing: # Route your messages to the transports # 'App\Message\YourMessage': amqp default_bus: command_bus buses: command_bus: middleware: - msgphp.messenger.console_message_receiver event_bus: middleware: - msgphp.messenger.console_message_receiver - allow_no_handler services: msgphp.messenger.command_bus: '#command_bus' msgphp.messenger.event_bus: '#event_bus' I tried also deleting composer.lock but still I get the same results. Any help would be appreciated.
Error requiring local pachage through composer
I have two symfony4 applications offer/management and offer/fetcher and for now, I want to use offer/management as the main project and offer/fetcher as a local dependency of offer/management. So I create separate directories: offer-management with own composer.json offer-fetcher with own composer.json Here is a composer.json for offer/fetcher: { "name": "offer/fetcher", "type": "project", "version": "1.0.0", "license": "proprietary", "require": { "php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", "nelmio/api-doc-bundle": "^3.3", "symfony/console": "*", "symfony/flex": "^1.1", "symfony/framework-bundle": "*", "symfony/messenger": "*", "symfony/monolog-bundle": "^3.3", "symfony/orm-pack": "^1.0", "symfony/yaml": "*" }, "require-dev": { "symfony/test-pack": "^1.0", "symfony/web-server-bundle": "*" }, "config": { "preferred-install": { "*": "dist" }, "sort-packages": true }, "autoload": { "psr-4": { "AppOffersFetcher\\": "src/" } }, "autoload-dev": { "psr-4": { "AppOffersFetcher\\Tests\\": "tests/" } }, "replace": { "paragonie/random_compat": "*", "symfony/polyfill-ctype": "*", "symfony/polyfill-iconv": "*", "symfony/polyfill-php71": "*", "symfony/polyfill-php70": "*", "symfony/polyfill-php56": "*" }, "scripts": { "auto-scripts": { "cache:clear": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd", "security-checker security:check": "script" }, "post-install-cmd": [ "#auto-scripts" ], "post-update-cmd": [ "#auto-scripts" ] }, "conflict": { "symfony/symfony": "*" }, "extra": { "symfony": { "allow-contrib": false, "require": "4.1.*" } } } and here is a composer.json for offer/management: { "name": "offer/management", "type": "project", "license": "proprietary", "repositories": [ { "type": "path", "url": "../offer-fetcher" } ], "require": { "offer/fetcher": "^1.0", "php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", "nelmio/api-doc-bundle": "^3.3", "symfony/console": "*", "symfony/flex": "^1.1", "symfony/framework-bundle": "*", "symfony/messenger": "*", "symfony/monolog-bundle": "^3.3", "symfony/orm-pack": "^1.0", "symfony/yaml": "*" }, "require-dev": { "symfony/test-pack": "^1.0", "symfony/web-server-bundle": "*" }, "config": { "preferred-install": { "*": "dist" }, "sort-packages": true }, "autoload": { "psr-4": { "OfferManagement\\": "src/" } }, "autoload-dev": { "psr-4": { "OfferManagement\\Tests\\": "tests/" } }, "replace": { "paragonie/random_compat": "*", "symfony/polyfill-ctype": "*", "symfony/polyfill-iconv": "*", "symfony/polyfill-php71": "*", "symfony/polyfill-php70": "*", "symfony/polyfill-php56": "*" }, "scripts": { "auto-scripts": { "cache:clear": "symfony-cmd", "assets:install %PUBLIC_DIR%": "symfony-cmd", "security-checker security:check": "script" }, "post-install-cmd": [ "#auto-scripts" ], "post-update-cmd": [ "#auto-scripts" ] }, "conflict": { "symfony/symfony": "*" }, "extra": { "symfony": { "allow-contrib": false, "require": "4.1.*" } } } and the error when I run composer install from offer-management is: Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for offer/management dev-master -> satisfiable by offer/management[dev-master]. - don't install offer/fetcher 1.0.0|remove offer/management dev-master - Installation request for offer/fetcher ^1.0 -> satisfiable by offer/fetcher[1.0.0].
Requirements could not be resolved personal repository
Anybody can help me solve this issue? I'm trying to add a dependency on a personal repository. I didn't have any issues with my other repositories, but I have issues with this one. Here is the composer.json file of the personal repository : { "name": "bundle-name-1", "type": "symfony-bundle", "license": "proprietary", "require": { "php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", "symfony/console": "*", "symfony/flex": "^1.1", "symfony/framework-bundle": "*", "symfony/monolog-bundle": "^3.3", "symfony/yaml": "*" }, "require-dev": { "symfony/dotenv": "*", "symfony/test-pack": "^1.0" }, "config": { "preferred-install": { "*": "dist" }, "sort-packages": true }, ... "replace": { "paragonie/random_compat": "2.*", "symfony/polyfill-ctype": "*", "symfony/polyfill-iconv": "*", "symfony/polyfill-php71": "*", "symfony/polyfill-php70": "*", "symfony/polyfill-php56": "*" }, ... "conflict": { "symfony/symfony": "*" }, "extra": { "symfony": { "allow-contrib": false, "require": "4.1.*" } } } Here is the composer.json file of the main project : { "name": "bundle-name-2", "type": "symfony-bundle", "license": "proprietary", "require": { "php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", "symfony/console": "*", "symfony/flex": "^1.1", "symfony/framework-bundle": "*", "symfony/monolog-bundle": "^3.3", "symfony/yaml": "*", "bundle-name-1": "~0.9.2" }, "require-dev": { "symfony/dotenv": "*", "symfony/test-pack": "^1.0" }, "config": { "preferred-install": { "*": "dist" }, "sort-packages": true }, "repositories": [ {"type": "vcs", "url": "ssh://git#stash.domainname.com:8999/core/bundlename1repository.git"} ], ... "replace": { "paragonie/random_compat": "2.*", "symfony/polyfill-ctype": "*", "symfony/polyfill-iconv": "*", "symfony/polyfill-php71": "*", "symfony/polyfill-php70": "*", "symfony/polyfill-php56": "*" }, ... "conflict": { "symfony/symfony": "*" }, "extra": { "symfony": { "allow-contrib": false, "require": "4.1.*" } } } I've removed autoload and scripts for both. The composer message is : don't install bundle-name-1 v0.9.3|remove bundle-name-2 dev-master Installation request for bundle-name-1 ~0.9.2 -> satisfiable by bundle-name-1[v0.9.2, v0.9.3].
The issue comes from the "replace" clause. It was added automatically when creating the symfony skeleton and my bundle wasn't replacing any of these. Solution : Remove the "replace" clause from the "composer.json". Run "composer update"