LGV_TZ_Lookup 1.4.2
Time zone lookup for PHP applications and HTTP clients
Loading...
Searching...
No Matches
deploy.php File Reference

This installs a tested HTTP timezone service, with private configuration and a default server secret. More...

Go to the source code of this file.

Functions

 deployAsk ($terminal, string $label, string $default='', bool $hidden=false)
 This asks for a setting, with a default and optional password hiding.
 deployCleanup (string $work)
 This removes installer downloads, and rolls back only installation-owned resources on failure. A completed deployment retains its database and files. The guard token authorizes removal of an incomplete timezones table; an unrelated table or installation is never adopted. Failed cleanup retains recovery state.
 deployConnection (array $settings, bool $administrative=false)
 This opens the configured application or administrative database.
 deployCopyTree (string $source, string $destination)
 Copy an installation for staging, preserving additional files, permissions, and symbolic links.
 deployDirectoryIsEmpty (string $path)
 Check an empty directory without following links. Hidden files also count as contents.
 deployEmptyDirectories (array $destinations)
 Record existing empty destinations so fresh installation can publish into them and roll back exactly.
 deployEmptyDirectoryCleanup (array $state)
 Restore the original empty directories on failure, or remove their empty backups after success.
 deployEndpointCode (string $private, string $relativePackage, string $licenseHeader)
 Generate the public entry point with the chosen private configuration and package paths.
 deployExistingInstallation (string $private, string $public, array $settings)
 Verify an existing installer-owned pair of directories and its unchanged database configuration.
 deployIdentifier (string $name, string $driver)
 This quotes a database identifier for the selected backend.
 deployLock (PDO $connection)
 This prevents two installers from loading the same database concurrently.
 deployPublishDirectories (array $state)
 Publish fresh staged code, retaining original empty directories until installation is committed.
 deployRefresh (string $work, array $settings, string $private, string $public, int $group, string $serviceUrl, array $existing, callable $install)
 Refresh owned installed code using existing polygons, retaining the configuration and secret.
 deployRefreshCleanup (string $work, array $state)
 Restore prior directories after an interrupted refresh, or remove backups after publication. Never changes database tables.
 deployRemoveTree (string $directory)
 This removes a directory tree without following symlinks.
 deployRun (string $work, bool $noSecret=false, $terminal=null, ?callable $install=null)
 This gathers settings, loads and tests the Composer package, then publishes the endpoint. The selected web directory must exist. New installations accept new or empty destinations. Existing installer-owned directories can be refreshed without reloading boundaries; private files must be outside the web document root. Existing timezones tables are refused before loading.
 deploySameDirectory (string $path, array $original)
 Recognize the exact original directory, including after it is moved aside for publication.
 deploySave (string $work, array $state)
 This saves recovery state atomically, with credentials readable only by the installer user.
 deployServiceUrl (string $webUrl, string $endpoint)
 Build the browser URL from the selected web directory's URL and the new service subdirectory.
 deployTableExists (PDO $connection, string $table)
 This checks for an existing table without attempting to create or replace it.

Detailed Description

© Copyright 2023-2026, Little Green Viper Software Development LLC

LICENSE:

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Little Green Viper Software Development LLC

deploy.sh supplies a private working directory. The worker asks for settings through the terminal, installs the Composer package, loads current boundaries, and checks known locations before publishing a small endpoint. A separate cleanup process removes downloads and rolls back an incomplete installation after errors or OOM. Database ownership is verified with a random guard token before cleanup can remove a newly loaded table.

Definition in file deploy.php.

Function Documentation

◆ deployAsk()

deployAsk ( $terminal,
string $label,
string $default = '',
bool $hidden = false )
Exceptions
RuntimeExceptionif terminal input ends, or password echo cannot be disabled.

Definition at line 92 of file deploy.php.

References $process, and deployAsk().

Referenced by deployAsk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployCleanup()

deployCleanup ( string $work)

Definition at line 438 of file deploy.php.

References $work, and deployCleanup().

Referenced by deployCleanup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployConnection()

deployConnection ( array $settings,
bool $administrative = false )
Exceptions
PDOExceptionon failure.

