private function checkAutoInstall()
{
$stats = array();
// config
if (!file_exists($this->config->projects_root . '/config')) {
mkdir($this->config->projects_root . '/config', 0755);
}
if (!file_exists($this->config->projects_root . '/config/exakat.ini')) {
$version = PHP_MAJOR_VERSION . PHP_MINOR_VERSION;
$neo4j_folder = getenv('NEO4J_HOME');
if (empty($neo4j_folder)) {
$neo4j_folder = 'neo4j';
// Local Installation
} elseif (!file_exists($neo4j_folder)) {
$neo4j_folder = 'neo4j';
// Local Installation
} elseif (!file_exists($neo4j_folder . '/scripts/')) {
// This Neo4J has no 'scripts' folder and we use it! Not our database
$neo4j_folder = 'neo4j';
// Local Installation
}
$php = $this->config->php;
$ini = <<<INI
; where and which PHP executable are available
neo4j_host = '127.0.0.1';
neo4j_port = '7474';
neo4j_folder = '{$neo4j_folder}';
neo4j_login = 'admin';
neo4j_password = 'admin';
; where and which PHP executable are available
php = "{$php}"
;php52 = /path/to/php53
;php53 = /path/to/php53
;php54 = /path/to/php54
;php55 = /path/to/php55
;php56 = /path/to/php56
;php70 = /path/to/php70
;php71 = /path/to/php71
;php72 = /path/to/php72
php{$version} = {$_SERVER['_']}
; Limit the size of a project to 1000 k tokens (about 100 k LOC)
token_limit = 1000000
INI;
file_put_contents($this->config->projects_root . '/config/exakat.ini', $ini);
}
if (!file_exists($this->config->projects_root . '/config/')) {
$stats['folders']['config-folder'] = 'No';
} elseif (file_exists($this->config->projects_root . '/config/exakat.ini')) {
$stats['folders']['config-folder'] = 'Yes';
$stats['folders']['config.ini'] = 'Yes';
$ini = parse_ini_file($this->config->projects_root . '/config/exakat.ini');
} else {
$stats['folders']['config-folder'] = 'Yes';
$stats['folders']['config.ini'] = 'No';
}
// projects
if (file_exists($this->config->projects_root . '/projects/')) {
$stats['folders']['projects folder'] = 'Yes';
} else {
mkdir($this->config->projects_root . '/projects/', 0755);
if (file_exists($this->config->projects_root . '/projects/')) {
$stats['folders']['projects folder'] = 'Yes';
} else {
$stats['folders']['projects folder'] = 'No';
}
}
$stats['folders']['in'] = file_exists($this->config->projects_root . '/in/') ? 'Yes' : 'No';
$stats['folders']['out'] = file_exists($this->config->projects_root . '/out/') ? 'Yes' : 'No';
$stats['folders']['projects/test'] = file_exists($this->config->projects_root . '/projects/test/') ? 'Yes' : 'No';
$stats['folders']['projects/default'] = file_exists($this->config->projects_root . '/projects/default/') ? 'Yes' : 'No';
$stats['folders']['projects/onepage'] = file_exists($this->config->projects_root . '/projects/onepage/') ? 'Yes' : 'No';
return $stats;
}