dr_lucas Posted November 27, 2012 Posted November 27, 2012 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! :) Did I help you? Click "Like" or "Thanks"! It's free of charge. :)My contributions:Total Configuration (newly updated 07/2018, for both osC 2.2 and 2.3.4.1 BS Frozen CE)User Tracking with Admin 1.0 (newly updated 07/2018)FedEx - Web Services v9, FAQ System , Who's Online Enhancement, Order Editor, MoneyBookers IPN, Ship in Cart (MS2), Admin Products Paging, Margin Report v1.00, 2Checkout INS / IPN (Instant Notification System) for MS2.2, Visitor Web Stats, Time Zone Offset - Adjust to match your location, Category Meta Tags
♥mommaroodles Posted September 28, 2013 Posted September 28, 2013 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."
♥bruyndoncx Posted September 28, 2013 Posted September 28, 2013 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
♥GLWalker Posted September 28, 2013 Posted September 28, 2013 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!
♥mommaroodles Posted September 28, 2013 Posted September 28, 2013 @ 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."
♥kymation Posted September 29, 2013 Posted September 29, 2013 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.
dr_lucas Posted September 29, 2013 Author Posted September 29, 2013 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... Did I help you? Click "Like" or "Thanks"! It's free of charge. :)My contributions:Total Configuration (newly updated 07/2018, for both osC 2.2 and 2.3.4.1 BS Frozen CE)User Tracking with Admin 1.0 (newly updated 07/2018)FedEx - Web Services v9, FAQ System , Who's Online Enhancement, Order Editor, MoneyBookers IPN, Ship in Cart (MS2), Admin Products Paging, Margin Report v1.00, 2Checkout INS / IPN (Instant Notification System) for MS2.2, Visitor Web Stats, Time Zone Offset - Adjust to match your location, Category Meta Tags
♥mommaroodles Posted September 29, 2013 Posted September 29, 2013 @@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."
♥mommaroodles Posted September 29, 2013 Posted September 29, 2013 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."
♥kymation Posted September 29, 2013 Posted September 29, 2013 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.