Open your .gitconfig and put this into the file:
[merge]
tool = extMerge
[mergetool "extMerge"]
cmd = extMerge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
trustExitCode = false
| <?php | |
| /** | |
| * Implements hook_field_widget_WIDGET_TYPE_form_alter(). | |
| * | |
| * Place this code into YOUR_MODULE.module file replacing YOUR_MODULE placeholder | |
| * with your modules' name. | |
| */ | |
| function YOUR_MODULE_field_widget_commerce_product_variation_attributes_form_alter(&$element, FormStateInterface $form_state, $context) { | |
| // Make ajax responsive changes on attribute fields' properties. |
| <?php | |
| /** | |
| * Implements hook_commerce_add_to_cart_message_alter(). | |
| * | |
| * Apply this patch: https://www.drupal.org/node/2905624#comment-12242300 | |
| * Place this code into YOUR_MODULE.module file replacing YOUR_MODULE placeholder | |
| * with your modules' name. | |
| */ | |
| function YOUR_MODULE_commerce_add_to_cart_message_alter(&$message, &$order, &$order_item) { |
| { | |
| "packages": { | |
| "drugan/project-base": { | |
| "dev-8.x": { | |
| "name": "drugan/project-base", | |
| "version": "8.4", | |
| "dist": { | |
| "type": "zip", | |
| "url": "https://github.com/drugan/project-base/archive/8.x.zip" | |
| } |
First, as an alternative install this version of the Drupal Commerce:
composer create-project --repository=https://raw.githubusercontent.com/drugan/project-base/8.x/packages.json drugan/project-base some-dir --stability dev
If desired, you might not install it as a Drupal site, instead use it as a
repository for all other of your projects (local or remote) to pull from. After
composer installing open .gitignore file in the root of a repo and replace its content
| CREATE TABLE IF NOT EXISTS continents ( continent_code VARCHAR(2) PRIMARY KEY, continent_name VARCHAR(25) NOT NULL ); | |
| INSERT IGNORE INTO continents VALUES ('AS', 'Asia'), ('AF', 'Africa'), ('NA', 'North America'), ('SA', 'South America'), ('EU', 'Europe'), ('AU', 'Australia') | |
| ON DUPLICATE KEY UPDATE continent_name = VALUES(continent_name); | |
| CREATE TABLE IF NOT EXISTS countries ( country_code VARCHAR(2) PRIMARY KEY, country_name VARCHAR(25), continent_code VARCHAR(2) ); | |
| INSERT IGNORE INTO countries VALUES ('IN', 'India', 'AS'), ('ZA', 'South Africa', 'AF'), ('US', 'United States', 'NA'), ('BR', 'Brazil', 'SA'), ('AU', 'Australia', 'AU'), ('AQ', 'Antarctica', 'AN') | |
| ON DUPLICATE KEY UPDATE country_name = VALUES(country_name); | |
| /* "SELF" JOIN trick. */ | |
| SELECT cr1.country_name "Name Self", cr1.country_code "Country Self", cr1.continent_code "Continent Self" |
| CREATE TABLE IF NOT EXISTS employee ( | |
| employee_id INT PRIMARY KEY, | |
| first_name VARCHAR(50), | |
| last_name VARCHAR(50), | |
| birthdate DATE, | |
| hire_date DATE, | |
| job_title VARCHAR(50), | |
| department VARCHAR(50), | |
| salary DECIMAL(10, 2) | |
| ); |
| <?php | |
| use Drupal\Core\Database\Database; | |
| // Method one. | |
| $result = \Drupal::database()->query('SELECT * FROM my_additional_db.my_table')->fetchAllAssoc('my_column'); | |
| dump($result); | |
| // Method two. | |
| $conn = Database::setActiveConnection('my_extra_connection'); |