Opinions Sought for a Chronicle Feature  php

7 years ago | 1 comment | github.com | Score: 2 Reddit

Latest Comment

Cross-signing and replication are already implemented. I'm looking for peoples' thoughts on ways to make the replication more useful.


7 years ago


a php $_POST parser of Golang.  php

7 years ago | 1 comment | github.com | Score: Reddit

Latest Comment

its can be parse php post format request body. a[b][c]=1&a[b][c]=1&a[b][d]=1&f=1&g[h][i]=1&g[h][i][t]=1 can be parse to map[string]interface{},like $_POST.


7 years ago


rfc1867 for PHP(form upload protocol)  php

7 years ago | 2 comments | github.com | Score: Reddit

Latest Comment

Probably shouldn't use rand() here. Use random_int() instead.


7 years ago


Requesting help to deploy my laravel website  laravel

7 years ago | 3 comments | self.laravel | Score: 1 Reddit

Latest Comment

Laravel Forge was built for this, and for my setup it's very much worth the money. Git-based deployment, multiple providers, 1-click Lets-Encrypt SSL, etc.


7 years ago


How can i sum a database column in yii 1  php

7 years ago | comments | self.PHP | Score: Reddit


PHPMetrics is safe?  php

7 years ago | comments | self.PHP | Score: 1 Reddit


Junior PHP developer job requirments  php

7 years ago | 9 comments | self.PHP | Score: 1 Reddit

Latest Comment

basic MVC, OOP, a little bit of design patterns, maybe able to write a recursive function is al you need for a junior position..no one expects a junior to have real experience..they expect to have a little experience and a little more formal knowledge..what is important is willingness to learn and improve..so most of the time we look more for personal qualities as skills..because you will need to educate a junior..and hopefully he will stay with you long enough to get your investments back..so don't worry based on your description you are good to go :)


7 years ago


Do I Need To Sanitize My CSVs Before Importing? (Link To Post On /R/Database Inside)  phphelp

7 years ago | 3 comments | self.PHPhelp | Score: 2 Reddit

Latest Comment

I would do it, just to be safe. It's not going to hurt anything if you do. I believe PDO will do this for you.


7 years ago


Need some clarification with Contact Forms  phphelp

7 years ago | 1 comment | self.PHPhelp | Score: 1 Reddit

Latest Comment

If Apache is serving from

/Library/WebServer/Documents

Then anything you want to serve should go there.


7 years ago


The PHP Exception Class Hierarchy  php

7 years ago | 5 comments | airbrake.io | Score: Reddit

Latest Comment

The only general-purpose distinction that matters here is between Error and Exception. Everything else was thrown in because Java has a similar hierarchy so we had to blindly imitate without understanding.

Of course, also the specific exceptions thrown by PDO etc. are interesting, but you don't need to see where in the hierarchy they are, you only need to notice that as you use extension XYZ it throws a XYZException.


7 years ago


I have created a PHP script that can defend websites by responding with a ZIP bomb to hackers  php

7 years ago | 51 comments | blog.haschek.at | Score: 86 Reddit

Latest Comment

can someone please explain me this condition ? Why is he testing for theese?

if (strpos($agent, 'nikto') !== false || strpos($agent, 'sqlmap') !== false || startswith($url,'wp-') || startswith($url,'wordpress') || startswith($url,'wp/'))


7 years ago


Authenticate users with Passport in PHP  php

7 years ago | comments | ibm.com | Score: 5 Reddit


Easily optimize images using PHP (and some binaries)  php

7 years ago | 4 comments | self.PHP | Score: 10 Reddit

Latest Comment

I noticed in the section of the README about logging, that it says to use setLogger(). From what I can tell, it is uses useLogger().


7 years ago


[DISCUSSION] How much do you guys comment in your code  phphelp

7 years ago | 12 comments | self.PHPhelp | Score: 6 Reddit

Latest Comment

I try to follow the principle of explaining why I'm doing something, not what is being done.

The problem, however, is deciding what needs explanation. I think my code probably has too few comments in that regard.


7 years ago


It's Drupal Contrib Wednesday! Post recent contrib module likes/dislikes  drupal

7 years ago | comments | self.drupal | Score: 6 Reddit


Forced FIFO Queue Library  php

7 years ago | 12 comments | self.PHP | Score: Reddit

Latest Comment

how could messages end up out of order on a FIFO queue? if pushing and popping to the queue are not locking atomic operations then it's not really a FIFO queue. regardless, putting a message back if it has an error in processing it is also a violation of FIFO behavior. as a user I would expect a message that throws an error to throw the error and then vanish. it's up to the user whether or not the message should be requeued.


7 years ago


why is laravel using a 227 bytes long csrf token, and why is it in the cookies?  laravel

7 years ago | 11 comments | self.laravel | Score: Reddit

Latest Comment

are you wasting bandwidth just for the hell of it?
you know that cookie is sent with every single request?

What are you attacking us for? We're Redditors just like you.


