You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Tatsuhiko Miyagawa <mi...@edge.co.jp> on 2002/09/02 12:09:21 UTC

RFC: Apache::CanonicalName

Here I've made a new mod_perl module which allows you to call
ap_construct_url() from mod_perl. 

http://bulknews.net/lib/archives/Apache-CanonicalName-0.01.tar.gz

Any suggestions welcome, especially regarding to:

* Is naming OK?

* Is it worth CPAN module? Should it be in mod_perl core?

  I think it should be in mod_perl core, but at the same time,
  it's worth CPANizing as it allows you to use this method without
  mod_perl upgrading.


-- 
Tatsuhiko Miyagawa <mi...@edge.co.jp>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Tatsuhiko Miyagawa <mi...@edge.co.jp>.
At Tue, 03 Sep 2002 08:41:19 -0400,
Geoffrey Young wrote:
> > 
> >   I think it should be in mod_perl core, but at the same time,
> >   it's worth CPANizing as it allows you to use this method without
> >   mod_perl upgrading.
> 
> isn't the result the same as what you would get with this:
> 
> my $uri = Apache::URI->parse($r);
> $uri->path('/bar/');
> $uri->unparse;
> 
> ?
> 
> Apache::URI->parse uses ap_construct_url behind the scenes.

You're right. grepping the mod_perl source with ap_construct_url gives
me that in URI.xs ;)

> granted, what you offer is a shortcut and opens up the raw apache API, 
> but we pretty much have the ability already.
> 
> it's pretty cool, though, what you can do with XS :)

*grin*

--
Tatsuhiko Miyagawa <mi...@edge.co.jp>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Geoffrey Young <ge...@modperlcookbook.org>.

Tatsuhiko Miyagawa wrote:
> Here I've made a new mod_perl module which allows you to call
> ap_construct_url() from mod_perl. 
> 
> http://bulknews.net/lib/archives/Apache-CanonicalName-0.01.tar.gz
> 
> Any suggestions welcome, especially regarding to:
> 
> * Is naming OK?
> 
> * Is it worth CPAN module? Should it be in mod_perl core?
> 
>   I think it should be in mod_perl core, but at the same time,
>   it's worth CPANizing as it allows you to use this method without
>   mod_perl upgrading.

isn't the result the same as what you would get with this:

my $uri = Apache::URI->parse($r);
$uri->path('/bar/');
$uri->unparse;

?

Apache::URI->parse uses ap_construct_url behind the scenes.

granted, what you offer is a shortcut and opens up the raw apache API, 
but we pretty much have the ability already.

it's pretty cool, though, what you can do with XS :)


--Geoff





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Per Einar Ellefsen <pe...@oslo.online.no>.
At 23:54 07.09.2002, Randy Kobes wrote:
>On Tue, 3 Sep 2002, Per Einar Ellefsen wrote:
>[ ... ]
> >        I just think of Util:: as the
> > most appropriate name. I don't want us having an endless argument on this
> > small naming issue. I'm open for suggestions if you have any other
> > appropriate name for that category.
>
>Utilities? or Utils? That indicates one of many ... This is a
>difficult category, as, in of itself, adding such a category to a
>distribution with a single module doesn't really tell one more
>about what the module does (to some degree, the same can be said
>of an 'Application'-like category). It's almost like a
>'Miscellaneous' category, in some sense; it indicates that the
>module doesn't belong in any of the other categories.

Utils fits me.
The category is clearly about some miscellaneous things, but it's for 
"Non-handler" modules, that just provide an API (and are not related to any 
of the other namespaces either).


-- 
Per Einar Ellefsen
pereinar@oslo.online.no



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 3 Sep 2002, Per Einar Ellefsen wrote:
[ ... ]
>        I just think of Util:: as the 
> most appropriate name. I don't want us having an endless argument on this 
> small naming issue. I'm open for suggestions if you have any other 
> appropriate name for that category.

Utilities? or Utils? That indicates one of many ... This is a
difficult category, as, in of itself, adding such a category to a
distribution with a single module doesn't really tell one more
about what the module does (to some degree, the same can be said
of an 'Application'-like category). It's almost like a
'Miscellaneous' category, in some sense; it indicates that the
module doesn't belong in any of the other categories.

-- 
best regards,
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


ModuleConfig on Win32

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
A couple if people have had problems building mod_perl-1.27 on
Win32 because ModuleConfig.c wasn't generated (when no APACHE_SRC
was specified). John Petrakis <jp...@rcn.com> tracked this
down to $PERL_DIRECTIVE_HANDLERS in Makefile.PL not being defined
in this instance - the attached diff fixes this. This also
includes an earlier diff replacing a touch() call by a perl
equivalent, for the benefit of Win32.

-- 
best regards,
randy

Re: RFC: Apache::CanonicalName

