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
27 views

Implementing SEO for a Zend Framework/PHP/Angular.js application

A team has implemented a web application using MySql, PHP with the Zend framework and Angular.js on the client side. I am in charge of implementing the SEO for this application. I understand I have ...
1
vote
1answer
32 views

How to use DataMapper pattern methods, when loading data from database?

How do I use DataMapper Pattern? I can use it as a glorified Database Access Object, aka TableGateway (loading a single class from a single database table), or I can use it more to drive business ...
0
votes
0answers
50 views

PHP filesystem best practice

I'm writing a PHP script which communicates with another program via files. I wonder if there is some policy or standard on where to put such files? I assume choosing a path like C:\foo\bar\ isn't the ...
1
vote
2answers
55 views

Where should PDOExceptions be dealt with?

I wrote a database wrapper class to help with queries and I'm trying to figure the best way to implement try-catch blocks. In my database class, I have a helper function; public function ...
-5
votes
0answers
37 views

Which software could you recomend for do a Artificial Inteligence [on hold]

I'm new in this page. wel.. I want to program a Artificial Inteligence, but I dont know what software use and what do I have to learn for do it. Can u help me? I was programing on java, php, sql and ...
-6
votes
0answers
33 views

Make a gui for the windows command line function junction point [on hold]

I want to make a GUI for command line function junction point basically for this command mklink /j D:\Docs E:\Users\Kari\Documents SO instead of going to command line and typing the DIR's the ...
3
votes
1answer
41 views

Can I resolve an issue with SRP, SOC that prevents object initialization via constructor?

In OOP, I can populate (initialize) an object using constructor injection at object creation time, or setter injection, after creation time. I like the idea of populating object at creation time via ...
2
votes
1answer
51 views

Why is SRP using the class construct to contain a responsibility opposed to using any other OOP entity?

SRP states ... There should never be more than one reason for a class to change. But why a class? Why not use granularity of a function/method? What instead of separating my functionality into ...
0
votes
0answers
27 views

Is it safe to only use intval to sanitize user input for a database select?

Is it safe to only use intval to sanitize the user input for a database select, as in the following example? $id = intval($_GET['id']); $query = "SELECT * FROM table WHERE id='$id'";
-1
votes
0answers
68 views

When should mixed PHP/JS snippets be refactored into a separate JS file? [duplicate]

This code snippet is from a teammate of mine, his title is "Full Stack Developer". He mostly write PHP code. I found this code at the end of a .php file and asked him to move it to a separate JS file ...
8
votes
2answers
350 views

Is automatically generating passwords during registration a good idea?

I'm developing a registration system for a project I'm working on. Since users tend not to sign up if the process is too long, I've thought to require (at least initially) just their email, where I ...
-7
votes
3answers
123 views

Why different languages have different syntax? [duplicate]

Different programming language always/most of the time use different syntax. For example take PHP, Java and Python. In Php & Java semicolons are compulsory at the end of the line, yet Python ...
2
votes
2answers
111 views

Does it break SRP to have concerns of data handling and object mapping inside a single class, as part of the DataMapper pattern?

Summary I want to look into separating the concern of "creating a populated object from database", to use inside my application. DataMapper pattern seems to be doing just that for me. DataMapper ...
-4
votes
0answers
29 views

Codeignitor Site and subfolder another site [on hold]

I have a site in codeignitor www.abc.com I have created one folder on root name ADMIN and create a structured admin panel over there now i want that when the user access www.abc.com/admin it will open ...
4
votes
3answers
212 views

What's special about “non-blocking” node.js?

In the short chapter, What is Node by McLaughlin, he writes: "Node has no blocks, no threads competing for the same resource (Node is happy to just let things happen however they happen), ...
-5
votes
0answers
31 views

php vs c# application [closed]

We are writing a point of sale application for a restaurant. We are debating whether to use a locally hosted PHP solution vs something in C# .NET etc. Our preference is PHP as we have more expertise ...
0
votes
0answers
2 views

What is the fool-proof way of setting up spreadsheet_excel_writer on Windows Server 2012 R2 [migrated]

