dbxapp 4.1.3
CMS, Shop, Workflows und modulare Geschäftsanwendungen
Loading...
Searching...
No Matches
dbxUpdateService_test.php File Reference

Go to the source code of this file.

Functions

 update_test_assert (bool $condition, string $message)
 update_test_write (string $file, string $content)
 update_test_remove_tree (string $directory)
 update_test_inventory (string $version, array $contents)
 update_test_package (string $zipFile, string $version, array $contents, string $extraPath='')
 update_test_stage (string $work, string $zipFile, array $manifest, array $package)

Variables

 $root
 try
 $newContents
 $work = $root . DIRECTORY_SEPARATOR . 'files' . DIRECTORY_SEPARATOR . 'update'
 $zipFile
 $manifest
 $service = new dbxUpdateService($root)
 $package = $service->inspectPackage($zipFile, $manifest)
 $badManifest = $manifest
 $badManifest ['zip_url'] = 'https://github.com/other/project/releases/download/v4.0.2/dbxapp-4.0.2.zip'
catch(RuntimeException $exception) $unsafeZip
catch(RuntimeException $exception) $staging = update_test_stage($work, $zipFile, $manifest, $package)
 $stopped = $service->cancel()
 $outsideGuard = $root . DIRECTORY_SEPARATOR . 'outside-stop-guard.txt'
 $manifest ['sha256'] = hash_file('sha256', $zipFile)
 $installed = $service->install()
 finally

Function Documentation

◆ update_test_assert()

update_test_assert ( bool $condition,
string $message )

Definition at line 9 of file dbxUpdateService_test.php.

◆ update_test_inventory()

update_test_inventory ( string $version,
array $contents )

Definition at line 46 of file dbxUpdateService_test.php.

References $content, $files, and $version.

◆ update_test_package()

update_test_package ( string $zipFile,
string $version,
array $contents,
string $extraPath = '' )

Definition at line 62 of file dbxUpdateService_test.php.

References $content, $version, $zipFile, and foreach.

◆ update_test_remove_tree()

update_test_remove_tree ( string $directory)

Definition at line 27 of file dbxUpdateService_test.php.

References $iterator.

◆ update_test_stage()

update_test_stage ( string $work,
string $zipFile,
array $manifest,
array $package )

Definition at line 85 of file dbxUpdateService_test.php.

References $manifest, $package, $staging, $work, and $zipFile.

◆ update_test_write()

update_test_write ( string $file,
string $content )

Definition at line 16 of file dbxUpdateService_test.php.

References $content, and $file.

Variable Documentation

◆ $badManifest [1/2]

$badManifest[ 'zip_url'] = 'https://github.com/other/project/releases/download/v4.0.2/dbxapp-4.0.2.zip'

Definition at line 182 of file dbxUpdateService_test.php.

◆ $badManifest [2/2]

$badManifest = $manifest

Definition at line 181 of file dbxUpdateService_test.php.

◆ $installed

$installed = $service->install()

◆ $manifest [1/2]

$manifest[ 'sha256'] = hash_file('sha256', $zipFile)

Definition at line 255 of file dbxUpdateService_test.php.

◆ $manifest [2/2]

$manifest
Initial value:
= array(
'schema' => 1,
'product' => 'dbxapp',
'channel' => 'stable',
'version' => '4.0.2',
'release_url' => 'https://github.com/ecb-dbxApp/dbxapp/releases/tag/v4.0.2',
'zip_url' => 'https://github.com/ecb-dbxApp/dbxapp/releases/download/v4.0.2/dbxapp-4.0.2.zip',
'sha256' => hash_file('sha256', $zipFile),
'requires' => array(
'php' => '>=8.2',
'extensions' => array('json', 'pdo', 'zip'),
),
)

Definition at line 160 of file dbxUpdateService_test.php.

◆ $newContents

$newContents
Initial value:
= array(
'VERSION' => "4.0.2\n",
'index.php' => "<?php echo 'new';\n",
'dbx/include/dbxApi.php' => "<?php
'new.php' => "<?php
)

Definition at line 146 of file dbxUpdateService_test.php.

◆ $outsideGuard

$outsideGuard = $root . DIRECTORY_SEPARATOR . 'outside-stop-guard.txt'

Definition at line 221 of file dbxUpdateService_test.php.

◆ $package

$package = $service->inspectPackage($zipFile, $manifest)

Definition at line 175 of file dbxUpdateService_test.php.

Referenced by update_test_stage().

◆ $root

$root
Initial value:
= sys_get_temp_dir() . DIRECTORY_SEPARATOR
. 'dbx-update-service-' . bin2hex(random_bytes(6))

Definition at line 114 of file dbxUpdateService_test.php.

◆ $service

$service = new dbxUpdateService($root)

Definition at line 174 of file dbxUpdateService_test.php.

◆ $staging

$staging = update_test_stage($work, $zipFile, $manifest, $package)

Definition at line 206 of file dbxUpdateService_test.php.

Referenced by update_test_stage().

◆ $stopped

$stopped = $service->cancel()

Definition at line 211 of file dbxUpdateService_test.php.

Referenced by dbx\dbxAdmin\dbxUpdate\run().

◆ $unsafeZip

catch (RuntimeException $exception) $unsafeZip
Initial value:
= $work . DIRECTORY_SEPARATOR . 'downloads'
. DIRECTORY_SEPARATOR . 'unsafe.zip'

Definition at line 193 of file dbxUpdateService_test.php.

◆ $work

◆ $zipFile

$zipFile
Initial value:
= $work . DIRECTORY_SEPARATOR . 'downloads'
. DIRECTORY_SEPARATOR . 'dbxapp-4.0.2.zip'

Definition at line 153 of file dbxUpdateService_test.php.

Referenced by dbx\dbxAdmin\dbxUpdateService\inspectPackage(), update_db_stage(), update_test_package(), and update_test_stage().

◆ finally

finally
Initial value:
{
update_test_remove_tree(string $directory)

Definition at line 281 of file dbxUpdateService_test.php.

◆ try

try
Initial value:
{
$oldContents = array(
'VERSION' => "4.0.1\n",
'index.php' => "<?php echo 'old';\n",
'dbx/include/dbxApi.php' => "<?php
'obsolete.php' => "<?php
)

Definition at line 117 of file dbxUpdateService_test.php.