🥺

開発日誌 2020年12月24日

2020/12/24に公開

開発日誌

初投稿につき練習がてら書きます。内容は無い模様。

EC-CUBE

docker-compose でインストール

インストール

$ git clone git@github.com:EC-CUBE/ec-cube.git
$ docker-compose up -d
$ docker-compose exec ec-cube bin/console eccube:install

エンドユーザー画面

http://localhost:8080/

管理者画面

http://localhost:8080/admin/ (admin/password)

EC-CUBEのセッションをファイルからDBに移行

テーブルの拡張

アノテーション

https://symfony.com/doc/current/the-fast-track/ja/8-doctrine.html

追加

app/Customize/Entity/ 以下に {TableName}.php 作成

TableName.php

app/Customize/Repository/ 以下に {TableName}Repository.php 作成

TableNameRepository.php

更新(というより拡張)

$ php bin/console eccube:generate:proxies
$ php bin/console cache:clear --no-warmup
$ php bin/console doctrine:schema:update --dump-sql
$ php bin/console doctrine:schema:update --dump-sql --force

Migration

初期化

php bin/console doctrine:migrations:generate

状態

php bin/console doctrine:migrations:status

差分

php bin/console doctrine:migrations:diff

更新

php bin/console doctrine:migrations:migrate

戻す

php bin/console doctrine:migrations:execute --down

Symfonyのコマンド

php bin/console list

