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

learn more… | top users | synonyms

-4
votes
0answers
59 views

What do you think about a CMS similar to WordPress but implemented in Java? [on hold]

I am a Java developer and I am also interestest in WordPress CMS (it is a very popular PHP product, I think that all know it) website development. In this time I am working in Java on LifeRay webapp. ...
-2
votes
0answers
22 views

php script to scrape emails for appointments and generate a .ics file to be emailed to relevant User for easy scheduling [on hold]

First sorry if this isn't quite the right group first time posting in ages (just let me know where would be better to post and will follow through) I work in a business where we have a hosted CRM ...
0
votes
0answers
10 views

PHP Netbeans coding style configuration, where is it? [migrated]

I want to standardize coding style accross all the developers computers in my office, I want to export my netbeans configuration and ask the other programmers to import it on their IDEs, do you know ...
-1
votes
1answer
120 views

How to pay the users of my website according to the number of clicks they get on the ads placed on their page [on hold]

I want to make a website where A user can login and put content on the website and a google or Chitika add will be placed automatically on their content. According to the popularity of the content, ...
-1
votes
0answers
10 views

Unable to retrieve result data [migrated]

I'm trying to retrieve a set of rows through a query. I am able to retrieve the number of rows using $query->num_rows(). However when I am trying to retrieve $query->result(), I am unable to ...
0
votes
0answers
7 views

Edit files on multiple domains on Mambo CMS

I have multiple domains on same web server, all running on Mambo CMS. Each site uses same template and has roughly same site structure. I need to edit the same page on each website - is there a ...
0
votes
1answer
70 views

using node.js server with mysql-module and PHP for a penny-auction website?

I'm building a penny-auction platform like DealDash and just read into the WebSocket and node.js topic. I used PHP, MySQL and Ajax to build the website. I'm nearly finished and just have to implement ...
0
votes
1answer
65 views

DI container with multiple instances of same object

I'm looking for idea to make a DI container that can store multiple instances of the same object. Usually, a DI container should store either a single instance of the object, or create new object each ...
-1
votes
0answers
64 views

I'd like to start *reusing* PHP. Where to start? [on hold]

I used php for years (PHP5) and after a long stop (where I developed with other languages/technologies) I would like to use PHP again. I simply started reading on php.net about the biggest changes on ...
-1
votes
0answers
101 views

Is it better (performance-wise) to save data as physical files on the server or into a MySQL database? [on hold]

I'm working on a large project with minimal resources for a client. I was wondering what would be a better approach to increase the performance of the site, would it be better to save the user ...
0
votes
1answer
79 views

Upgrade object in PHP

I cannot find information on this anywhere so I assume it doesn't exist. It makes much sense for me for such functionality to exist and I want to ask whether it actually does and I am wrong in my ...
0
votes
0answers
47 views

using native php for templates [closed]

I have come across a situation where I'm doubting if I continue using a template engine like Smarty or just plain PHP. I have the problem that when I started coding... I learned with a framework and ...
-6
votes
0answers
34 views

When will PHP allow key: syntax for array keys? [closed]

Currently you have to specify the keys and values of an array like array('method'=>'get') You can now use brackets ['method'=>'get'] When will PHP adopt the syntax Ruby uses for hashes, ...
-3
votes
1answer
61 views

What would you look for in a junior PHP developer [closed]

Apart from reading the job spec I am wondering if there is something else employers look for in a Junior PHP developer? How many example projects? What spread of frameworks? Specialise in one, or ...
0
votes
1answer
83 views

DRY principles vs local-only variable scope in functions (PHP motivated question)

I'm new to programming and in particular new to PHP. I often find that DRY is directly opposed to the principle of keeping variables local in PHP functions. Sometimes I think that it's easier to ...
-1
votes
0answers
20 views

How to distinct vector classes and native classes in PHP autoload? [migrated]

How to distinct vector classes and native project classes in PHP autoload? see a part of the file and namespace structure: app/ app/Models/ app/Models/User.php app/Contoller/ app/Contoller/Login.php ...
0
votes
1answer
49 views

