N
N
NetyNicka2015-01-23 00:14:17
PHP
NetyNicka, 2015-01-23 00:14:17

What happens when the specified php code is executed?

There is a file with the following content:

#!/bin/bash
# using:
#   cli-service.sh send-emails
#   cli-service.sh send-smss
# absolute path absolutely required for cron
path=`dirname $0 | xargs readlink -e`/../..
# import or export
action=$1
# user or document
model=$2
if [ $action = "send-emails" ]; then
  params="admin_email-queue/send-top"
elif [ $action = "send-smss" ]; then
  params="admin_request/send-sms-queue"
elif [ $action = "update-caller-info" ]; then
  params="admin_request/update-caller-info"
elif [ $action = "upload-s3-objects" ]; then
  params="admin_s3-queue/upload-top"
elif [ $action = "download-s3-objects" ]; then
  params="admin_s3-queue/download-top"
fi
/usr/bin/php $path/index.php $params

There is also code that accesses this file:
$process = proc_open("/bin/sh cli-service.sh $type-s3-objects >> $logFile &\n", array(), $pipes, APPLICATION_PATH . '/sh');

Question. What happens when a php request is executed? Is a task created/started in Cron, or something else?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Penkovsky, 2015-01-23
@NetyNicka

A background process is started, the bash script, depending on the action, launches a php script with the appropriate parameters.

V
Vyacheslav, 2015-01-23
@hedint

I'm even afraid to ask where you saw the php code here.
This is a bash script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question