Questions about PHP, a widely-used general-purpose scripting language that is especially suited for Web development.
0
votes
1answer
85 views
Multiple conditions in a function using PSR
I'm trying use the PSR conventions in all my projects, but today I view some code of my co-worker and I disagree.
if ($cond == 1 AND $cond == 2) {
// to-do
}
For me, the correct is:
if (($cond ...
0
votes
2answers
75 views
Arguments for conforming to PSR-2
I am trying to convince the lead developer of an open-source project I'm contributing to, to conform to the PSR standards (PSR-2 in particular) created by the PHP Framework Interop Group.
He is ...
4
votes
1answer
513 views
Objects of different programming languages
Apparently, there are some resemblance between objects in JavaScript and dictionaries in Python. Each language defines an object a little different (and there is some logic that all definitions to be ...
0
votes
1answer
91 views
What is a good php alternative to pip python or python easy_install? [closed]
I have read some tutorials on PEAR like this:
http://www.electricmonk.nl/log/2009/04/12/easy-pear-package-creation/
But, they seem to be old.
I am a python programmer and I am new to PHP. What do ...
-1
votes
1answer
47 views
Best Approach to pass id for populating update form? [on hold]
i want to know the best way and why it is ?
may be passing through URL Query string.
may be posting form having id element in to it.
may be Session /Cookie.
Thanks in advance.
1
vote
1answer
125 views
Unit testing methods which access an Internet API
Hi I'm developing a Wordpress plugin which accesses a couple of API's (Amazon Product API, Flickr, Freebase, Ebay).
I've already started writing unit tests for it but I'm still wondering if its ...
1
vote
1answer
118 views
How should I handle two crons that update the database?
I'm working on a Bitcoin-clone block explorer (specifically Mincoin) which has a block timer of about 1 minute. For those unfamiliar with Bitcoin, basically a new data structure called a block is ...
2
votes
2answers
160 views
What are the different meanings of 'fixture'?
I have some difficulty understanding the concept of "fixture". I know what a test suite is, a test case, a test run,
but what exactly is a "fixture"? A parameterized test case?
It seems to me that ...
1
vote
4answers
291 views
Which ASP.Net programming model is closer to PHP? [on hold]
I've been using ASP.Net WebForms for the last year or two at work for development, but I've used PHP for personal projects for 10 years. So, I'm far more adept at developing with PHP.
When it comes ...
2
votes
3answers
287 views
Is it good practice to return an array of objects?
If I have an ItemContainer class that contains, for example, items in an order, where each item is an Item object; is it best to have a method like:
ItemContainer->getItems()
that returns an ...
0
votes
2answers
222 views
More efficient way to paginate search results
I'm making a website in PHP where the user can search a big MySQL database. The user is shown the first result. I want the next button to take the user to the next result, and so on.
The trivial ...
0
votes
3answers
331 views
What's best practice for a SELECT * FROM SQL in PHP? [closed]
I need to make a "SELECT * FROM" Sql from PHP, that now returns about 10.000 records, that I insert in an Array and re-utilize in a page to show results in a table.
I need to have all that elements ...
2
votes
5answers
277 views
Planning relational database - one or two tables?
I'm currently planning the database structure of a used car's advertisements site. Each advert contains information about a vehicle, and a vehicle can be advertised multiple times over its lifespan ...
-1
votes
0answers
48 views
What to check/study for Web Development? [duplicate]
for the needs of some projects i ll need to get into web development client & server side in order to build up a few websites and some custom server side apps.
i ve got more than 20 years ...
2
votes
1answer
113 views
How to find classes that use certain DB tables
Problem:
I'm asked to prepare a document where all our DB tables are listed and I'm supposed to list all Controllers that uses these DB tables for read and another list for Controllers that do write ...