Skip to content

Commit

Permalink
fixed path for autoloading nettools files and misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
n0nag0n committed Jan 15, 2021
1 parent 6e48a1f commit 073c6f7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
10 changes: 8 additions & 2 deletions controllers/Manage_Composer_Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
class Manage_Composer_Controller extends Base_Controller {

public function indexAction(\Base $fw): void {
require(__DIR__.'/../vendor/net-tools/composer-interface/src/autoload.php');
$PROJECT = array_pop(explode(DIRECTORY_SEPARATOR, rtrim($fw->PROJECT_BASE_DIR, DIRECTORY_SEPARATOR)));
foreach([ __DIR__.'/../vendor/', getenv('HOME').'/.config/composer/vendor/' ] as $dir_path) {
$final_path = $dir_path.'net-tools/composer-interface/src/autoload.php';
if(file_exists($final_path)) {
require($final_path);
break;
}
}

$root = rtrim($fw->PROJECT_BASE_DIR, '/');
try
{
Expand Down
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// local and global installation paths
foreach([ __DIR__.'/../vendor/autoload.php', __DIR__.'/../../../autoload.php' ] as $path) {
foreach([ __DIR__.'/../vendor/autoload.php', __DIR__.'/../../../autoload.php', getenv('HOME').'/.config/composer/vendor/autoload.php' ] as $path) {
if(file_exists($path)) {
require($path);
}
Expand Down
11 changes: 10 additions & 1 deletion templates/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
$fw->set('DB', new \DB\Jig(PROJECT_DEVTOOLS_DATA_DIR, \DB\Jig::FORMAT_JSON ), 6000);
</check><check if="{{ @cnf_mysql_name }}">
// Setup MySQL DB Connection
$fw->set('DB', new DB\SQL('mysql:host='.$fw->get('mysql.host').';port='.$fw->get('mysql.port').';dbname='.$fw->get('mysql.database').';charset='.$fw->get('mysql.charset'), $fw->get('mysql.username'),$fw->get('mysql.password')
$fw->set('DB', new DB\SQL(
'mysql:host='.$fw->get('mysql.host').';port='.$fw->get('mysql.port').';dbname='.$fw->get('mysql.database').';charset='.$fw->get('mysql.charset'),
$fw->get('mysql.username'),
$fw->get('mysql.password',
[
PDO::ATTR_EMULATE_PREPARES => false,
PDO::ATTR_STRINGIFY_FETCHES => false,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
]
)
));
</check><check if="{{ @cnf_sqlite }}">
// Setup SQLite DB Connection
Expand Down
2 changes: 1 addition & 1 deletion ui/init_environment/directory_setup.htm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h1>Directory Setup</h1>
<div class="input-group-prepend">
<span class="input-group-text">{{ @PROJECT_BASE_DIR }}</span>
</div>
<input type="text" class="form-control" id="temp" name="temp" value="{{ @config.temp ?: 'app/temp/' }}">
<input type="text" class="form-control" id="temp" name="temp" value="{{ @config.temp ?: 'app/tmp/' }}">
</div>
<small class="form-text text-muted">These are usually cached files from Fat-Free.</small>
</div>
Expand Down

0 comments on commit 073c6f7

Please sign in to comment.