Tagged Questions
The php5 tag has no wiki summary.
1
vote
1answer
55 views
Improve code of BDDs in phpunit
no one in my team knows how to write BDD tests, so I started writing some and its quite working well for but I think the time has come to improve the code quality.
Here is my code and it contains a ...
1
vote
1answer
34 views
is there a better and short way to getting that array from joined sql query and converting it to superfish dropdown menu?
I'm trying to build a superfish dropdown menu from a sql query. Working example is can be seen from here check the "emlak bul" category: ...
2
votes
1answer
37 views
Refactoring a loop with many boolean conditions
I usually spent more time on refactoring than in developing itself. But this little piece of code is really hard to refactor. I'd like to keep it as short as possible, but it's quite undarstandable:
...
4
votes
1answer
49 views
php swiftmailer two message instances with one mailer instance?
I created a simple function for swiftmailer to send two different messages for support and client. Not sure i did it the rigth way as I am using two different instances for message and one mailer ...
1
vote
2answers
116 views
class - tweet - 0 - to_do
This class sends "tweet" data to the client in the form of a custom markup language. How can it be improved?
It is used in Ajax call and in previous post people have suggested not to echo the ...
1
vote
1answer
127 views
Form validation idea, bad or Good?
Here is a class that I made to validate my html forms, I will really appreciate any criticism and hints.
<?php
class formvalidator {
public $filtered, $errors,$db,
$fields_type = ...
0
votes
1answer
91 views
How can I display the results of mysql_fetch_assoc in a dynamic table?
I have a MySQL database with several columns and two rows of data, so far. I'm using mysql_fetch_assoc to return the data in database, but I don't know how to put it all together in a table so that I ...
1
vote
1answer
108 views
Accessing multiple schemas using singleton pattern
I have a situation where I have to connect to multiple schema to populate a single page.
I altered our singleton db class in to help me do this.
It will now destroy and re-declare itself whenever we ...
1
vote
0answers
57 views
PHP Optimization performance
i have following code, but. it's too Slow
<?php
class Ngram {
const SAMPLE_DIRECTORY = "samples/";
const GENERATED_DIRECTORY = "languages/";
const SOURCE_EXTENSION = ".txt";
const ...
1
vote
1answer
102 views
Loading module to a templated page.
Hi there!
I am trying to create a web app (CMS) as part of my research project, and I use the code below to load modules into a page, It will be great to have your guys review and critics
...
2
votes
2answers
2k views
Learning OOP PHP, simple MySQL connection class.
I have posted an earlier version of this and here is the improved version from the feedback I recieved. Some of the feedback I received was;
Don't chain method (tried my best to limit this)
Do not ...
4
votes
2answers
321 views
Anti-Bot comment system - PHP
Hii, with some advice from SO [see the details on my previous questions if you are interested] i developed the system, which i think is quite strong for bot to automatically post comment !
I'm posting ...
3
votes
2answers
160 views
Critique my first OOP attempt
I am trying to learn OOP using PHP5 and I wrote a simple MySQL connection class. Please take a look and give me some feedback on better practices, critical errors, and any other feedback you can ...
4
votes
3answers
250 views
PHP Table generation
I have been using the following function (in the kohana html class in a table) to generate tables.
function table($columns,$reverse=false,$fill=false,array $attr=null){
$c = '';
//ugly hack, ...
4
votes
2answers
251 views
Cart Class feedback
I have written a cart Class, it use session to store data. Is the code well implemented or could been better? You can rewrite my code if you can.
Each item have a number of options with price
Each ...