jalmenarez / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

ImportProcessor missing realpath() call for DOC_ROOT #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify version: 2.1.0
PHP version: PHP 5.2.6

What steps will reproduce the problem?
1. upload min dir into server root
2. browse to {domain.com}/min_unit_tests
3. test test_Minify_ImportProcessor.php

Expected output: PASS

Actual output: !FAIL: ImportProcessor (1 of 1 tests run so far have failed)

Did you run the unit tests? Did any FAIL? Yes, the ImportProcessor

Please provide any additional information below.

Hello guys. I'm having problems with Minify. I just uploaded min dir to
server root and wanted to play with the builder. But there is not form at
the builder page. Just title, "Need help? Search or post to the Minify
discussion list." and text "This app is minified". So i thought that some
unit isn't working and i tested all units. One failed (ImportProcessor).
What could be the problem? I'm using mod_rewrite module of Apache. Maybe
this could be the problem. But i deactivated htaccess in root dir and
nothing happened, it was the same. So can anyone help me please to get
Minify working.

Original issue reported on code.google.com by vasja.la...@gmail.com on 18 Oct 2008 at 7:25

GoogleCodeExporter commented 9 years ago
I looked into test_Minify_ImportProcessor.php and the problem is in line 29...

if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) {
        echo "\n---Output: " .strlen($actual). " bytes\n\n{$actual}\n\n";
        if (!$passed) {
            echo "---Expected: " .strlen($expected). " bytes\n\n{$expected}\n\n\n";
        }
    }

This if sentence is true.

Original comment by vasja.la...@gmail.com on 18 Oct 2008 at 7:48

GoogleCodeExporter commented 9 years ago
I tried on another server and i got the same error. So i guess the script isn't 
that
'crosssystems' build...

I got...

!FAIL: ImportProcessor (1 of 1 tests run so far have failed)

---Output: 1651 bytes

@media screen {
/* some CSS to try to exercise things in general */

@import    
url(min_unit_tests/_test_files/importProcessor/min_unit_tests/_test_files/import
Processor/min_unit_tests/_test_files/css/more.css);

from where we can see that there is no local path prefix... sometimes this 
general
$_SERVER variables are disabled due to security reasons so there must be also a
workaround for this kind of situation.

Original comment by vasja.la...@gmail.com on 18 Oct 2008 at 7:58

GoogleCodeExporter commented 9 years ago
OK definitely it's the $_SERVER['DOCUMENT_ROOT'] variable. It says on the 
hosting
server that $_SERVER['DOCUMENT_ROOT'] always returns just '/' and i should use
getcwd() instead.

Original comment by vasja.la...@gmail.com on 19 Oct 2008 at 8:38

GoogleCodeExporter commented 9 years ago
I manually declared variable $_SERVER['DOCUMENT_ROOT'] in index.php and now it 
works
great. Nice script.

Original comment by vasja.la...@gmail.com on 19 Oct 2008 at 9:14

GoogleCodeExporter commented 9 years ago

Original comment by mrclay....@gmail.com on 20 Oct 2008 at 6:35