logs archiveIRC Archive / Freenode / #php / 2015 / September / 5 / 1
ionas
but: ssd + much ram = good stuff
FireLight
(how do you pronounce puphpet irl?)
NoiseEee
FireLight: that is a perfect excuse for a VM
bango2
puppet
LawnGnome
dp: I've never used ATTACH DATABASE, but there are StackOverflow answers that would suggest it works. Are you trying to attach after you've prepared statements? Seems like that might be problematic, per https://www.sqlite.org/faq.html#q15.
NoiseEee
the VM runs everything - the DB, etc etc
cjuehring
windows as hypervisor
LawnGnome
dp: Try attaching immediately after connecting, if you can.
FireLight
I shoulda known lol Noisee
         

LawnGnome
FireLight: I've always gone with "puff-pet", personally.
FireLight
I kept getting "puhpeht" when I tried :P
fritz4fun
with puphet its possible to create se same environment like on the VPS
make sense?
cjuehring
in crazy agencyland i have maybe 50-70 sites
would you run a vm for each site?
ionas
pu php et - e.g. it sucks FireLight
or puppet
FireLight
:P
NoiseEee
cjuehring: each site would be a directory, ie: an apache vhost directive for example
bango2
not side by side on the same host machine but yes different vm for different sites
FireLight
I'm pretty sure the agency would have its own system for how to deal with that sort of thing
ionas
puffpet hah
cjuehring
FireLight: you'd be surprised :D
ionas
If I ahve a stirng like Foo.bar.quux.batz how would I find the substring quux.batz by something like 2nd occurance from the right (like strrpos but one shifted)?
FireLight
well, unless they say "do whatever" :P
dp
LawnGnome: I'm populating my database, and then recreating the PDO connection; unless PDO is holding on to prepared statements after being null'd, then I'm "not using" prepared statements.
fritz4fun
with VM you mean the virtualzation of a server or a linux desktop distro?
FireLight
ionas let me get that info for u I did it before
cjuehring
yeah, its all cheap wordpress sites, so "it doesnt work on centos and mariadb!" hasn't been an issue for us
ionas
like Users.Articles.is_visiible and I want to get Articles.is_visible - but I dont know how many dot separations there will be in
FireLight
ok I got it ionas, you need the strpos with the minus X option on it
if you dont know number of dots you will need countif
bango2
ionas, explode by period (.) into an array? sounds easier to work with that way
         

FireLight
to count how many you need
ionas
bango2: thought about explode too.
FireLight
and set it into a variable
and pass variable into countif
ionas
countif?
fritz4fun
NoiseEee: with VM you mean the virtualzation of a server or a linux desktop distro?
FireLight
I can't remember which order around it was, but basically you will need a variable for counting number of dots (countif)
ionas
$pathBits = count(explode('.', $path));
NoiseEee
fritz4fun: a virtual machine running on your (laptop/desktop) that runs the particular linux distro you plan on deploying to
FireLight
and then you will need to explode it yeah
ionas
well $pathBits wont count the dots, it will count the parts
in case no dot, it will say 0
which is fine too
bango2
so theres parts-1 dots
FireLight
yes
ionas
but in case it is more than 1 dots I need to take some actions
LawnGnome
dp: Are you using persistent connections? (It'll be obvious if you are, because there'll be a PDO::ATTR_PERSISTENT option in your new PDO().)
FireLight
do a conditional
if pathbits == '1' or whatever
fritz4fun
noiseeee:Are we speaking of a server distro or desktop distro on the VM
FireLight
messaged you
dp
LawnGnome: newp. :/
Even then, nulling out and creating a new PDO connection should get past that, right?
LawnGnome
dp: It should. I can't 3v4l or codepad.viper-7.com this, because they don't support filesystem writes, but this works for me: https://gist.github.com/LawnGnome/66edb4c3cce643d178f2
dp
LawnGnome: works for me as well. So then it's somewhere above that. Time to go do some *serious* digging through frameworks. Thanks for your help.
ionas
NoiseEee
fritz4fun: server
bango2
$dotCount = count(explode('.', $path)) - 1;
NoiseEee
fritz4fun: puhphet.com will give you one all set up, and install php/apache already configured for you
bango2
youve got 4 fingers, but only 3 cracks between each finger
ionas
bango2: hmm& laughing out loud whut ;)
NoiseEee
fritz4fun: it requires you to download something called Vagrant, and then VM software like Virtual Box
ionas
ah yes
its not dotcount
its partcount
bango2
;)
fritz4fun
NoiseEee: Appreciate your help. Would it actually make sense to use windows as hypervisor for A VM with both a linux server (for coding) and a linux desktop
NoiseEee
fritz4fun: if you like windows, there's no need to a VM linux desktop
bango2
im not totally sure what youre trying to do, you want path = Articles.is_visible?
laszlof
oh joy
fritz4fun
thanks for the clarification
laszlof
i get to do a talk at a php conference and have less than a week to prepare!
:)
FireLight
cool, what's the talk
dp
LawnGnome: do you know if there's a way to tell if there are any prepared statements on a PDO object?
rsc
http://php.net/manual/en/language.oop5.decon.php refers to compatibility for old PHP versions. What does that mean? PHP 4?
FireLight
yes
anything before current if stated
rsc
I actually got "Methods with the same name as their class will not be constructors in a future version of PHP" for a third party library with PHP 7 and I wondered if the fix will break old PHP versions (__construct rather the classname)
I unfortunately still have to support PHP 5.1 (RHEL 5), thus explicitly asking.
FireLight
usually older versions = the X.0.0 before current
rsc
5 is still "current", even 7 is RC?
FireLight
let me check that page
bango2
ionas can you tell me your endgame? im confused by this code and what youre trying to accomplish
FireLight
pretty sure it is referring to 4 and below rsc, which paragraph are u referring to on that page tho
rsc
FireLight: "For backwards compatibility, if PHP 5 cannot find a __construct() function for a given class, and the class did not inherit one from a parent class, it will search for the old-style constructor function, by the name of the class. Effectively, it means that the only case that would have compatibility issues is if the class had a method named __construct() which was used for different semantics. "
ionas
bango2: https://gist.github.com/ionas/2f7eada054b85bd0914a works basically I have a Dotnotation path that is for instance in a query string of post data array
rsc
FireLight: but it was more about the whole page
LawnGnome
dp: I can't think of one, no.
FireLight
that page is referring to php 4 and below
ionas
like /?Users[Profiles][status]=foo bango2 & and I want to get [Profiles.status => foo] to save into a session or have as an hash filter option for a query builder
rsc
FireLight: thanks!
FireLight
np
bango2
given the string "Users.Articles.is_visible", you want the new string returned to be "Articles.is_visible"?
LawnGnome
I'll make that clearer and note that it's officially deprecated in PHP 7.
Haven't gotten that far in the migration guide yet, but this is a quick fix. :)
laszlof
FireLight: i dont have a clue
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 next »