I have an financial projection and budgeting application that produces spreadsheet outputs. This is working fine on Linux OS, with PHP 5.5.12 and also Spreadsheet_Excel_Writer 0.9.3 and OLE 1.0.0RC2. ...
0
votes
0answers
34 views

What are PHP Worker (with functional example)

I was handed a PHP Project to maintain and after going through the code, I think some tasks can be off-loaded to increase efficiency and create some compartmentalization. Our app runs on Heroku and I ...
0
votes
0answers
25 views

BCMath vs MySQL: performance

Scenario I am working on a web application that handles financial transactions, and my code will need to be reusable for everything from consumer carts to manufacturer/distributor shipments. The ...
-4
votes
0answers
16 views

problem on working with ksweb server [closed]

I want to run a php file in android mobile using browser. can I able to done it in ksweb and how it possible? is it is same as working with xampp server in windows. then where I have to save my file ...
3
votes
1answer
93 views

PHP Refactoring advice

I'm working on a Soccer management game. Project is fairly new and small and I'm new to PHP. The project was starting to get a bit messy so I've been looking into refactoring. The first thing I've ...
-5
votes
1answer
80 views

How can I check if Google username and password are actual?

I have a PHP page that takes a Google username and a password. How can I check if the credentials belong to an actual Google account. Does Google provide any APIs through which I can authenticate the ...
0
votes
0answers
60 views

php - design: database operations

I am working on a control-panel for a VoIP program and I've been working on it for a while. It started off as a small project that I just did because it was fun, but over time I added more and more ...
0
votes
1answer
126 views

What can I use to distinguish a user chosen name from other identical names [closed]

I am writing a dating/social website using php and mysql. We want the users to select a name for themselves, but we don't want to make it unique. It is not going to be used for searching. It is ...
5
votes
1answer
87 views

PHP: Injecting the same database connection into multiple objects

Suppose that there are two classes that define objects of vastly different function such that in the datastore, the information they require is divided into two separate databases. For example, the ...
0
votes
1answer
68 views

Should migrations modify data?

Imagine you have a table that has 5 columns, and you need to split this into two tables, because in your iterative process, your application has increased in complexity. Should migrations change the ...
1
vote
2answers
127 views

Making a safe PHP login system [duplicate]