Updating hosted website [closed]

I made a simple website Just for learning purposes. I hosted it for free for me i update it by just going in codes and change something but want to if my website was to be updated by those who don't ...
0
votes
1answer
122 views

Best OOP practice for object vs dataservice [duplicate]

I am working on a new project and am curious as to how I should go about doing something properly. Lets say I have a table called "leads" in my database. This clearly means that a single "lead" would ...
1
vote
1answer
202 views

How to avoid big class complexity while keeping encapsulation?

I'm developing a PHP library to work with big numbers (at this moment only with a "Decimal" class, but I want to add new classes, to handle Integers, Rationals, and Complex numbers). In any case, the ...
-1
votes
3answers
54 views

What is an initial skeleton of the website called? A Framework? [closed]

I am building a website but I am wondering can I call the initial set of pages a framework? Say I have a project to build a website for a school. Before I start implementing the requirements I have ...
6
votes
2answers
224 views

Should HTTP Request/Response objects be immutable?

I think it's safe to say that most web applications are based on the request/response paradigm. PHP has never had a formal abstraction of these objects. One group is trying to change this: ...
4
votes
3answers
80 views

What is Black Box Testing? Are Functional and Usability Testing its types?

I am writing about testing and I am confused about the following: What exactly is Black-Box testing? Are functional testing and Usability testing two different types of testing and are they types of ...
0
votes
1answer
42 views

PHP Composer vendors licensing

I'm using a composer as a dependency manager for my PHP project. Composer operates as a library, which uses packagist as a software repository to fetch third-party dependencies. I'm interested, ...
1
vote
3answers
192 views

PHP: is read file at every page load too heavy?

In F3 Framework Controller I wrote a function checking whether MySql data are saved in a file, otherwise loading a form to ask users for that data (similar to Wordpress Installation). This function ...
-2
votes
0answers
10 views

Process two forms in 1 PHP file [migrated]

So, I got this piece of code, I'm trying to test it out, my issue is this, I've got 1 single PHP file, which contains 2 variables... what I want to achieve is this, first get the first name from the ...
0
votes
3answers
119 views

Selecting between multiple actions in PHP

I have been programming for a number of years now and in PHP for about 4 of those years. I have always wondered what is the best approach when it comes your program deciding what action to take based ...
2
votes
1answer
184 views

Hidden dependencies - why not?

Hidden dependencies: function __construct($dep_registry){ $this->db = $dep_registry->get('db'); $this->request = $dep_registry->get('request'); ... } Not so hidden: function ...
1
vote
1answer
110 views

Using exceptions as regular objects [duplicate]

I have views that handle different errors in my application. For example error 404, 403 and such, giving my errors a more user-friendly presentation. By assumption, they get passed in an exception, so ...
0
votes
1answer
54 views

Test logic with external data [duplicate]

I have a site programmed in PHP where I make more call to external server that return me big xml of data. For each record of the xml I have to make other external call to get other data. So my ...
0
votes
1answer
83 views

Multiple method calls in the constructor and dependency injection

I was asked to refactor some almost ureadable spaghetti code into object-oriented architecture. I have some doubts regarding a class that I designed. Here is the class' skeleton: require_once ...
0
votes
1answer
67 views

Cleanly using PHP Iterator class in Loops - calling first element

