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

learn more… | top users | synonyms

2
votes
1answer
212 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
1answer
169 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 ...
2
votes
1answer
925 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 - ...
0
votes
1answer
60 views

How to determine which service to call

I have modeled my application using multiple 'user' domain objects. Candidate Recruiter Administrator Each entity extends from an AbstractUser implementing UserInterface. interface UserInterface ...
0
votes
1answer
78 views

Improve processing of data (and structure) from flat file to CMS Database

I have a flat file (CSV) that brings me the data I want, but it needs to be cleaned and processed before it can be used, so I built an intermediate Database (MySQL) in order to get the structure from ...
2
votes
0answers
61 views

Sharing constructor code between classes that do not inherit from each other

There is a PHP library of classes (generated from a WSDL) that cannot be changed. These look like the below for simplicity. class System extends \SoapClient { public function __construct(array ...
2
votes
0answers
31 views

Directory access from PHP script

Introduction I'm creating an Android app for webpage that runs on Joomla 1.5. Yes I know that it's an old version etc. but it's not my site and I can't do anything about it. So basically I'm creating ...
2
votes
0answers
100 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 ...
1
vote
0answers
12 views

Recommend an approach to decouple Product and Access code constructs, in order to simplify Product testing

I have some code that tightly couples Product specific code and Product-Access code. I am not sure how to untangle it. So for example, for testing Product, I have to mock up Access objects. And ...
1
vote
0answers
52 views

Incorporating custom Algorithm in SOLR-LUCENE , before Indexing?

CURRENT FLOW: I am using a custom algorithm(presently in php) to rank the MYSQL records before INDEXING it to SOLR . WHAT I WANT : Is it possible implementing this ALGORITHM(may be in JAVA) inside ...
1
vote
0answers
53 views

PHPExcel Application With Cases

I've been working on an application for my company's intraweb which will automate production scheduling based on information from our legacy mainframe databases in addition to side tables with ...
1
vote
0answers
80 views

Single complex or multiple simple autoload functions

Using the spl_autoload_register(), should I use a single autoload function that contains all the logic to determine where the include files are or should I break each include grouping into it's own ...
1
vote
0answers
119 views

Menu building pattern

I'm having troubles getting my head around the active-state handling of a menu when the menu isn't used for routing. I come from Drupal where the menu system handles the routing as well. so setting ...
1
vote
0answers
371 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
138 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
184 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
116 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
176 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
523 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
341 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
900 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
23 views

Managing customer-specific modules in a composer/PHP-based SaaS

I'm developing a business-to-business SaaS. I expect that most of my customers will be able to use my mainline product, and I intend to deploy it in an independent instance for each customer. Some ...
0
votes
0answers
41 views

Rewrite Engine vs Boostrap type index file

I currently use apache mod rewrite on a site to redirect various queries / visitors such as this: if you come to example.com/authors/, you are redirected to authors.php if you come to ...
0
votes
0answers
45 views

Automatically verifying INSERTs when building a PHP(5.3.3) application

I am building a form in PHP. I would like to automatically verify that INSERT queries are successful, and populate data correctly, as opposed to running queries in Workbench or MySQL with every code ...
0
votes
0answers
113 views

How many functions called by other functions are too many?

I posted a question about a week ago about using PHPExcel with multiple cases of use and how to simplify it. Since then my process has simplified as we've agreed to work with a single lay out with ...
0
votes
0answers
150 views

Tournament bracket customized algorithm

I'm in the making of a tournament for archery but i'm stuck because they want a specific match-matching for players. There is the usual 1-32,2-31,3-30 etc but the way they want the tree is a specific ...
0
votes
0answers
84 views

The finer points of HMVC

I'm new to HMVC and whilst tutorials are great about dealing with the overall details of keeping modules separate and only letting controllers communicate, they aren't so great at explaining the ...
0
votes
0answers
43 views

Scale parts of image to fill bezier path with no wastage

I want to be able to take an image and stretch/contract each pixel row (or 5 rows for performance) to fit within a curved shape. I've been searching for this for the last few days and have turned up ...
0
votes
0answers
55 views

Pitfalls of combining dependant traits and exceptions in same file as interface in php

What are the potential pitfalls of combining related class like objects (interfaces, traits, custom exceptions) in the same source file? For code reuse and only loading what I need I always separate ...
0
votes
0answers
137 views

Best practice: dynamically handle variable data, multiple file uploads and encoding with jQuery, AJAX, PHP and MySQL

I'm currently writing an e-learing web-application. I'm sorry if this is information overkill but I think it's better to describe it in detail so you get the idea. I have made thought on every point ...
0
votes
0answers
85 views

Approach for packing 2D shapes while minimizing total enclosing area

Not sure on my tags for this question, but in short .... I need to solve a problem of packing industrial parts into crates while minimizing total containing area. These parts are motors, or pumps, ...
0
votes
0answers
31 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
101 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
47 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
35 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
93 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
39 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
35 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
29 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
228 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
167 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
72 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
119 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
53 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
191 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
279 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? ...
0
votes
0answers
139 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
567 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
157 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
133 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 ...