Update drupal/core Composer

kenneth
# Verify pending updates
composer outdated drupal/*

# Update drupal core and dependencies
composer update drupal/core --with-dependencies

# Drupal site using drupal-composer/drupal-project
composer update drupal/core webflo/drupal-core-require-dev --with-dependencies

# Once I was forced to remove composer.lock and vendor/ then redo composer update with dependencies
rm -Rf composer.lock vendor/

 

Update-Database NuGet Package Manager on Azure

kenneth

Firstly setup properly Azure DB firewall, then execute the following command within you Visual Studio,

 Update-Database -Configuration {Project_Namespace}.Migrations.Configuration -Verbose -ConnectionString "Server=tcp:{Azure_SQL_Server}.database.windows.net,1433;Initial Catalog={Azure_DB_Name};Persist Security Info=True;User ID={Azure_DB_Username};Password={Azure_DB_Password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" -ConnectionProviderName "System.Data.SqlClient"

 

Tar Linux Usage

kenneth

Create compress files

tar -czvf NEW_FILE_NAME.tar.gz /PATH/TO/DIRECTORY-OR-FILE-TO-COMPRESS

Extract files

tar -xzvf FILE_NAME.tar.gz -C /tmp

 

Drupal 8 format date

kenneth
\Drupal::service('date.formatter')->format($timestamp, $type, $format, $timezone, $langcode);
/* $type:  - One of the built-in formats: 
 *  'short', 'medium', 'long', 'html_datetime', 'html_date', 
 *  'html_time', 'html_yearless_date', 'html_week', 'html_month', 'html_year'. 
 */

 

Subscribe to