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

learn more… | top users | synonyms

3
votes
1answer
651 views

Reverse horizontal and vertical for a HTML table

There is a two-dimensional array describing a HTML table. Each element of the array consists of: the cell content rowspan colspan Every row of this two dimensional array corresponds to <td> ...
2
votes
1answer
91 views

Interface hierarchy design for separate domains

There are businesses and people. People could be liked and businesses could be commented on: class Like class Comment class Person implements iLikeTarget class Business implements iCommentTarget ...
1
vote
1answer
68 views

Repository Pattern: Doctrine2 vs Microsoft Entity Framework?

I have been using Symfony2 with Doctrine2 for some years. I have recently started using Microsoft's Entity Framework with MVC5. From my Symfony2 experience I understand that a repository's job is only ...
1
vote
1answer
91 views

Web Application: Combining View Layer Between PHP and Javascript-AJAX

I'm developing web application using PHP with CodeIgniter MVC framework with a huge real time client-side functionality needs. This is my first time to build large scale of client-side app. So I ...
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. ...
2
votes
0answers
79 views

Use and manage Front End Assets for Web

I am a beginner and am currently developing a kind of cms using PHP. The number of libraries that we can potentially use in the front end is large. I have a question about properly selecting, ...
2
votes
0answers
69 views

How to build child classes as parent configuration?

I'm using Codeigniter PHP Framework for developing a web application, and when developing an admin zone, I've ended building a generic parent class called AdminController which is extended by the ...
2
votes
0answers
755 views

codeigniter pagination - how to have multiple sets of pagination links on one view

Problem I don't know how to create two sets of pagination links one view. Background Information I have a situation where I have parent / child tables that I have to display on the same view - ...
1
vote
0answers
47 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 ...
1
vote
0answers
133 views

MVC content management framework with an admin panel

I've lately been developing my own MVC content management system using PHP and, at least in my mind, am a little stuck with the system design. I believe this would apply to building a content ...
1
vote
0answers
110 views

Websockets VS SSE