I am making a php website that requires user login. It has a remember me function. I would like to ask if the following approach is safe ? User logs in with correct username and pass (and remember ...
1
vote
1answer
100 views

The correct way to use Sessions (PHP)?

I am making a website that requires logins, and would like to know what a good approach is. Right now, I am thinking of the following: User sends username and password to server, where it is ...
-1
votes
1answer
88 views

What might be a good way to get hands on experience with Object Oriented PHP [closed]

I am a Computer Science student. I took a course on OOP, and I understand the concepts (classes, extending, encapsulation, etc). I'm also a web developer, have been doing it for about three years; ...
2
votes
4answers
283 views

Should I check parameter before using it in methods? [duplicate]

I'm going to build some public PHP packages, Following standards is a priority for me. PHP lets users call methods even if they don't pass required parameters to it. My question. Should I check ...
0
votes
0answers
3 views

How to deal with extra “/” in phpleague route [migrated]

I am setting endpoints for my web application like this: $router = new League\Route\RouteCollection; $router->addRoute('GET', '/user', function (Request $request, Response $response) { // ...
-3
votes
3answers
164 views

Why should PHP developer use/learn VI editor? [closed]

Why should PHP developer use/learn VI editor ? I mean there are 10 most amazing editors like PHPStorm, Netbeans which increases developers productivity. Lets just consider PHPStorm. I never got ...
0
votes
0answers
29 views

Is it safe to directly access superglobals with isset()?

I understand that one should always try to avoid direct access to superglobals to put values from superglobals into variables, eg.: $name = filter_input(INPUT_POST, 'name'); //instead of $name = ...
6
votes
2answers
313 views

How does the Hip hop virtual machine (HHVM) theoretically improve PHP runtime performance?

From a high level, how does Facebook, et. al use to improve PHP performance with the Hip Hop Virtual Machine? How does it differ from executing code using the traditional zend engine? Is it because ...
2
votes
1answer
69 views

How to write proper documentation for references in a docblock? [closed]

I am adding documentation to PHP code using the phpDocs tool: /** * This is a summary * * This is a description * * @use This function is called here and here */ function doSomething(){ } I am ...
0
votes
0answers
27 views

Uploading Named Binary Tag files(NBT) via PHP - a bit scared security wise

I'll cut right to the chase. I'm building an application that deals with NBT files(named binary tag). They are being uploaded via the usual PHP methods. I haven't dealt much with uploading files in ...
-3
votes
0answers
41 views

For Review: My UML Structure for a PHP PDF Invoice Module

I like to develope a simple PDF Invoice Module on PHP5. It s important for me to provide a good design and code structure. For that, I made the following UML: http://postimg.org/image/yzxandd0p/ The ...
1
vote
3answers
96 views

Is an application supposed to recover from a exception thrown in PHP?

What if the programmer uses Exceptions for debugging? Would it be better in that case to just report the failure and immediately interrupt the script since ideally all bugs should be fixed radically? ...
0
votes
1answer
40 views

Count amount of points for XY options (in poll) where options dont have equal amount of points

I have a code where I want to avoid using a for/each loop to count the amount of points options in poll have together. Reason is, every option has different ammount of points and I want to get number ...
0
votes
0answers
25 views

Tomcat & Apache(PHP) HTTPD - integration limitations

I started developing an application using PHP/HTML/CSS/JQuery/SQL and after a few months of development I discovered that some automation would be required. The level of automation that is required ...
1
vote
1answer
97 views

Multiple MySQL update calls per second, can some of them be “missed”?

I have simple question, I think its not that big of a deal, but I'd still like to ask it as its boggling my mind for past 2 days a lot. What if I have a poll where instead of inserting answers to ...
1
vote
1answer
64 views

Symfony 2 Multi tenancy architecture, data loaded form front controller/kernel based on subdomain

Hello fellow programmers, (a bit of background)I'm building a Symfony 2 application for university Student accommodation, when our clients from the university side register with their details a ...
-1
votes
1answer
127 views

Separating front end and back end using private api php

I am using php only for basic CRUD operations with MySQL. I want to create private API in php. From what I came to know , these are the steps for a developer local server to get data from remote ...
1
vote
3answers
164 views

Auto-save user input - the smartest way?

I'm developing a social network website and I'm working with php/mysql/jquery and I want users to have the most user-friendly website experience. That's why I try to avoid a save (submit) button at ...
0
votes
2answers
80 views

What is the value of encoders with decoders currently present

Can you tell me the value of using PHP encoder (ioncube, phpshield) with currently present service like decry.pt (http://www.decry.pt/) that can easily decode source codes. I have tried decry.pt's ...
2
votes
2answers
235 views

Lesser of two evils regarding return types

I'm implementing a system in PHP where values are represented with objects that implement an Amount interface. I'm building two different implementations of this interface, one using a simple integer ...
1
vote
2answers
137 views

PHP MVC how to access current user?

What is the best way to tell if a user is already logged in when accessing the page? I have seen many people talk about a Recognition service that will validate a user trying to login, but what about ...
0
votes
1answer
56 views

PHP Multi-Page / Session Question

I created index.php that basically looks up all the individual php files (articles) in a few subfolders and prints them out. Since the quantity of articles is over 30 and growing, I implemented a ...
13
votes
2answers
1k views

Is an NPath complexity of over sixteen octillion realistic? Or have I broken the tool?

I have just measured a large chunk of PHP code (1153 lines) using PHPMD (http://phpmd.org/) and it tells me the code has an NPath complexity of 16244818757303403077832757824. That looks like a ...
1
vote
1answer
83 views

Generic PHP web interface for handling concurrent updates optimistically

I'm looking in to writing a new PHP based CMS which handles concurrent edits optimistically like source version control rather than pessimistic locking like Wordpress. I want to be able to write some ...