Questions about PHP, a widely-used general-purpose scripting language that is especially suited for Web development.

learn more… | top users | synonyms

0
votes
1answer
326 views

Does it make sense to break fluid interface if a bad argument is passed?

If I chain some setters together and one of them does not return $this, then I will get a fatal error. But maybe that is a good thing. $object = new object(); ...
0
votes
1answer
16 views

Roles configuration strategy

We're close to start new project using sf2, and, probably, FosUserBundle. Keeping that in mind - what's the best strategy to define roles? App will be used by multiple divisions inside our company ...
2
votes
2answers
67 views

Multiple many to many relations or one option table?

Let's say I have a database of persons who have some properties. For the sake of this problem let's say all of these properties relate as N-N. I can either create two tables for each property (one ...
0
votes
1answer
32 views

Using XAMPP for intranet setup

Hi I'm planning to run production code in an intranet of about 12 computers. Is it okay to use XAMPP to run this or are there better alternatives?
-1
votes
0answers
40 views

How can we create a desktop based application in php? [duplicate]

I this possible to create a web based application in php if we can please provide me some link of that app also if applicable in youtube provide me youtube link. My search: I search on google and ...
-2
votes
0answers
12 views

Google App Engine File Upload Error - PHP [on hold]

PHP Warning: File Upload Mime headers garbled in Unknown on line 0 When i am trying to submit form with large data in texarea and uploading image also.
1
vote
1answer
102 views

How can I fetch data from more than one web services simultaneously in PHP?

I have 3 web services that are providing me data for my hotel booking engine. It is taking too long if i run them sequentially. Therefore I wanted to run them using threads, but I am not sure if php ...
0
votes
1answer
46 views

How can I configure updates in a CMS like WordPress?

I have a CMS built in core PHP. Till now, if a new version is released, it is downloaded to client machine in zipped form. And then client has to manually unzip the folder and copy that to required ...
0
votes
1answer
81 views

Ensuring non conflicting components in a modular system

So lets say we are creating a simple "modular system" framework. The bare bones might be the user management. But we want things like the Page Manager, the Blog, the Image Gallery to all be ...
0
votes
1answer
622 views

Reporting Solution in PHP / CodeIgniter - Server side logic vs client side

I'm building a report for an end user. They would like to see a list of all widgets... but then also like to see widgets with missing attributes, like missing names, or missing size. So i was ...
1
vote
1answer
203 views

How to discover a class in PHP dynamically much like a plug-in architecture

I'm encountering a common issue in PHP (and most other languages) at the moment, where systems I'm designing need to be updated in multiple places to add new features, whereas I would like to have a ...
0
votes
0answers
15 views

MYSQL selecting multiple rows of same type [migrated]

From this MYSQL table which has several hundred cities divided into different sets, I need a page to display a clickable link pertaining to each set (i.e. set 1, set 2 etc.) in a list and when one is ...
2
votes
2answers
97 views

I have a legacy project that I'm working on, how should I improve its structure?

I have a slightly old PHP project I'm working on for a client (I think it was started around 5 years ago), it makes extensive use of the outmoded mysql_query function, which is concerning not only ...
0
votes
0answers
37 views

PHP: frequent file system write

I am building a game based on PHP and MySQL. Basically there is a player-vs-player mode but I figured I should add a player-vs-computer mode as well, since players may not be online at all times, ...
9
votes
6answers
1k views

Can someone help me understand MVC? [duplicate]

I've read a few articles on the MVC pattern and tried to understand what it exactly is. But till now, what I get is a plain diagram showing 3 modules of Model, View and Controller. Some say that it ...
0
votes
0answers
34 views

Zend framework 2 authentication - only storing the user ID in session

I've just put together my first app using Zend_Authenticate. According to some tutorials I've read they store the user's "email" column. Is this recommended? I've read to store the ID only, then on ...
0
votes
0answers
45 views

What other technologies/other skills should I develop in my hunt for a job in development/research? [closed]

The question up-top sounds fairly vague but bear with me... I have developed some intermediate-advanced skills in PHP/JavaScript/Python and a few other languages. I've done so through the course of my ...
0
votes
0answers
42 views

Database auto Increment primary key as a foreign key in another table [on hold]

So right now I have one table user with primary key userID, this primary key is cross referenced with another table Sets where userID is a foreign key (the set belongs to the user)- Autoincrementing ...
0
votes
0answers
20 views

Are Components ideal for packaging and reusing find() requests?

I find myself loading several models over and over again throughout my application. Instead of typing the code to load the model, run a find, would it be reasonable to put that code in a method and ...
0
votes
0answers
13 views

Should I use session or cache to keep the time it last polled when polling to server at intervals?

I'm building a web chat app using session to keep the time the app last polled so that the server can determine whether messages exist between the current polling time and last polling time. It works ...
-3
votes
0answers
24 views

How to validate using regexp [closed]

how am i going to validate my characters using regexp? these are my codes: public function updateuserAction(){ $this->view->disable(); $get = $this->request; $key = ...
2
votes
2answers
178 views

optimizing webapp workflow

I have a debug and a live server running a LAMP setup with some python scripts. By now I'm working with eclipse and Expandrive (via SSH) on the debug server. Whenever I want to release new code on the ...
0
votes
0answers
44 views

How have PHP and MySQL changed in four years? [closed]

First things first: I submitted this question directly at Stackoverflow, but got directed to StackExchange. Didn't know about this platform here, sorry! The last time I worked with PHP for private ...
0
votes
0answers
47 views

How my cms user get to know about latest cms updates (like wordpress) [closed]

I am going to use Content Management system built in core php. I want to send notification(like wordpress) to users who are using my CMS whenever I add new functionality to my CMS. I have no idea ...
-2
votes
0answers
37 views

which programing language is best suite for news website? [closed]

the most flexible form may is php but the oldies and advanced programer like asp Ain other hand the c-panel fprm of these website like news website most the user friendly one so the "?" is wich one is ...
1
vote
0answers
43 views

PHP Framework that favors better general habits over convention

This is intended as an objective question. I've been reading about most of the Frameworks for PHP. We use Cake at work, and I've had exposure to CodeIgniter and Symphony. They all have their own ...
0
votes
0answers
24 views

Deleting dynamic elements from a database

I have a select dropdown, with '+' and '-' buttons that add and remove items before submission. I would like to be able to remove the elements with the '-' button after they have been added to the ...
6
votes
1answer
7k views

PHP Framework for RESTful Web Service

I have been going round in circles with this question for days - which is the best PHP framework to use to create a RESTful Web service? I've trawled the web for info and have come across three main ...
0
votes
0answers
22 views

Verifying and insertion of details in db [migrated]

I need to insert the details (name, id , number )of many documents into database if they are not already existing and if they exist i just need to do a update for any changed information. I have ...
0
votes
0answers
43 views

How to loop through a foreach in php? [migrated]

I need to retrieve day and amount data according to car name. i managed to retrieve carname,car image using foreach and while loop but I'm unable to loop through day and amount of rental for that car. ...
2
votes
1answer
152 views

PHP Cache Strategy - Genius or Sheer Stupidity?

I have a shared hosting with limited capabilities. Memcache and mod_cache are not available to me. I would like to implement my own PHP caching method to cache the results of load-intensive SQL query. ...
2
votes
2answers
246 views

Repository pattern implementation that knows nothing about the database table and column names

I've seen around the Internet and Github, implementations for the design pattern Repository that knows about database table and column names. I was think, if I want to work with the database as a ...
0
votes
0answers
20 views

Can't post data to php, Can't see why [migrated]

I have some data from a form that is being sent to a php script to send an email, it is from a template but I think it is wrong. I have isolated the part of the code that is to blame. The specific ...
-1
votes
1answer
27 views

Load partial data and data sorting [on hold]

I have one database table that I query on load and display items in a list sorted out by dates (latest first). However, as the table may become quite big, I only fetch the n first rows. To see more ...
0
votes
2answers
117 views

Is there a better way to load objects?

I have always kept the code to load an object within the object itself. That way no matter what method is creating the object, it always has access to the method to load the object. However this does ...
0
votes
2answers
225 views

How do I handle 3rd party search result data (via cache)

I have a search function on my site and it is taking data from 6 different 3rd party resources. The problem is, it takes too long requesting the data over and over again on the results page. I've ...
0
votes
0answers
23 views

Rendering STL file to STL viewer which is in new page

I've uploaded a STL file as an additional file for a product. And it gets downloaded in frontend as shown in screen shot. When I click on that link for STL Downloader, then that STL file will be ...
0
votes
1answer
28 views

Creating a voting platform for submissions during timeperiod

I have a site where stories are submitted at any time by users. The staff would like the ability to create a voting period at any time. For example, they can choose to open up voting from today until ...
1
vote
1answer
142 views

What is the simplest archive file format to aim for when writing collections of files?

I've created a PHP-based document management system and hosted it on my Raspberry Pi. I created a "backup" function that zips together all the documents, but it takes too long due to the hardware ...
0
votes
1answer
156 views

Best practice for storing information from a php script for future use

My employer uses forms to help people search for products. The product lists can change from time to time and the forms need to be updated again. The product information can be accessed through a ...
1
vote
2answers
566 views

Search and Replace in MVC

What would be a good MVC/OOP/GRASP/SOLID structure for a search/replace functionality. Methods: search/searchNext/replace/replaceAll. I'm interested only in the PHP arhitecture and how a professional ...
3
votes
2answers
194 views

Understanding exceptional cases

I've been studying the use of exceptions in various php projects (such as Doctrine and Zend Framework). Exceptions seem to be thrown when unordinary input/state occurs. A perfect example is Doctrine ...
0
votes
1answer
276 views

PHP class data implementation

I'm studying OOP PHP and have watched two tutorials that implement user login\registration system as an example. But implementation varies. Which way will be more correct one to work with data such as ...
1
vote
1answer
122 views

Updating an Entity through a Service

I'm separating my software into three main layers (maybe tiers would be a better term): Presentation ('Views') Business logic ('Services' and 'Repositories') Data access ('Entities' (e.g. ...
3
votes
2answers
242 views

What's a good simple way to combat the n+1 problem?

I'm trying to better understand performance in PHP. One issue I'm thinking about is the n+1 problem. By n+1 I mean something like this: $posts = Posts::getPosts(); foreach($posts as $post) { ...
1
vote
1answer
123 views

AJAX or web sockets for client-server communication?

I recently took a course on AngularJS, and quite frankly I loved the concepts of a website that fetches json to handle subsequent requests, however I still feel like Javascript is far too slow for ...
-1
votes
1answer
76 views

PHP4 constructor does not work with namespaces [closed]

Here's a scenario: whenever accessing class using namespaces in php, it doesn't launch the standard constructor, but only the 'magic' method. What's wrong here and what can be fixed? hierarchy ...
0
votes
0answers
26 views

Doctrine 2 and Concrete table inheritance

I use Doctrine 2 and I've read some articles on inheritance strategies' mapping with ORM. I've seen three main strategies : "Class table inheritance", "Concrete table inheritance" and "Single table ...
0
votes
1answer
71 views

How can I cancel all running mysql queries in a web application?

I am running a web application which has to scan (mysql query on a particular column) a huge MySQL table, which has over 100,000 records. The problem I find that when a user requests another page ...
-3
votes
0answers
19 views

Regular expression(preg_replace) in php [duplicate]

I tried below code for replace some text with regular expression pattern..but i cant get properly: Following scenario: My input 'the is good [[text]] [[link1|text1]] [[link2|text2]] [[text]]' ...