7 years ago


5 Common Mistakes PHP Developers Make when Writing SQL  php

7 years ago | 18 comments | eversql.com | Score: Reddit

Latest Comment

I followed your link to OWASP to find what they say about utf8mb4. I see :

Use UTF-8 as your database and application charset unless you have a mandatory requirement to use another encoding.

Looks like OWASP is recommending UTF8. Am I missing something?


7 years ago


D8 Multisite theme set up  drupal

7 years ago | 1 comment | self.drupal | Score: 4 Reddit


Create a Laravel Contact Us form with Email  laravel

7 years ago | comments | cloudways.com | Score: Reddit


Jokes IRL: A man and a genie or a Failed singleton.  php

7 years ago | 2 comments | phpdelusions.net | Score: Reddit

Latest Comment

The joke was funny. Not thigh-trashing funny, but it gets by.

I fail to see the fun in the code example, though. It's just an example of a flawed implementation. Not only should the constructor be utilized, as pointed out in the gist (https://gist.github.com/rob-murray/5454707). This will also open a new connection every time it is called, which - in turn - may bring the code execution (and if improperly configured, the database) to a grinding halt when the connection limit is reached.

Also kids: Use factories.


7 years ago


Special answer style for an online survey  phphelp

7 years ago | comments | self.PHPhelp | Score: 1 Reddit


Face Recognition package for Laravel (using Face++ api)  laravel

7 years ago | 4 comments | github.com | Score: 14 Reddit

Latest Comment

This is not a face recognition package, that's an api wrapper package for face recognition service. You got me excited there for a second...


7 years ago


Empty array when i run print_r()  phphelp

7 years ago | 5 comments | self.PHPhelp | Score: Reddit

Latest Comment

$data1 = array();
print_r($data1);

What do you expect to happen?


7 years ago


What is the proper way of deleting a language in D8?  drupal

7 years ago | 1 comment | self.drupal | Score: 2 Reddit


How to Install Apache, PHP 7.1, and MySQL on Ubuntu with Vagrant  php

7 years ago | 4 comments | taniarascia.com | Score: Reddit

Latest Comment

A lot of the shell commands could be done in with Vagrantfile's config.vm.provision "shell".

Alternatively, you could probably just install Laravel Homestead and be done with it lol. Note that Laravel Homestead has nginx and not Apache.


7 years ago


PHP7 application runs as Microservice to resize and crop images on the fly.  php7

7 years ago | comments | self.php7 | Score: 5 Reddit


Heatmapping what do you use?  php

7 years ago | 8 comments | self.PHP | Score: Reddit

Latest Comment

on a trial of fullstory.com right now through affiliate link fullstory.com/boag

I released a wordpress.org plugin for it, as I found it interesting. they do heat-maps, visitor recording & playback and a pretty powerful user segmentation and filter area (with built-in hiding of password and cc fields).

TBH I'm not going to sign up as it's 500/pcm and one thing I never thought about was what happens in nations with specific policies on what you can monitor, what you can keep and transmit, and where to etc...


7 years ago


H2 push on CGI  php

7 years ago | 8 comments | self.PHP | Score: Reddit

Latest Comment

If the size of the body is negating the impact of preload via Link: thing.css;rel="preload";as="style", do you perhaps need to load in your body via fetch/ajax as well ?


7 years ago


Top 10 Programming Languages of 2017 So Far  php

7 years ago | comments | evontech.com | Score: Reddit


First steps on Drupal  drupal

7 years ago | 12 comments | self.drupal | Score: 2 Reddit


A few quick questions about Laravel and AWS  laravel

7 years ago | 16 comments | self.laravel | Score: 5 Reddit

Latest Comment

I don't have a .env file for my elastic beanstalk environment. I just put in all the environment variables in the Software Configuration panel in the elastic beanstalk settings. So you'll have your dev environment variables for your dev elastic beanstalk environment, and the same for prod.

Elastic beanstalk is pretty easy once you get the configuration all set up. For me to deploy a new version I just commit everything to git, do an eb use <environment_name> and then eb deploy and my new version is up.

I only really use the eb cli and then the aws console whenever I need to.


7 years ago


Where in the page generation pipeline can an HTML beautifier be placed?  drupal

7 years ago | 12 comments | self.drupal | Score: 5 Reddit


Why am I getting an undefined error?  phphelp

7 years ago | 3 comments | self.PHPhelp | Score: 1 Reddit

Latest Comment

$this->_datatypes would look up the property _datatypes. $this->$_datatypes looks up the property named by $_datatypes.


7 years ago


How are things like price table created/managed in Drupal 8?  drupal

7 years ago | 2 comments | self.drupal | Score: 3 Reddit


Problem accessing function in Laravel 5.4 Model  laravel

7 years ago | 10 comments | self.laravel | Score: 2 Reddit

Latest Comment

Laravel is looking for a foreign id based on the name of the relation. So since it's role_id in your table, not roles_id, only the first one works.