I have implemented the Iterator class in PHP and built the follow mandatory methods as follows class I implements Iterator { private $a = []; function __construct(array $a) { ...
0
votes
0answers
25 views

Will turning error reporting and error display on and off throughout the stack cause a problem with PHP

I want to turn error reporting and error display on and off for different parts of the same framework (same stack and scope). ini_set('display_errors', 'On'); Changing to 'Off'. ...
2
votes
2answers
141 views

How to store data in memory(RAM) using php without using Memcache/Redis or any other software? [closed]

I want to implement a cache system in PHP consisting of following features 1) It should be able to store any(large or small) amount of data as long as the memory serves.(key value pair i.e. get & ...
1
vote
5answers
347 views

Are there too many parameters in this constructor? [duplicate]

Check this out: public function __construct( \Magento\Framework\Model\Context $context, \Magento\Framework\View\DesignInterface $design, \Magento\Framework\Registry $registry, ...
4
votes
3answers
164 views

Better way of manipulating large objects

I am doing a lot of work with SOAP Api in PHP and the objects that are returned are quite big. I am then updating the objects from local db changes and pushing them back. So more often than not I ...
1
vote
0answers
50 views

How to off load DB & API calls (PHP Heroku App) [closed]

I took over support for a PHP app that runs on Heroku. After analyzing the performance with New Relic, I'm noticing that the three bottles necks are the database and API calls to outside services. ...
1
vote
1answer
262 views

Is this a race condition?

I have a friend arguing this is a race condition, but I'm struggling to understand how. This is for a web application using PHP and MySQL where users can login and create tickets, these tickets have ...
1
vote
1answer
77 views

PHP OOP: value property is guaranteed different?

Imagine this code: class Test { public $result; public function makeSum($a,$b) { $sum = $a+$b; $this->result = $sum; } } In a webserver. At same exact moment, ...
0
votes
1answer
104 views

Does the phrase “range for R1-1 through R10H” actually have an agreed-upon meaning?

I was recently sent a code test by a potential employer to complete on my own time. The first question has to do with identifying whether a given zoning code falls within a range of codes. I'm not ...
1
vote
2answers
109 views

Can i write html on one line only in my php code?

i need to embed a html 301 redirect in my php code and i wanted to save chars in my html. Can i write HTML on one line since it is parsed? Is there anything against this practice? ?> <!DOCTYPE ...
0
votes
1answer
69 views

Are there any strong reasons to use DI for sub-classes that are known to be tightly coupled to their parent containers?

I have Product classes for Products A through Z. And each Product class has its own set of product-specific subclasses, which I'd say are tightly coupled to them, like so: //specific product class ...
0
votes
1answer
88 views

php Database operations in separate files?

I have a single page application. Select boxes need to be filled with select queries from the database. How do I structure the application? Currently I have a file add_details.php. It contains a ...
0
votes
2answers
105 views

Should I extend an interface or keep it independent?

I'm trying to decide whether to extend a base interface with additional methods or create several independent interfaces. I have a Task interface that looks like this interface Task { public ...
1
vote
1answer
61 views

Laravel using models

I started working with Laravel about a month ago and I started by reading the documentation etc. Now I'm working on a project in Laravel 4.2 and I skipped some parts of the full documentation. In my ...
-1
votes
1answer
54 views

keeping of all javascript functions in one place [duplicate]

In php website I am using different javascript functions in different pages for example page a calls functions 1,2,3 and page b calls functions 2, 4, 6 and page c calls functions 3, 6 can I place ...
1
vote
1answer
98 views

Calculating winning probability for 2 teams using their history?

So I'm working on this project where I have a database full of team winning history. For example let's say these are all football teams. Every match has 2 participants (2 teams) and always a winner. ...
2
votes
1answer
252 views

Laravel 5 Multi-App

So my work has a dashboard built in codeigniter where every app on the dashboard has its own subfolder in controllers / models / views and nothing is shared. I have been tasked with upgrading this to ...
0
votes
1answer
100 views

2 Classes that share similar behaviours but unrelated.

I'm working on something at the moment and am a little confused. I'm working on an enquiry system in PHP (it's Opencart Based, so MVC). An enquiry comes in and depending on what form it was ...
1
vote
3answers
188 views

OOP implementation doubts with databases

I was starting a project today and after designing the database structure and how the data would be stored etc, I started the implementation. I am doing this on php, but the language isn't really ...
1
vote
2answers
77 views

How to organize code which converts from one type to another

If I have a DateRange class, and I want to translate a DateRange into SQL (e.g. some_col >= '2015-3-5' AND some_col <= '2015-3-5'), where should I put the method that does the translating? ...