This commit is contained in:
Bastian Allgeier
2019-01-14 10:52:45 +01:00
parent 01277f79f2
commit 8070893b64
22 changed files with 482 additions and 351 deletions

View File

@@ -1,16 +1,15 @@
# Kirby # Kirby
[![Build Status](https://travis-ci.com/k-next/kirby.svg?branch=master)](https://travis-ci.com/k-next/kirby) [![Build Status](https://travis-ci.com/k-next/kirby.svg?branch=master)](https://travis-ci.com/k-next/kirby)
[![Coverage Status](https://coveralls.io/repos/github/k-next/kirby/badge.svg?branch=master)](https://coveralls.io/github/k-next/kirby?branch=master)
This is Kirby's core application folder. Get started with one of the following repositories instead: This is Kirby's core application folder. Get started with one of the following repositories instead:
- [Starterkit](https://github.com/getkirby/starterkit) - [Starterkit](https://github.com/getkirby/starterkit)
- [Plainkit](https://github.com/getkirby/plainkit) - [Plainkit](https://github.com/getkirby/plainkit)
## Bug reports ## Bug reports
Please post all bug reports in our issue tracker: Please post all bug reports in our issue tracker:
https://github.com/getkirby/kirby/issues https://github.com/getkirby/kirby/issues
## Feature suggestions ## Feature suggestions

View File

@@ -1,7 +1,7 @@
{ {
"name": "getkirby/cms", "name": "getkirby/cms",
"description": "The Kirby 3 core", "description": "The Kirby 3 core",
"version": "3.0.0-RC-5.0", "version": "3.0.0-RC-6.0",
"license": "proprietary", "license": "proprietary",
"keywords": ["kirby", "cms", "core"], "keywords": ["kirby", "cms", "core"],
"homepage": "https://getkirby.com", "homepage": "https://getkirby.com",
@@ -24,13 +24,13 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-ctype": "*", "ext-ctype": "*",
"getkirby/composer-installer": "*", "getkirby/composer-installer": "*",
"mustangostang/spyc": "0.6.*", "mustangostang/spyc": "0.6.2",
"michelf/php-smartypants": "1.8.*", "michelf/php-smartypants": "1.8.1",
"claviska/simpleimage": "3.3.*", "claviska/simpleimage": "3.3.3",
"phpmailer/phpmailer": "6.0.*", "phpmailer/phpmailer": "6.0.6",
"filp/whoops": "2.3.*", "filp/whoops": "2.3.1",
"true/punycode": "2.1.*", "true/punycode": "2.1.1",
"zendframework/zend-escaper": "2.6.*" "zendframework/zend-escaper": "2.6.0"
}, },
"autoload": { "autoload": {
"files": ["config/helpers.php", "config/aliases.php", "config/tests.php"], "files": ["config/helpers.php", "config/aliases.php", "config/tests.php"],

2
kirby/composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "0f4c41d639d0273e46924acd006c47cc", "content-hash": "795a9baff274c8a85cd3670e696e6331",
"packages": [ "packages": [
{ {
"name": "claviska/simpleimage", "name": "claviska/simpleimage",

View File

@@ -64,6 +64,7 @@ return [
'views' => [ 'views' => [
'login' => [ 'login' => [
'isOk', 'isOk',
'isInstallable',
'isInstalled', 'isInstalled',
'title', 'title',
'translation' 'translation'

View File

@@ -53,6 +53,10 @@ return [
throw new Exception('The server is not setup correctly'); throw new Exception('The server is not setup correctly');
} }
if ($system->isInstallable() === false) {
throw new Exception('The panel cannot be installed');
}
if ($system->isInstalled() === true) { if ($system->isInstalled() === true) {
throw new Exception('The panel is already installed'); throw new Exception('The panel is already installed');
} }

View File

@@ -87,21 +87,22 @@ function css($url, $options = null)
return implode(PHP_EOL, $links); return implode(PHP_EOL, $links);
} }
$href = $url === '@auto' ? Url::toTemplateAsset('css/templates', 'css') : Url::to($url);
$attr = [
'href' => $href,
'rel' => 'stylesheet'
];
if (is_string($options) === true) { if (is_string($options) === true) {
$attr['media'] = $options; $options = ['media' => $options];
} }
if (is_array($options) === true) { $kirby = App::instance();
$attr = array_merge($options, $attr);
if ($component = $kirby->component('css')) {
$url = $component($kirby, $url, $options);
} }
$url = $url === '@auto' ? Url::toTemplateAsset('css/templates', 'css') : Url::to($url);
$attr = array_merge((array)$options, [
'href' => $url,
'rel' => 'stylesheet'
]);
return '<link ' . attr($attr) . '>'; return '<link ' . attr($attr) . '>';
} }
@@ -334,19 +335,19 @@ function js($url, $options = null)
return implode(PHP_EOL, $scripts); return implode(PHP_EOL, $scripts);
} }
$src = $url === '@auto' ? Url::toTemplateAsset('js/templates', 'js') : Url::to($url);
$attr = [
'src' => $src,
];
if (is_bool($options) === true) { if (is_bool($options) === true) {
$attr['async'] = $options; $options = ['async' => $options];
} }
if (is_array($options) === true) { $kirby = App::instance();
$attr = array_merge($options, $attr);
if ($component = $kirby->component('js')) {
$url = $component($kirby, $url, $options);
} }
$url = $url === '@auto' ? Url::toTemplateAsset('js/templates', 'js') : Url::to($url);
$attr = array_merge((array)$options, ['src' => $url]);
return '<script ' . attr($attr) . '></script>'; return '<script ' . attr($attr) . '></script>';
} }

View File

@@ -119,8 +119,17 @@ return function (App $app) {
* *
* @return Files * @return Files
*/ */
'toFiles' => function (Field $field) { 'toFiles' => function (Field $field, string $separator = 'yaml') {
return $field->parent()->files()->find(false, false, ...$field->toData('yaml')); $parent = $field->parent();
$files = new Files([]);
foreach ($field->toData($separator) as $id) {
if ($file = $parent->kirby()->file($id, $parent)) {
$files->add($file);
}
}
return $files;
}, },
/** /**
@@ -226,8 +235,8 @@ return function (App $app) {
* *
* @return Users * @return Users
*/ */
'toUsers' => function (Field $field) use ($app) { 'toUsers' => function (Field $field, string $separator = 'yaml') use ($app) {
return $app->users()->find(false, false, ...$field->toData('yaml')); return $app->users()->find(false, false, ...$field->toData($separator));
}, },
// inspectors // inspectors

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -177,16 +177,7 @@ class App
public function apply(string $name, $value) public function apply(string $name, $value)
{ {
if ($functions = $this->extension('hooks', $name)) { if ($functions = $this->extension('hooks', $name)) {
static $applied = [];
foreach ($functions as $function) { foreach ($functions as $function) {
if (in_array($function, $applied[$name] ?? []) === true) {
continue;
}
// mark the hook as triggered, to avoid endless loops
$applied[$name][] = $function;
// bind the App object to the hook // bind the App object to the hook
$value = $function->call($this, $value); $value = $function->call($this, $value);
} }

View File

@@ -387,7 +387,7 @@ trait AppPlugins
$this->extendCacheTypes([ $this->extendCacheTypes([
'apcu' => 'Kirby\Cache\ApcuCache', 'apcu' => 'Kirby\Cache\ApcuCache',
'file' => 'Kirby\Cache\FileCache', 'file' => 'Kirby\Cache\FileCache',
'memcached' => 'Kirby\Cache\MemCache', 'memcached' => 'Kirby\Cache\MemCached',
]); ]);
$this->extendComponents(include static::$root . '/config/components.php'); $this->extendComponents(include static::$root . '/config/components.php');

View File

@@ -7,6 +7,7 @@ use Kirby\Exception\InvalidArgumentException;
use Kirby\Exception\NotFoundException; use Kirby\Exception\NotFoundException;
use Kirby\Data\Data; use Kirby\Data\Data;
use Kirby\Form\Field; use Kirby\Form\Field;
use Kirby\Toolkit\A;
use Kirby\Toolkit\F; use Kirby\Toolkit\F;
use Kirby\Toolkit\I18n; use Kirby\Toolkit\I18n;
use Kirby\Toolkit\Obj; use Kirby\Toolkit\Obj;
@@ -197,10 +198,10 @@ class Blueprint
if ($mixin === null) { if ($mixin === null) {
$props = $props; $props = $props;
} elseif (is_array($mixin) === true) { } elseif (is_array($mixin) === true) {
$props = array_replace_recursive($mixin, $props); $props = A::merge($mixin, $props, A::MERGE_REPLACE);
} else { } else {
try { try {
$props = array_replace_recursive(Data::read($mixin), $props); $props = A::merge(Data::read($mixin), $props, A::MERGE_REPLACE);
} catch (Exception $e) { } catch (Exception $e) {
$props = $props; $props = $props;
} }

View File

@@ -91,11 +91,11 @@ trait HasChildren
} }
/** /**
* Return all drafts for the site * Return all drafts of the model
* *
* @return Pages * @return Pages
*/ */
public function drafts(): Pages public function drafts()
{ {
if (is_a($this->drafts, 'Kirby\Cms\Pages') === true) { if (is_a($this->drafts, 'Kirby\Cms\Pages') === true) {
return $this->drafts; return $this->drafts;

View File

@@ -191,10 +191,6 @@ class System
*/ */
public function isOk(): bool public function isOk(): bool
{ {
if ($this->isInstallable() === false) {
return false;
}
return in_array(false, array_values($this->status()), true) === false; return in_array(false, array_values($this->status()), true) === false;
} }

View File

@@ -337,6 +337,16 @@ class Database
return $this->lastError; return $this->lastError;
} }
/**
* Returns the name of the database
*
* @return string|null
*/
public function name(): ?string
{
return $this->database;
}
/** /**
* Private method to execute database queries. * Private method to execute database queries.
* This is used by the query() and execute() methods * This is used by the query() and execute() methods

View File

@@ -72,7 +72,7 @@ class Sql
return [ return [
'query' => $query, 'query' => $query,
'bindings' => [ 'bindings' => [
$databaseBinding => $this->database->database, $databaseBinding => $this->database->name(),
$tableBinding => $table, $tableBinding => $table,
] ]
]; ];
@@ -696,7 +696,7 @@ class Sql
return [ return [
'query' => 'SELECT TABLE_NAME AS name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ' . $binding, 'query' => 'SELECT TABLE_NAME AS name FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ' . $binding,
'bindings' => [ 'bindings' => [
$binding => $this->database->database $binding => $this->database->name()
] ]
]; ];
} }

View File

@@ -218,7 +218,7 @@
"installation": "Installation", "installation": "Installation",
"installation.completed": "Le Panel a été installé", "installation.completed": "Le Panel a été installé",
"installation.disabled": "The panel installer is disabled on public servers by default. Please run the installer on a local machine or enable it with the <code>panel.install</code> option.", "installation.disabled": "L'installation du Panel est désactivée par défaut sur les serveurs publics. Veuillez lancer l'installation sur un serveur local, ou activez-la avec l'option <code>panel.install</code>.",
"installation.issues.accounts": "installation.issues.accounts":
"Le dossier <code>/site/accounts</code> nexiste pas ou nest pas accessible en écriture", "Le dossier <code>/site/accounts</code> nexiste pas ou nest pas accessible en écriture",
"installation.issues.content": "installation.issues.content":

409
kirby/translations/pt_BR.json Executable file
View File

@@ -0,0 +1,409 @@
{
"add": "Adicionar",
"avatar": "Foto do perfil",
"back": "Voltar",
"cancel": "Cancelar",
"change": "Alterar",
"close": "Fechar",
"confirm": "Salvar",
"copy": "Copiar",
"create": "Criar",
"date": "Data",
"date.select": "Selecione uma data",
"day": "Dia",
"days.fri": "Sex",
"days.mon": "Seg",
"days.sat": "S\u00e1b",
"days.sun": "Dom",
"days.thu": "Qui",
"days.tue": "Ter",
"days.wed": "Qua",
"delete": "Excluir",
"dimensions": "Dimensões",
"discard": "Descartar",
"edit": "Editar",
"email": "Email",
"email.placeholder": "mail@exemplo.com",
"error.access.login": "Login inválido",
"error.access.panel": "Você não tem permissão para acessar o painel",
"error.avatar.create.fail": "A foto de perfil não pôde ser enviada",
"error.avatar.delete.fail": "A foto do perfil não pôde ser deletada",
"error.avatar.dimensions.invalid":
"Por favor, use uma foto de perfil com largura e altura menores que 3000 pixels",
"error.avatar.mime.forbidden":
"A foto de perfil deve ser um arquivo JPEG ou PNG",
"error.blueprint.notFound": "O blueprint \"{name}\" não pôde ser carregado",
"error.email.preset.notFound": "Preset de email \"{name}\" não encontrado",
"error.field.converter.invalid": "Conversor \"{converter}\" inválido",
"error.file.changeName.permission":
"Você não tem permissão para alterar o nome de \"{filename}\"",
"error.file.duplicate": "Um arquivo com o nome \"{filename}\" já existe",
"error.file.extension.forbidden":
"Extensão \"{extension}\" não permitida",
"error.file.extension.missing":
"Extensão de \"{filename}\" em falta",
"error.file.mime.differs":
"O arquivo enviado precisa ser do tipo \"{mime}\"",
"error.file.mime.forbidden": "Tipo de mídia \"{mime}\" não permitido",
"error.file.mime.missing":
"Tipo de mídia de \"{filename}\" não detectado",
"error.file.name.missing": "O nome do arquivo não pode ficar em branco",
"error.file.notFound": "Arquivo \"{filename}\" não encontrado",
"error.file.type.forbidden": "Você não tem permissão para enviar arquivos {type}",
"error.file.undefined": "Arquivo n\u00e3o encontrado",
"error.form.incomplete": "Por favor, corrija os erros do formulário…",
"error.form.notSaved": "O formulário não pôde ser salvo",
"error.page.changeSlug.permission":
"Você não tem permissão para alterar a URL de \"{slug}\"",
"error.page.changeStatus.incomplete":
"A página possui erros e não pode ser salva",
"error.page.changeStatus.permission":
"O estado desta página não pode ser alterado",
"error.page.changeStatus.toDraft.invalid":
"A página \"{slug}\" não pode ser convertida para rascunho",
"error.page.changeTemplate.invalid":
"O tema da página \"{slug}\" não pode ser alterado",
"error.page.changeTemplate.permission":
"Você não tem permissão para alterar o tema de \"{slug}\"",
"error.page.changeTitle.empty": "O título não pode ficar em branco",
"error.page.changeTitle.permission":
"Você não tem permissão para alterar o título de \"{slug}\"",
"error.page.create.permission": "Você não tem permissão para criar \"{slug}\"",
"error.page.delete": "A página \"{slug}\" não pode ser excluída",
"error.page.delete.confirm": "Por favor, digite o título da página para confirmar",
"error.page.delete.hasChildren":
"A página possui subpáginas e não pode ser excluída",
"error.page.delete.permission": "Você não tem permissão para excluir \"{slug}\"",
"error.page.draft.duplicate":
"Um rascunho de página com a URL \"{slug}\" já existe",
"error.page.duplicate":
"Uma página com a URL \"{slug}\" já existe",
"error.page.notFound": "Página\"{slug}\" não encontrada",
"error.page.num.invalid":
"Digite um número de ordenação válido. Este número não pode ser negativo.",
"error.page.slug.invalid": "Por favor, digite uma URL válida",
"error.page.sort.permission": "A página \"{slug}\" não pode ser ordenada",
"error.page.status.invalid": "Por favor, defina um estado de página válido",
"error.page.undefined": "P\u00e1gina n\u00e3o encontrada",
"error.page.update.permission": "Você não tem permissão para atualizar \"{slug}\"",
"error.section.files.max.plural":
"Você não pode adicionar mais do que {max} arquivos à seção \"{section}\"",
"error.section.files.max.singular":
"Você não pode adicionar mais do que um arquivo à seção \"{section}\"",
"error.section.files.min.plural":
"Adicione pelo menos {min} arquivos à seção \"{section}\"",
"error.section.files.min.singular":
"Adicione pelo menos um arquivo à seção \"{section}\"",
"error.section.pages.max.plural":
"Você não pode adicionar mais do que {max} página à seção \"{section}\"",
"error.section.pages.max.singular":
"Você não pode adicionar mais do que uma página à seção \"{section}\"",
"error.section.pages.min.plural":
"Adicione pelo menos {min} páginas à seção \"{section}\"",
"error.section.pages.min.singular":
"Adicione pelo menos uma página à seção \"{section}\"",
"error.section.notLoaded": "A seção \"{name}\" não pôde ser carregada",
"error.section.type.invalid": "O tipo da seção \"{type}\" não é válido",
"error.site.changeTitle.permission":
"Você não tem permissão para alterar o título do site",
"error.site.update.permission": "Você não tem permissão para atualizar o site",
"error.template.default.notFound": "O tema padrão não existe",
"error.user.changeEmail.permission":
"Você não tem permissão para alterar o email do usuário \"{name}\"",
"error.user.changeLanguage.permission":
"Você não tem permissão para alterar o idioma do usuário \"{name}\"",
"error.user.changeName.permission":
"Você não tem permissão para alterar o nome do usuário \"{name}\"",
"error.user.changePassword.permission":
"Você não tem permissão para alterar a senha do usuário \"{name}\"",
"error.user.changeRole.lastAdmin":
"O papel do último administrador não pode ser alterado",
"error.user.changeRole.permission":
"Você não tem permissão para alterar o papel do usuário \"{name}\"",
"error.user.create.permission": "Você não tem permissão para criar este usuário",
"error.user.delete": "O usuário \"{name}\" não pode ser excluído",
"error.user.delete.lastAdmin": "O último administrador não pode ser excluído",
"error.user.delete.lastUser": "O último usuário não pode ser excluído",
"error.user.delete.permission":
"Você não tem permissão para excluir o usuário \"{name}\"",
"error.user.duplicate":
"Um usuário com o email \"{email}\" já existe",
"error.user.email.invalid": "Digite um endereço de email válido",
"error.user.language.invalid": "Digite um idioma válido",
"error.user.notFound": "Usuário \"{name}\" não encontrado",
"error.user.password.invalid":
"Digite uma senha válida. Sua senha deve ter pelo menos 8 caracteres.",
"error.user.password.notSame": "As senhas não combinam",
"error.user.password.undefined": "O usuário não possui uma senha",
"error.user.role.invalid": "Digite um papel válido",
"error.user.undefined": "Usu\u00e1rio n\u00e3o encontrado",
"error.user.update.permission":
"Você não tem permissão para atualizar o usuário \"{name}\"",
"error.validation.accepted": "Por favor, confirme",
"error.validation.alpha": "Por favor, use apenas caracteres entre a-z",
"error.validation.alphanum":
"Por favor, use apenas caracteres entre a-z ou 0-9",
"error.validation.between":
"Digite um valor entre \"{min}\" e \"{max}\"",
"error.validation.boolean": "Por favor, confirme ou rejeite",
"error.validation.contains":
"Digite um valor que contenha \"{needle}\"",
"error.validation.date": "Escolha uma data válida",
"error.validation.denied": "Por favor, cancele",
"error.validation.different": "O valor deve ser diferente de \"{other}\"",
"error.validation.email": "Digite um endereço de email válido",
"error.validation.endswith": "O valor deve terminar com \"{end}\"",
"error.validation.filename": "Digite um nome de arquivo válido",
"error.validation.in": "Digite um destes valores: ({in})",
"error.validation.integer": "Digite um número inteiro válido",
"error.validation.ip": "Digite um endereço de IP válido",
"error.validation.less": "Digite um valor menor que {max}",
"error.validation.match": "O valor não combina com o padrão esperado",
"error.validation.max": "Digite um valor igual ou menor que {max}",
"error.validation.maxlength":
"Digite um valor curto. (no máximo {max} caracteres)",
"error.validation.maxwords": "Digite menos que {max} palavra(s)",
"error.validation.min": "Digite um valor igual ou maior que {min}",
"error.validation.minlength":
"Digite um valor maior. (no mínimo {min} caracteres)",
"error.validation.minwords": "Digite ao menos {min} palavra(s)",
"error.validation.more": "Digite um valor maior que {min}",
"error.validation.notcontains":
"Digite um valor que não contenha \"{needle}\"",
"error.validation.notin":
"Não digite nenhum destes valores: ({notIn})",
"error.validation.option": "Escolha uma opção válida",
"error.validation.num": "Digite um número válido",
"error.validation.required": "Digite algo",
"error.validation.same": "Por favor, digite \"{other}\"",
"error.validation.size": "O tamanho do valor deve ser \"{size}\"",
"error.validation.startswith": "O valor deve começar com \"{start}\"",
"error.validation.time": "Digite uma hora válida",
"error.validation.url": "Digite uma URL válida",
"field.files.empty": "Nenhum arquivo selecionado",
"field.pages.empty": "Nenhuma página selecionada",
"field.structure.delete.confirm": "Deseja realmente excluir este registro?",
"field.structure.empty": "Nenhum registro",
"field.users.empty": "Nenhum usuário selecionado",
"file.delete.confirm":
"Deseja realmente excluir <br> <strong>{filename}</strong>?",
"files": "Arquivos",
"files.empty": "Nenhum arquivo",
"hour": "Hora",
"insert": "Inserir",
"install": "Instalar",
"installation": "Instalação",
"installation.completed": "Painel instalado com sucesso",
"installation.disabled": "O instalador do painel está desabilitado em servidores públicos por padrão. Por favor, execute o instalador em uma máquina local ou habilite a opção <code>panel.install</code>.",
"installation.issues.accounts":
"A pasta <code>/site/accounts</code> não existe ou não possui permissão de escrita",
"installation.issues.content":
"A pasta <code>/content</code> não existe ou não possui permissão de escrita",
"installation.issues.curl": "A extensão <code>CURL</code> é necessária",
"installation.issues.headline": "O painel não pôde ser instalado",
"installation.issues.mbstring":
"A extensão <code>MB String</code> é necessária",
"installation.issues.media":
"A pasta <code>/media</code> não existe ou não possui permissão de escrita",
"installation.issues.php": "Certifique-se que você está usando o <code>PHP 7+</code>",
"installation.issues.server":
"Kirby necessita do <code>Apache</code>, <code>Nginx</code> ou <code>Caddy</code>",
"installation.issues.sessions": "A pasta <code>/site/sessions</code> não existe ou não possui permissão de escrita",
"language": "Idioma",
"language.code": "Código",
"language.convert": "Tornar padrão",
"language.convert.confirm":
"<p>Deseja realmente converter <strong>{name}</strong> para o idioma padrão? Esta ação não poderá ser revertida.</p><p>Se <strong>{name}</strong> tiver conteúdo não traduzido, partes do seu site poderão ficar sem conteúdo.</p>",
"language.create": "Adicionar novo idioma",
"language.delete.confirm":
"Deseja realmente excluir o idioma <strong>{name}</strong> incluíndo todas as traduções. Esta ação não poderá ser revertida!",
"language.deleted": "Idioma excluído",
"language.direction": "Direção de leitura",
"language.direction.ltr": "Esquerda para direita",
"language.direction.rtl": "Direita para esquerda",
"language.locale": "String de localização do PHP",
"language.name": "Nome",
"language.updated": "Idioma atualizado",
"languages": "Idiomas",
"languages.default": "Idioma padrão",
"languages.empty": "Nenhum idioma",
"languages.secondary": "Idiomas secundários",
"languages.secondary.empty": "Nenhum idioma secundário",
"license": "Licen\u00e7a do Kirby ",
"license.buy": "Comprar uma licença",
"license.register": "Registrar",
"license.register.help":
"Você recebeu o código da sua licença por email após a compra. Por favor, copie e cole-o para completar o registro.",
"license.register.label": "Por favor, digite o código da sua licença",
"license.register.success": "Obrigado por apoiar o Kirby",
"license.unregistered": "Esta é uma demonstração não registrada do Kirby",
"link": "Link",
"link.text": "Texto do link",
"loading": "Carregando",
"login": "Entrar",
"login.remember": "Manter-me conectado",
"logout": "Sair",
"menu": "Menu",
"meridiem": "AM/PM",
"mime": "Tipo de mídia",
"minutes": "Minutos",
"month": "Mês",
"months.april": "Abril",
"months.august": "Agosto",
"months.december": "Dezembro",
"months.february": "Fevereiro",
"months.january": "Janeiro",
"months.july": "Julho",
"months.june": "Junho",
"months.march": "Mar\u00e7o",
"months.may": "Maio",
"months.november": "Novembro",
"months.october": "Outubro",
"months.september": "Setembro",
"more": "Mais",
"name": "Nome",
"next": "Próximo",
"open": "Abrir",
"options": "Opções",
"orientation": "Orientação",
"orientation.landscape": "Paisagem",
"orientation.portrait": "Retrato",
"orientation.square": "Quadrado",
"page.changeSlug": "Alterar URL",
"page.changeSlug.fromTitle": "Criar a partir do t\u00edtulo",
"page.changeStatus": "Alterar estado",
"page.changeStatus.position": "Selecione uma posição",
"page.changeStatus.select": "Selecione um novo estado",
"page.changeTemplate": "Alterar tema",
"page.delete.confirm":
"Deseja realmente excluir <strong>{title}</strong>?",
"page.delete.confirm.subpages":
"<strong>Esta página possui subpáginas</strong>. <br>Todas as subpáginas serão excluídas também.",
"page.delete.confirm.title": "Digite o título da página para confirmar",
"page.draft.create": "Criar rascunho",
"page.status": "Estado",
"page.status.draft": "Rascunho",
"page.status.draft.description":
"A página está em modo de rascunho e é visível somente para editores",
"page.status.listed": "Pública",
"page.status.listed.description": "A página é pública para todos",
"page.status.unlisted": "Não listadas",
"page.status.unlisted.description": "Esta página é acessível somente através da URL",
"pages": "Páginas",
"pages.empty": "Nenhuma página",
"pages.status.draft": "Rascunhos",
"pages.status.listed": "Publicadas",
"pages.status.unlisted": "Não listadas",
"password": "Senha",
"pixel": "Pixel",
"prev": "Anterior",
"remove": "Remover",
"rename": "Renomear",
"replace": "Substituir",
"retry": "Tentar novamente",
"revert": "Descartar",
"role": "Papel",
"role.all": "Todos",
"role.empty": "Não há usuários com este papel",
"role.description.placeholder": "Sem descrição",
"save": "Salvar",
"search": "Buscar",
"select": "Selecionar",
"settings": "Configurações",
"size": "Tamanho",
"slug": "URL",
"sort": "Ordenar",
"title": "Título",
"template": "Tema",
"today": "Hoje",
"toolbar.button.code": "Código",
"toolbar.button.bold": "Negrito",
"toolbar.button.email": "Email",
"toolbar.button.headings": "Títulos",
"toolbar.button.heading.1": "Título 1",
"toolbar.button.heading.2": "Título 2",
"toolbar.button.heading.3": "Título 3",
"toolbar.button.italic": "Itálico",
"toolbar.button.link": "Link",
"toolbar.button.ol": "Lista ordenada",
"toolbar.button.ul": "Lista não-ordenada",
"translation.author": "Kirby Team",
"translation.direction": "ltr",
"translation.name": "Português (Brasileiro)",
"upload": "Enviar",
"upload.errors": "Erro",
"upload.progress": "Enviando…",
"url": "Url",
"url.placeholder": "https://exemplo.com",
"user": "Usuário",
"user.blueprint":
"Você pode definir seções e campos de formulário adicionais para este papel de usuário em <strong>/site/blueprints/users/{role}.yml</strong>",
"user.changeEmail": "Alterar email",
"user.changeLanguage": "Alterar idioma",
"user.changeName": "Renomear este usuário",
"user.changePassword": "Alterar senha",
"user.changePassword.new": "Nova senha",
"user.changePassword.new.confirm": "Confirme a nova senha…",
"user.changeRole": "Alterar papel",
"user.changeRole.select": "Selecione um novo papel",
"user.create": "Adicionar novo usuário",
"user.delete": "Excluir este usuário",
"user.delete.confirm":
"Deseja realmente excluir <br><strong>{email}</strong>?",
"version": "Vers\u00e3o do Kirby",
"view.account": "Sua conta",
"view.installation": "Instala\u00e7\u00e3o",
"view.settings": "Configurações",
"view.site": "Site",
"view.users": "Usu\u00e1rios",
"welcome": "Bem-vindo",
"year": "Ano"
}

View File

@@ -218,7 +218,7 @@
"installation": "Installation", "installation": "Installation",
"installation.completed": "Panelen har installerats", "installation.completed": "Panelen har installerats",
"installation.disabled": "The panel installer is disabled on public servers by default. Please run the installer on a local machine or enable it with the <code>panel.install</code> option.", "installation.disabled": "Installeraren för panelen är som standard inaktiverad på offentliga servrar. Kör installeraren på en lokal maskin eller aktivera den med alternativet <code>panel.install</code>.",
"installation.issues.accounts": "installation.issues.accounts":
"Mappen <code>/site/accounts</code> finns inte eller är inte skrivbar", "Mappen <code>/site/accounts</code> finns inte eller är inte skrivbar",
"installation.issues.content": "installation.issues.content":
@@ -232,7 +232,7 @@
"installation.issues.php": "Se till att du använder <code>PHP 7+</code>", "installation.issues.php": "Se till att du använder <code>PHP 7+</code>",
"installation.issues.server": "installation.issues.server":
"Kirby kräver <code>Apache</code>, <code>Nginx</code> eller <code>Caddy</code>", "Kirby kräver <code>Apache</code>, <code>Nginx</code> eller <code>Caddy</code>",
"installation.issues.sessions": "The <code>/site/sessions</code> folder does not exist or is not writable", "installation.issues.sessions": "Mappen <code>/site/sessions</code> finns inte eller är inte skrivbar",
"language": "Spr\u00e5k", "language": "Spr\u00e5k",
"language.code": "Kod", "language.code": "Kod",

View File

@@ -218,7 +218,7 @@
"installation": "Kurulum", "installation": "Kurulum",
"installation.completed": "Panel kuruldu", "installation.completed": "Panel kuruldu",
"installation.disabled": "The panel installer is disabled on public servers by default. Please run the installer on a local machine or enable it with the <code>panel.install</code> option.", "installation.disabled": "Panel yükleyici, herkese açık sunucularda varsayılan olarak devre dışıdır. Lütfen yükleyiciyi yerel bir makinede çalıştırın veya <code>panel.install</code> seçeneğiyle etkinleştirin.",
"installation.issues.accounts": "installation.issues.accounts":
"<code>/site/accounts</code> klasörü yok yada yazılabilir değil", "<code>/site/accounts</code> klasörü yok yada yazılabilir değil",
"installation.issues.content": "installation.issues.content":

View File

@@ -1,144 +0,0 @@
<?php
namespace Psr\Log\Test;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
/**
* Provides a base test class for ensuring compliance with the LoggerInterface.
*
* Implementors can extend the class and implement abstract methods to run this
* as part of their test suite.
*/
abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
{
/**
* @return LoggerInterface
*/
abstract public function getLogger();
/**
* This must return the log messages in order.
*
* The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>".
*
* Example ->error('Foo') would yield "error Foo".
*
* @return string[]
*/
abstract public function getLogs();
public function testImplements()
{
$this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
}
/**
* @dataProvider provideLevelsAndMessages
*/
public function testLogsAtAllLevels($level, $message)
{
$logger = $this->getLogger();
$logger->{$level}($message, array('user' => 'Bob'));
$logger->log($level, $message, array('user' => 'Bob'));
$expected = array(
$level.' message of level '.$level.' with context: Bob',
$level.' message of level '.$level.' with context: Bob',
);
$this->assertEquals($expected, $this->getLogs());
}
public function provideLevelsAndMessages()
{
return array(
LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
);
}
/**
* @expectedException \Psr\Log\InvalidArgumentException
*/
public function testThrowsOnInvalidLevel()
{
$logger = $this->getLogger();
$logger->log('invalid level', 'Foo');
}
public function testContextReplacement()
{
$logger = $this->getLogger();
$logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
$expected = array('info {Message {nothing} Bob Bar a}');
$this->assertEquals($expected, $this->getLogs());
}
public function testObjectCastToString()
{
if (method_exists($this, 'createPartialMock')) {
$dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString'));
} else {
$dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
}
$dummy->expects($this->once())
->method('__toString')
->will($this->returnValue('DUMMY'));
$this->getLogger()->warning($dummy);
$expected = array('warning DUMMY');
$this->assertEquals($expected, $this->getLogs());
}
public function testContextCanContainAnything()
{
$closed = fopen('php://memory', 'r');
fclose($closed);
$context = array(
'bool' => true,
'null' => null,
'string' => 'Foo',
'int' => 0,
'float' => 0.5,
'nested' => array('with object' => new DummyTest),
'object' => new \DateTime,
'resource' => fopen('php://memory', 'r'),
'closed' => $closed,
);
$this->getLogger()->warning('Crazy context data', $context);
$expected = array('warning Crazy context data');
$this->assertEquals($expected, $this->getLogs());
}
public function testContextExceptionKeyCanBeExceptionOrOtherValues()
{
$logger = $this->getLogger();
$logger->warning('Random message', array('exception' => 'oops'));
$logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
$expected = array(
'warning Random message',
'critical Uncaught Exception!'
);
$this->assertEquals($expected, $this->getLogs());
}
}
class DummyTest
{
public function __toString()
{
}
}

View File

@@ -1,146 +0,0 @@
<?php
namespace Psr\Log\Test;
use Psr\Log\AbstractLogger;
/**
* Used for testing purposes.
*
* It records all records and gives you access to them for verification.
*
* @method bool hasEmergency($record)
* @method bool hasAlert($record)
* @method bool hasCritical($record)
* @method bool hasError($record)
* @method bool hasWarning($record)
* @method bool hasNotice($record)
* @method bool hasInfo($record)
* @method bool hasDebug($record)
*
* @method bool hasEmergencyRecords()
* @method bool hasAlertRecords()
* @method bool hasCriticalRecords()
* @method bool hasErrorRecords()
* @method bool hasWarningRecords()
* @method bool hasNoticeRecords()
* @method bool hasInfoRecords()
* @method bool hasDebugRecords()
*
* @method bool hasEmergencyThatContains($message)
* @method bool hasAlertThatContains($message)
* @method bool hasCriticalThatContains($message)
* @method bool hasErrorThatContains($message)
* @method bool hasWarningThatContains($message)
* @method bool hasNoticeThatContains($message)
* @method bool hasInfoThatContains($message)
* @method bool hasDebugThatContains($message)
*
* @method bool hasEmergencyThatMatches($message)
* @method bool hasAlertThatMatches($message)
* @method bool hasCriticalThatMatches($message)
* @method bool hasErrorThatMatches($message)
* @method bool hasWarningThatMatches($message)
* @method bool hasNoticeThatMatches($message)
* @method bool hasInfoThatMatches($message)
* @method bool hasDebugThatMatches($message)
*
* @method bool hasEmergencyThatPasses($message)
* @method bool hasAlertThatPasses($message)
* @method bool hasCriticalThatPasses($message)
* @method bool hasErrorThatPasses($message)
* @method bool hasWarningThatPasses($message)
* @method bool hasNoticeThatPasses($message)
* @method bool hasInfoThatPasses($message)
* @method bool hasDebugThatPasses($message)
*/
class TestLogger extends AbstractLogger
{
/**
* @var array
*/
public $records = [];
public $recordsByLevel = [];
/**
* @inheritdoc
*/
public function log($level, $message, array $context = [])
{
$record = [
'level' => $level,
'message' => $message,
'context' => $context,
];
$this->recordsByLevel[$record['level']][] = $record;
$this->records[] = $record;
}
public function hasRecords($level)
{
return isset($this->recordsByLevel[$level]);
}
public function hasRecord($record, $level)
{
if (is_string($record)) {
$record = ['message' => $record];
}
return $this->hasRecordThatPasses(function ($rec) use ($record) {
if ($rec['message'] !== $record['message']) {
return false;
}
if (isset($record['context']) && $rec['context'] !== $record['context']) {
return false;
}
return true;
}, $level);
}
public function hasRecordThatContains($message, $level)
{
return $this->hasRecordThatPasses(function ($rec) use ($message) {
return strpos($rec['message'], $message) !== false;
}, $level);
}
public function hasRecordThatMatches($regex, $level)
{
return $this->hasRecordThatPasses(function ($rec) use ($regex) {
return preg_match($regex, $rec['message']) > 0;
}, $level);
}
public function hasRecordThatPasses(callable $predicate, $level)
{
if (!isset($this->recordsByLevel[$level])) {
return false;
}
foreach ($this->recordsByLevel[$level] as $i => $rec) {
if (call_user_func($predicate, $rec, $i)) {
return true;
}
}
return false;
}
public function __call($method, $args)
{
if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
$genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
$level = strtolower($matches[2]);
if (method_exists($this, $genericMethod)) {
$args[] = $level;
return call_user_func_array([$this, $genericMethod], $args);
}
}
throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
}
public function reset()
{
$this->records = [];
}
}