<div dir="ltr">I've seen this sort of thing in a few projects and it works reasonably nicely.. though I'm not sure how it would work in Koha as we seem to replace all calls to a function and remove the function at the same time.<div><br></div><div>If we did switch to this approach I'd suggest adding code to allow it to report to HEA so we can see the general adoption at the core level before nuking functions entirely.</div><div><br></div><div>Juries out from my end as to whether this is a good or bad idea as a whole though I'm afraid.</div><div><br></div><div>Martin</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><table cellspacing="0" cellpadding="0" width="410" style="font-family:'Times New Roman'"><tbody><tr><td colspan="2"><p style="font-family:Arial;font-size:12px;line-height:20px;margin:0px;color:rgb(45,92,136)"><strong>Martin Renvoize</strong></p></td></tr><tr><td colspan="2"><p style="font-family:Arial;font-size:12px;line-height:20px;margin:0px;color:rgb(45,92,136)">Development Manager</p></td></tr><tr><td colspan="2"><p style="font-family:Arial;margin:0px"><br></p></td></tr><tr><td colspan="2"><p style="font-family:Arial;margin:0px"> </p></td></tr><tr><td><p style="font-family:Arial;font-size:12px;line-height:20px;margin:0px;color:rgb(45,92,136)"><strong>T:</strong> +44 (0) 1483 378728</p></td></tr><tr><td><p style="font-family:Arial;font-size:12px;line-height:20px;margin:0px;color:rgb(45,92,136)"><strong>F:</strong> +44 (0) 800 756 6384</p></td></tr><tr><td><p style="font-family:Arial;font-size:12px;line-height:20px;margin:0px;color:rgb(45,92,136)"><strong>E:</strong> <a href="mailto:martin.renvoize@ptfs-europe.com" style="color:rgb(45,92,136);text-decoration:none" target="_blank">martin.renvoize@ptfs-europe.com</a></p></td></tr><tr><td><p style="font-family:Arial;font-size:12px;line-height:20px;margin:0px;color:rgb(45,92,136)"><a href="https://www.ptfs-europe.com" style="color:rgb(45,92,136);text-decoration:none" target="_blank">www.ptfs-europe.com</a></p></td></tr><tr><td><p style="font-family:Arial;margin:0px"> </p></td></tr><tr><td colspan="2"><p style="line-height:20px;margin:0px"><a href="https://www.ptfs-europe.com" border="0" target="_blank"><img src="https://www.ptfs-europe.com/wp-content/uploads/2014/09/ptfs_logo1.png" width="" height="" border="0"></a></p></td></tr><tr><td><p style="font-family:Arial;margin:0px"><br></p></td></tr><tr><td><p style="font-family:Arial;margin:0px"><br></p></td></tr></tbody></table><table cellspacing="0" cellpadding="0" style="font-family:'Times New Roman';border-top-width:1px;border-top-style:solid;border-top-color:rgb(194,194,194);padding:20px 0px 0px;margin:0px"><tbody><tr><td><p style="font-family:Arial;font-size:12px;color:rgb(45,92,136);margin:0px">Registered in the United Kingdom No. 06416372   VAT Reg No. 925 7211 30</p><br><p style="font-family:Arial;font-size:12px;color:rgb(45,92,136);margin:0px">The information contained in this email message may be privileged, confidential and protected from disclosure. If you are not the intended recipient, any dissemination, distribution or copying is strictly prohibited. If you think that you have received this email message in error, please email the sender at <a href="mailto:info@ptfs-europe.com" target="_blank">info@ptfs-europe.com</a></p></td></tr></tbody></table><span style="font-size:12.8px"><br></span></div></div><div dir="ltr"></div></div></div></div></div>
<br><div class="gmail_quote">On 22 June 2018 at 21:52, Barton Chittenden <span dir="ltr"><<a href="mailto:barton@bywatersolutions.com" target="_blank">barton@bywatersolutions.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It would be useful for Koha to have a 'Deprecated' function, which would send a warning about the caller() function and the version of Koha where the function will be deprecated, and what it will be replaced by... so let's say that C4::Adequate::DoEET() is being replaced by Koha::Awesome->sauce(). in Koha 18.11.<div><br></div><div>In versions of koha prior to 18.11, we add a call to</div><div><br></div><div>deprecated( "18.11", "Koha::Awesome->sauce()");</div><div><br></div><div>at the beginning of C4::Adequate::DoEET(). </div><div><br></div><div>Then, when C4::Adequate::DoEET() is called, this would generate the following message in the logs:</div><div><br></div><div>"C4::Adequate::DoEET is deprecated and will be removed in Koha 18.11. It will be replaced by Koha::Awesome->sauce()."</div><div><br></div><div>This would allow plugin authors to know that they will need to patch their plugins before they break on upgrade.<br><div><div><div><div><div><div><br></div><div>This is a bare-bones implementation of deprecated():</div><div><br></div><div><div>sub deprecated {</div><div>    my ( $version, $replacement ) = @_;</div><div>    my (</div><div>        $package, $filename, $line, $subroutine, $hasargs,</div><div>        $wantarray, $evaltext, $is_require, $hints, $bitmask, $hinthash</div><div>    ) = caller(1);</div><div>    warn( </div><div>        "${subroutine} is deprecated and will be removed"</div><div>         . " in Koha version $version."</div><div>         . defined( $replacement ) </div><div>            ? " It will be replaced by ${replacement}."</div><div>            : ""</div><div>    );</div><div>}</div></div><div><br></div><div><div><br></div></div></div></div></div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org">Koha-devel@lists.koha-<wbr>community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.<wbr>org/cgi-bin/mailman/listinfo/<wbr>koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.<wbr>org/</a><br></blockquote></div><br></div>