RE: [PHP] PHP RUBY

2001-05-22 Thread John Monfort



 Thanks for the background info.

 I'll check it out.

__John Monfort_
_+---+_
 P E P I E  D E S I G N S
   www.pepiedesigns.com
The world is waiting, are you ready?
-+___+-

On Tue, 22 May 2001, Maxim Maletsky wrote:

 a new (?) infamous programming language.

 Something similar to PHP but fully (religiously) Object Oriented.
 It claims to be more OOOriented then Python while with easier syntax than
 Perl.
 eRuby (it's embedded scripting language for web) can also run as an apache
 module, not only CGI (*nix only ).
 Ruby itself can function in similar way C does. (including windows
 management, command line, background jobs etc..)
 It is written by some Japanese gurus and is quite famous here in Tokyo.

 read on here:
 http://www.ruby-lang.org/en/

 Quite impressive as an idea and I really like it's language concept,
 but it is still soo immature.

 Sincerely,

  Maxim Maletsky
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com




 -Original Message-
 From: John Monfort [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, May 22, 2001 2:42 PM
 To: Maxim Maletsky
 Cc: 'PHP General List. (E-mail)'
 Subject: Re: [PHP] PHP  RUBY




   What is RUBY?


 -John




 On Tue, 22 May 2001, Maxim Maletsky wrote:

  Hello gurus,
 
  does anyone know a way to make PHP and RUBY running together (parsing both
  the same file) ?
 
  This is what I tried to do:
 
  httpd.conf:
 
  AddType application/x-httpd-php-source .phps
  AddType application/x-httpd-php .html
 
  #Action application/x-httpd-php /php/php.exe
 
  AddType application/x-httpd-eruby .rhtml .html
  Action application/x-httpd-eruby /cgi-bin/eruby
 
  as you can see PHP runs as apache's module and Ruby as CGI,
 
  It works fine for .rhtml files (with ruby), but when I give them the same
  file extension to parse only Ruby works, PHP shows the source.
 
  I know this a wrong try, well, still a try. Has anyone tried to do the
 same?
  Any success in any way?
 
  There are some things I'd like Ruby to do while processing PHP files.
 
 
  Sincerely,
 
   Maxim Maletsky
   Founder, Chief Developer
   PHPBeginner.com (Where PHP Begins)
   [EMAIL PROTECTED]
   www.phpbeginner.com
 
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP RUBY

2001-05-21 Thread Rasmus Lerdorf

Well, sort of by definition you can't do this.  You can't have multiple
mime types mapping to the same extension.  And even if you could, Apache
can only have one content-generating phase.  Anything that generates
content will send it back to the client.  With Apache2 it will be possible
to layer multiple content filters on the same request.

-Rasmus

On Tue, 22 May 2001, Maxim Maletsky wrote:

 Hello gurus,

 does anyone know a way to make PHP and RUBY running together (parsing both
 the same file) ?

 This is what I tried to do:

 httpd.conf:

   AddType application/x-httpd-php-source .phps
   AddType application/x-httpd-php .html

   #Action application/x-httpd-php /php/php.exe

   AddType application/x-httpd-eruby .rhtml .html
   Action application/x-httpd-eruby /cgi-bin/eruby

 as you can see PHP runs as apache's module and Ruby as CGI,

 It works fine for .rhtml files (with ruby), but when I give them the same
 file extension to parse only Ruby works, PHP shows the source.

 I know this a wrong try, well, still a try. Has anyone tried to do the same?
 Any success in any way?

 There are some things I'd like Ruby to do while processing PHP files.


 Sincerely,

  Maxim Maletsky
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


RE: [PHP] PHP RUBY

2001-05-21 Thread Maxim Maletsky

Thanks Rasmus,
hope a stable Apache 2.0 comes out soon.

I have done some tests few minutes ago and discovered that eRuby is much
slower then PHP.
While might still have some advantages.

This is how I tested it:


ruby.php // with PHP
==
htmlheadtitlePHP example/title/headbody

h1Enumeration/h1
ul
?for($i=1; $i10; $i++) {?
  linumber ?=$i?/li
?}?
/ul

h1Environment variables/h1
table
?foreach($HTTP_SERVER_VARS as $key=$val) {?
  tr
th?=$key?/thtd?=$HTTP_SERVER_VARS[$key]?/td
  /tr
?}?
/table

/body/html
==



ruby.rhtml // with eRuby
==
htmlheadtitleeruby example/title/headbody

h1Enumeration/h1
ul
%(1..10).each do|i|%
  linumber %=i%/li
%end%
/ul

h1Environment variables/h1
table
%ENV.keys.sort.each do |key|%
  tr
th%=key%/thtd%=ENV[key]%/td
  /tr
%end%
/table

/body/html
==


As you can see this is a sample of a very basic functionality.

It took 4 times longer to generate the page for Ruby.
(tested by eyes)

However, Ruby here was running as CGI. I believe the performance would be
better under mod_ruby.

Just for the reference in anyone else cares. (and to avoid some PHP vs
eRuby)



Sincerely, 

 Maxim Maletsky
 Founder, Chief Developer
 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 1:38 PM
To: Maxim Maletsky
Cc: 'PHP General List. (E-mail)'
Subject: Re: [PHP] PHP  RUBY


Well, sort of by definition you can't do this.  You can't have multiple
mime types mapping to the same extension.  And even if you could, Apache
can only have one content-generating phase.  Anything that generates
content will send it back to the client.  With Apache2 it will be possible
to layer multiple content filters on the same request.

-Rasmus

On Tue, 22 May 2001, Maxim Maletsky wrote:

 Hello gurus,

 does anyone know a way to make PHP and RUBY running together (parsing both
 the same file) ?

 This is what I tried to do:

 httpd.conf:

   AddType application/x-httpd-php-source .phps
   AddType application/x-httpd-php .html

   #Action application/x-httpd-php /php/php.exe

   AddType application/x-httpd-eruby .rhtml .html
   Action application/x-httpd-eruby /cgi-bin/eruby

 as you can see PHP runs as apache's module and Ruby as CGI,

 It works fine for .rhtml files (with ruby), but when I give them the same
 file extension to parse only Ruby works, PHP shows the source.

 I know this a wrong try, well, still a try. Has anyone tried to do the
same?
 Any success in any way?

 There are some things I'd like Ruby to do while processing PHP files.


 Sincerely,

  Maxim Maletsky
  Founder, Chief Developer
  PHPBeginner.com (Where PHP Begins)
  [EMAIL PROTECTED]
  www.phpbeginner.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]