php syntax question
Can I take out all the carriage returns and spaces within my php pages to make it more "garbled" for others to try to edit and rip apart ?
Will the pages all still function properly is done on a global scale to all my php files in a particular site ?
I realize that there are proggies that make them very hard to edit - but - I just want it to be pretty hard to edit (i.e. no encryption).
Any suggestions, software recommendation, or tips appreciated.
I can't think of anywhere this would affect execution except for inside strings, so go for it.
sure, you could do like a search/replace, and change all newline characters to spaces, that would pretty much do what you want.
(although, if you are just talking about the PHP code, nobody can access that anyway, unless they have FTP access to your server)
They are going to have access to the FTP - and I know they will try to edit my code :) I just want to make it a pain in the *** for them if (when) they do :)
Any tips on how (exactly) I can replace all the carriage returns with spaces ?
Despending of the editor You use, I should be possible to just copy a carriage return and do a find and replace (replace with nothing). Alternetivly write '\r' in the find part.
By the way, i don't know if there are PHP Editors, that can place carriage returns for better reading - like GoLive can rewrite a sourcecode and will put new carriage returns in the source...
How do you copy a carriage return ?
Does /r work for this in all cases - or - only if /r is seen in the code.
you couldn't restrict access to certain files?
or keep copies of your code on hand to replace the edited files...
just a few other options.
its moreso a case of just making it hard on the guy (I wont go into details why).
(still need answer to /r question above)
\r = mac newline
\n = unix newline
\r\n = windows newline
What your trying to do won't really make anything more difficult. I could open a page formatted like that and just point my cursor in the middle of the file and start typing. That's enough to destroy any script!
I'd look more at getting the FTP accounts setup to not allow them to change any of your files.
I dont care if they wreck the scripts - the scripts were purchased by the guy and were supposed to stay on my servers. After a huge battle he wants the scripts on his server so I am going to comply just to shut him up :) --- I also know that he intends to reuse and sell these scripts which would take some of my other clients away from me.
Although I am not proficient in php yet I do know that he is less proficient than I - so I want to make sure that he has a tough time changing them around (but at the same time - I cannot really encrypt them cuz that just would be taking it a bit too far).
I have a utility called "HandyFile Find and Replace" which replace all instances of a string in multiple files.
I have all my files on my windows computer.
I want to replace "_______" with blank as I read above.
So correct me if I am wrong if I replace:
/r/n with "" (nothing)
this should do the trick ?
backslash! \r\n on windows, in editplus you can go to find-replace, check 'Regular expressions', if your file is written with win (PC) line breaks, you can do replace \r\n with (nothing), if you develop on linux you replace \n with (nothing), in editplus for example you can see what format the file is, it says in the bottom right corner (PC/MAC/UNIX)
I hope you charged him enough to make up for the clients he wants to take from you.
Like people are saying, the best policy is to adjust your business dealings so that this is a non-issue. Easier said than done, perhaps.
Anyway, you could use this, I suppose: PHP Obfuscator/Obscurer ... not sure if that is too much for what you had in mind.