Skip to content
Permalink
Browse files

Small simplifications

  • Loading branch information...
flack committed Oct 8, 2019
1 parent 478a01c commit 4640626f46686c0b6348970fb15b588dece6087c
@@ -2,7 +2,7 @@
<?php
//Some fiddling to get autoloader...
$path = dirname(dirname(dirname(__DIR__))) . '/autoload.php'; // installed as dependency
$path = dirname(__DIR__, 3) . '/autoload.php'; // installed as dependency
if (!file_exists($path)) {
$path = dirname(__DIR__) . '/vendor/autoload.php'; // installed as root package
}
@@ -12,7 +12,7 @@ if (!file_exists($path)) {
require_once $path;
if (!defined('OPENPSA_PROJECT_BASEDIR')) {
define('OPENPSA_PROJECT_BASEDIR', dirname(dirname($path)) . '/');
define('OPENPSA_PROJECT_BASEDIR', dirname($path, 2) . '/');
}
use midcom\console\application;
@@ -259,7 +259,7 @@ public function get_interface_class($path) : midcom_baseclasses_components_inter
public function path_to_snippetpath($component_name)
{
if (array_key_exists($component_name, $this->manifests)) {
return dirname(dirname($this->manifests[$component_name]->filename));
return dirname($this->manifests[$component_name]->filename, 2);
}
debug_add("Component {$component_name} is not registered", MIDCOM_LOG_CRIT);
return false;
@@ -28,7 +28,7 @@ public static function setUpBeforeClass()
self::$_attachment = self::create_class_object(midcom_db_attachment::class, $parameters);
midcom::get()->auth->request_sudo('midgard.admin.asgard');
self::$_attachment->copy_from_file(dirname(dirname(dirname(__FILE__))) . '/__files/' . self::$_filename);
self::$_attachment->copy_from_file(dirname(__FILE__, 3) . '/__files/' . self::$_filename);
midcom::get()->auth->drop_sudo();
}

0 comments on commit 4640626

Please sign in to comment.
You can’t perform that action at this time.