Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions code.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
include "code/base/server.php";

// MOST IMPORTANT SETTING -- path to editable files ##
// Read more at http://ecoder.quintalinda.com/docs/installation.html
$code['root'] = 'D:/dev/ecoder/testingdata/'; // full path, with trailing slash ##
if (!$live) { // running locally ##
$code['root'] = 'D:/dev/ecoder/testingdata/'; // local path -- for testing ##
Expand Down Expand Up @@ -31,12 +32,12 @@
}
}

$cnf['uploadWhitelist'] = array( "php", "js", "html", "css", "txt", "htaccess", "ini" );
$cnf['uploadWhitelist'] = array( 'php', 'inc', 'js', 'html', 'css', 'txt', 'htaccess', 'ini' );
$cnf['showHidden']=false; //Show hidden files in tree?

include "code/base/io.php";
include "code/filemanipulation.php";
include "code/tree.php";
include "code/env.php";

$i=Input::_get();
$i=Input::_get();
15 changes: 13 additions & 2 deletions code/filemanipulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,18 @@ public static function getFileEditingInfo($file) {
$sfi=new SplFileInfo($file);
$content=trim(htmlspecialchars(file_get_contents($sfi->getRealPath())));
$ext=$sfi->getExtension();
$mimes=array("php"=>"application/x-httpd-php-open","js"=>"text/javascript","html"=>"text/html","css"=>"text/css","text"=>"text/plain","cpp"=>"text/x-c++src", "c"=>"text/x-csrc","py"=>"text/x-python","pl"=>"text/x-perl");
$mimes=array(
'php'=>'application/x-httpd-php-open',
'inc'=>'application/x-httpd-php-open',
'js'=>'text/javascript',
'html'=>'text/html',
'css'=>'text/css',
'text'=>'text/plain',
'cpp'=>'text/x-c++src',
'c'=>'text/x-csrc',
'py'=>'text/x-python',
'pl'=>'text/x-perl',
);
$cmMime=$mimes[$ext];
Output::add("content",$content);
Output::add("cmMime",$cmMime);
Expand Down Expand Up @@ -265,4 +276,4 @@ public static function editSave($file,$newcontent) {
return;
}
}
}
}