Skip to content

Instantly share code, notes, and snippets.

View anyt's full-sized avatar

Andrii Yatsenko anyt

View GitHub Profile
@anyt
anyt / behat.yml.dist
Last active December 10, 2021 11:56
Run OroCommerce behat tests in headless mode
imports:
- behat.yml.dist
default: &default
extensions: &default_extensions
Behat\MinkExtension:
base_url: 'http://oro.ee.local'
sessions:
second_session:
oroSelenium2:
composer create-project davidrjonas/composer-lock-diff:^1.0 --working-dir=$APP_ROOT
local composer_diff=$(php -derror_reporting=0 ./composer-lock-diff/composer-lock-diff --from HEAD:composer.lock --to composer.lock --md)
rm -rf ${APP_ROOT}/composer-lock-diff
git commit -a -m "Updated composer.locks
${composer_diff}" || fatal "Can't commit to git"

Run on changed files:

php bin/phpcs {} -p --encoding=utf-8 --extensions=php --standard=vendor/oro/platform/build/Oro/phpcs.xml

php bin/php-cs-fixer fix {} --verbose --dry-run --config=vendor/oro/platform/build/.php-cs-fixer.php

php bin/phpmd {} text vendor/oro/platform/build/phpmd.xml --suffixes php 

where {} is the changed file

{"paths":["\/Users\/anyt\/Sites\/laboro\/maintenance-41\/package\/platform\/src\/Oro\/Bundle\/WsseAuthenticationBundle","\/Users\/anyt\/Sites\/laboro\/maintenance-41\/package\/platform\/src\/Oro\/Bundle\/CacheBundle","\/Users\/anyt\/Sites\/laboro\/maintenance-41\/application\/commerce-crm-ee\/vendor\/symfony\/symfony\/src\/Symfony\/Bundle\/FrameworkBundle","\/Users\/anyt\/Sites\/laboro\/maintenance-41\/application\/commerce-crm-ee\/vendor\/gos\/pubsub-router-bundle","\/Users\/anyt\/Sites\/laboro\/maintenance-41\/application\/commerce-crm-ee\/vendor\/symfony\/acl-bundle\/src","\/Users\/anyt\/Sites\/laboro\/maintenance-41\/application\/commerce-crm-ee\/vendor\/symfony\/symfony\/src\/Symfony\/Bundle\/SecurityBundle","\/Users\/anyt\/Sites\/laboro\/maintenance-41\/package\/platform\/src\/Oro\/Bundle\/SyncBundle","\/Users\/anyt\/Sites\/laboro\/maintenance-41\/application\/commerce-crm-ee\/vendor\/symfony\/symfony\/src\/Symfony\/Bundle\/TwigBundle","\/Users\/anyt\/Sites\/laboro\/maintenance-41\/application\/commerce
  1. Install PHP 7.4 with all required extensions.
sudo apt -y install php \
      php-fpm \
      php-cli \
      php-pdo \
      php-mysqlnd \
      php-xml \
      php-soap \
      php-gd \
@anyt
anyt / DemoBundle\Resources\views\layouts\default\oro_product_frontend_product_index\page\sidebar_filters.yml
Last active April 10, 2020 13:47
Move OroCommerce storefront datagrid filters to the left sidebar
layout:
actions:
- '@move':
id: product_datagrid_cell__product_add_to_cart_button_wrapper
parentId: product_datagrid_row_product_line_item_form_buttons
prepend: true
- '@move':
id: product_datagrid_toolbar_filter_container
parentId: page_sidebar
- '@move':
  1. Install PHP 7.3
brew install [email protected] 
  1. Run commands from the above command output. In my environment there are two of them after this phrase:

If you need to have [email protected] first in your PATH run:

 echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

Docker

Pgsql

Backup

docker exec -t $(docker-compose ps -q pgsql) pg_dumpall -c -U oro_db_user > dump.psql

Restore

@anyt
anyt / AppBundle.php
Last active May 17, 2018 16:06
Translate Task Priority field
<?php
namespace AppBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AppBundle extends Bundle
{
}
<?php
namespace Demo\Bundle\CalendarBundle\Migrations\Schema\v2_3;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\EntityExtendBundle\Tools\ExtendDbIdentifierNameGenerator;
use Oro\Bundle\MigrationBundle\Migration\Extension\NameGeneratorAwareInterface;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;