logs archiveIRC Archive / Freenode / #php / 2015 / July / 13 / 1
morfin
i think unit testing is supposed to finding logical errors not errors like "Oops i was drunk and wrote var not $var in code so everything broke"
__adrian
morfin, i'm getting confused. what kinds of errors are you trying to handle? runtime/in production?
or testing/during development
also don't code while drunk
morfin
nice advice)
__adrian
morfin thank you, and you're welcome. (but there was a question too)
morfin
__adrian - there is requirement cover code with tests
__adrian
so testing/dev?
phpunit
morfin
that guys suggested codeception
and only thing is driving me mad is YAML configs aaaaargh
but they can even Phalcon
mewm
https://gist.github.com/mewm/370ed2ad9fe9cb1fb1b9 - can anyone tell me why I can't use my mutator in my constructor? It should be basic php and now I feel stupid..
biberu
mewm: setProp1() sets the property and returns nothing, and the constructor assigns that nothing to prop1
         

mewm
yes of course... Facepalm...
biberu, thanks mate :)
midgetpower
All paths in any context in PHP using "/foo/boo/" format will be automatically convered to "\foo\boo\" on Windows platforms, no?
So why should I ever use DIRECTORY_SEPARATOR?
Cans you explain?
__adrian
morfin
btw can PHP open COM1 on Windows?
midgetpower
I don't get what __adrian meant by that.
__adrian
just some possible complications.
but no, it's not "automatically converted," it's just that windows _accpets_ slashes in addition to backslashes
i personally don't pay much attention to the possibility that my code will ever be run on windows, but... why not?
TinoDidriksen
Just use / - it works everywhere and won't litter your code with fugly.
midgetpower
Hmm...
__adrian
midgetpower
Dangit.
__adrian
also MacOS (uses ":")
TinoDidriksen
Mac OS X uses /
__adrian
just in case you're gonna run your code on a ten-year-old apple computer
MacOS, not OSX
theskillwithin
can't you just use the DS consant
TinoDidriksen
Nobody sane uses OS 9 any longer, so not a problem. / works.
theskillwithin
define('DS', DIRECTORY_SEPARATOR);
__adrian
:p
theskillwithin
define('PS', PATH_SEPARATOR);
define('BP', dirname(dirname(__FILE__)));
$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'local';
morfin
why
define('BP',__DIR__);
theskillwithin
Don't ask my, I acctually don't know what I'm talking about
me*
         

morfin
then
theskillwithin
(Action) looks to __adrian
__adrian
hm. just realized that DIRECTORY_SEPARATOR might be bad, in case it IS a backslash, and preceeds some path segment which might be interpreted as an escape sequence
theskillwithin
I;'m just taking this out of Magento
__adrian
"BP"?
base path?
theskillwithin
yea I think so
this is literally the first 3 lines of mage.php
Mage.php*
__adrian
i used to do something like but have since abandoned it in favor of __DIR__
likewise with the "DS" definition
for all the complications i am pointing out, I just use literal "/" in my paths
theskillwithin
would you ever need to run production code on Windows anyways?
__adrian
$path = "c:\tmp"; // see the problem, there?? :p
_I_ wouldn't.
couldn't speak for anyone else :)
theskillwithin
I use windows on a regular basis, now I use it to remote login to my mac =D
My new job I will be getting a mac at work though =X
I kinda wan't to bring my mac in to work, all my sh*t is already set up on it
__adrian
tip: kepp work and personal machines separate
*keep
theskillwithin
It's hard for me, because what I do at work is my interest. and I do personal study on my interest at home.
morfin
i never tried to do that but i think PHP would open COM)
theskillwithin
I think we should just say if you need to program PHP for windows, you are in the wrong place in life
__adrian
theskillwithin
https://www.cygwin.com/
I literally Can't Even on Windows
you can't even drag files into the dock to open them in that program
__adrian
"Get that Linux feeling - on Windows"
yeah, i, uh... no
theskillwithin
terminal is just way too valuble. grep omfg, the pipe | omfg, > can't live without this sh*t
__adrian
if i wanted, i'd just log in to windows, spin up arch on a vm, and fullscreen it
theskillwithin
tail
ahahaha
__adrian
that's assuming there are no usb ports i can boot from
theskillwithin
one time I used sublime text to edit a csv because Excel couldent do what I wanted
morfin
i was not going
theskillwithin
__adrian I am front-end dev mostly so I use sublimetext3, I wonder what do you use?
If I may ask
__adrian
komodo
theskillwithin
I have PHPstorm installed, but I found it not usefull to me (prob cuz I don't know hwo to use it)
__adrian
there is a free version ("Edit") if you want to try it out
theskillwithin
Would you recommend I use Komodo if I am doing PHP work on a Magento site?
__adrian
i would recommend you use what you like and are productive with
theskillwithin
$99 a little steep, but this isn't just a text-editor
__adrian
i personally find komodo invaluable
theskillwithin
I already like the look
ooooo
I like this, minimalistic compared to phpstorms ide
__adrian
the full IDE has some great stuff too, though it's a bit pricey
theskillwithin
__adrian given I don't understand how this sh*t works yet, when I was looking at a Magento video and they were extending classes, they were able to click on the extended class to see the original class. Is this avaliable in Komodo?
jorela
Hello. I have a question regarding prepared statements in MySQLi.
x0rs
Any recommendations out there for matching strings? Specifically string with addresses? I am not looking to just match them if they are identical, but wanting to match them if they are "close". This is to help not use up my geocoding quota.
__adrian
it has tooltips...?
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 next »