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

learn more… | top users | synonyms

-1
votes
0answers
8 views

PHP Build System issue on sublime text3

I am creating PHP Build system on sublime text 3 with help of This blog post I have installed XAMPP on /opt/lampp/ on Ubuntu 14.04 and created php.sublime-build { "cmd": ["php", "-l", ...
-4
votes
0answers
14 views

MySQL table bolding

here it is my code to print my four headers with rows of MySQL table: while($row = mysql_fetch_row($result)) { echo "<tr class='tr4'>"; // $row is array... foreach( .. ) puts every ...
0
votes
1answer
62 views

How to choose between different ways to write some code?

I would like to validate point in a two-dimensional rectangular Cartesian coordinate. I found following regular expression solution on stackoverflow ^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$ . Another ...
0
votes
0answers
13 views

Help Improve DB model/strategy, for use in refactoring SQL-ridden legacy code

I am looking for a good model to help me refactor out DB code in a large legacy php project. I thought at first to use TableModule, but seeing how my SQL is complex, I think DomainModel may be ...
-2
votes
0answers
30 views

Second AJAX call unloading result of the first [migrated]

<script> var result; function init(){ var name = window.name; name = name.split(","); getCompany(); setTimeout(200); ...
-1
votes
0answers
20 views

Style for multiline concatenation in PHP

Which style do you think is best (and why)? The single line: // single line $lok = sprintln("Everything changed when the fire nation attacked") . $cactusJuice . $numElements . $sharpnessLevel; ...
2
votes
0answers
40 views

String comparison equivalence between mysql database and php code

I wonder if it is possible to compare two strings using mysql and php and obtain the same results. In mysql I have a = b collate utf8_general_ci For PHP I found a promising way to do it with the ...
0
votes
0answers
30 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 ...
1
vote
1answer
43 views

Patterns for subclass constructors that vary the parent class constructor slightly

So, my problem is in the context of an MVC-style approach. The code here is PHP, but I'm hoping this is a design issue independent of it. abstract class Controller { private $domain; private ...
0
votes
0answers
18 views

Monolog - retrieve the logged messages in a variable [migrated]

I looked into to monolog, and there are dozens of handlers that allow logging almost everywhere. What I didn't see is logging to a variable. What I mean is that I want the log messages kept in a ...
-2
votes
0answers
21 views

How to use slack api for chat application using php? [closed]

How to use slack api for chat application using php? Any source code for to develope the chat application using slack api?
0
votes
1answer
55 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 ...
1
vote
1answer
262 views

Why is PHP so hated? [closed]

Lately I've been coming across several jokes and comics about how apparently awful PHP is. As a complete ignorant of the language, why is this? Is it my own perception or is this the overall general ...
1
vote
1answer
85 views

How to design large applications with little planning experience [closed]

I understand there is plenty of information on the internet about planning and implementing said solid plan in building a large software application, but I was hoping to get something a little more ...
0
votes
1answer
48 views

Notify about starting event

I am having quite a hard time figuring out how to solve this problem. Basically I have a mini social network with notifications and events. I want to add such functionality where 1 day before an event ...
0
votes
1answer
188 views

When to use AJAX [closed]

So I am having this internal debate about choosing commonly accessible technology to develop web sites.. There seems to be increasing desire from clients to perform data transfers without the ...
-3
votes
0answers
46 views

Why does flight php break when i rename its directory [closed]

For some reason when i try to change the directory name of flight to something else the library breaks, i believe I've narrowed it down to the class autoloader but i still don't know why this happens. ...
4
votes
0answers
156 views
+50

How to move php documentation closer to standards?

I have an large php project. I used to document it with NaturalDocs, but I didn't include the documentation generation in the build process for a long time ( years ). I recently started using ...
1
vote
1answer
145 views

Should we use data object (or the data transfer object) for sharing data between these three classes?

I found an article by Martin Fowler that has made me doubt my design choices, particularly about data objects. Martin Fowler has written an article about what he thinks is a code smell. In this ...
0
votes
1answer
92 views

How can I avoid the “global $dbh” anti-pattern?

This is what most of my database-related library code looks like: lib.php <?php $dbh = new PDO(...); function doSomeDatabaseThing() { global $dbh; return $dbh->doStuff(); } function ...
0
votes
0answers
44 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 ...
-4
votes
0answers
18 views

error in defining a subview in codeigniter [migrated]

this is my controller public function index() { $this->data['users'] = $this->user_login_model->get(); $this->data['abc'] = 'admin/user/index'; $this->load->view ( ...
0
votes
3answers
237 views

Using PHP or C++ for in real world electronic devices

I want to use my programing skills to make my day-to-day life easier, to do this I want to be able to program in my appliances like alarm clock or microwave or refrigerator, air conditioner etc, wish ...
-1
votes
0answers
32 views

Problem with node.js and server.js [migrated]

I'm a bit stuck right now, and hoping someone can shed some light. I'm relatively new to sockets in general, but have been programming in javascript on and off for several years, although only about ...
0
votes
2answers
68 views

Parameters Stored as Sessions - Pros / Cons?

Some background on my system: I have 1 query with multiple pages. There are filtering parameters on the left of the page which $_POSTs on submission. The posted parameters will change the query at ...
1
vote
2answers
118 views

Good way to count unique anonymous visitors of articles

I'm building a website with articles, and I'd like to count unique-per-day visits for each article. The idea to use cookies suggests itself, but I simply can't set a cookie for each and every article ...
1
vote
1answer
55 views

Would this be considered a plugin or template type architecture?

I would like to build a system that basically offers the option to make various APIs interchangeable for usage to the end user. For example, the person using the software would have the option of ...
1
vote
2answers
51 views

Why is entangling injectable with class that uses it a bad practice?

I have had this argument for a while, because I have noticed some people prefer "readable" code over properly structured one. So in the example I am showing, basically I have this Mapper class in ...
1
vote
0answers
46 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 ...
-3
votes
1answer
41 views

Understand the date structure - how the date is structured [closed]

I am just not getting the structure below Can anyone pls explain below date structure? 2014-11-01T02:35Z What does the T and Z means here?
-1
votes
1answer
82 views

Looking for encryption method [closed]

I have a blackbox system whose code is hidden from the end user. That's the intent anyway, I know some may break into it, but generally it's closed. It's running on PHP, and I need to export a ...
0
votes
1answer
70 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 ...
-1
votes
0answers
59 views

Efficient way to get comments of newspapers [duplicate]

I'm trying to get comments of large newspapers for a personal project. (Top newspapars in this list: http://www.onlinenewspapers.com/Top50/Top50-CurrentUS.htm) I tried to find their rss feeds but ...
-4
votes
1answer
54 views

How do i upload small changes on a view of an asp.net mvc4 project [closed]

How do i structure an asp.net mvc 4 website in such a way that i can make small changes to views and upload those small changes only. i am a php developer trying to switch to asp.net mvc4. please ...
1
vote
1answer
104 views

What is the point behind building an abstraction layer PDO Adapter class instead of using native PDO?

I have built a PDO adapter class because I thought, at the time anyway, it would be a good idea. After fighting with it, it makes no sense to me. Isn't the design of PDO the way it is to keep you ...
1
vote
1answer
80 views

Transferring information between a web server and a Python backend?

I have been Googling my problem but haven't been able to come up with anything; here's the situation: I have a PHP / MySQL website hosted with 1and1.com. I also have a Python program that runs on a ...
0
votes
1answer
169 views

Project directory structure

Actually i'm using this project directory structure http://framework.zend.com/manual/1.12/en/project-structure.project.html But recently i started using namespaces in all my php-classes like: ...
0
votes
1answer
55 views

Storing Form Data in a class

I have a form that writes to a database. Other than creating a class handle an external API, this project is done. However, the processing script is your standard procedural calling of queries using ...
0
votes
1answer
109 views

Different operators in query string like ?var!=value

This one may actually be 2 questions in one. Studying some APIs I came across an api suggesting to have operand different from equal (=) inside the query string (http://www.salesboard.com/api/): ...
0
votes
1answer
189 views

Is not being able to resolve a function call to its declaration a drawback of Polymorphism?

Consider a class that prints an "outline" table for a particular product line. Say you have several, A, B, C, D. The mechanism of the table generation is the same, but the data is different. I ...
-2
votes
2answers
87 views

What should config files and the bootstrap do? [closed]

I already read dozens of articles and questions/answers on SO and Programmers but I can't understand what config and bootstrap files are, in the context of a web application. So my questions are : ...
14
votes
2answers
2k views

Illegal in PHP: Is there an OOP design reason?

The below interface inheritance is illegal in PHP, but I think it would be fairly useful in real life. Is there an actual antipattern or documented problem with the below design, that PHP is ...
4
votes
1answer
482 views

How dangerous is it to take shortcuts when coding Web based applications? [closed]

I started working as a Web developer few months back. Previously, I had no prior professional experience in programming besides school classes and fun-side projects I did on my own. I am the only ...
0
votes
1answer
172 views

Static and not-static: programmer quantum theory

Let me illustrate using the PHP language. The discussion here is, how should I do exactly to solve this problem in a clear and unambiguous mode. Imagine that I have a class called Path. This class is ...
0
votes
1answer
53 views

How to keep class parameters visible while using generic argument passing

After writing some classes where class initialization requires multiple options, instead of writing several parameters into constructors or setters, I started passing an associative array of ...
2
votes
2answers
178 views

How would I allow a PHP front end to communicate with a back end written in Go (or any other combination of languages)?

I like PHP. It's not overly complex to achieve what you want, you can write straight up HTML inside it, and I suppose I'm just used to it. I also like Go, having just discovered it while looking for ...
0
votes
1answer
118 views

Is there a particular coding standard with comments between function name and body?

I'm integrating with a shipping API built in php. They have a strange coding standard where the comments are between the function name and the first curly bracket.. which - subjectively - makes the ...
0
votes
0answers
111 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
102 views

More efficient management of assets(image, documents) in a large web project

I am beginning to refactor a large, very old, messy project. One of the biggest issues is the lack of a central location on the filesystem for simple things like images, icons, documents, csv, etc. ...
0
votes
3answers
214 views

How do I design my application to use REST for itself?

I'm not sure how to ask this. I know this is simplistic, but I understand (I think): REST is an architecture, not required, simply a way to build REST is a style and a community standard for ...