7 years ago


Rails developer looking for insight/tips  laravel

7 years ago | 6 comments | self.laravel | Score: 2 Reddit

Latest Comment

1. Permissions / Roles

Laravel's built in authentication and authorization is very good. I wouldn't use a third party package.

2. Packages

One off the top of my head would be something like Laracogs.

3. Overriding

In PHP you can simply extend the class and write your own method with the exact same name.

For example, look at this controller: https://github.com/laravel/laravel/blob/master/app/Http/Controllers/Auth/LoginController.php

It implements the trait Illuminate\Foundation\Auth\AuthenticatesUsers which has the login logic. If you wanted to write your own you can simply override the methods by using your own in that class with the same name.

I'd highly recommend getting up to date with Composer and namespacing before diving into Laravel.

Also check out Laracasts


7 years ago


Do we as PHP community need MQ standard such as Java JMS?  php

7 years ago | 17 comments | self.PHP | Score: 14 Reddit

Latest Comment

If you need Java, write Java. Trying to turn PHP into java isn't healthy for either ecosystem.


7 years ago


MySQLi lib problem  phphelp

7 years ago | 17 comments | self.PHPhelp | Score: 4 Reddit

Latest Comment

WHERE username = ?

I've never seen the ? in an SQL statement like that before. What does it do?


7 years ago


FOPO - Free Online PHP Obfuscator  php

7 years ago | 9 comments | fopo.com.ar | Score: Reddit

Latest Comment

Useless. My code is already incomprehensible when I write it.


7 years ago


Embed Videos in Drupal 8 Easily With Video Embed Field Module  drupal

7 years ago | comments | cloudways.com | Score: 8 Reddit


It's Triumphant Tuesday! Post your recent Drupal wins and launches  drupal

7 years ago | comments | self.drupal | Score: Reddit


Laravel Best Practices for your Application  laravel

7 years ago | comments | cloudways.com | Score: Reddit

Latest Comment

Sorry, but that was a pretty terrible article. You don't cite any sources for these "best practises," or even explain why you believe them to be best. Lots of English mistakes. (No space between sentences is a huge pet peeve of mine!) Much of the advice isn't Laravel-specific, and some is downright wrong. It comes across more like an introduction to Laravel than an actual best practices guide.


7 years ago


PHP Application Development Services  php

7 years ago | comments | indianic.com | Score: Reddit


Mysql pdo binding variables problem  phphelp

7 years ago | 7 comments | self.PHPhelp | Score: 3 Reddit

Latest Comment

This seems to work for me regardless of whether $param1 is set to '2017-10-10' or null. I'm curious what you have in $opt, I'm just using the defaults and not passing any options there.

There is, at least in theory, a PDOStatement method called debugDumpParams() that's supposed to be of help here. However, I have yet to find a version of PHP where it dumps the bound values. If you have administrator access to the MySQL server, it may be easier to turn on query logging there, and examine the MySQL log to see what queries PDO is sending. You would need to put something like this in your my.cnf:

# Log all queries
general_log_file = /var/log/mysqld-all-queries.log
general_log = 1

The MySQL user will need permission to write to the file specified here. Restart the MySQL service and inside the log file you'll get the queries including parameters, like this:

2017-07-04T16:33:32.020672Z        11 Query     SELECT *
FROM table_a
WHERE name = 'name is carl' AND ((`my date` >= NULL AND `my date` < '2017-10-17') OR
ISNULL(NULL))
ORDER BY `my date`
2017-07-04T16:33:32.021104Z        11 Quit

If you go this route, don't forget to turn that logging back off, since the log file can get big in a hurry depending on your environment.


7 years ago


What is PHP Point of sale software?  php

7 years ago | 2 comments | blog.webprojectbuilder.com | Score: Reddit

Latest Comment

A POS article about POS systems.


7 years ago


Any other sites like bestpractices.thecodingmachine.com ?  php

7 years ago | 8 comments | bestpractices.thecodingmachine.com | Score: 40 Reddit

Latest Comment

You can read through my own best practices deck at https://ocramius.github.io/extremely-defensive-php/


7 years ago


PHP 7.1 added to Apache Openwhisk  php

7 years ago | comments | github.com | Score: 2 Reddit


Need help with Twig  phphelp

7 years ago | 2 comments | self.PHPhelp | Score: 1 Reddit

Latest Comment

just get your data into array. For example, with PDO you can use fetchAll() method:

$stmt = $pdo->query("SELECT * FROM users limit ?, ?");
$stmt->execute([$limit, $offset]);
$users = $stmt->fetchAll();

then assign this $users variable to twig template the usual way and then iterate over it as it's shown in the manual:

<% for row in users %>
    <a href="details.php?id={{ row.id }}">
        {{ row.name }}
    </a>
<% endfor %>

7 years ago


Learn php from scratch with these top courses  php

7 years ago | comments | onlinecoursesgalore.com | Score: 2 Reddit