Posted by Per Einar Ellefsen <pe...@oslo.online.no>.
At 21:47 03.09.2002, Randy Kobes wrote:
>On Tue, 3 Sep 2002, Per Einar Ellefsen wrote:
>
> > At 22:52 02.09.2002, Randy Kobes wrote:
> > "e) The perhaps most interesting namespace protection is provided by the
> > perl symbol table itself. A namespace Foo:: is just a package name and its
> > relationship to a namespace Foo::Bar:: is not predetermined whatsoever. 
> The
> > two namespaces can be closely or loosely related or not related at all, 
> but
> > what's most important, they can be writen by different authors who may 
> work
> > rather independently from each other. So if you have registered any
> > namespace, it does not mean that you own the whole namespace tree that
> > starts there. If you are registered as the contact for Foo::Bar, you are
> > not necessarily also associated with Foo::Bar::Baz. "
> >
> > See http://www.cpan.org/modules/00modlist.long.html#ID5_NamespaceCo
>
>That's what I meant by the hierarchy not being a forced
>convention. However, this natural association has evolved, at
>least for 2nd level namespaces (eg, File::Spec::* related to
>File::Spec, Apache::Session::* related to Apache::Session). It
>isn't as widespread at the top level, where it does occur (eg,
>Tk::* related to Tk), but also, when the name isn't a module (eg,
>File), it denotes a generic category. But having a 2nd level name
>denoting a generic category isn't widespread, so the
>useage/inheritance association is more widely expected when the
>2nd level name exists already as a module.

That's all right, I agree with your point, I just think of Util:: as the 
most appropriate name. I don't want us having an endless argument on this 
small naming issue. I'm open for suggestions if you have any other 
appropriate name for that category.


-- 
Per Einar Ellefsen
pereinar@oslo.online.no



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 3 Sep 2002, Per Einar Ellefsen wrote:

> At 22:52 02.09.2002, Randy Kobes wrote:
[ ... ]
> >I was thinking more of the hierarchy, not of the functional
> >grouping. The convention of X::Y::Z being related to X::Y by, eg,
> >using or requiring it or through inheritance is widespread (and
> >is generally used at the top-level Apache::* namespace). One
> >might similarly expect an Apache::Util::* module to require in
> >some way Apache::Util, which if not true, could be confusing.
> >Although this isn't a forced convention, it's so common that I
> >think breaking it shouldn't be officially encouraged.
> 
> Not so according to the module list:
> 
> "e) The perhaps most interesting namespace protection is provided by the 
> perl symbol table itself. A namespace Foo:: is just a package name and its 
> relationship to a namespace Foo::Bar:: is not predetermined whatsoever. The 
> two namespaces can be closely or loosely related or not related at all, but 
> what's most important, they can be writen by different authors who may work 
> rather independently from each other. So if you have registered any 
> namespace, it does not mean that you own the whole namespace tree that 
> starts there. If you are registered as the contact for Foo::Bar, you are 
> not necessarily also associated with Foo::Bar::Baz. "
> 
> See http://www.cpan.org/modules/00modlist.long.html#ID5_NamespaceCo

That's what I meant by the hierarchy not being a forced
convention. However, this natural association has evolved, at
least for 2nd level namespaces (eg, File::Spec::* related to
File::Spec, Apache::Session::* related to Apache::Session). It
isn't as widespread at the top level, where it does occur (eg,
Tk::* related to Tk), but also, when the name isn't a module (eg,
File), it denotes a generic category. But having a 2nd level name
denoting a generic category isn't widespread, so the
useage/inheritance association is more widely expected when the
2nd level name exists already as a module.

-- 
best regards,
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Per Einar Ellefsen <pe...@oslo.online.no>.
At 22:52 02.09.2002, Randy Kobes wrote:
>On Mon, 2 Sep 2002, Per Einar Ellefsen wrote:
>
> > At 20:52 02.09.2002, Randy Kobes wrote:
>[ ... ]
> > >One of the downsides of an Apache::Util::* name (and also some
> > >others in the suggested namespace categorization) is that there's
> > >already an Apache::Util in modperl-2. Although it's not a rule,
> > >there's a typical expectation that module X::Y::Z has a
> > >relationship of some sort to module X::Y.
> >
> > And there is already a Apache::Util in 1.0. I don't believe there will be
> > many misunderstandings, as they are all utility modules after all. It 
> might
> > even help, because then people will group all Util:: modules together with
> > Apache::Util mentally.
>
>I was thinking more of the hierarchy, not of the functional
>grouping. The convention of X::Y::Z being related to X::Y by, eg,
>using or requiring it or through inheritance is widespread (and
>is generally used at the top-level Apache::* namespace). One
>might similarly expect an Apache::Util::* module to require in
>some way Apache::Util, which if not true, could be confusing.
>Although this isn't a forced convention, it's so common that I
>think breaking it shouldn't be officially encouraged.

Not so according to the module list:

