Upgrade to Pro — share decks privately, control downloads, hide ads and more …

レガシーPerlと「今」を組み合わせ、開発を継続し続ける方法

 レガシーPerlと「今」を組み合わせ、開発を継続し続ける方法

YAPC::Fukuoka 2017 HAKATAでロリポップのコアAPIについて話しました。

Kazuhiko Yamashita

July 01, 2017
Tweet

More Decks by Kazuhiko Yamashita

Other Decks in Programming

Transcript

  1. ϩϦϙοϓͷ؆қγεςϜߏ੒ਤ 1FSM ϩϦϙοϓͷίΞ"1*͸1FSM  .Z42-4FSWFS 'SPOU"1* 3BJMT ;FOE ਃ͠ࠐΈαΠτ ίΞ"1*

    ϑϩϯτ"1* ϗεςΟϯάαʔό܈ .BJM4FSWFS 8FC4FSWFS ܖ໿৘ใ΍αʔό৘ใΛ ίϯτϩʔϧ αʔόϓϩϏδϣχϯάͷ ࣮ߦࢦࣔ
  2. 

  3. ϝϯςφϯε͞Ε͍ͯͳ͍Ϣχοτςετ 5FTU.PDL(VBSEΛར༻͠ɺ ֎෦ίϯϙʔωϯτ͸શͯ.PDLԽ my $mock = mock_guard(‘Hosting::Server::API::Ext', +{ run =>

    sub { my($self, $params) = @_; switch ($params->{'parameters'}) { case /—domain=example.com/ { return { key => $dummy_key, }; } } }, });
  4. ϝϯςφϯε͞Ε͍ͯͳ͍Ϣχοτςετ 5FTUNZTRMEΛར༻͠ɺ ςετσʔλͷিಥΛճආ͢Δ sub new { my %self; my $class

    = shift; $self->{mysqld} = Test::mysqld->new(my_cnf => {'port' => '3306'}, copy_data_from => 't/data/mysql'); $self->{dbh} = DBI->connect($self->{mysqld}->dsn, '', '') or die 'cannot connect to db'; return bless $self, $class; } UEBUBNZTRM .Z42- UFTUDBTF" UFTUDBTF# .Z42- ϕʔεσʔλΛݩʹ ৽نΠϯελϯεىಈ ςετέʔε͝ͱʹ࢖༻͢Δ %#͕ҟͳΔͨΊ ΫϦʔχϯά͕ෆཁ