PHP Classes

File: app/check.php

Recommend this page to a friend!
  Classes of Manolo Salsas   Online PHP Image Transform   app/check.php   Download  
File: app/check.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Online PHP Image Transform
Application to do interactive image manipulation
Author: By
Last change:
Date: 4 years ago
Size: 1,643 bytes
 

Contents

Class file image Download
<?php

require_once dirname(__FILE__).'/SymfonyRequirements.php';

$symfonyRequirements = new SymfonyRequirements();

$iniPath = $symfonyRequirements->getPhpIniConfigPath();

echo
"********************************\n";
echo
"* *\n";
echo
"* Symfony requirements check *\n";
echo
"* *\n";
echo
"********************************\n\n";

echo
$iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n";

echo
"** ATTENTION **\n";
echo
"* The PHP CLI can use a different php.ini file\n";
echo
"* than the one used with your web server.\n";
if (
'\\' == DIRECTORY_SEPARATOR) {
    echo
"* (especially on the Windows platform)\n";
}
echo
"* To be on the safe side, please also launch the requirements check\n";
echo
"* from your web server using the web/config.php script.\n";

echo_title('Mandatory requirements');

foreach (
$symfonyRequirements->getRequirements() as $req) {
   
echo_requirement($req);
}

echo_title('Optional recommendations');

foreach (
$symfonyRequirements->getRecommendations() as $req) {
   
echo_requirement($req);
}

/**
 * Prints a Requirement instance
 */
function echo_requirement(Requirement $requirement)
{
   
$result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
    echo
' ' . str_pad($result, 9);
    echo
$requirement->getTestMessage() . "\n";

    if (!
$requirement->isFulfilled()) {
        echo
sprintf(" %s\n\n", $requirement->getHelpText());
    }
}

function
echo_title($title)
{
    echo
"\n** $title **\n\n";
}