"e) The perhaps most interesting namespace protection is provided by the 
perl symbol table itself. A namespace Foo:: is just a package name and its 
relationship to a namespace Foo::Bar:: is not predetermined whatsoever. The 
two namespaces can be closely or loosely related or not related at all, but 
what's most important, they can be writen by different authors who may work 
rather independently from each other. So if you have registered any 
namespace, it does not mean that you own the whole namespace tree that 
starts there. If you are registered as the contact for Foo::Bar, you are 
not necessarily also associated with Foo::Bar::Baz. "

See http://www.cpan.org/modules/00modlist.long.html#ID5_NamespaceCo


-- 
Per Einar Ellefsen
pereinar@oslo.online.no



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 2 Sep 2002, Per Einar Ellefsen wrote:

> At 20:52 02.09.2002, Randy Kobes wrote:
[ ... ]
> >One of the downsides of an Apache::Util::* name (and also some
> >others in the suggested namespace categorization) is that there's
> >already an Apache::Util in modperl-2. Although it's not a rule,
> >there's a typical expectation that module X::Y::Z has a
> >relationship of some sort to module X::Y.
> 
> And there is already a Apache::Util in 1.0. I don't believe there will be 
> many misunderstandings, as they are all utility modules after all. It might 
> even help, because then people will group all Util:: modules together with 
> Apache::Util mentally.

I was thinking more of the hierarchy, not of the functional
grouping. The convention of X::Y::Z being related to X::Y by, eg,
using or requiring it or through inheritance is widespread (and
is generally used at the top-level Apache::* namespace). One
might similarly expect an Apache::Util::* module to require in
some way Apache::Util, which if not true, could be confusing.
Although this isn't a forced convention, it's so common that I
think breaking it shouldn't be officially encouraged.

-- 
best regards, 
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Per Einar Ellefsen <pe...@oslo.online.no>.
At 20:52 02.09.2002, Randy Kobes wrote:
>On Mon, 2 Sep 2002, Per Einar Ellefsen wrote:
>
> > At 12:09 02.09.2002, Tatsuhiko Miyagawa wrote:
> > >Here I've made a new mod_perl module which allows you to call
> > >ap_construct_url() from mod_perl.
> > >
> > >http://bulknews.net/lib/archives/Apache-CanonicalName-0.01.tar.gz
> > >
> > >Any suggestions welcome, especially regarding to:
> > >
> > >* Is naming OK?
> >
> > If you're CPANizing it, could I invite you to adopt the naming conventions
> > I presented here:
> > 
> http://users.skynet.be/pereinar/mod-perl/products/apache-modules.html#Module_Naming_Conventions 
>
> > for your module? Apache::Util::CanonicalName seems like it would fit 
> pretty
> > well.
>
>One of the downsides of an Apache::Util::* name (and also some
>others in the suggested namespace categorization) is that there's
>already an Apache::Util in modperl-2. Although it's not a rule,
>there's a typical expectation that module X::Y::Z has a
>relationship of some sort to module X::Y.

And there is already a Apache::Util in 1.0. I don't believe there will be 
many misunderstandings, as they are all utility modules after all. It might 
even help, because then people will group all Util:: modules together with 
Apache::Util mentally.


-- 
Per Einar Ellefsen
pereinar@oslo.online.no



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 2 Sep 2002, Per Einar Ellefsen wrote:

> At 12:09 02.09.2002, Tatsuhiko Miyagawa wrote:
> >Here I've made a new mod_perl module which allows you to call
> >ap_construct_url() from mod_perl.
> >
> >http://bulknews.net/lib/archives/Apache-CanonicalName-0.01.tar.gz
> >
> >Any suggestions welcome, especially regarding to:
> >
> >* Is naming OK?
> 
> If you're CPANizing it, could I invite you to adopt the naming conventions 
> I presented here: 
> http://users.skynet.be/pereinar/mod-perl/products/apache-modules.html#Module_Naming_Conventions 
> for your module? Apache::Util::CanonicalName seems like it would fit pretty 
> well.

One of the downsides of an Apache::Util::* name (and also some
others in the suggested namespace categorization) is that there's
already an Apache::Util in modperl-2. Although it's not a rule,
there's a typical expectation that module X::Y::Z has a
relationship of some sort to module X::Y.

-- 
best regards,
randy


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: RFC: Apache::CanonicalName

Posted by Per Einar Ellefsen <pe...@oslo.online.no>.
At 12:09 02.09.2002, Tatsuhiko Miyagawa wrote:
>Here I've made a new mod_perl module which allows you to call
>ap_construct_url() from mod_perl.
>
>http://bulknews.net/lib/archives/Apache-CanonicalName-0.01.tar.gz
>
>Any suggestions welcome, especially regarding to:
>
>* Is naming OK?

If you're CPANizing it, could I invite you to adopt the naming conventions 
I presented here: 
http://users.skynet.be/pereinar/mod-perl/products/apache-modules.html#Module_Naming_Conventions 
for your module? Apache::Util::CanonicalName seems like it would fit pretty 
well.


-- 
Per Einar Ellefsen
pereinar@oslo.online.no



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org