Recent

Author Topic: New Feature : Convert Pascal Code to PHP for web developers  (Read 13530 times)

jshand2010

  • Full Member
  • ***
  • Posts: 236
New Feature : Convert Pascal Code to PHP for web developers
« on: January 31, 2015, 12:22:34 pm »
I am a website designer with no experience in php at all, just thought you could write a function that will take your pascal code and convert it to php 5.x.  for example if you use wordpress and want to write plugins.  i have experience in pascal.

please vote for this if you guys think it is a good idea
OpenSUSE Tumbleweed x86_64, Lazarus 2.2.0RC2 fixes branch, fpc 3.2.3 fixes branch

Leledumbo

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #1 on: January 31, 2015, 02:30:37 pm »
Though I don't like it: http://www.wascal.org/

Pascal alone is capable enough to write web applications itself without the need of PHP.

rvk

  • Hero Member
  • *****
  • Posts: 6953


jshand2010

  • Full Member
  • ***
  • Posts: 236
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #4 on: January 31, 2015, 09:44:42 pm »
it seems that wascal is  for windows only.  i was wondering when you create a web application you can have a choice of whether or not you can create an application or a php file.  i'm not after cgi at all right now
OpenSUSE Tumbleweed x86_64, Lazarus 2.2.0RC2 fixes branch, fpc 3.2.3 fixes branch

rvk

  • Hero Member
  • *****
  • Posts: 6953
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #5 on: January 31, 2015, 09:53:59 pm »
Something like this?
http://www.wascal.net/?page=pas2php

Quote
Pas2Php will translate a large subset of Object Pascal to PHP, allowing you to write web applications using Lazarus/FreePascal, and then run the application on a standard HTML/PHP server.

example:
http://www.wascal.net/pas2php/
« Last Edit: January 31, 2015, 09:57:21 pm by rvk »

jshand2010

  • Full Member
  • ***
  • Posts: 236
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #6 on: January 31, 2015, 10:30:59 pm »
hey from a standpoing it looks like i'll have to rebuild lazarus.  i'm not really comfortable with that?  is it possible perhaps to install it in my user account for lazarus perhaps?  i'll give it a go
OpenSUSE Tumbleweed x86_64, Lazarus 2.2.0RC2 fixes branch, fpc 3.2.3 fixes branch

jshand2010

  • Full Member
  • ***
  • Posts: 236
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #7 on: January 31, 2015, 11:34:24 pm »
i've tried creating a lpk packge and adding it to the ide, but it doesn't work.  tell me, is there any other way to use just lazarus to do what i want to do yet??
OpenSUSE Tumbleweed x86_64, Lazarus 2.2.0RC2 fixes branch, fpc 3.2.3 fixes branch

rvk

  • Hero Member
  • *****
  • Posts: 6953
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #8 on: January 31, 2015, 11:41:51 pm »
I have no experience with pas2php myself, but as far as I can see you don't need to recompile Lazarus. It should be possible to write in Pascal and create native PHP. The library is still in development and I think there is a Linux-variant of Wascal in development.

Quote
You can use this library to create either native CGI or PHP applications in a object oriented design.

Furthermore... this is not just like some drag and drop components and coding in Pascal and getting PHP. You need to learn how to use it. (at least that's what my first impression is)

If you really want to drag and drop components you're better of using something like RadPHP (formerly Delphi for PHP) or some Linux alternative (there are some) and learning some PHP.

What exactly are you trying to do in Lazarus (for which you need to convert to PHP)? Are you using visual components? Are you using database components? etc... etc... Without knowing what you want it's difficult to give you the advise you need.

jshand2010

  • Full Member
  • ***
  • Posts: 236
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #9 on: January 31, 2015, 11:57:21 pm »
hey,

yes i am using visible components and database components
OpenSUSE Tumbleweed x86_64, Lazarus 2.2.0RC2 fixes branch, fpc 3.2.3 fixes branch

rvk

  • Hero Member
  • *****
  • Posts: 6953
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #10 on: February 01, 2015, 12:58:12 am »
When you're using the visual and database components of Lazarus there is no easy converter to PHP, as far as I know.

For the drag and drop (using visual and database components) there is RadPHP (formerly Delphi for PHP) like I already mentioned. It uses the opensource VCL4PHP framework (the RadPHP is just the IDE for development, you could of course use a text-editor instead but I wouldn't recommend it). I'm not sure VCL4PHP is even actively maintained anymore. There is another framework like VCL4PHP (which still is active) and that's Prado. I haven't found an IDE which supports this one though. But anyway... for both these frameworks you would need to know PHP for writing the actual events etc.

There is another option (which I only just found). That's extpascal. You can see a video here and here. You said you're not after creating a cgi but that's the closest one I could find which would be helpful to you (i.e. showing the visual components on the webpage and still coding in pascal).

jshand2010

  • Full Member
  • ***
  • Posts: 236
Re: New Feature : Convert Pascal Code to PHP for web developers
« Reply #11 on: February 01, 2015, 01:45:00 am »
thanks for that.  i'll look into that more
OpenSUSE Tumbleweed x86_64, Lazarus 2.2.0RC2 fixes branch, fpc 3.2.3 fixes branch

 

TinyPortal © 2005-2018