Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOOD
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
whb
10 years ago
Commit
b0bcdd149be0591d9eaaebcb9cff78bc201cbe22
1 parent
000ed394
minify判断site
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
87 deletions
res/min/index.php
res/min/index.php
View file @
b0bcdd1
<?php
/**
* Front controller for default Minify implementation
*
* DO NOT EDIT! Configure this utility via config.php and groupsConfig.php
*
* @package Minify
*/
define
(
'MINIFY_MIN_DIR'
,
dirname
(
__FILE__
));
// set config path defaults
$min_configPaths
=
array
(
'base'
=>
MINIFY_MIN_DIR
.
'/config.php'
,
'test'
=>
MINIFY_MIN_DIR
.
'/config-test.php'
,
'groups'
=>
MINIFY_MIN_DIR
.
'/groupsConfig.php'
);
// check for custom config paths
if
(
!
empty
(
$min_customConfigPaths
)
&&
is_array
(
$min_customConfigPaths
))
{
$min_configPaths
=
array_merge
(
$min_configPaths
,
$min_customConfigPaths
);
}
// load config
require
$min_configPaths
[
'base'
];
if
(
isset
(
$_GET
[
'test'
]))
{
include
$min_configPaths
[
'test'
];
}
require
"
$min_libPath
/Minify/Loader.php"
;
Minify_Loader
::
register
();
Minify
::
$uploaderHoursBehind
=
$min_uploaderHoursBehind
;
Minify
::
setCache
(
isset
(
$min_cachePath
)
?
$min_cachePath
:
''
,
$min_cacheFileLocking
);
if
(
$min_documentRoot
)
{
$_SERVER
[
'DOCUMENT_ROOT'
]
=
$min_documentRoot
;
Minify
::
$isDocRootSet
=
true
;
}
$min_serveOptions
[
'minifierOptions'
][
'text/css'
][
'symlinks'
]
=
$min_symlinks
;
// auto-add targets to allowDirs
foreach
(
$min_symlinks
as
$uri
=>
$target
)
{
$min_serveOptions
[
'minApp'
][
'allowDirs'
][]
=
$target
;
}
if
(
$min_allowDebugFlag
)
{
$min_serveOptions
[
'debug'
]
=
Minify_DebugDetector
::
shouldDebugRequest
(
$_COOKIE
,
$_GET
,
$_SERVER
[
'REQUEST_URI'
]);
}
if
(
$min_errorLogger
)
{
if
(
true
===
$min_errorLogger
)
{
$min_errorLogger
=
FirePHP
::
getInstance
(
true
);
}
Minify_Logger
::
setLogger
(
$min_errorLogger
);
}
// check for URI versioning
if
(
preg_match
(
'/&\\d/'
,
$_SERVER
[
'QUERY_STRING'
])
||
isset
(
$_GET
[
'v'
]))
{
$min_serveOptions
[
'maxAge'
]
=
31536000
;
}
// need groups config?
if
(
isset
(
$_GET
[
'g'
])
&&
isset
(
$_GET
[
'site'
]))
{
// well need groups config
$min_serveOptions
[
'minApp'
][
'groups'
]
=
(
require
MINIFY_MIN_DIR
.
'/groupConfig/'
.
$_GET
[
'site'
]
.
'.php'
);
$min_configPaths
[
'groups'
]
=
MINIFY_MIN_DIR
.
'/groupConfig/'
.
$_GET
[
'site'
]
.
'.php'
;
}
// serve or redirect
if
(
isset
(
$_GET
[
'f'
])
||
isset
(
$_GET
[
'g'
]))
{
if
(
!
isset
(
$min_serveController
))
{
$min_serveController
=
new
Minify_Controller_MinApp
();
}
Minify
::
serve
(
$min_serveController
,
$min_serveOptions
);
}
elseif
(
$min_enableBuilder
)
{
header
(
'Location: builder/'
);
exit
;
}
else
{
header
(
'Location: /'
);
exit
;
}
<?php
/**
* Front controller for default Minify implementation
*
* DO NOT EDIT! Configure this utility via config.php and groupsConfig.php
*
* @package Minify
*/
define
(
'MINIFY_MIN_DIR'
,
dirname
(
__FILE__
));
// set config path defaults
$min_configPaths
=
array
(
'base'
=>
MINIFY_MIN_DIR
.
'/config.php'
,
'test'
=>
MINIFY_MIN_DIR
.
'/config-test.php'
,
'groups'
=>
MINIFY_MIN_DIR
.
'/groupsConfig.php'
);
// check for custom config paths
if
(
!
empty
(
$min_customConfigPaths
)
&&
is_array
(
$min_customConfigPaths
))
{
$min_configPaths
=
array_merge
(
$min_configPaths
,
$min_customConfigPaths
);
}
// load config
require
$min_configPaths
[
'base'
];
if
(
isset
(
$_GET
[
'test'
]))
{
include
$min_configPaths
[
'test'
];
}
require
"
$min_libPath
/Minify/Loader.php"
;
Minify_Loader
::
register
();
Minify
::
$uploaderHoursBehind
=
$min_uploaderHoursBehind
;
Minify
::
setCache
(
isset
(
$min_cachePath
)
?
$min_cachePath
:
''
,
$min_cacheFileLocking
);
if
(
$min_documentRoot
)
{
$_SERVER
[
'DOCUMENT_ROOT'
]
=
$min_documentRoot
;
Minify
::
$isDocRootSet
=
true
;
}
$min_serveOptions
[
'minifierOptions'
][
'text/css'
][
'symlinks'
]
=
$min_symlinks
;
// auto-add targets to allowDirs
foreach
(
$min_symlinks
as
$uri
=>
$target
)
{
$min_serveOptions
[
'minApp'
][
'allowDirs'
][]
=
$target
;
}
if
(
$min_allowDebugFlag
)
{
$min_serveOptions
[
'debug'
]
=
Minify_DebugDetector
::
shouldDebugRequest
(
$_COOKIE
,
$_GET
,
$_SERVER
[
'REQUEST_URI'
]);
}
if
(
$min_errorLogger
)
{
if
(
true
===
$min_errorLogger
)
{
$min_errorLogger
=
FirePHP
::
getInstance
(
true
);
}
Minify_Logger
::
setLogger
(
$min_errorLogger
);
}
// check for URI versioning
if
(
preg_match
(
'/&\\d/'
,
$_SERVER
[
'QUERY_STRING'
])
||
isset
(
$_GET
[
'v'
]))
{
$min_serveOptions
[
'maxAge'
]
=
31536000
;
}
// need groups config?
if
(
isset
(
$_GET
[
'g'
])
&&
isset
(
$_GET
[
'site'
]))
{
if
(
!
file_exists
(
MINIFY_MIN_DIR
.
'/groupConfig/'
.
$_GET
[
'site'
]
.
'.php'
))
{
$_GET
[
'site'
]
=
'www'
;
}
// well need groups config
$min_serveOptions
[
'minApp'
][
'groups'
]
=
(
require
MINIFY_MIN_DIR
.
'/groupConfig/'
.
$_GET
[
'site'
]
.
'.php'
);
$min_configPaths
[
'groups'
]
=
MINIFY_MIN_DIR
.
'/groupConfig/'
.
$_GET
[
'site'
]
.
'.php'
;
}
// serve or redirect
if
(
isset
(
$_GET
[
'f'
])
||
isset
(
$_GET
[
'g'
]))
{
if
(
!
isset
(
$min_serveController
))
{
$min_serveController
=
new
Minify_Controller_MinApp
();
}
Minify
::
serve
(
$min_serveController
,
$min_serveOptions
);
}
elseif
(
$min_enableBuilder
)
{
header
(
'Location: builder/'
);
exit
;
}
else
{
header
(
'Location: /'
);
exit
;
}
...
...
Please
register
or
login
to post a comment