Tagged Questions
-1
votes
0answers
23 views
Include Multiple Database Connections Inside a PHP Class [closed]
I've a simple PHP class file and i Want to include multiple database connections, since each of my functions using different databases for fetching information.
The files to be included in the class
...
4
votes
2answers
276 views
Validation Class - Feedback Welcome!
I have written a Validation and Form class in PHP.
Validation class allow you to define the rules of each field and a error message.
Form class allow you to get a error message and also allow you ...
3
votes
1answer
522 views
How to improve Try…Catch Block for PDO?
I have written a PDO wrapper and a class file like a model. So far, it's looking so good! I am just confuse where I should put Try...Catch block - Would it be better to place in PDO wrapper ...
1
vote
1answer
285 views
PHP Config Class
I'm working on a config class for PHP, where I can easily bring in config options. Any improvements/suggestions are appreciated.
Example usage:
echo Config::get('database.host');
// Returns: ...
1
vote
1answer
180 views
PHP Lazy loading with __get - yay or nay?
I have my own PHP MVC framework that I'm iteratively developing (i.e. adding a feature when I have the time). I'm trying to keep it to the best practices I can, while still adding the most in terms of ...
1
vote
1answer
1k views
how to properly use database connections in PHP classes
I need some advice\suggestions on how to create\handle database connections for a project I'm working on. I'm creating a simple work order system for my company using PHP 5.4.3, right now there isn't ...
3
votes
1answer
277 views
How to convert my classes to Dependency injection?
I am still learning to develop my skills in OOP.
It uses a combination of the factory and its real singletons?
As I did more research, I have realized this design pattern is bad because of global ...
7
votes
2answers
318 views
Any way to improve the performance of this PHP class?
I have been developing this class, and was wondering if anyone had any thoughts on how I can improve the performance of it.
<?php
class Something {
private $APIUsername, $APIPassword;
...