first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-06-08 17:09:23 -04:00
commit df3a033196
17887 changed files with 8637778 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
<?php
/**
* @file classes/facades/Locale.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2000-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class Locale
*
* @brief This facade provides access to the locale
*/
namespace PKP\facades;
use Illuminate\Support\Facades\Facade;
use PKP\i18n\interfaces\LocaleInterface;
/**
* @method static string get(string $key, array $replace = [], $locale = null) Get the translation for a given key.
* @method static string choice(string $key, int $number, array $replace = [], string $locale = null) Get a translation according to an integer value.
* @method static string getLocale() Get the default locale being used.
* @method static void setLocale(string $locale) Set the default locale.
* @method static string getPrimaryLocale() Deprecated on 3.4.0, use Context::getPrimaryLocale()
* @method static void registerPath(string $path, int $priority = 0) Register a locale folder
* @method static void registerLoader(callable $fileLoader, int $priority = 0) Register a locale file loader
* @method static bool isLocaleValid(string $locale) Check if the supplied locale is valid.
* @method static \PKP\i18n\LocaleMetadata getMetadata(string $locale) Retrieves the metadata of a locale
* @method static \PKP\i18n\LocaleMetadata[] getLocales() Retrieves a list of available locales with their metadata
* @method static void installLocale(string $locale) Install support for a new locale.
* @method static void uninstallLocale(string $locale) Uninstall support for an existing locale.
* @method static bool isSupported(string $locale) Retrieves whether the given locale is in the list of supported locales
* @method static array getSupportedFormLocales() Deprecated on 3.4.0, use Context::getSupportedFormLocales()
* @method static array getSupportedLocales() Deprecated 3.4.0, use Context::getSupportedLocales()
* @method static void setMissingKeyHandler(callable $handler) Sets the handler to format missing locale keys
* @method static callable getMissingKeyHandler() Retrieves the handler to format missing locale keys
* @method static \PKP\i18n\translation\LocaleBundle getBundle(?string $locale = null, bool $useCache = true) Retrieves a locale bundle to translate texts.
* @method static string getDefaultLocale() Retrieves the default locale
* @method static \Sokil\IsoCodes\Database\Countries getCountries(?string $locale = null) Retrieve the countries
* @method static \Sokil\IsoCodes\Database\Currencies getCurrencies(?string $locale = null) Retrieve the currencies
* @method static \Sokil\IsoCodes\Database\LanguagesInterface getLanguages(?string $locale = null, bool $fromCache = true) Retrieve the languages
* @method static \Sokil\IsoCodes\Database\Scripts getScripts(?string $locale = null) Retrieve the scripts
* @method static array getFormattedDisplayNames(array $filterByLocales = null, array $locales = null, int $langLocaleStatus = LocaleMetadata::LANGUAGE_LOCALE_WITH, bool $omitLocaleCodeInDisplay = true) Get the formatted locale display names with country if same language code present multiple times
*/
class Locale extends Facade
{
/**
* Connects the facade to a container component
*/
protected static function getFacadeAccessor(): string
{
return LocaleInterface::class;
}
}
+95
View File
@@ -0,0 +1,95 @@
<?php
/**
* @file classes/facades/Repo.php
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2000-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class Repo
*
* @brief This facade provides access to all Repositories in the application.
*
* A Repo contains all the methods needed to interact with an entity, such
* as CRUD operations as well as utility methods to check status, locate items
* and perform bulk actions.
*
* A Repository is a wrapper around an entity's DAO where additional business
* logic can be performed. Use the Repository to coordinate actions across the
* application, such as firing events, writing activity logs, or refreshing
* cached data. The Repository should hand off data to the DAO to perform
* basic crud operations.
*/
namespace PKP\facades;
use PKP\announcement\Repository as AnnouncementRepository;
use PKP\author\Repository as AuthorRepository;
use PKP\category\Repository as CategoryRepository;
use PKP\decision\Repository as DecisionRepository;
use PKP\emailTemplate\Repository as EmailTemplateRepository;
use PKP\institution\Repository as InstitutionRepository;
use PKP\job\repositories\FailedJob as FailedJobRepository;
use PKP\job\repositories\Job as JobRepository;
use PKP\submissionFile\Repository as SubmissionFileRepository;
use PKP\userGroup\Repository as UserGroupRepository;
use PKP\log\event\Repository as EventLogRepository;
class Repo
{
public static function announcement(): AnnouncementRepository
{
return app(AnnouncementRepository::class);
}
public static function author(): AuthorRepository
{
return app(AuthorRepository::class);
}
public static function decision(): DecisionRepository
{
return app()->make(DecisionRepository::class);
}
public static function emailTemplate(): EmailTemplateRepository
{
return app(EmailTemplateRepository::class);
}
public static function category(): CategoryRepository
{
return app(CategoryRepository::class);
}
public static function submissionFile(): SubmissionFileRepository
{
return app(SubmissionFileRepository::class);
}
public static function job(): JobRepository
{
return app()->make(JobRepository::class);
}
public static function failedJob(): FailedJobRepository
{
return app()->make(FailedJobRepository::class);
}
public static function institution(): InstitutionRepository
{
return app()->make(InstitutionRepository::class);
}
public static function userGroup(): UserGroupRepository
{
return app(UserGroupRepository::class);
}
public static function eventLog(): EventLogRepository
{
return app(EventLogRepository::class);
}
}