Проект SnarkNews представляет

SnarkNews winter series - 2012

 

Используемая версия PHP - PHP 5.2.5

Скрипт для обработки программ на PHP:


#!/bin/sh
# $Id: php.in 4855 2008-04-05 08:03:28Z cher $
# Copyright (c) 2008 Alexander Chernov 

# This is a `compilation' script for the PHP language.
# The idea is to append "#! ${PHPPATH} -nf" string
# to the beginning of the file.
# Usage: php < input > < output >

# using EJUDGE_FLAGS we may pass additional flags

LANG_CONFIG_DIR="/home/ejudge/contests/compile/conf/lang.d"
[ "${EJUDGE_LANG_CONFIG}" = "" ] && EJUDGE_LANG_CONFIG="${LANG_CONFIG_DIR}/php.cfg"

if [ -f "${EJUDGE_LANG_CONFIG}" ]
then
  . "${EJUDGE_LANG_CONFIG}"
else
  version="unknown"
  PHPPATH="/usr/bin/php"
fi

if [ x"${version}" = x ]
then
  echo "This language is not supported." >&2
  exit 1
fi

echo "#! ${PHPPATH} -nf" > $2
echo >> $2
cat $1 >> $2
chmod +x $2
exit 0