Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

The original osCommerce's PHP-code styling/formatting


dr_lucas

Recommended Posts

Posted

As time passed - I got my osC php files' code styling all messed up and was wondering which auto-formatter/beautifier and/or rules and/or program were used to format the original osCommerce PHP files. (MS2.2 RC2a version in my case, although I believe they are the same formatting like the other versions)

I am looking for the same exact styling used, in order to make it easier to work, compare and modify the code with contributions and other reasons.

The closest I could find was K&R styling (for example: http://beta.phpformatter.com/), but it's still not the same and not giving me the same indents (among other issues) like the original/unmodified osC files.

Does anyone know?

 

Thanks a lot in advance! :)

  • 10 months later...
Posted

Fairly old post this, but I've been searching for the same thing for ages - I wonder what everyone else is using - the online tools seem to mess everything even more

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Posted

I know I've used this online one in the past

http://beta.phpformatter.com/

 

but it supports lots of different settings

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Posted

Most editors will have some sort of balance brackets tool, which usually works well with HTML tags, and can provide a starting point for doing it by hand. I used to use Rapid PHP which was really good at this, but after switching O.S. systems that software is no longer a choice.

 

I now do it all by hand. I believe osC goes by the standard of 2 spaces, but I perfer to tab indent. It may seem cumbersome, but I find myself doing it anytime I have a page open and the code is not balanced. It actually becomes habitual after a while. Better than smoking crack for sure.

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Posted

@ I got so fed up today with searching for a decent code formatter that I landed up purchasing PHPDesigner 8 - absolutely marvellous and I've downloaded the trial version of PHPEdit which is awesome, -a bit of a learning curve involved but I'm gonna try it for the month and I may very well buy that too.

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Posted

Eclipse has a good formatter built in. It's fairly close to the osCommerce standard, and you can tweak the settings if you want. The built-in PHP validator is also very useful for finding my bone-headed typos.It's free/open source as well.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Posted

Yeah, there are many formatters that are *fairly close*, but close is not enough as I am looking for the *exact* style to be able to easily use File comparison apps when modifying the code...

Hopefully hpdl or one of the osC team can shed some light on this topic...

Posted

@@kymation I actually downloaded the trial of Eclipse yesterday and ran it - but unless I'm missing something - to me it appeared to be more for Java than PHP so I landedup uninstalling it again.

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Posted

Yeah, there are many formatters that are *fairly close*, but close is not enough as I am looking for the *exact* style to be able to easily use File comparison apps when modifying the code...

Hopefully hpdl or one of the osC team can shed some light on this topic...

 

Yes, now that is something I would like to know too ! :)

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Posted

Eclipse has a lot of plugins for various languages. A search for PHP Eclipse should get you a pre-installed version suitable for your OS. You can also install modules from inside Eclipse using the Help >> Install New Software menu.

 

Eclipse is very powerful, but the learning curve is steep. Just setting the Preferences is a pain. Expect to spend some time with on-line tutorials to learn it properly.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...