今年は「月刊PHPカンファレンス」といった感じで、1月を皮切りに6月まで毎月どこかでPHPカンファレンスが開催されることをご存知でしょうか?
このスライド助かるw
— ことみん (@kotomin_m) October 8, 2023
#phpcon #phpcon2023 pic.twitter.com/WvDMgcq1iI
そんな「月刊PHPカンファレンス」仲間の「PHPカンファレンス関西2024(2月開催)」と「PHPカンファレンス香川2024(5月開催)」が php.net の「Upcoming conferences」のページに掲載されているではありませんか。
ズルい!「PHPカンファレンス福岡2024」も掲載してほしい!!!
ということで、掲載依頼の手順についてまとめていきたいと思います。
「Upcoming conferences」のページの右上に「Want to see your conference appear here?」とあるので、こちらにアクセスします。
掲載する方法は2つあり、1つはGitHubでPull Requestを送る方法(推奨)、もう1つはメーリングリストに送信する方法のようです。
関西と香川の実行委員長にやり方を聞いてみたところ、Pull Requestを送る方法で実施したとのことだったので、福岡もPull Requestの形式でやってみることにしました。
先ほどのページに以下のように手順が書いてあるので、1つずつやっていきましょう。
- Fork and clone that repository
- php.netのwebサイトのリポジトリを
fork
してgit clone
する。
- php.netのwebサイトのリポジトリを
- execute the bin/createNewsEntry script (php bin/createNewsEntry)
- リポジトリ内の「
bin/createNewsEntry
」というPHPで書かれたスクリプトを実行する。
- リポジトリ内の「
- follow the step-by-step instructions, and commit and push the generated changes, and open a pull request.
- 対話式のやり取りを終えたら変更点をコミットし、プッシュして、Pull Requestを作る。
まず、php.netのwebサイトのリポジトリにアクセスして、画面右上の「Fork」ボタンをクリックします。
自分のアカウントの配下に「web-php」のリポジトリが fork
されました。
次に、 fork
したリポジトリを git clone
します。
clone
についてはご自分の環境に合わせて行ってください。
私は /home/akase244/repos/web-php
に clone
しました。
次は、 bin/createNewsEntry
というスクリプトを実行する手順ですが、このファイルの中身を見てみるとPHPで書かれています。
#!/usr/bin/env php
<?php
PHP_SAPI == 'cli' or die("Please run this script using the cli sapi");
require_once __DIR__ . '/../src/autoload.php';
use phpweb\News\Entry;
・
・
・
なので、以下のコマンドを実行します。するとニュース記事(今回はカンファレンスの紹介記事)のタイトルの入力を求められます。
$ php bin/createNewsEntry
Please type in the title:
メッセージに従い、カンファレンスのタイトルを入力し、エンターを押下します。
Please type in the title: PHP Conference Fukuoka 2024
次は、カテゴリーの入力を求められます。
Categories:
0: PHP.net frontpage news [frontpage]
1: New PHP release [releases]
2: Conference announcement [conferences]
3: Call for Papers [cfp]
Please select appropriate categories, seperated with space:
今回はカンファレンスの告知を行いたいので「2」と入力し、エンターを押下します。
Please select appropriate categories, seperated with space: 2
次は、カンファレンスの開始日(もしくはCFPの受付終了日)の入力を求められます。
When does the conference start/cfp end? (strtotime() compatible syntax):
今回はカンファレンスの開催日を入力します。
When does the conference start/cfp end? (strtotime() compatible syntax): 2024-06-22
次に、この告知記事には画像を添付するのか否かを質問されます。
Will a picture be accompanying this entry?
しかし、これだけでは一体何を入力してよいのやら。。。
ということで、 createNewsEntry
のコードを読んでみると、以下の箇所が見つかりました。
fwrite(STDOUT, "Will a picture be accompanying this entry? ");
$yn = fgets(STDIN);
if (strtoupper($yn[0]) !== "Y") {
return NULL;
}
どうやら、画像を添付する場合は「y」と回答したらよいみたいです。
Will a picture be accompanying this entry? y
次に、画像ファイルの名前の入力を求められます。
ここで、どうやら images/news
配下にファイルを配置しておく必要があったことがわかります。
Enter the image name (note: the image has to exist in './images/news'):
しかし、推奨されるファイルの形式やサイズがわかりません。
なので、また createNewsEntry
のコードを読んでみると、以下の箇所が見つかりました。
どうやら、幅400px、高さ250px以内に収まる形式にする必要がありそうです。
$imageRestriction = [
'width' => 400,
'height' => 250
];
$imageSizes = getimagesize("./images/news/$path");
if (($imageSizes[0] > $imageRestriction['width']) || ($imageSizes[1] > $imageRestriction['height'])) {
fwrite(STDOUT, "Provided image has a higher size than recommended (" . implode(' by ', $imageRestriction) . "). Continue? ");
$ynImg = fgets(STDIN);
if (strtoupper($ynImg[0]) !== "Y") {
$isValidImage = false;
}
}
なので、 /home/akase244/repos/web-php/images/news
配下に 250x250の phpconfuk2024.png
を配置して、以下のように入力しました。
Enter the image name (note: the image has to exist in './images/news'): phpconfuk2024.png
次に、画像ファイルのタイトルの入力を求められます。
Image title:
カンファレンスのタイトルを入力し、エンターを押下します。
Image title: PHP Conference Fukuoka 2024
次に、画像ファイルをクリックした際のリンク先の入力を求められます。
Link (when clicked on the image):
カンファレンスのURLを入力し、エンターを押下します。
Link (when clicked on the image): https://phpcon.fukuoka.jp/2024/
最後にHTMLコンテンツの入力を求められます。
And at last; paste/write your news item here.
To end it, hit <enter>.<enter>
以下のようにカンファレンスの紹介記事のHTMLを入力します。
<p>
We are delighted to announce the PHP Conference Fukuoka 2024.
</p>
<p>
We want to boost the IT industry in the Kyushu region and provide a place where PHPers in Kyushu and PHPers from all over Japan can interact.<br/>
This event has been held continuously since 2015 with this in mind.<br/>
We hope that through this event, participants will inspire each other and create new ideas and connections. (This conference will be conducted in Japanese)
</p>
<strong>Basic facts</strong><br/>
<ul>
<li>Date: June 22, 2024 (JST)</li>
<li>Location: Fukuoka, Japan</li>
</ul>
<p>
For more information, See the event page: <a href="https://phpcon.fukuoka.jp/2024/">PHP Conference Fukuoka 2024</a>.
</p>
<p>
Follow us on <a href="https://twitter.com/phpcon_fukuoka">X(formerly Twitter)</a>.
</p>
上記のコンテンツを入力後、エンターを1回、「.」を1回、エンターを1回入力すると、「File saved.」と表示されます。
・
・
・
<p>
Follow us on <a href="https://twitter.com/phpcon_fukuoka">X(formerly Twitter)</a>.
</p>
.
File saved.
Please git diff archive/archive.xml and sanity-check the changes before committing
NOTE: Remember to git add archive/entries/2024-01-07-1.xml !!
上記の手順により、以下のファイルが作成されます。
- archive/archive.xml
- archive/entries/2024-01-07-1.xml
上記の2ファイルと以下のロゴ画像と合わせて、 git commit
して git push
します。
- images/news/phpconfuk2024.png
これで準備が整ったので、Pull Requestを作成してしばらく待つと、無事にマージされました。
マージされると php.net のwebページに反映されますのでトップページにアクセスしてみると、「Upcoming conferences」に「PHP Conference Fukuoka 2024」のリンクが追加されました。
「PHP Conference Fukuoka 2024」のリンクをクリックすると、このように先ほど入力したHTMLが表示されます。