Skip to content

Commit ff9e256

Browse files
author
Marco Dickert
committed
Merge branch 'cryol-2.6.1'
2 parents 45a4e44 + c7ee281 commit ff9e256

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1102
-9965
lines changed

Diff for: .gitattributes

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ifm.php -diff
2-
ifm.min.php -diff
3-
build/* -diff
1+
dist/ifm.php -diff
2+
dist/ifm.min.php -diff
3+
dist/* -diff
44
src/includes/ace.js -diff
55

6-
src export-ignore
7-
compiler.php export-ignore
8-
.gitignore export-ignore
9-
.gitattributes export-ignore
6+
src export-ignore
7+
compiler.php export-ignore
8+
.gitignore export-ignore
9+
.gitattributes export-ignore

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
*.zip
33
misc
44
src/includes/ace/*
5+
sftp-config.json
6+
dist/*

Diff for: build/libifm.php

-4,686
This file was deleted.

Diff for: compiler.php

+28-17
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,32 @@
88

99
chdir( realpath( dirname( __FILE__ ) ) );
1010

11+
// output files and common attrs
12+
define( "IFM_CDN", true );
13+
define( "IFM_VERSION", "<a href='https://github.com/misterunknown/ifm/tree/cryol-2.6.1' target=_blank>v2.6.1</a>" );
14+
define( "IFM_RELEASE_DIR", "dist/");
15+
define( "IFM_STANDALONE", "ifm.php" );
16+
define( "IFM_STANDALONE_GZ", "ifm.min.php" );
17+
define( "IFM_LIB", "libifm.php" );
18+
19+
if( IFM_CDN ){
20+
$IFM_ASSETS = "src/assets.cdn.part";
21+
} else {
22+
$IFM_ASSETS = "src/assets.part";
23+
}
24+
1125
// php source files
1226
$IFM_SRC_PHP = array(
1327
0 => "src/main.php",
1428
1 => "src/ifmarchive.php",
1529
2 => "src/htpasswd.php"
1630
);
1731

18-
// output files
19-
define( "IFM_STANDALONE", "ifm.php" );
20-
define( "IFM_STANDALONE_GZ", "build/ifm.min.php" );
21-
define( "IFM_LIB", "build/libifm.php" );
22-
2332
// get options
2433
$options = getopt( null, array( "language::" ) );
2534

2635
// process languages
27-
$vars['languages'] = isset( $options['language'] ) ? explode( ',', $options['language'] ) : array( "en" );
36+
$vars['languages'] = isset( $options['language'] ) ? explode( ',', $options['language'] ) : array( "en", "ru" );
2837
$vars['defaultlanguage'] = $vars['languages'][0];
2938
$vars['languageincludes'] = "";
3039
foreach( $vars['languages'] as $l ) {
@@ -49,6 +58,7 @@
4958
}
5059
$compiled = join( $compiled );
5160

61+
$compiled = str_replace( "IFM_ASSETS", file_get_contents( $IFM_ASSETS ), $compiled );
5262
/**
5363
* Process file includes
5464
*/
@@ -82,26 +92,27 @@
8292
foreach( $includes as $var )
8393
$compiled = str_replace( $var[0], $vars[$var[1]], $compiled );
8494

85-
/**
86-
* Build versions
87-
*/
95+
$compiled = str_replace( 'IFM_VERSION', IFM_VERSION, $compiled );
96+
97+
if (!is_dir(IFM_RELEASE_DIR)){
98+
mkdir(IFM_RELEASE_DIR);
99+
}
100+
88101
// build standalone ifm
89-
file_put_contents( IFM_STANDALONE, $compiled );
90-
file_put_contents( IFM_STANDALONE, '
102+
file_put_contents( IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') . IFM_STANDALONE, $compiled );
103+
file_put_contents( IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') . IFM_STANDALONE, '
91104
/**
92105
* start IFM
93106
*/
94107
$ifm = new IFM();
95108
$ifm->run();
96109
', FILE_APPEND );
97110

98-
/* // build compressed ifm
111+
// build compressed ifm
99112
file_put_contents(
100-
IFM_STANDALONE_GZ,
113+
IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') . IFM_STANDALONE_GZ,
101114
'<?php eval( gzdecode( file_get_contents( __FILE__, false, null, 85 ) ) ); exit(0); ?>'
102-
. gzencode( file_get_contents( "ifm.php", false, null, 5 ) )
115+
. gzencode( file_get_contents( IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') .IFM_STANDALONE, false, null, 5 ) )
103116
);
104-
*/
105-
106117
// build lib
107-
file_put_contents( IFM_LIB, $compiled );
118+
file_put_contents( IFM_RELEASE_DIR . (IFM_CDN ? 'cdn.' : 'simple.') . IFM_LIB, $compiled );

Diff for: .dockerignore renamed to docker/.dockerignore

File renamed without changes.

Diff for: Dockerfile renamed to docker/Dockerfile

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)