Symfony 3.4.42 (kernel: Eccube, env: dev, debug: true)

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "dev"]
      --no-debug        Switches off debug mode.
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  about                                      Displays information about the current project
  help                                       Displays help for a command
  list                                       Lists commands
 assets
  assets:install                             Installs bundles web assets under a public directory
 cache
  cache:clear                                Clears the cache
  cache:pool:clear                           Clears cache pools
  cache:pool:prune                           Prunes cache pools
  cache:warmup                               Warms up an empty cache
 config
  config:dump-reference                      Dumps the default configuration for an extension
 debug
  debug:autowiring                           Lists classes/interfaces you can use for autowiring
  debug:config                               Dumps the current configuration for an extension
  debug:container                            Displays current services for an application
  debug:event-dispatcher                     Displays configured listeners for an application
  debug:form                                 Displays form type information
  debug:router                               Displays current routes for an application
  debug:swiftmailer                          Displays current mailers for an application
  debug:translation                          Displays translation messages information
  debug:twig                                 Shows a list of twig functions, filters, globals and tests
 doctrine
  doctrine:cache:clear-collection-region     Clear a second-level cache collection region
  doctrine:cache:clear-entity-region         Clear a second-level cache entity region
  doctrine:cache:clear-metadata              Clears all metadata cache for an entity manager
  doctrine:cache:clear-query                 Clears all query cache for an entity manager
  doctrine:cache:clear-query-region          Clear a second-level cache query region
  doctrine:cache:clear-result                Clears result cache for an entity manager
  doctrine:cache:contains                    Check if a cache entry exists
  doctrine:cache:delete                      Delete a cache entry
  doctrine:cache:flush                       [doctrine:cache:clear] Flush a given cache
  doctrine:cache:stats                       Get stats on a given cache provider
  doctrine:database:create                   Creates the configured database
  doctrine:database:drop                     Drops the configured database
  doctrine:database:import                   Import SQL file(s) directly to Database.
  doctrine:ensure-production-settings        Verify that Doctrine is properly configured for a production environment
  doctrine:fixtures:load                     Load data fixtures to your database
  doctrine:generate:entities                 [generate:doctrine:entities] Generates entity classes and method stubs from your mapping information
  doctrine:mapping:convert                   [orm:convert:mapping] Convert mapping information between supported formats
  doctrine:mapping:import                    Imports mapping information from an existing database
  doctrine:mapping:info                      
  doctrine:migrations:diff                   Generate a migration by comparing your current database to your mapping information.
  doctrine:migrations:execute                Execute a single migration version up or down manually.
  doctrine:migrations:generate               Generate a blank migration class.
  doctrine:migrations:latest                 Outputs the latest version number
  doctrine:migrations:migrate                Execute a migration to a specified version or the latest available version.
  doctrine:migrations:status                 View the status of a set of migrations.
  doctrine:migrations:version                Manually add and delete migration versions from the version table.
  doctrine:query:dql                         Executes arbitrary DQL directly from the command line
  doctrine:query:sql                         Executes arbitrary SQL directly from the command line.
  doctrine:schema:create                     Executes (or dumps) the SQL needed to generate the database schema
  doctrine:schema:drop                       Executes (or dumps) the SQL needed to drop the current database schema
  doctrine:schema:validate                   Validate the mapping files
 eccube
  eccube:composer:install                    
  eccube:composer:remove                     
  eccube:composer:require                    
  eccube:composer:require-already-installed  
  eccube:composer:update                     
  eccube:delete-carts                        Delete Carts from the database
  eccube:fixtures:generate                   Dummy data generator
  eccube:fixtures:load                       Load data fixtures to your database.
  eccube:generate:proxies                    Generate entity proxies
  eccube:install                             Install EC-CUBE
  eccube:plugin:disable                      
  eccube:plugin:enable                       
  eccube:plugin:generate                     Generate plugin skeleton.
  eccube:plugin:install                      Install plugin from local.
  eccube:plugin:schema-update                Execute plugin schema update.
  eccube:plugin:uninstall                    Uninstall plugin.
  eccube:plugin:update                       Execute plugin update process.
  eccube:schema:update                       [doctrine:schema:update] Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata
 lint
  lint:twig                                  Lints a template and outputs encountered errors
  lint:xliff                                 Lints a XLIFF file and outputs encountered errors
  lint:yaml                                  Lints a file and outputs encountered errors
 make
  make:auth                                  Creates a Guard authenticator of different flavors
  make:command                               Creates a new console command class
  make:controller                            Creates a new controller class
  make:crud                                  Creates CRUD for Doctrine entity class
  make:entity                                Creates or updates a Doctrine entity class, and optionally an API Platform resource
  make:fixtures                              Creates a new class to load Doctrine fixtures
  make:form                                  Creates a new form class
  make:functional-test                       Creates a new functional test class
  make:message                               Creates a new message and handler
  make:messenger-middleware                  Creates a new messenger middleware
  make:migration                             Creates a new migration based on database changes
  make:registration-form                     Creates a new registration form system
  make:reset-password                        Create controller, entity, and repositories for use with symfonycasts/reset-password-bundle.
  make:serializer:encoder                    Creates a new serializer encoder class
  make:serializer:normalizer                 Creates a new serializer normalizer class
  make:subscriber                            Creates a new event subscriber class
  make:twig-extension                        Creates a new Twig extension class
  make:unit-test                             Creates a new unit test class
  make:user                                  Creates a new security user class
  make:validator                             Creates a new validator and constraint class
  make:voter                                 Creates a new security voter class
 router
  router:match                               Helps debug routes by simulating a path info match
 security
  security:encode-password                   Encodes a password.
 server
  server:log                                 Starts a log server that displays logs in real time
  server:run                                 Runs a local web server
  server:start                               Starts a local web server in the background
  server:status                              Outputs the status of the local web server
  server:stop                                Stops the local web server that was started with the server:start command
 swiftmailer
  swiftmailer:email:send                     Send simple email message
  swiftmailer:spool:send                     Sends emails from the spool
 translation
  translation:update                         Updates the translation file
 workflow
  workflow:dump                              Dump a workflow

フロントのGraphql化への道

だいぶ長い

業務日誌

実を言うと俺は、タイトルとタグとMarkdownだけあれば別になんだっていいと思ってる。
ただ、どのサービスも絶対に無くならないという保証がなくてどうしたもんかなと

Qiita を使ってみた

プレゼンもかけるし、こっちが楽かぁ?

note を使ってみた

zenn.dev 使ってみた

見出し

見出し1

見出し2

見出し3

見出し4

リスト

  • Hello!
  • Hola!
    • Bonjour!
    • Hi!
      Hello!
      Hola!
      Bonjour!
      Hi!
      リストのアイテムには*もしくは-を使います。

番号付きリスト

  1. First
  2. Second
    First
    Second
    テキストリンク
    アンカーテキスト
    アンカーテキスト
    Ctrl + Kのショートカットでも挿入できます。

画像
altテキスト
altテキスト

画像の横幅を指定する
画像の表示が大きすぎる場合は、URLの後に半角スペースを空けて=○○xと記述すると、画像の幅をpx単位で指定できます。

altテキスト
altテキスト

キャプションをつける
画像のすぐ下の行に*で挟んだテキストを配置すると、キャプションのような見た目で表示されます。


キャプション

captions

