Questions tagged [php]

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

115 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
1answer
372 views

Accessing i18n objects from different scopes

I have been building a personal framework of mine which started off as a way to learn the MVC pattern and has progressed now into something that I like more than most frameworks out there (which is ...
4
votes
0answers
102 views

Intuitive dependency management with code includes?

I am building a PHP CMS system that parses template files and replaces tags with content. Sometimes this content is a HTML, CSS or JS snippet, but it can also be a code include. Most code includes ...
4
votes
0answers
552 views

Symfony2 - Best aproach for a plugin system

Symfony2 is handling all its things in bundles in /app or in /vendor. This is fine if you are handling and managing all by yourself or Ops that handle all needed things. But I haven't found a good ...
4
votes
0answers
202 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 ...
4
votes
1answer
961 views

How should I store usernames and passwords for user login using php/cassandra?

I am new to NOSQL and Cassandra. I am not sure if I should store usernames and password in Cassandra. If I should, what is the best way to do that? I am getting lots of conflicting ideas from research....
3
votes
0answers
50 views

How to let users specify their own logical conditions (PHP / Laravel)

I am currently trying to create a web application, that saves inbound emails. I have figured out how to save the incoming emails into my database, and I have all the email information available (...
3
votes
0answers
54 views

Restructuring PHP application classes

I'm trying to modernize a very old PHP application for a customer to keep its code base up with modern coding standards. I am permitted to restructure things a bit, but dumping the entire app and ...
3
votes
0answers
75 views

Performance: Creating duplicate file

I have a Web server (Local) and File server(Remote). I need to create a duplicate of an xml file in the same location with different file name in the File server. The size of the file is random, but ...
3
votes
0answers
972 views

How to store unique sessions for logged in user(s) with different devices?

I want to do something like Facebook does. We can see any time where we're logged in. e.g.: Windows PC · New Delhi, India Edge · Active now Windows PC · New Delhi, India Chrome · 8 minutes ago ...
3
votes
0answers
73 views

API Cilent - global request method or one method per request?

I am designing a 3rd-party library for developers to retrieve data from various endpoints of another system which itself has multiple APIs. Each of those APIs may contain the same type of request but ...
3
votes
0answers
314 views

Dependency injection - Nested objects

# Introduction I am working on a CMS application in PHP with about 200 classes. The CMS, in general, does the same thing every CMS does: generate sites. I am learning a lot about OOP and design ...
3
votes
0answers
105 views

In browser form validation in laravel

In laravel 5 I describe models without specifying fields in model class. Some magic identifies which fields exist in database for this model. use Illuminate\Database\Eloquent\Model; class MyModel ...
3
votes
0answers
1k views

Dependency Injection and class Inheritance

The project I am working on for about a year now was used to create a new mysqli connection to the database each time there was a Query to the database. In order to quickfix this problem at places ...
3
votes
0answers
1k views

How to passing variables from php to react.js component?

For example, I have a react.js component named Question which need the props title,id,content. <div id="main-section"> <div id="question"></div> </div> ReactDOM.render( ...
3
votes
0answers
203 views

Is Nested Structure with Spread Responsibilities Not Logical?

Given the following code snippet in a Laravel Controller: $this->userRepository->saveByProject( $this->fileRepository->saveByProject( $this->metricRepository->...
3
votes
0answers
161 views

Are there downsides to writing PDO/mysqli statements into my code directly vs using my own redirect wrapper methods?

TL;DR: To access DB functionality in my codebase I currently use a custom layer throughout the code. The layer needs an upgrade in order to begin accepting prepared statements, which it currently ...
3
votes
0answers
81 views

How to architect rule matching with multiple conditionals and outcomes

I'm working on allowing my users to create their own ruleset for data that's coming in. All of the data below is sample mock data and not in relation to our product. Example of a rule (there can be ...
3
votes
0answers
485 views

PHP Vertical Columns from 3 SQL Tables

I work at a high needs school in which there are several classes that plan their work through Excel spread sheets grading and tracking student progress. We have come to the conclusion that this ...
3
votes
0answers
2k views

Prevent Timeout for large scripts without changing any System Settings

Current Option If I have a process that I know may take a while I have been chopping it up using ajax to do a part of the request then once the ajax is returned do the next part of the request. This ...
3
votes
0answers
245 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 ...
3
votes
0answers
3k 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 ...
3
votes
1answer
400 views

Procedural PHP Framework Concept

So I had this idea to map my framework's folder structure to namespaces with a dynamic build process. To give you an idea how this would work here an example structure: src/ FS/ File/ ...
2
votes
0answers
39 views

Web Service returning serialized helper objects

I had the idea to have a route in my REST API that returns serialized (PHP) helper objects. The client code then can use those objects to format some complex JSON structures for the next request. When ...
2
votes
0answers
66 views

Coupling form fields to functionality: using a Command Bus?

I built an app where the app owner can build custom forms for each of his clients. The forms have default fields like "name" and "message" as well as custom fields for each client requirement, like "...
2
votes
0answers
153 views

Should I use value objects creating them via factory method and have only getters or just write DTO's with constructor and getters/setters?

I've been using the APIs of a ticketing service which returns arrays of data more or less complex based on the entrypoint called. In order to simplify my life when consuming such API I wrote some ...
2
votes
0answers
316 views

PHP OOP best practice to split low level class into two

What i got now is low level object that has bunch of methods and its difficult to navigate trough i want to break it down, however functions logically have same functionality just different ...
2
votes
0answers
610 views

PHP MySql - Statistical Reporting - Best Approach to query appointment system time utilization

I have built an appointments system for various medical practices. Practice schedule appointments - I am looking to provide analysis on the amount of time that has been utilised by the practice. I ...
2
votes
0answers
444 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 ...
2
votes
0answers
207 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 ...
1
vote
1answer
122 views

RabbitMQ Consumer Architecture

I have been investigating using RabbitMQ for a publish/subscribe pattern across micro-services where aysnc calls are appropriate but I am having trouble understanding some concepts and could not find ...
1
vote
1answer
63 views

Using the objects retrieved at the time of request validation

I hope the question title already answers the subject here. Lets say I have a number of ids that needs to be validated in a request. Example: request uri: [POST] /album/{album_id}/song Request ...
1
vote
0answers
476 views

Handling complex dynamic queries in Laravel 5

I am developing a project using Laravel. My workflow is: route directs to controller Controller calls eloquent models Eloquent models perform queries (tipically CRUD and find) Controller returns ...
1
vote
0answers
130 views

What Design Pattern to use to render PDF pages for a PDF Proposal?

I want to create a set of patterns to use for rendering a PDF Proposal (a set of PDF pages). I have made a good start, but not clear on how to proceed when more complexity is involved. I am using ...
1
vote
1answer
88 views

Static data reuse

I'm going to describe the situation first and ask questions in the end. I need to validate a scalar value using the Symfony Validator component. The value is an associative array. Now I have defined ...
1
vote
0answers
44 views

PHP MVC - Single action for multiple similar views or one action for each?

For example, if I have 3 database tables that have similar columns/attributes: cats, dogs, bunnies Each table has a view that consists of an html table listing all records in the table, and a form ...
1
vote
0answers
102 views

Storing laravel API tokens from one API in another APIs env file

Last year my company started using Laravel to build APIs, and we created two separate repositories - one for a primary API and then a second for a secure API that would only accept requests from the ...
1
vote
0answers
221 views

Storing temporary data received through an API call

I am working on a web app which uses Google oAuth flow and Drive API to list user's Google Drive files. With the access_type set to online, my app doesn't receive a refresh token. My question is, ...
1
vote
0answers
237 views

Best practice to maintain 2 servers - PHP and NodeJs

We have a Symfony backend server for our Android and iOS application. Recently we need to extend our application by supporting real time interaction such as chatting, and we decided to use NodeJs with ...
1
vote
0answers
63 views

Efficient structure for storing/handling lots of datasets

I am looking to develop a piece of software which will probably store hundred of thousands or even millions of datasets with 3 to 5 datasets to look up per ID. Is there any way to build something ...
1
vote
0answers
66 views

Project Structure for intermediate level abstraction

This is really a question on higher level naming. We have an API directory for classes that deal directly without outside APIs, and contain all the code to consume a specific API. We call this lib ...
1
vote
0answers
50 views

How to implement my own CMS hosted on a remote domain in all my projects?

So, I'm developing my own CMS which dynamically adjusts to the settings I have set on a specific domain. I just developed this whole CMS on my local machine and now facing the problem that I have ...
1
vote
0answers
25 views

How to handle the set of objects that represents a context?

How can I handle the situation when exists the context that represents a collection of arbitrary objects? This context can be created by code like this: $context = new Context(); $context->add(...
1
vote
0answers
3k views

Is this Codeigniter HMVC folder structure good practice?

The web App has four distinct user areas. The frontend for people off the street The user area for logged in users A teacher zone An Admin c-panel I am using CodeIgniter with the HMVC extension. ...
1
vote
0answers
94 views

How does the FOSS exception for MySQL connectors apply to code written in PHP or Python?

I have looked all over and can't find clear answers to the following: If I write code in PHP or Python that uses GPL MySQL connectors for PHP or Python - which license applies to my code? That of PHP ...
1
vote
0answers
78 views

Website that only loads content on modal windows (ajax)

I'm working with a client that only loves Wordpress, so I have to create a theme. The idea of my client is to have an interactive background (meaning there's no other content but the background, the ...
1
vote
0answers
304 views

What would you call this design pattern? MVC or PAC

I have been reading and researching about MVC, HMVC, MVP, MVVM and PAC design patterns when I came accross this article by larry garfield > MVC vs. PAC My Implementation: Think of a modular app ...
1
vote
0answers
97 views

Dynamic Printing Options

I believe this is the correct community to post this question in, if not please point me to the correct one. Overview: Current web app gives users the ability to print labels from specific printers. ...
1
vote
0answers
60 views

Where does export file code belong in an MVC implementation that is designed mainly for HTML

I have an MVC website set up with a base view (Layout.php) containing HTML header and footer code. Other views (such as CarView.php) will extend this class. One of the methods in this class is CarView-...
1
vote
0answers
118 views

Sending large amount of messages async

The scenario is this: I have web based service that does regular request processing and it's doing persistence into db etc.. Fast response to the client is crucial. So now the average request is about ...
1
vote
0answers
934 views

How to persist a session cookie in a PSR7 request/response middleware?

I am building a package that implements native-like sessions in a PSR7 middleware architecture. I created a middleware which is responsible to create and persist a session cookie. The session is also ...