Skip to main content

Crate mortise_core

Crate mortise_core 

Source
Expand description

Reads a Laravel app that uses nwidart/laravel-modules from its files.

Nothing here draws or writes into the app folder. It runs PHP only when asked, with the run feature (see test_php). The entry point is read_app, which turns a folder into an AppSnapshot: plain data that an interface, a command line tool or a service can show.

Modules§

ansi
Command output with its escape sequences read into four styles.
catalog_cache
The generators read from an app (P3), kept in Mortise’s data folder.
history
The last runs of each app, kept on disk.

Structs§

AcceptedSurface
The accepted public surface of a module: the surface key of its module.json.
AllowedUse
The rule allowed use: the allowed-use object of mortise.json. nwidart/larch reads the same key.
AppEntry
An app Mortise knows.
AppSnapshot
Everything Mortise knows about an app from one read of its folder.
Argument
An argument of a generator, in the order artisan reads it.
Catalog
The generators of the package, as P3 describes them.
CheckResult
A check that ran, with how many things it looked at and how many findings it gave.
Churn
How often a folder changed.
CommandLine
A program and its arguments, started without a shell.
Component
One health indicator of the app.
Context
What plan needs to know about the app.
Coverage
Covered and total statements.
CoverageReport
The coverage report an app’s coverage figures come from.
CoverageSettings
The coverage limit and report of an app: the coverage object of mortise.json, or the flags of mortise check. A value that is set wins over the settings of the window.
Cycle
Modules that are on and use each other, directly or through others.
Difference
One difference between a later scan and the accepted surface (S5.9).
EditorError
The editor did not start. program is the first word of the command and message is the operating system’s own text.
Environment
A running copy of an app that Mortise can ask for its runtime status.
FailedMigration
The migration at which a run failed.
Figures
The figures of a scope over a range.
Filled
What the user filled in on the form of a generator.
Finding
Findings
The findings of an app and the checks they came from.
General
What applies to Mortise as a whole, not to one app.
GeneratedFile
One file of a generator run.
Generator
One generator, such as module:make-model.
GeneratorOption
An option of a generator.
GeneratorReport
The document of a generator and of module:make, for a run and for a dry run.
Info
What info says. Every part is absent when the app does not give it.
KindCount
How many files of one kind a module has.
LangModule
The translations of one module in a LangReport.
LangReport
The document of module:lang --json, and the report Mortise keeps of it.
Layout
Where the modules of an app live and how their state is kept.
Line
Requests per minute over a range.
Link
One module uses another.
LiveApp
An app folder with a worker thread that reads it.
LiveMetrics
The reads of one environment, shared between the worker and the interface.
LiveRuntime
An environment with a worker thread that asks it.
Locale
What one locale of a module lacks.
MetricsState
What the reads of an environment gave so far.
MigrationCount
The migrations that a run ran and rolled back.
MigrationRow
One migration of a ModuleStatus.
MigrationStatus
The document of module:migrate-status --json.
Module
One module of an app.
ModuleMigrations
The migration state of one module.
ModuleRuntime
What the running app reports about one module.
ModuleStatus
The migrations of one module in a MigrationStatus.
ModuleTests
The tests of one module in a TestReport. The counts are None when the module has no tests folder or the runner wrote no report.
OptionSet
The options an action takes, as S10.2 draws them.
Options
The options the user set for an action. An option that the action does not take is ignored.
Pace
How often things are asked.
PackageData
What the package said about an app, from the reads the user started.
PhpSettings
How PHP runs for one app.
Point
A rate between two neighbouring kept reads.
Progress
How far a read of an app is: how many of its PHP files are read.
Proposal
What a scan found, as a list the developer can change.
RanMigration
A migration that ran.
Rates
What one row of the table counts over the range.
Read
A read that runs.
ReadCache
The facts of the files read so far, by path.
ReadEnd
How a read ended, with its lines.
ReadOptions
What the user set for an app in Mortise, as far as reading it is concerned.
RecentRun
A run that was an action or a generator, and when it started.
Reference
One file of a module that names one class of another module.
ReportedFile
One file of a GeneratorReport.
Route
One route of the app, from mappings.
Row
One row of the table.
Rules
The rules of this version, and whether a broken one fails CI.
Run
A command that started. Its owner thread sends what happens to it.
Runs
The commands that run now, one per app at most. A clone shares the same list.
Runtime
What a running app answered.
RuntimeByModule
The components of an answer, split between the app and its modules.
RuntimeState
What a LiveRuntime holds at this moment.
ScanCounts
How far a scan is, for the lines of the scanning view.
Secrets
The secrets Mortise keeps, by app folder and environment name.
Settings
Everything Mortise keeps between runs.
SurfaceAnswer
What module:surface --json prints: the surface it stored, or why it stored nothing.
SurfaceEntry
One thing a module offers to the outside.
SurfaceProblem
One reason module:surface stored nothing.
SurfaceScan
A scan in progress. It reads the files of one module, a few at each step, so that the interface can show how far it is and stop it.
Task
One scheduled task of the app, from scheduledtasks.
TestReport
The document of module:test --json.
Todo
Work in progress on a module. It is not a finding: it changes no mark and no count.
Version
A package version as composer.lock records it.

