PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Jun 9, 2013 18:31
Bump. I'm "having fun" with a chicken and egg problem. Does it make sense to create an IOC that instatiates a logger and uses it for its own needs?
Jun 9, 2013 18:17
Hi! I'm "having fun" with a chicken and egg problem. Does it make sense to create an IOC that instatiates a logger and uses it for its own needs?
Jun 8, 2013 20:40
I came up with something
Jun 8, 2013 20:40
@tereško Sorry for bugging you. Thank you :)
Jun 8, 2013 20:28
@tereško in my case they also aren't. They are optitional features ;)
Jun 8, 2013 20:24
@tereško Zend has classes for creating bar codes, so why the hell not?
Jun 8, 2013 20:21
@tereško For instance: giving admin a nice GUI to change parameters in config files
Jun 8, 2013 20:17
*Hi
Jun 8, 2013 20:17
Ji
Jun 8, 2013 20:17
Would it be ok if used the same config class for reading and writting files?
Jun 8, 2013 20:11
What do you mean by adapter in first example?
Jun 8, 2013 20:09
@tereško Something like this? $config->add(new JsonConfig('config.json'))
Jun 8, 2013 20:07
Just messing around with my little framework
Jun 8, 2013 20:05
Hi. I have an oop question. Let's say that you're building a lib that reads config files and uses a parser object to translate config files into an array. There are more parsers available (Eg. Yaml, Json, ini,..). How should I make the config object aware of these drivers/plugins?
Apr 20, 2013 19:51
parseConfig($path), get($key), set($key, $value)
Apr 20, 2013 19:44
*I mean cache file location
Apr 20, 2013 19:44
filename
Apr 20, 2013 19:44
@dyelawn which driver to use (Memcache, APC, File,..) user/pass, ip addresses,
Apr 20, 2013 19:40
manual :)
Apr 20, 2013 19:38
probably passing setting with an array?
Apr 20, 2013 19:31
no, not really :P
Apr 20, 2013 19:31
YOU ARE WRONG!
Apr 20, 2013 19:26
FooBarInterface, InterfaceFoo, Barable
Apr 20, 2013 19:26
There are more standards
Apr 20, 2013 19:15
@dyelawn What about if Cache library is being used on its own? How would developers know which methods must they implement, if they want to use their own config class?
Apr 20, 2013 19:13
@dy
Apr 20, 2013 19:12
if it's capital, then you are talking about an OOP Interface, else you refer to interface as in 'hardware interface'
Apr 20, 2013 19:10
@dyelawn Interface. Cache class has a 'setConfig(ConfigInterface)' method and Config implements ConfigInterface. Where should ConfigInterface be located? In Config folder, Cache folder or somewhere else?
Apr 20, 2013 19:02
abstract class counterpart
Apr 20, 2013 19:02
@dyelawn OOP interface
Apr 20, 2013 18:52
Hello everybody!
I have a little problem. I'm writing a small PHP framework inspired by Symfony's components. The basic philosophy is that each component can be used on its own. Some of the components can work with others, in my case a configuration class returns configuration to the caching class. To keep the classes as decoupled as possible I use an interface. The question is where to put the interface, as it should always be available to both libraries. My file system is PSR-0 compatible
Apr 17, 2013 14:25
@PhilipK This is better, but still not good enough. Either use prepared statements or make sure that $email and $pin are correctly escaped and write it like this:
"INSERT INTO temp_user ('$email', '$pin')"
Apr 17, 2013 14:20
How much would you charge for a simple wordpress template? I will get an psd file and I will need to convert it to html and write some custom php.
Apr 17, 2013 14:18
@PhilipK use mysqli_query, or even better PDO.
Apr 17, 2013 14:16
Hello everybody! How much would you charge for a simple wordpress template? I will get an psd file and I will need to convert it to html and write some custom php.
Mar 6, 2013 19:14
@rdlowrey Well not yet, but I believe that they will when specification is finished
Mar 6, 2013 19:12
@rdlowrey At least it has native support in browsers
Mar 6, 2013 19:12
@PeeHaa I didn't understand the concept entirely. Now I think I got it :)
Mar 6, 2013 19:10
@rdlowrey Then Websockets are spot on ;)
Mar 6, 2013 19:09
@PeeHaa Anyways: I found something called 'dependency injection' I think this might be it
Mar 6, 2013 19:08
@rdlowrey It's shame there isn't any standard, but it's really exciting
Mar 6, 2013 19:03
@rdlowrey In PHP? That's nice :)
Mar 6, 2013 19:02
@rdlowrey Which websocket server are you using?
Mar 6, 2013 19:01
@rdlowrey That's nice to hear :D
Mar 6, 2013 18:47
@PeeHaa Nope, I don't use Git yet.
Mar 6, 2013 18:46
@LeviMorrison It most certainly is.
Mar 6, 2013 18:43
@PeeHaa Of course I do. Controllers are called dynamically, and the loader doesn't 'know' if they need access to a certain object
Mar 6, 2013 18:39
@PeeHaa Yes, but how?
Mar 6, 2013 18:30
@PeeHaa The config class was just an example. The problem is that in some cases framework components should be able to access the same instance of a certain class
Mar 6, 2013 18:28
@Happyninja I'm already using it heavily.