/usr/local/php/7.1/bin/php -v
SQL Server 実行されたSQLをSQLで取得
SELECT
sql.text,
req.session_id,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) sql
C# Dictionaryの多重配列
var arr = new Dictionary<int, Dictionary<int, string>>();
var ko_arr = new Dictionary<int, string>();
ko_arr.Add(int_i, str_s);
arr.Add(int_ii, ko_arr);
fc2 ワードプレス移行
/wp-content/plugins/movabletype-importer/movabletype-importer.php
if( !empty($line) )
$line .= “\n”;
↓ 空改行を反映してくれるようになる。
//if( !empty($line) )
$line .= “\n”;
$post->post_excerpt .= $line;
↓ コメントアウトしないと、一覧表示時、本文の先頭100文字くらいが表示されなくなる。
↓ (抜粋に空文字が入ってしまう)
//$post->post_excerpt .= $line;
Drupal Twig
$form[‘field_name’][$value[‘id’]] = [
‘#type’ => ‘table’, ‘#tag’ => ‘tr’,
‘#attributes’ => [‘style’ => ‘display:none’]
];
$form[‘field_name’][$value[‘id’]] = [
‘#id’ => ‘field_name’, ‘#type’ => ‘hidden’, ‘#value’ => 1,
‘#prefix’ => ‘1’, // 1<input type=”hidden”> みたいな表示になる
];
$form[‘input’][‘button_on_off’] = [
‘#type’ => ‘hidden’, ‘#value’ => $button_flag,
];
{{dump(_context|keys)}}
{{ content.field_col_name.0[‘#text’]|striptags|replace({‘ ’:”, ‘\r\n’:”, ‘\n’:”, ‘\r’:”})|slice(0,50)|raw }}
{% if “now”|date(‘Y-m-d H:i:s’) > content.field_col_date.0[‘#markup’]|date(‘Y^m^d H:i:s’) %}
{% set get_param = get_paramter(‘nid.content.param’) %}
{{ content.view_name_view_page_section }}
{% set item_array = item_array(content.field_col_name.0[‘#text’]) %}
{% if content.field_col_item.getValue()|first.value > 0 %}
{% for item in items if not break %}{{ item.content }}{% if loop.index == 4 %}{% set break = true %}{%- endif -%}
{% set rows_count = ((rows|length) / 8) | round(0, ‘cell’) %}
{% set get_color = drupal_field(‘field_col_coler’, ‘node’, get_param) %}
{{ drupal_field(‘field_col_link’, ‘node’, 3) }}
{{ drupal_view(‘view_name’, ‘view_page_section’) }}
{{ label.0[‘#context’].value|length > 10 ? label.0[‘#context’].value|slice(0, 10) ~ ‘…’ : label.0[‘#context’].value }}
{% if paragraph.field_col_link.0.url.toString() is empty %}
{{ row.cells.0.context[‘color_flag’] }}
{% if path(‘<current>’) == ‘/cart’ %}
{% url(‘<current>’)[‘#markup’]|split(‘/’)|last == get_paramter(‘nid.content.top’) %}
drupal.libraries.yml
item:
js:
js/link-and-url.js: {preprocess: false}
{{ attach_library(‘drupal/item’) }}
Drupal モジュール有効化
composer require ‘addtoany’;
C:/laragon/www/drupal/vendor/bin/drush pm:enable addtoany
Drupal プロキシ設定
sites/default/settings.php
$settings[‘http_client_config’][‘proxy’][‘http’] = ‘http://userid:password@proxy.xxx.jp:8089/’;
$settings[‘http_client_config’][‘proxy’][‘https’] = ‘http://userid:password@proxy.xxx.jp:8089/’;
$settings[‘http_client_config’][‘proxy’][‘no’] = [‘127.0.0.1’, ‘localhost’];
Drupal インストール
cd C:\laragon\www\drupal\
composer install
composer diagnose
set HTTP_PROXY=http://userid:password@proxy.xxx.jp:8089/
set HTTP_PROXY_REQUEST_FULLURI=1
set HTTPS_PROXY=http://userid:password@proxy.xxx.jp:8089/
set HTTPS_PROXY_REQUEST_FULLURI=0
composer diagnose
composer update
WORDPRESS ホーム全文表示
wp-content/themes/tortuga/template-parts/content.php
<?php tortuga_post_image_archives(); ?> 削除
<?php tortuga_post_image_single(); ?> 追加
<?php the_excerpt(); ?> 削除
<?php the_content(); ?> 追加
<?php tortuga_entry_tags(); ?> 追加
■スマホでは全文表示したくない場合
<?php if ( wp_is_mobile() ) : ?>
<?php tortuga_post_image_archives(); ?>
<?php else: ?>
<?php tortuga_post_image_single(); ?>
<?php endif; ?>
<?php if ( wp_is_mobile() ) : ?>
<?php the_excerpt(); ?>
<?php else: ?>
<?php the_content(); ?>
<?php tortuga_entry_tags(); ?>
<?php endif; ?>
select for update
begin transaction;
select * from tables where id = 1 for update;
これで、id=1のデータをselectしてる画面を読み込むと、クルクルで止まる。
↓↓↓これ実行で、読み込めるようになる。
rollback;