Enums§

Action
An action that Mortise can run for a module or for all modules.
Answer
What asking an environment gave. “No answer” and “Not authorized” are Mortise’s words for the connection, not statuses of the app.
Ask
The question Mortise asks before it runs a command.
Check
What Mortise checks. The first three are the boundary rules of the app.
Credentials
What the app’s middleware asks for.
DataError
Why a run gave no document.
Detail
What exactly was found.
Detected
A runner that the folder of an app points to.
Editor
The editor that opens files.
Failure
Why a test failed. The interface writes the text; this is data only.
FileAction
What a generator means to do with a file.
FileOutcome
What a generator run did with one file.
FileResult
What a generator did with a file.
FindingState
The finding state of a module: its worst finding.
Git
The git state of an app folder.
Group
The groups of the picker, in the order of S9.1.
IndexRows
How high the rows of the module index are.
Kept
Where a secret went.
LayoutKey
A setting of config/modules.php that Mortise needs.
LiveState
What a LiveApp holds at this moment.
Manifest
What reading a module’s module.json gave.
ModuleState
Whether a module is turned on.
Motion
Whether things move.
NameRule
How Mortise checks a name the user types for an argument.
NoMetrics
Why a read of prometheus gave no metrics.
NotKept
Why a read added nothing to the store.
Plan
What happens when the user runs an action.
Ran
What a run of the history was.
Range
The time the figures of the tab cover.
ReadError
Why a folder could not be read as an app.
RowOf
What a row is about. Rows of one kind sort by name: a route by its route, then its method.
RulesError
RulesSource
Where the rules of a snapshot came from.
RunEnd
How a run ended.
RunEvent
What a run sends, in order. RunEvent::Ended comes last.
RunnerKind
The program through which PHP runs artisan for an app.
Scope
What the rows of the table are.
SettingsError
Severity
StartError
Why a command did not start.
Status
The status the actuator reports, for the app or for one component.
Stream
The pipe a line came from.
SurfaceKind
What an entry of a public surface is.
Target
What an action runs on.
TestOutcome
What came of a test of the runner of an app.
ThemeChoice
The theme of the interface.
Typed
What a name typed by hand turned out to be.
Under
The 95% figure: a bucket bound, in seconds.

Constants§

ALL_CODE
The code of the “All modules” row. No module can have it.
CHURN_DAYS
The window for “commits in 30 days”.
DEFAULT_COVERAGE_LIMIT
The coverage limit of an app until it is changed: a module under it is a warning.
METRICS_BODY_LIMIT
The most text Mortise reads from one prometheus answer, after decompression.
MODULE_MAKE
The artisan name of the generator of a new module.
OTHER
The kind of files that are in none of the generator folders.
OUTPUT_LIMIT
The most bytes of output one run keeps. A line counts as its length plus one for its newline.
RULES_FILE
The name of the rules file in the app folder.
STOP_WAIT
The longest a stop takes to end a run, from Run::stop to RunEvent::Ended: STOP_GRACE to the kill, GRACE and DETACH for the readers, and a margin for a few TICKs and, on Windows, taskkill. A stop that comes while a child that outlived the program still writes takes STOP_GRACE and DETACH.
TESTS
The kind of test files.
TEST_LIMIT
How long “Test” waits for artisan --version before it stops it.

Functions§

