Problem/Motivation

With the PHP version 5.4.0 and above, PHP includes an embedded server. This server can be used to easily and quickly set up projects. Currently Drupal needs to implement a router script in order to works with the PHP embedded server.

Proposed resolution

This module was created to provide an easy way to start Drupal using PHP embedded server. This module provides a Drush command which let to set the project host and handles the routing to start Drupal.
This module also provide an php script with let start the server without need of Drush and it can be used for first time installations.

Remaining tasks

Currently an php script let it works without need of the module installation, witch let not depends of Drush, but next task will be to allow it be execute from a global Drush installation and no need to enable this module in order to use Drush.

PHP Server Project https://www.drupal.org/sandbox/andrefy/2418877

Git Repository

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/andrefy/2418877.git php_server
cd php_server

Issues reported at Drupal Community related with this project

https://www.drupal.org/node/1543858 This will be at the core of Drupal 8 but still not project for Drupal 7

Why Use PHP Embedded Server

- It is an alternative to other servers like apache, nginx, ...
- It allows to have an easy Drupal set up, this server is intent to be used for local environments for development propouses.
- It holds the property routing, so you don't have to create a virtual host configuration.
- Drush command let you to run the server just when it needed so you will don't have several sites listen server host like apache does with virtual host

Example of use from a fresh Drupal Installation

- Download Drupal
- Download the php_server module and place it on the Drush profile folder. Ex: ~/.drush/php_server.
- Run: drush ss
Example:

// Place php server at drush profile folder
mv php_server ~/.drush/php_server 
cd [project root folder]
drush ss

This command will ask you for the ip and port to start the server, defaults are http://0.0.0.0:8181
- Open the browser at the default url:
http://0.0.0.0:8181

Screen shoot

Manual reviews of other projects

Comments

PA robot’s picture

Status: Active » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxandrefy2418877git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

andrefy’s picture

Status: Needs work » Needs review
arijits.drush’s picture

Please change git clone command

from

git clone --branch 7.x-1.x andrefy@git.drupal.org:sandbox/andrefy/2418877.git 

to

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/andrefy/2418877.git

Manual Review

Individual user account

Yes: Follows the guidelines for individual user accounts.

No duplication

Yes: Does not cause module duplication and/or fragmentation.

Master Branch

Yes: Follows the guidelines for master branch.

Licensing

Yes: Follows the licensing requirements.

3rd party assets/code

Yes: Follows the guidelines for 3rd party assets/code.

README.txt/README.md

No: Does not follow , Please use Read me template

Code long/complex enough for review

No: Does not follow the guidelines for project length and complexity.

Secure code

Yes:Meets the security requirements

Coding style & Drupal API usage

This review uses the Project Application Review Template.

arijits.drush’s picture

Status: Needs review » Needs work
klausi’s picture

Status: Needs work » Needs review

The readme formatting is surely not an application blocker, anything else that you found or should this be RTBC instead?

andrefy’s picture

@arijits.drush Thanks for you review, the REAMD file was updated using the recommended template

andrefy’s picture

Issue summary: View changes
mattdanger’s picture

I've reviewed the code base and tested functionality for this project and have not found any blocking issues. Perhaps you could provide an example or documentation of a simple use case for a Drupal server?

andrefy’s picture

Issue summary: View changes
StatusFileSize
new1.09 MB
andrefy’s picture

@MattDanger

Thanks for the review, I added a more detail description of why this module and the PHP Embedded Server, and also some instructions, if you have any other feed back I will be glad to heard it.

andrefy’s picture

@MattDanger

Thanks for the review, I added a more detail description of why this module and the PHP Embedded Server, and also some instructions, if you have any other feed back I will be glad to heard it.

andrefy’s picture

Issue summary: View changes
casivaagustin’s picture

My comments.

Readme.TXT
-----------

> Typo in line 41, says necesary and must be necessary

I don't think this is necessary if you are doing this as a drush command.

"php [module path]/php_server.start.inc -s 0.0.0.0:8181"

Avoid that redundancy, is not necessary since with drush is better.

Module
-------

I tried to use the module, I cloned, when I try to run the start server I got an error since requieres the php_server module enabled.

vagrant@packer-virtualbox /var/www/drupal/sites/default $ drush en php_server -y
php_server was not found and will not be enabled.                                                                                                                  [warning]
There were no extensions that could be enabled.

Then I tried to enabled the module

vagrant@packer-virtualbox /var/www/drupal/sites/default $ drush en php_server -y
php_server was not found and will not be enabled.                                                                                                                  [warning]
There were no extensions that could be enabled.

I created an empty module file (php_server.module) and I was able to enable the module

vagrant@packer-virtualbox /var/www/drupal/sites/default $ drush en php_server -y
The following extensions will be enabled: php_server
Do you really want to continue? (y/n): y
php_server was enabled successfully.

Once the module was enabled a tried again tu run the server

vagrant@packer-virtualbox /var/www/drupal/sites/default $ drush php-server-start
Missing argument 1 for drush_php_server_start() php_server.drush.inc:38                                                                                            [warning]
Your are using Drupal PHP Server
Server set:
Invalid address: /var/www/drupal/sites/all/modules/contrib/php_server/php_server.router.inc

I think it would be better of you validate the $server variable and print a better error message if the server address is not set.

When I did this it worked

vagrant@packer-virtualbox /var/www/drupal/sites/default $ drush php-server-start 0.0.0.0:8181
Your are using Drupal PHP Server
Server set: 0.0.0.0:8181

I suggest to change the alias to pss instead of just ss.

Cheers

andrefy’s picture

Thanks @casivaagustin, I applied your suggestion and updated this module.

andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue tags: +PAreview: review bonus
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
andrefy’s picture

Issue summary: View changes
klausi’s picture

Issue summary: View changes

Removing some automated reviews that don't include a manual review.

klausi’s picture

Assigned: Unassigned » misc
Status: Needs review » Reviewed & tested by the community
Issue tags: +PAreview: single application approval
StatusFileSize
new1.47 KB

Review of the 7.x-1.x branch (commit 8c6e23b):

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. project page: drush is not a module, so that could confuse users.
  2. This project is too short to approve you as git vetted user. We are currently discussing how much code we need, but everything with less than 120 lines of code or less than 5 functions cannot be seriously reviewed. However, we can promote this single project manually to a full project for you.

Otherwise looks good to me. Assigning to MiSc as he might have time to take a final look at this.

andrefy’s picture

ok, thanks for the review klausi

klausi’s picture

Assigned: misc » Unassigned
Status: Reviewed & tested by the community » Fixed

no objections for more than a week, so ...

Thanks for your contribution, andrefy!

I promoted this project for you: https://www.drupal.org/project/php_server

Now that this experimental project has been promoted, you'll need to update the URL of your remote repository or reclone it.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

PA robot’s picture

Status: Fixed » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2486797

Project 2: https://www.drupal.org/node/2420901

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

I'm a robot and this is an automated message from Project Applications Scraper.

klausi’s picture

Status: Closed (duplicate) » Closed (fixed)

let's leave this as fixed.