mirror of
https://github.com/Karaka-Management/oms-Knowledgebase.git
synced 2026-02-15 01:38:39 +00:00
update
This commit is contained in:
parent
931d5a4669
commit
bea740b0af
|
|
@ -245,7 +245,7 @@ final class ApiController extends Controller
|
||||||
$doc->category = new NullWikiCategory($request->getDataInt('category') ?? 1);
|
$doc->category = new NullWikiCategory($request->getDataInt('category') ?? 1);
|
||||||
$doc->app = new NullWikiApp($request->getDataInt('app') ?? 1);
|
$doc->app = new NullWikiApp($request->getDataInt('app') ?? 1);
|
||||||
$doc->version = $request->getDataString('version') ?? '';
|
$doc->version = $request->getDataString('version') ?? '';
|
||||||
$doc->setLanguage((string) ($request->getDataString('language') ?? $request->header->l11n->language));
|
$doc->setLanguage($request->getDataString('language') ?? $request->header->l11n->language);
|
||||||
$doc->setStatus($request->getDataInt('status') ?? WikiStatus::INACTIVE);
|
$doc->setStatus($request->getDataInt('status') ?? WikiStatus::INACTIVE);
|
||||||
|
|
||||||
if (!empty($tags = $request->getDataJson('tags'))) {
|
if (!empty($tags = $request->getDataJson('tags'))) {
|
||||||
|
|
@ -446,11 +446,11 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function updateDocFromRequest(RequestAbstract $request, WikiDoc $new) : WikiDoc
|
private function updateDocFromRequest(RequestAbstract $request, WikiDoc $new) : WikiDoc
|
||||||
{
|
{
|
||||||
$new->isVersioned = (bool) ($request->getData('versioned') ?? $new->isVersioned);
|
$new->isVersioned = $request->getDataBool('versioned') ?? $new->isVersioned;
|
||||||
$new->name = (string) ($request->getData('title') ?? $new->name);
|
$new->name = $request->getDataString('title') ?? $new->name;
|
||||||
$new->docRaw = (string) ($request->getData('plain') ?? $new->docRaw);
|
$new->docRaw = $request->getDataString('plain') ?? $new->docRaw;
|
||||||
$new->doc = Markdown::parse((string) ($request->getData('plain') ?? $new->docRaw));
|
$new->doc = Markdown::parse($request->getDataString('plain') ?? $new->docRaw);
|
||||||
$new->version = (string) ($request->getData('version') ?? $new->version);
|
$new->version = $request->getDataString('version') ?? $new->version;
|
||||||
|
|
||||||
return $new;
|
return $new;
|
||||||
}
|
}
|
||||||
|
|
@ -755,7 +755,7 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function updateAppFromRequest(RequestAbstract $request, WikiApp $new) : WikiApp
|
private function updateAppFromRequest(RequestAbstract $request, WikiApp $new) : WikiApp
|
||||||
{
|
{
|
||||||
$new->name = (string) ($request->getData('name') ?? $new->name);
|
$new->name = $request->getDataString('name') ?? $new->name;
|
||||||
|
|
||||||
return $new;
|
return $new;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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