mirror of
https://github.com/Karaka-Management/oms-OnlineResourceWatcher.git
synced 2026-02-17 00:18:41 +00:00
update
This commit is contained in:
parent
0989aaa5e7
commit
1e74be0e78
|
|
@ -191,11 +191,7 @@ final class ApiController extends Controller
|
||||||
$resource->path = $request->getDataString('path') ?? '';
|
$resource->path = $request->getDataString('path') ?? '';
|
||||||
|
|
||||||
// @todo: check if user is part of organization below AND has free resources to add!!!
|
// @todo: check if user is part of organization below AND has free resources to add!!!
|
||||||
$resource->organization = new NullAccount(
|
$resource->organization = new NullAccount($request->getDataInt('organization') ?? 1);
|
||||||
!$request->hasData('organization')
|
|
||||||
? 1
|
|
||||||
: (int) ($request->getData('organization'))
|
|
||||||
);
|
|
||||||
|
|
||||||
return $resource;
|
return $resource;
|
||||||
}
|
}
|
||||||
|
|
@ -514,9 +510,16 @@ final class ApiController extends Controller
|
||||||
|
|
||||||
$hasDifferentHash = $md5Old !== $md5New;
|
$hasDifferentHash = $md5Old !== $md5New;
|
||||||
|
|
||||||
// @todo: check if old path exists and if not, don't calculate a diff
|
|
||||||
|
|
||||||
$difference = 0;
|
$difference = 0;
|
||||||
|
|
||||||
|
// Is new file -> always different -> no content inspection required
|
||||||
|
if ($hasDifferentHash && !\is_file($oldPath)) {
|
||||||
|
$difference = 1;
|
||||||
|
|
||||||
|
$hasDifferentHash = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Different file hash -> content inspection required
|
||||||
if ($hasDifferentHash) {
|
if ($hasDifferentHash) {
|
||||||
if (\in_array($extension, self::TEXT_RENDERABLE)) {
|
if (\in_array($extension, self::TEXT_RENDERABLE)) {
|
||||||
$contentOld = \Modules\Media\Controller\ApiController::loadFileContent($oldPath, $extension);
|
$contentOld = \Modules\Media\Controller\ApiController::loadFileContent($oldPath, $extension);
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,12 @@ final class Autoloader
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @throws AutoloadException Throws this exception if the class to autoload doesn't exist. This could also be related to a wrong namespace/file path correlation.
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function defaultAutoloader(string $class) : void
|
public static function defaultAutoloader(string $class) : void
|
||||||
{
|
{
|
||||||
$class = \ltrim($class, '\\');
|
$class = \ltrim($class, '\\');
|
||||||
$class = \str_replace(['_', '\\'], '/', $class);
|
$class = \strtr($class, '_\\', '//');
|
||||||
|
|
||||||
foreach (self::$paths as $path) {
|
foreach (self::$paths as $path) {
|
||||||
$file = $path . $class . '.php';
|
$file = $path . $class . '.php';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user