Definition at line 57 of file deploy.php.

References $driver, $dsn, $settings, and deployConnection().

Referenced by deployConnection(), and deployRefresh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployCopyTree()

deployCopyTree ( string $source,
string $destination )

Definition at line 280 of file deploy.php.

References $source, and deployCopyTree().

Referenced by deployCopyTree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployDirectoryIsEmpty()

deployDirectoryIsEmpty ( string $path)

Definition at line 157 of file deploy.php.

References deployDirectoryIsEmpty().

Referenced by deployDirectoryIsEmpty(), deployEmptyDirectories(), deployEmptyDirectoryCleanup(), and deployPublishDirectories().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployEmptyDirectories()

deployEmptyDirectories ( array $destinations)

Definition at line 174 of file deploy.php.

References deployDirectoryIsEmpty(), and deployEmptyDirectories().

Referenced by deployEmptyDirectories().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployEmptyDirectoryCleanup()

deployEmptyDirectoryCleanup ( array $state)

Definition at line 214 of file deploy.php.

References deployDirectoryIsEmpty(), deployEmptyDirectoryCleanup(), and deploySameDirectory().

Referenced by deployEmptyDirectoryCleanup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployEndpointCode()

deployEndpointCode ( string $private,
string $relativePackage,
string $licenseHeader )

Definition at line 295 of file deploy.php.

References deployEndpointCode().

Referenced by deployEndpointCode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployExistingInstallation()

deployExistingInstallation ( string $private,
string $public,
array $settings )

Definition at line 235 of file deploy.php.

References $directory, $settings, and deployExistingInstallation().

Referenced by deployExistingInstallation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployIdentifier()

deployIdentifier ( string $name,
string $driver )

Definition at line 40 of file deploy.php.

References $driver, $name, $quote, and deployIdentifier().

Referenced by deployIdentifier().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployLock()

deployLock ( PDO $connection)

Definition at line 69 of file deploy.php.

References $connection, and deployLock().

Referenced by deployLock(), and deployRefresh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployPublishDirectories()

deployPublishDirectories ( array $state)

Definition at line 192 of file deploy.php.

References deployDirectoryIsEmpty(), deployPublishDirectories(), and deploySameDirectory().

Referenced by deployPublishDirectories().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployRefresh()

deployRefresh ( string $work,
array $settings,
string $private,
string $public,
int $group,
string $serviceUrl,
array $existing,
callable $install )

Definition at line 337 of file deploy.php.

References $connection, $settings, $work, deployConnection(), deployLock(), deployRefresh(), and deployTableExists().

Referenced by deployRefresh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployRefreshCleanup()

deployRefreshCleanup ( string $work,
array $state )

Definition at line 305 of file deploy.php.

References $work, deployRefreshCleanup(), and if.

Referenced by deployRefreshCleanup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployRemoveTree()

deployRemoveTree ( string $directory)

Definition at line 145 of file deploy.php.

References $directory, deployRemoveTree(), and if.

Referenced by deployRemoveTree().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployRun()

deployRun ( string $work,
bool $noSecret = false,
$terminal = null,
?callable $install = null )
Exceptions
Exceptionif setup, validation, or publication fails.

Definition at line 498 of file deploy.php.

References $work, and deployRun().

Referenced by deployRun().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deploySameDirectory()

deploySameDirectory ( string $path,
array $original )

Definition at line 164 of file deploy.php.

References deploySameDirectory().

Referenced by deployEmptyDirectoryCleanup(), deployPublishDirectories(), and deploySameDirectory().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deploySave()

deploySave ( string $work,
array $state )

Definition at line 47 of file deploy.php.

References $work, and deploySave().

Referenced by deploySave().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployServiceUrl()

deployServiceUrl ( string $webUrl,
string $endpoint )

Definition at line 128 of file deploy.php.

References deployServiceUrl().

Referenced by deployServiceUrl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deployTableExists()

deployTableExists ( PDO $connection,
string $table )

Definition at line 80 of file deploy.php.

References $connection, and deployTableExists().

Referenced by deployRefresh(), and deployTableExists().

Here is the call graph for this function:
Here is the caller graph for this function: