Giter Site home page Giter Site logo

apft's Introduction

自分の開発環境について

SDKについて

2017/12/10現在、WordPressのSDKはcomposerで配布されていない。 開発に最低限必用なものはwordpress,wordpress-test-lib,そしてこいつの親クラスであるphpunitの3つだ。 phpunitcomposer installで持ってくるとして、WordPress関係のものは公式が作成したスクリプト(同梱してある)bin/install-wp-tests.shでpullできる。

bin/install-wp-tests.sh wp_test wp_test 'wp_test' localhost latest 

このシェルは、シェル内で定義されたinstall_wp,install_test_suite,install_dbの3つの関数を順に実行するというもので、 mysqldが建っていないとinstall_dbが失敗するが、必用なのは始めの2つで十分なので問題ない。 成功すると、/tmp/wordpress,/tmp/wordpress-tests-libに生成される。なお/tmp下なので多くの場合再起動すると消える。 このパッケージへのパスはtests/bootstrap.phpで定義されているのだが、 それはそれとして、私は開発に必用なものは全てリポジトリ下のディレクトリに格納したいので、

cp -r /tmp/wordpress vendor/.
cp -r /tmp/wordpress-tests-lib vendor/.

としている。

動作確認

実際にブラウザで目視テストをする場合、docker-compose uplocalhost:8080でアクセスできる。 このdocker-compose.ymlはwordpress公式のdocker-hubからコピペしてきたものに、

  1. このプラグインをバインド
  2. mysqldが全クエリのログを取るようなconf.dのバインド という一手間をくわえたものだ。

私はWordpressのプロセスがどうなっているのか詳しく無い為、ドキュメントとは別にクエリの流れを見たい事があるので、 大体、docker-compose upした後に、別のターミナルから

docker exec -ti [__NAME__]_mysql_1 /bin/bash
tail -f /var/log/mysql/general.log

をしている。

開発の流れ

今回、@yousanのadd-page-from-templateというプラグインをTDDでクローンをするという目的で動いている。

ActivateするとSettingsのところにページリンクが追加される

pluginの基本

apft's People

Contributors

say3no avatar

Stargazers

Yousan_O avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.