app_relative
A path the package printed, relative to the app folder root with / between its parts, or None when Mortise cannot place it. The package prints absolute paths with / on every platform, from the real folder of the app, so root is compared as given and with its links resolved.
ask
Asks an environment for everything Mortise reads: what is exposed, health, and info, mappings and scheduledtasks where they are exposed.
ask_metrics
Asks an environment for prometheus. Ok is the text of a 200 that is not empty.
ask_status
Asks an environment for health only, which is what the regular check does. The rest is taken over from earlier, the last full answer.
asks_again
True when Mortise asks before args run: a command with --force, a roll back or a reset that is not a dry run, and refresh, fresh and delete. Run again asks first for these too, because the question was about this very line.
autoload_failed
True when the output says that composer dump-autoload failed.
by_module
Splits the components of an answer between the app and its modules.
class_name_ok
True for a class name: one or more segments split on / or \, each an ASCII letter, then ASCII letters, digits or _. create_posts_table passes.
columns
Places modules in columns from left to right: a module sits to the left of what it uses, and the modules of a circle share a column. A circle through a module that is off counts here too.
detect
What the folder points to, the best first. Reads files only.
document
The last non-empty line of standard output, read as T.
editor_arguments
Splits a command into its program and arguments, with the file and the line put in.
failed_migration
The first migration that failed, or None when no migration line failed.
fuzzy
How well a query matches a text. Lower is better. None when it does not match.
generated_files
The files of a generator run, in output order. force is true when the run carried --force.
generator_gives_data
True when Mortise lists the files of generator by a dry run and reads the result of its run from its answer (design D5, D6): the package gives data (gives_data) and ships the generator (ships). An app’s own generator runs as before 13.4.
gives_data
True when the app’s package gives P2 to P8: a released 13.4.0 or later.
has_option
True when the artisan words hold option before a --. A word after -- is a name, such as a module named --json.
herd_config_dir
The valet folder of Herd on this platform. None on Linux.
migrate_status_args
The words of a read of the migration state of target on database: module:migrate-status Checkout --database=testing --json, or --all. An empty database is the default connection and is left out. A module name that starts with - goes after --, as crate::plan puts it.
migration_count
What the migration lines of a run say it ran and rolled back.
migration_file
The file of a migration in the default folder of the package, database/migrations, when it exists.
migrations_changed_by
The migration state that a run of the artisan words args may have changed, when it ends, whatever its exit code (design D7): a migrate, roll back, reset, refresh or fresh that is not a dry run (--pretend). Every module for --all, for a fresh or for words that name no module; else the module the words name, the second word or the word after --. None for other words.
model_flag_of
The flag of module:make-model whose call writes the file at path, for the model typed as model: policy for <Model>Policy.php. None for the model’s own file, for a migration, whose file name carries the time, and for any other file.
module_name_ok
True for a module name: an ASCII letter, then ASCII letters, digits, - or _. The package also takes a leading _; Mortise does not.
module_of
The module a class belongs to: the one whose namespace the class name starts with.
module_of_task
The module a scheduled task belongs to. The module its module tag names wins, compared without case. Without the tag, or when the tag names no module of the app, it is the module of its class, or the module that declares the command of php artisan <name>. Then a task with a description, a closure or a shell command belongs to none.
open_in_editor
Starts the editor on a file at a line. Does not wait for it to close.
plan
The plan for an action: its words, and whether Mortise asks first.
prohibited
True when the output says that the app prohibits the command. Laravel’s warn component prints the sentence after WARN.
propose_codes
Proposes a code for every name, in the order given. Each code is three capital letters or digits, differs from all the others and is never ALL_CODE.
propose_monogram
Proposes the two letter monogram of an app from the name of its folder: the initials of its first two words, or its first two letters. If that is taken, the first two letters; if that is taken too, the first letter and the next free letter.
read_app
Reads the app in root. Reads only: nothing in the folder is changed and nothing is run.
read_app_cached
Reads the app in root. Files that did not change since they were put in cache are not read again.
read_app_env
APP_ENV from the .env file of the app in root, read now. A confirmation checks it again just before a destructive command starts.
read_app_with
Reads the app in root, keeping the codes its modules already have.
read_layout
Reads the layout of the app in root from config/modules.php now, without the rest of the app. A confirmation checks it again just before a delete.
recent_runs
The distinct actions and generators of runs, which hold the latest first: at most limit, the latest first. A run is the action of Action::from_artisan or a generator of catalog, by its first word, with the module of its words. A run that is neither, whose module is not in app, or whose action the Actions tab does not list for the module as it is now (Turn off of a module that is off), is left out. Of two runs of the same action or generator on the same module, the latest stays.
refuses
True when Mortise does not run action, and its line can only be copied: reset, refresh, fresh and delete in production, and delete when the modules folder is assumed.
replace_words
The words that write left again with --force, if Mortise knows the generator that wrote it. run holds the words of the run that left the file.
reported_files
The files of a generator run from its document (P5), in write order. The folder that module:make --force deletes is not a file. A path is made relative to the app folder root, as the output lines print it, through app_relative with the modules folder modules; a path it cannot place stays as printed.
routes_by_module
How many routes each module has, most first, and how many are in no module: closures and the routes of other packages.
routes_of
The routes of one module: those whose action is a class of the module.
shipped_mark
The version that Catalog::shipped describes, when it is not the app’s own major and minor version: 13.4 for 13.5.0, 13.3 for 13.2.0 or a dev version. None when the shipped catalog is of the app’s version.
stop_asks_first
Whether a stop of the command with these artisan words asks first. A migration that stops half way can leave the database between two states.
stores_surface
True when the app’s package stores a public surface (P6): module:surface, in a released 13.5.0 or later. The version is read as for gives_data.
surface_args
The package command that stores surface as the accepted surface of module. Its standard input is AcceptedSurface::to_stdin.
tasks_of
The scheduled tasks of one module.
test_php
Runs artisan --version through runner in folder, for at most limit. It blocks, so an interface calls it off its drawing thread.
typed_name_matches
True when typed is name exactly: same case, no space trimmed. An empty text never matches.
whole_document
document, unless the last non-empty line of stdout was cut (cut): then DataError::Cut, since the start of a line may parse as a whole document.
with_dry_run
The artisan words with --dry-run --json, before a -- when the words hold one. A flag the words hold already is not added again.
with_json
The artisan words with --json, before a -- when the words hold one. Words that hold it already stay as they are.

Type Aliases§

MetricsClock
The clock of the reads: the time since any fixed start.
Secret
The secret that goes with Credentials: a token, a password or a header value.