diff --git a/.gitattributes b/.gitattributes
index ecd6b17..9b00969 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,9 +1,9 @@
-ifm.php -diff
-ifm.min.php -diff
-build/* -diff
+dist/ifm.php -diff
+dist/ifm.min.php -diff
+dist/* -diff
src/includes/ace.js -diff
-src export-ignore
-compiler.php export-ignore
-.gitignore export-ignore
-.gitattributes export-ignore
+src export-ignore
+compiler.php export-ignore
+.gitignore export-ignore
+.gitattributes export-ignore
diff --git a/.gitignore b/.gitignore
index 75a763a..f3b0a71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@
*.zip
misc
src/includes/ace/*
+sftp-config.json
+dist/*
\ No newline at end of file
diff --git a/build/libifm.php b/build/libifm.php
deleted file mode 100644
index 6bb5455..0000000
--- a/build/libifm.php
+++ /dev/null
@@ -1,4686 +0,0 @@
- 0,
- "auth_source" => 'inline;admin:$2y$10$0Bnm5L4wKFHRxJgNq.oZv.v7yXhkJZQvinJYR2p6X1zPvzyDRUVRC',
- "root_dir" => "",
- "root_public_url" => "",
- "tmp_dir" => "",
- "timezone" => "",
- "forbiddenChars" => array(),
- "language" => "en",
- "selfoverwrite" => 0,
-
- // api controls
- "ajaxrequest" => 1,
- "chmod" => 1,
- "copymove" => 1,
- "createdir" => 1,
- "createfile" => 1,
- "edit" => 1,
- "delete" => 1,
- "download" => 1,
- "extract" => 1,
- "upload" => 1,
- "remoteupload" => 1,
- "rename" => 1,
- "zipnload" => 1,
- "createarchive" => 1,
- "search" => 1,
-
- // gui controls
- "showlastmodified" => 0,
- "showfilesize" => 1,
- "showowner" => 1,
- "showgroup" => 1,
- "showpermissions" => 2,
- "showhtdocs" => 0,
- "showhiddenfiles" => 1,
- "showpath" => 0,
- "contextmenu" => 1,
- "disable_mime_detection" => 0,
- "showrefresh" => 1,
- "forceproxy" => 0
- );
-
- private $config = array();
- private $templates = array();
- private $i18n = array();
- public $mode = "";
-
- public function __construct( $config=array() ) {
-
- // load the default config
- $this->config = $this->defaultconfig;
-
- // load config from environment variables
- $this->config['auth'] = getenv('IFM_AUTH') !== false ? intval( getenv('IFM_AUTH') ) : $this->config['auth'] ;
- $this->config['auth_source'] = getenv('IFM_AUTH_SOURCE') !== false ? getenv('IFM_AUTH_SOURCE') : $this->config['auth_source'] ;
- $this->config['root_dir'] = getenv('IFM_ROOT_DIR') !== false ? getenv('IFM_ROOT_DIR') : $this->config['root_dir'] ;
- $this->config['root_public_url'] = getenv('IFM_ROOT_PUBLIC_URL') !== false ? getenv('IFM_ROOT_PUBLIC_URL') : $this->config['root_public_url'] ;
- $this->config['tmp_dir'] = getenv('IFM_TMP_DIR') !== false ? getenv('IFM_TMP_DIR') : $this->config['tmp_dir'] ;
- $this->config['timezone'] = getenv('IFM_TIMEZONE') !== false ? getenv('IFM_TIMEZONE') : $this->config['timezone'] ;
- $this->config['forbiddenChars'] = getenv('IFM_FORBIDDENCHARS') !== false ? str_split( getenv('IFM_FORBIDDENCHARS') ) : $this->config['forbiddenChars'] ;
- $this->config['language'] = getenv('IFM_LANGUAGE') !== false ? getenv('IFM_LANGUAGE') : $this->config['language'] ;
- $this->config['selfoverwrite'] = getenv('IFM_SELFOVERWRITE') !== false ? getenv('IFM_SELFOVERWRITE') : $this->config['selfoverwrite'] ;
- $this->config['ajaxrequest'] = getenv('IFM_API_AJAXREQUEST') !== false ? intval( getenv('IFM_API_AJAXREQUEST') ) : $this->config['ajaxrequest'] ;
- $this->config['chmod'] = getenv('IFM_API_CHMOD') !== false ? intval( getenv('IFM_API_CHMOD') ) : $this->config['chmod'] ;
- $this->config['copymove'] = getenv('IFM_API_COPYMOVE') !== false ? intval( getenv('IFM_API_COPYMOVE') ) : $this->config['copymove'] ;
- $this->config['createdir'] = getenv('IFM_API_CREATEDIR') !== false ? intval( getenv('IFM_API_CREATEDIR') ) : $this->config['createdir'] ;
- $this->config['createfile'] = getenv('IFM_API_CREATEFILE') !== false ? intval( getenv('IFM_API_CREATEFILE') ) : $this->config['createfile'] ;
- $this->config['edit'] = getenv('IFM_API_EDIT') !== false ? intval( getenv('IFM_API_EDIT') ) : $this->config['edit'] ;
- $this->config['delete'] = getenv('IFM_API_DELETE') !== false ? intval( getenv('IFM_API_DELETE') ) : $this->config['delete'] ;
- $this->config['download'] = getenv('IFM_API_DOWNLOAD') !== false ? intval( getenv('IFM_API_DOWNLOAD') ) : $this->config['download'] ;
- $this->config['extract'] = getenv('IFM_API_EXTRACT') !== false ? intval( getenv('IFM_API_EXTRACT') ) : $this->config['extract'] ;
- $this->config['upload'] = getenv('IFM_API_UPLOAD') !== false ? intval( getenv('IFM_API_UPLOAD') ) : $this->config['upload'] ;
- $this->config['remoteupload'] = getenv('IFM_API_REMOTEUPLOAD') !== false ? intval( getenv('IFM_API_REMOTEUPLOAD') ) : $this->config['remoteupload'] ;
- $this->config['rename'] = getenv('IFM_API_RENAME') !== false ? intval( getenv('IFM_API_RENAME') ) : $this->config['rename'] ;
- $this->config['zipnload'] = getenv('IFM_API_ZIPNLOAD') !== false ? intval( getenv('IFM_API_ZIPNLOAD') ) : $this->config['zipnload'] ;
- $this->config['createarchive'] = getenv('IFM_API_CREATEARCHIVE') !== false ? intval( getenv('IFM_API_CREATEARCHIVE') ) : $this->config['createarchive'] ;
- $this->config['showlastmodified'] = getenv('IFM_GUI_SHOWLASTMODIFIED') !== false ? intval( getenv('IFM_GUI_SHOWLASTMODIFIED') ) : $this->config['showlastmodified'] ;
- $this->config['showfilesize'] = getenv('IFM_GUI_SHOWFILESIZE') !== false ? intval( getenv('IFM_GUI_SHOWFILESIZE') ) : $this->config['showfilesize'] ;
- $this->config['showowner'] = getenv('IFM_GUI_SHOWOWNER') !== false ? intval( getenv('IFM_GUI_SHOWOWNER') ) : $this->config['showowner'] ;
- $this->config['showgroup'] = getenv('IFM_GUI_SHOWGROUP') !== false ? intval( getenv('IFM_GUI_SHOWGROUP') ) : $this->config['showgroup'] ;
- $this->config['showpermissions'] = getenv('IFM_GUI_SHOWPERMISSIONS') !== false ? intval( getenv('IFM_GUI_SHOWPERMISSIONS') ) : $this->config['showpermissions'] ;
- $this->config['showhtdocs'] = getenv('IFM_GUI_SHOWHTDOCS') !== false ? intval( getenv('IFM_GUI_SHOWHTDOCS') ) : $this->config['showhtdocs'] ;
- $this->config['showhiddenfiles'] = getenv('IFM_GUI_SHOWHIDDENFILES') !== false ? intval( getenv('IFM_GUI_SHOWHIDDENFILES') ) : $this->config['showhiddenfiles'] ;
- $this->config['showpath'] = getenv('IFM_GUI_SHOWPATH') !== false ? intval( getenv('IFM_GUI_SHOWPATH') ) : $this->config['showpath'] ;
- $this->config['contextmenu'] = getenv('IFM_GUI_CONTEXTMENU') !== false ? intval( getenv('IFM_GUI_CONTEXTMENU') ) : $this->config['contextmenu'] ;
- $this->config['search'] = getenv('IFM_API_SEARCH') !== false ? intval( getenv('IFM_API_SEARCH') ) : $this->config['search'] ;
- $this->config['showrefresh'] = getenv('IFM_GUI_REFRESH') !== false ? intval( getenv('IFM_GUI_REFRESH') ) : $this->config['showrefresh'] ;
- $this->config['forceproxy'] = getenv('IFM_GUI_FORCEPROXY') !== false ? intval( getenv('IFM_GUI_FORCEPROXY') ) : $this->config['forceproxy'] ;
-
- // optional settings
- if( getenv('IFM_SESSION_LIFETIME') !== false )
- $this->config['session_lifetime'] = getenv('IFM_SESSION_LIFETIME');
- if( getenv('IFM_FORCE_SESSION_LIFETIME') !== false )
- $this->config['session_lifetime'] = getenv('IFM_FORCE_SESSION_LIFETIME');
-
- // load config from passed array
- $this->config = array_merge( $this->config, $config );
-
- // get list of ace includes
- $this->config['ace_includes'] = <<<'f00bar'
-
-f00bar;
-
- // templates
- $templates = array();
- $templates['app'] = <<<'f00bar'
-
-
- {{#fixtop}}
- |
- {{/fixtop}}
- {{^fixtop}}
- |
- {{/fixtop}}
-
-
-
- {{linkname}}
-
- |
- {{#config.download}}
-
-
- |
- {{/config.download}}
- {{#config.showlastmodified}}
- {{lastmodified_hr}} |
- {{/config.showlastmodified}}
- {{#config.showfilesize}}
- {{size}} |
- {{/config.showfilesize}}
- {{#config.showpermissions}}
-
-
- |
- {{/config.showpermissions}}
- {{#config.showowner}}
-
- {{owner}}
- |
- {{/config.showowner}}
- {{#config.showgroup}}
-
- {{group}}
- |
- {{/config.showgroup}}
-
- {{#button}}
-
-
-
- {{/button}}
- |
-
-{{/items}}
-
-f00bar;
- $templates['footer'] = <<<'f00bar'
-
-
-f00bar;
- $templates['task'] = <<<'f00bar'
-