Tagged Questions
2
votes
0answers
38 views
Practical advise for CMS
I'm working on a CMS system. The basis is pretty much done but before going any further I would like to know if there are things I really should change in the way I code things.
I am pretty sure ...
3
votes
4answers
227 views
Best practices in PHP
I've posted here before and got pretty helpful reviews. So, how does my code look now. To keep it really helpful, I just copied this from the middle of one of my projects. Review please?
<?php
...
1
vote
1answer
39 views
Referring to nested arrays and array_merge (php)
In such an array:
$arr = Array (
[key0] => Array (
[subkey0] => Array (
[0] => "value0"
[1] => "value1"
)
[subkey1] => Array (
...
1
vote
1answer
132 views
Getting familiar with OOP - Factories
I have no idea if I'm doing this efficiently, or ideally, but I've written what I think is a factory. Please help me understand if this is good practice, or if there is another direction I should take ...
3
votes
2answers
115 views
How can this this URL Checker be made cleaner?
I have a table full of URLs, some of which will occasionally become invalid. As part of a system I'm writing to go through the links periodically, and test if they are valid (or redirect to valid ...
1
vote
0answers
62 views
CakePHP Best strategy for getting HABTM data in multiple ways within the same tool
School HABTM AthleticDirector
I am building a tool for assigning athletic directors (ADs) to schools. The tool has a school menu/filter which, when selected, shows a list of ADs already assigned to ...
3
votes
2answers
157 views
PHP PDO Factory Classes
So, my question is more of a 'best practices' question rather than a question with a particular aim. This is my current understanding of PHP factories and how to incorporate them into a project using ...
0
votes
2answers
58 views
Consistent implementation of PHP class constants (arrays not allowed)
I'm currently writing a class:
final class MyTestClass {
const URL = 'http://www.example.org';
private static $MY_ARRAY = array('...');
// since this is not allowed
// const MY_ARRAY = ...
10
votes
4answers
1k views
How would a senior PHP developer design this Login class?
I incorporated the feedback I received from my previous post into a very simple Login class.
Main question:
How can I design this class and it's implementation so that it
looks like it was ...
1
vote
3answers
187 views
PHP - Deleting Directory Contents & SubDirectory Contents
I've set up some PHP to delete a directory, it's contents, and any subdirectory and its contents... I'm new to PHP so I'm most definitely doing something WRONG or am doing something in the most ...
3
votes
1answer
722 views
Better way of handling data returned from fetch_assoc() (mysqli)
So I connected to the db, pull the data using fetch_assoc() (fetch_all(NUMB) is not available on the machine we are working with else this would be less of an issue). So I get the returned data and ...
3
votes
1answer
110 views
Semi-Repost: How can I improve my PHP model for my html5/js mobile app?
I was advised, rightfully so, to simplify my question.
I am posting the a section of the model of my application.
Any/all feedback would be very helpful as I am trying to build my PHP skills, but I ...
0
votes
2answers
256 views
How can I improve my PHP backend for html5/js mobile app?
I would really appreciate any feedback on the back-end of my mobile application.
I tried to keep an MVC pattern, where I considered the app to be my view.
Perhaps an REST framework would have been ...
9
votes
4answers
1k views
Best practice in php for “If the variable is empty, set a default value”
This is the pattern I've been using for "If the variable is empty, set a default value", and for variables like $muffin it has all seemed well and good. But in the following real example this pattern ...
2
votes
2answers
1k views
Getting Facebook comments count via FQL
I'm currently getting the Facebook comments count over a query request to the Facbeook api.
The problem is, there are about 15 queries on each site which makes it real slow to load (up to 6 seconds)
...