<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2008-04-22:10</id>
  <title>Dreamwidth Development</title>
  <subtitle>Dreamwidth Open Source Development</subtitle>
  <author>
    <name>Dreamwidth Open Source Development</name>
  </author>
  <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom"/>
  <updated>2013-01-11T13:04:41Z</updated>
  <dw:journal username="dw_dev" type="community"/>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:130395</id>
    <author>
      <name>fu</name>
    </author>
    <dw:poster user="fu"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/130395.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=130395"/>
    <title>Renaming Apache2::Request $r</title>
    <published>2013-01-11T08:51:04Z</published>
    <updated>2013-01-11T13:04:41Z</updated>
    <category term="apache2"/>
    <dw:security>public</dw:security>
    <dw:reply-count>3</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='fu' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://fu.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://fu.dreamwidth.org/'&gt;&lt;b&gt;fu&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I keep tripping over $r which is from DW::Request-&amp;gt;get, and is a DW::Request object $r which is an actual Apache2::RequestRec object -- the two are used in similar contexts and often have similarly named methods, but then you'll run into a method which behaves a a bit differently from one to the other and spend two hours debugging a completely unrelated thing.&lt;br /&gt;&lt;br /&gt;We're trying to move away from Apache2::RequestRec objects and converting them into DW::Request where needed. How about we rename the old $r to $apache_r, and keep the new $r the same, so it's obvious at a glance which is which?&lt;br /&gt;&lt;br /&gt;ETA: I've gone ahead and done just that for &lt;a href="https://github.com/dreamwidth/dw-free/pull/211"&gt;https://github.com/dreamwidth/dw-free/pull/211&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=130395" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:98513</id>
    <author>
      <name>Res facta quae tamen fingi potuit</name>
    </author>
    <dw:poster user="pauamma"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/98513.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=98513"/>
    <title>Apache::LiveJournal::db_logger(), LJ::AccessLogRecord, LJ::AccessLogSink, and LJ::AccessLogSink::*</title>
    <published>2011-10-01T14:01:10Z</published>
    <updated>2011-10-01T14:01:10Z</updated>
    <category term="other dw sites"/>
    <category term="apache2"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='pauamma' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://pauamma.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user.png' alt='[personal profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://pauamma.dreamwidth.org/'&gt;&lt;b&gt;pauamma&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Apache::LiveJournal::db_logger() was disabled early on as part of the Apache2 conversion. The intent was apparently to revisit that later, but it's been over 3 years and there's no "later" yet. As far as I can tell, Apache::LiveJournal::db_logger() is the only bit that uses LJ::AccessLogRecord, LJ::AccessLogSink, and LJ::AccessLogSink::* (there are other references, but they're in stuff like confcheck, so they don;t count).&lt;br /&gt;&lt;br /&gt;Get rid of those? Or is there a planned use or another reason to keep them in the codebase?&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=98513" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2008-04-22:10:630</id>
    <author>
      <email>mark@plogs.net</email>
      <name>Mark Smith</name>
    </author>
    <dw:poster user="mark"/>
    <link rel="alternate" type="text/html" href="https://dw-dev.dreamwidth.org/630.html"/>
    <link rel="self" type="text/xml" href="https://dw-dev.dreamwidth.org/data/atom/?itemid=630"/>
    <title>Converting to Apache 2</title>
    <published>2008-06-03T22:52:17Z</published>
    <updated>2008-06-03T22:52:17Z</updated>
    <category term="apache2"/>
    <category term="coding"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">Posted by: &lt;span lj:user='mark' style='white-space: nowrap;' class='ljuser'&gt;&lt;a href='https://mark.dreamwidth.org/profile'&gt;&lt;img src='https://www.dreamwidth.org/img/silk/identity/user_staff.png' alt='[staff profile] ' width='17' height='17' style='vertical-align: text-bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='https://mark.dreamwidth.org/'&gt;&lt;b&gt;mark&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here's a quick and dirty guide to things you will need to watch for when touching files and how to help us convert everything to Apache 2 / mod_perl 2 compatibility.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1) The Request Object&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Never call Apache-&amp;gt;request.&amp;nbsp; If you need the request object, use BML::get_request() which will do the Right Thing to return the appropriate request object for you to mess with.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2) $ENV{LJHOME} is Dead&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You should use $LJ::HOME instead.&amp;nbsp; (Caveat: if you're writing a command line tool, you may need to use the environment variable, depending on what libraries you load... but for web context, always use $LJ::HOME!)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3) Methods become Hashes&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In a move that I don't particularly understand, now we must pluralize some things and treat most things like a hash.&amp;nbsp; If you are used to this:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; $r-&amp;gt;header_in("Host")&lt;br /&gt;&amp;nbsp;&amp;nbsp; $r-&amp;gt;header_in("Host" =&amp;gt; "bar");&lt;br /&gt;&amp;nbsp;&amp;nbsp; $r-&amp;gt;notes("Something")&lt;br /&gt;&lt;br /&gt;Then you should now get used to this:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; $r-&amp;gt;headers_in-&amp;gt;{Host};&lt;br /&gt;&amp;nbsp;&amp;nbsp; $r-&amp;gt;headers_in-&amp;gt;{Host} = "bar";&lt;br /&gt;&amp;nbsp;&amp;nbsp; $r-&amp;gt;notes-&amp;gt;{Something}&lt;br /&gt;&lt;br /&gt;Not much of a change.&amp;nbsp; This goes for all of the header calls: headers_in, headers_out, err_headers_in, err_headers_out, etc as well as notes and pnotes.&amp;nbsp; There are probably other changes I've missed that do this too.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4) $r-&amp;gt;send_http_header defunct?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I've yet to figure out a replacement for this function.&amp;nbsp; It seems to not be required anymore?&amp;nbsp; The modules seem to do the right thing, at least in all of the cases I've tried, without ever calling this.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5) ...?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I'm sure I'm missing something.&amp;nbsp; But at this point, if you want to start grepping through dw-free for header_in, send_http_header, notes, etc and then start fixing it, go for it!&amp;nbsp; It's appreciated, as there are still many files that have these.&lt;br /&gt;&lt;br /&gt;As a second/other thought, I've been debating creating an LJ::Request object that we can use instead of Apache2::RequestRec (or whatever it is).&amp;nbsp; That way, if we ever need to change the way something works (i.e. upgrade to Apache 2.2 / mod_perl 2.2?) then we can change that one module.&lt;br /&gt;&lt;br /&gt;Opinions and discussion are welcome, of course!&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=dw_dev&amp;ditemid=630" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