Suppose I have a service which requires to seek the database for different data once and in a while. For this I have 2 or 3 SSE, each one with a different retry basetime (20000 miliseconds, 1000 ...
1
vote
0answers
105 views

How to authenticate user on php and Node.js

I´m currently developing a little chat page. The main page and user management is written in php and also all the authentication stuff with sessions. Now I´m planning to run the messaging stuff on a ...
1
vote
0answers
66 views

Use Generic of Specific Function names for similar objects

Is there a school of thought on putting focus on using generic names for functions, opposed to naming functions based on the things they do? Example Say we have a Bill / Price Sheet object, that has ...
1
vote
0answers
67 views

How should I connect to my php framework to use methods written in the framework, in a framework agnostic environment?

My company runs 2 websites, a public facing website for clients, and an employee intranet. The intranet is used as a backend for employees to edit and maintain various parts of the public website. ...
1
vote
0answers
90 views

Writing a PHP wrapper for Javascript to safely access REST API

I am looking for signposting help to secure my API keys when accessing a database over REST API from Javascript on a webpage. I have read that in order to secure the API key I need to create a wrapper ...
1
vote
0answers
67 views

Zend 'Page Tile' view helper

I've created a ZF2 view helper PageTitle (extending Zend\View\Helper\AbstractHelper). As the name of the helper suggests , it is responsible for rendering the page title for each action view script. ...
1
vote
0answers
260 views

Which interface allows you to use a design pattern that is characteristically changed with the instantiation of objects?

I am doing a research on this and can't find my answer to this question: Which interface allows you to use a design pattern that is characteristically changed with the instantiation of objects? ...
1
vote
0answers
141 views

How to bypass Oauth2 authentication when the client and resource owner is the same entity?

We are currently working on using an API provided by Mercado Libre which is a maket place for selling various goods. Their APIs use OAuth 2.0 for authentication. The problem is that OAuth 2.0 as ...
1
vote
0answers
400 views

Flight framework, static or non-static?

I recently came across the Flight micro-framework, I want to use for a project because it seems lightweight, easily extensible and maintained. Most of the other micro-frameworks I looked into and ...
1
vote
0answers
285 views

Codeigniter modular separation with Phing

I am thinking of managing a product source I am doing using Codeigniter + HMVC. Right now my folder structure is something like this: application |-modules |-module1 | |--controllers ...
1
vote
0answers
682 views

Google Maps - Geofence a route

I'm looking at implementing a PHP based application, where by you have a certain route for example London to Edinburgh. Along this route, I want to calculate say a 10mi Radius or Polygon around the ...
0
votes
0answers
2 views

Evenly Distribute students into rooms based on student study subjects and room capacity limitations

The problem is that I need an algorithm (preferably in PHP) to solve the following problem. Students need to be placed into dorm rooms of varying capacities based on the subjects the student is ...
0
votes
0answers
66 views

When to use packages or Repositories in Laravel?

I'm a Laravel (PHP) developer, and new with DI, Packages (workbench) and Repositories (Pattern). I want to know about the best concept/methodology for a more flexible design; ie. the project can grow ...
0
votes
0answers
40 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, ...
0
votes
0answers
41 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
21 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
17 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 ...
0
votes
0answers
25 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 ...
0
votes
0answers
26 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
0answers
28 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
0answers
29 views

Laravel 4: Binding/linking two users together

I'm building a unittest system. At some point I want to bind two users together in order to make an assignment for those two. So when the admin chooses to link two students together the system should ...
0
votes
0answers
17 views

Writing Models in PyroCMS/Codeinighter Models

In Pyrocms there are Admin views and User views. Im developing a complex module where my model file is getting to be rather large. Should I be abstracting logic in my model files to also be User ...
0
votes
0answers
80 views

Penny auction concept and how the timer works

I am creating a penny auction site using PHP yii framework. The main consideration of the system is to update the database records of all active auctions (max 15 auctions) with the current ticker ...
0
votes
0answers
53 views

ffmpeg: cut multiple input files with seeking to one output file

I have list of video files (loaded from database), each with start and end time of requested interval: # file begin end v1.mp4 1:01 2:01 v2.mp4 3:02 3:32 v3.mp4 2:03 5:23 And ...
0
votes
0answers
37 views

Is there just one EventHandler class per application?

In a game I'm making I was about to add a MovementEventHandler, with events like "pre-character-movement" and "post-character-movement". But this class will do exactly the same as a future ...
0
votes
0answers
56 views

Import data and modify

I should build an importer in PHP. So below you can see how it should work or how it currently works. This is only a small example, the real importer is much bigger so the import() method is also ...
0
votes
0answers
32 views

How to unit-test for PHP implicit conversion errors?

Is there a way to find errors caused by crafted input in php, such as naming POST-fields like variable[] instead of variable, causing PHP to implicitly convert it into an array, by using some form of ...
0
votes
0answers
40 views

User Generated Content and Hotlink Protection

I have a website that allows for users to paste content (like snippets of code, etc) for sharing. Like Pastebin and Github, I also have a "raw" link that will display the raw contents of those posts. ...
0
votes
0answers
26 views

Class/Object with different sets of configurations, singletons etc (PHP)

I want to produce maintainable code for configuring one or multiple classes differently depending whether in a production or development environment. For example, making a Paypal class/object that ...
0
votes
0answers
147 views

Use a global variable, a singleton, or something else

Preface: I am working in PHP (Abandon hope all ye who enter here). Background: There exists a large set of global functions in PHP, a number of which are miscellaneous system calls, like sleep (and ...
0
votes
0answers
116 views

API Client Design

I'm designing a client to the Tomtom WEBFLEET.connect API in PHP. (You can read more about the API through the full documentation here: ...
0
votes
0answers
67 views

How should one handle accessing a 'local' API?

I'm currently writing a project that is using a few separate virtual machines for the database, API and front-end website (currently 1 of each). I'm writing my code in PHP, and all of these virtual ...
0
votes
0answers
79 views

Customizing configuration for PHP will Laravel 4 IoC be useful?

This topic has been discussed in this post: Customizing configuration with Dependency Injection However - I couldn't find one for PHP syntax and since one of the answers was to use a specific ASP.net ...
0
votes
0answers
48 views

Algorithm for Testing interoperability

I am writing a php script that carries out a task. One input is a list of options that I need to test for interoperability. If the options are A B C then I need to test every combination, but I only ...
0
votes
0answers
159 views

Rest Api Client response handler

I have two instances of Laravel: Rest Server API and Rest Client. Let's say I want to display list of positions on the front page. I'm making request to my Server API from my client controller: ...
0
votes
0answers
127 views

Algorithms or patterns for a linked question and answer cost calculator

I've been asked to build an online calculator in PHP (and the Laravel framework). It will take the answers to a series of questions to estimate the cost of a home extension. For example, a couple of ...
0
votes
0answers
449 views

Syncing client and server CRUD operations using json and php

I'm working on some code to sync the state of models between client (being a javascript application) and server. Often I end up writing redundant code to track the client and server objects so I can ...
0
votes
0answers
153 views

Pattern or solution for using classes with different interface the same way

What I would like to achieve is to use classes (now two, later more) with different interface the same way, so I would like avoid using decisions based on the interface on upper levels for instance, I ...
0
votes
0answers
158 views

Model design used in Zend Framework 1.8 Web application development

I am currently reading Zend Framework 1.8 web application development by Keith Pope. In this book an application called storefront which is a shopping cart is being built. But I am not able to ...
0
votes
0answers
128 views

Need server suggestion to handle Twitter API

I am working on generating some statistics by using twitter trends and streaming API. ( I have adjusted keywords such that traffic I get from twitter daily is of max size 1GB) I was currently ...