Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 115 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 115 Revision 1372
Zeile 66... Zeile 66...
66
                    return false;
66
                    return false;
67
                }
67
                }
68
            }
68
            }
Zeile 69... Zeile 69...
69
 
69
 
70
            $ref = $u['path'];
70
            $ref = $u['path'];
71
            $path = array($_SERVER['DOCUMENT_ROOT']);
71
            $path = array( $_SERVER['DOCUMENT_ROOT'] );
72
            if ( $ref[0] != '/' )
72
            if ( $ref[0] != '/' )
73
            {
73
            {
74
                $path[] = $_SERVER['PHP_SELF'];
74
                $path[] = $_SERVER['PHP_SELF'];
75
            }
75
            }
Zeile 177... Zeile 177...
177
 
177
 
178
        public function setParams( $params )
178
        public function setParams( $params )
179
        {
179
        {
180
            foreach ( $params as $key => $value )
180
            foreach ( $params as $key => $value )
-
 
181
            {
181
            {
182
                if (
182
                if ( !in_array( $key, array(
183
                    !in_array( $key, array(
183
                    'query_strings',
184
                        'query_strings',
184
                    'write_headers',
185
                        'write_headers',
185
                    'debug_toggle',
186
                        'debug_toggle',
-
 
187
                    ) )
186
                ) ) )
188
                )
187
                {
189
                {
188
                    throw new sacy_Exception( "Invalid option: $key" );
190
                    throw new sacy_Exception( "Invalid option: $key" );
189
                }
191
                }
-
 
192
            }
190
            }
193
            if (
191
            if ( isset( $params['query_strings'] ) && !in_array( $params['query_strings'], array(
194
                isset( $params['query_strings'] ) && !in_array( $params['query_strings'], array(
192
                    'force-handle',
195
                    'force-handle',
193
                    'ignore',
196
                    'ignore',
-
 
197
                ) )
194
                ) ) )
198
            )
195
            {
199
            {
196
                throw new sacy_Exception( "Invalid setting for query_strings: " . $params['query_strings'] );
200
                throw new sacy_Exception( "Invalid setting for query_strings: " . $params['query_strings'] );
-
 
201
            }
197
            }
202
            if (
198
            if ( isset( $params['write_headers'] ) && !in_array( $params['write_headers'], array(
203
                isset( $params['write_headers'] ) && !in_array( $params['write_headers'], array(
199
                    true,
204
                    true,
200
                    false,
205
                    false,
-
 
206
                ), true )
201
                ),                                               true ) )
207
            )
202
            {
208
            {
203
                throw new sacy_Exception( "Invalid setting for write_headers: " . $params['write_headers'] );
209
                throw new sacy_Exception( "Invalid setting for write_headers: " . $params['write_headers'] );
Zeile 413... Zeile 419...
413
        foreach ( $files as $f )
419
        foreach ( $files as $f )
414
        {
420
        {
415
            $max = max( $max, filemtime( $f ) );
421
            $max = max( $max, filemtime( $f ) );
416
        }
422
        }
417
        // not using the actual content for quicker access
423
        // not using the actual content for quicker access
418
	$key = md5( $max . serialize( $files ) );
424
        $key = md5( $max . serialize( $files ) );
419
	@mkdir(ASSET_COMPILE_OUTPUT_DIR,0755,true);
425
        @mkdir( ASSET_COMPILE_OUTPUT_DIR, 0755, true );
420
        $cfile = ASSET_COMPILE_OUTPUT_DIR . DIRECTORY_SEPARATOR . "$ident-$key" . $rh->getFileExtension();
426
        $cfile = ASSET_COMPILE_OUTPUT_DIR . DIRECTORY_SEPARATOR . "$ident-$key" . $rh->getFileExtension();
421
        $pub = ASSET_COMPILE_URL_ROOT . "/$ident-$key" . $rh->getFileExtension();
427
        $pub = ASSET_COMPILE_URL_ROOT . "/$ident-$key" . $rh->getFileExtension();
Zeile 422... Zeile 428...
422
 
428
 
423
        if ( file_exists( $cfile ) && ( $rh->getConfig()->getDebugMode() != 2 ) )
429
        if ( file_exists( $cfile ) && ( $rh->getConfig()->getDebugMode() != 2 ) )
Zeile 433... Zeile 439...
433
        return $pub;
439
        return $pub;
434
    }
440
    }
Zeile 435... Zeile 441...
435
 
441
 
436
    function sacy_write_cache( &$smarty, $cfile, $files, sacy_CacheRenderHandler $rh )
442
    function sacy_write_cache( &$smarty, $cfile, $files, sacy_CacheRenderHandler $rh )
437
    {
443
    {
438
	    $lockfile = $cfile . ".lock";
444
        $lockfile = $cfile . ".lock";
439
        $fhl = @fopen( $lockfile, 'w' );
445
        $fhl = @fopen( $lockfile, 'w' );
440
        if ( !$fhl )
446
        if ( !$fhl )
441
        {
447
        {
442
            $smarty->trigger_error( "Cannot create cache-lockfile: $lockfile" );
448
            $smarty->trigger_error( "Cannot create cache-lockfile: $lockfile" );