Added Logging calls to \ncc\Managers > PackageLockManager
This commit is contained in:
parent
e878ce4ff9
commit
0281ba2af4
1 changed files with 13 additions and 0 deletions
|
@ -5,8 +5,11 @@
|
||||||
namespace ncc\Objects;
|
namespace ncc\Objects;
|
||||||
|
|
||||||
use ncc\Abstracts\Versions;
|
use ncc\Abstracts\Versions;
|
||||||
|
use ncc\Exceptions\InvalidPackageNameException;
|
||||||
|
use ncc\Exceptions\InvalidScopeException;
|
||||||
use ncc\Exceptions\VersionNotFoundException;
|
use ncc\Exceptions\VersionNotFoundException;
|
||||||
use ncc\Objects\PackageLock\PackageEntry;
|
use ncc\Objects\PackageLock\PackageEntry;
|
||||||
|
use ncc\Utilities\Console;
|
||||||
use ncc\Utilities\Functions;
|
use ncc\Utilities\Functions;
|
||||||
|
|
||||||
class PackageLock
|
class PackageLock
|
||||||
|
@ -56,9 +59,13 @@
|
||||||
* @param Package $package
|
* @param Package $package
|
||||||
* @param string $install_path
|
* @param string $install_path
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws InvalidPackageNameException
|
||||||
|
* @throws InvalidScopeException
|
||||||
*/
|
*/
|
||||||
public function addPackage(Package $package, string $install_path): void
|
public function addPackage(Package $package, string $install_path): void
|
||||||
{
|
{
|
||||||
|
Console::outVerbose("Adding package {$package->Assembly->Package} to package lock file");
|
||||||
|
|
||||||
if(!isset($this->Packages[$package->Assembly->Package]))
|
if(!isset($this->Packages[$package->Assembly->Package]))
|
||||||
{
|
{
|
||||||
$package_entry = new PackageEntry();
|
$package_entry = new PackageEntry();
|
||||||
|
@ -88,6 +95,8 @@
|
||||||
*/
|
*/
|
||||||
public function removePackageVersion(string $package, string $version): bool
|
public function removePackageVersion(string $package, string $version): bool
|
||||||
{
|
{
|
||||||
|
Console::outVerbose(sprintf('Removing package %s version %s from package lock file', $package, $version));
|
||||||
|
|
||||||
if(isset($this->Packages[$package]))
|
if(isset($this->Packages[$package]))
|
||||||
{
|
{
|
||||||
$r = $this->Packages[$package]->removeVersion($version);
|
$r = $this->Packages[$package]->removeVersion($version);
|
||||||
|
@ -110,9 +119,11 @@
|
||||||
*
|
*
|
||||||
* @param string $package
|
* @param string $package
|
||||||
* @return bool
|
* @return bool
|
||||||
|
* @noinspection PhpUnused
|
||||||
*/
|
*/
|
||||||
public function removePackage(string $package): bool
|
public function removePackage(string $package): bool
|
||||||
{
|
{
|
||||||
|
Console::outVerbose(sprintf('Removing package %s from package lock file', $package));
|
||||||
if(isset($this->Packages[$package]))
|
if(isset($this->Packages[$package]))
|
||||||
{
|
{
|
||||||
unset($this->Packages[$package]);
|
unset($this->Packages[$package]);
|
||||||
|
@ -130,6 +141,8 @@
|
||||||
*/
|
*/
|
||||||
public function getPackage(string $package): ?PackageEntry
|
public function getPackage(string $package): ?PackageEntry
|
||||||
{
|
{
|
||||||
|
Console::outDebug(sprintf('getting package %s from package lock file', $package));
|
||||||
|
|
||||||
if(isset($this->Packages[$package]))
|
if(isset($this->Packages[$package]))
|
||||||
{
|
{
|
||||||
return $this->Packages[$package];
|
return $this->Packages[$package];
|
||||||
|
|
Loading…
Add table
Reference in a new issue