画像にリンクを貼る
以下のようにすることで画像に対してリンクを貼ることもできます。

altテキスト
テーブル

Head Head Head
Text Text Text
Text Text Text
Head Head Head
Text Text Text
Text Text Text
コードブロック
コードは「```」で挟むことでブロックとして挿入できます。以下のように言語を指定するとコードへ装飾(シンタックスハイライト)が適用されます。

const great = () => {
console.log("Awesome")
}
シンタックスハイライトにはPrism.jsを使用しています。
📄 対応言語の一覧 →

ファイル名を表示する
言語:ファイル名と:区切りで記載することで、ファイル名がコードブロックの上部に表示されるようになります。

ファイル名

fooBar.js
const great = () => {
console.log("Awesome")
}
数式
ZennではKaTeXによる数式表示に対応しています。

数式のブロックを挿入する
$$で記述を挟むことで、数式のブロックが挿入されます。たとえば

e^{i\theta} = \cos\theta + i\sin\theta

は以下のように表示されます。

e^{i\theta} = \cos\theta + i\sin\theta
e

=cosθ+isinθ
$$の前後は空の行でないと正しく埋め込まれないことがあります。

インラインで数式を挿入する
a\ne0というように$ひとつで挟むことで、インラインで数式を含めることができます。たとえばa\ne0a

=0のようなイメージです。

引用

引用文
引用文
引用文
引用文

注釈
注釈を指定するとページ下部にその内容が表示されます。

脚注の例[1]です。インライン[2]で書くこともできます。

区切り線

インラインスタイル
イタリック
太字
打ち消し線
インラインでcodeを挿入する
イタリック
太字
打ち消し線
インラインでcodeを挿入する

インラインのコメント
自分用のメモをしたいときはHTMLのコメント記法を使用できます。


この形式で書いたコメントは公開されたページ上では表示されません。ただし、複数行のコメントには対応していないのでご注意ください。

Zenn独自の記法
メッセージ

メッセージをここに

警告メッセージをここに

アコーディオン(トグル)

タイトル

表示したい内容

タイトル
分かりづらいのですが「detail」ではなく「details」です。

コンテンツの埋め込み
リンクカード

URLだけの行

https://zenn.dev/zenn/articles/markdown-guide
2020年11月から実験的に導入中です。URLだけが貼り付けられた行があると、その部分がカードとして表示されます。

カードへの変換はzenn.dev上でだけ行われ、CLIでプレビューすることはできません。

Twitter

ツイートページのURLを指定してください

「twitter」ではなく「tweet」であることにご注意ください。

YouTube

YouTubeのvideoIDが不正です

URLに含まれる英数字の組み合わせを入力します。たとえばURLがhttps://youtube.com/watch?v=ApXoWvfEYVUの場合、@youtubeと指定します。

CodePen

CodePenのURLが不正です

デフォルトの表示タブはページのURL?default-tab=html,cssのようにクエリを指定することで変更できます。

SlideShare

Slide Shareのkeyが不正です

SlideShareの埋め込みiframeに含まれる...embed_code/key/○○...の◯◯の部分を入力します。

SpeakerDeck

Speaker Deckのkeyが不正です

SpeakerDeckで取得した埋め込みコードに含まれるdata-idの値を入力します。

JSFiddle

jsfiddleのURLが不正です

CodeSandbox

「https://codesandbox.io/embed/」から始まる正しいURLを入力してください

CodeSandboxでは、各ページから埋め込み用の<iframe>を取得できます。この<iframe>に含まれるsrcのURLを括弧の中に入力します。

StackBlitz

StackBlitzのembed用のURLを指定してください

StackBlitzでは、各ページから「Embed URL」を取得できます。取得したURLをそのまま括弧の中に入力します。

オンラインエディターではモーダルから挿入可能
オンラインのエディターでは「+」ボタンを押すことで、外部コンテンツ埋め込み用のモーダルを表示できます。

::: mermaid
graph TD
A["質問"] -->|https://twvsts.visualstudio.com/TRAdEWORKS/_wiki| B{"社内Wikiで調べる"}
B -->|未解決| D["詳しそうな人に訊く"]
B -->|解決| C[満足]
D --> F["Wikiのページ追加・更新"]
F --> C
:::

脚注
  1. 脚注の内容その1
    脚注の例[1]です。インライン[2]で書くこともできます。 ↩︎

  2. 脚注の内容その2 ↩︎

Discussion