Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Error related fixes #10

Closed
wants to merge 1 commit into from
Closed

Type Error related fixes #10

wants to merge 1 commit into from

Conversation

rotexdegba
Copy link

  • Added code to guard against some type errors in \Ginfo\OS\Windows

@Gemorroj Gemorroj self-assigned this May 23, 2020
@Gemorroj
Copy link
Owner

Gemorroj commented Jun 6, 2020

@rotexdegba can you explain how to reproduce the problems?
I always have FileSystem and LastBootUpTime.

@rotexdegba
Copy link
Author

rotexdegba commented Jun 8, 2020

@rotexdegba can you explain how to reproduce the problems?
I always have FileSystem and LastBootUpTime.

I am running on Windows 10 with all errors, warnings and notices turned on in PHP. I think it might have been before I ran Set-ExecutionPolicy -ExecutionPolicy .

The ->setType($volume['FileSystem'] ) was blowing up for my dvd drive as it contained null and setType was expecting a string.

The other checks are defensive and don't adversely affect Ginfo\OS\Windows .

Gemorroj added a commit that referenced this pull request Jun 9, 2020
@Gemorroj
Copy link
Owner

Gemorroj commented Jun 9, 2020

@rotexdegba can you check master branch which last changes? i don't have dvd drive to check it myself.

@rotexdegba
Copy link
Author

@rotexdegba can you check master branch which last changes? i don't have dvd drive to check it myself.

Here's one error I am currently getting on windows with the latest master branch code, that would have been prevented by one of the changes in this pull request:

PHP Fatal error:  Uncaught Error: Call to a member function getTimestamp() on boolean in D:\SoftwareProjects\general-php-project\vendor\gemorroj\ginfo\src\OS\Windows.php:171
Stack trace:
#0 D:\SoftwareProjects\general-php-project\vendor\gemorroj\ginfo\src\Info.php(41): Ginfo\OS\Windows->getUptime()

@Gemorroj
Copy link
Owner

I can't reproduce the problem. Can you execute the powershell code and show me the result?

Get-WmiObject -Class Win32_OperatingSystem LastBootUpTime

@rotexdegba
Copy link
Author

I can't reproduce the problem. Can you execute the powershell code and show me the result?

Get-WmiObject -Class Win32_OperatingSystem LastBootUpTime
PS D:\SoftwareProjects\linux-server-info-api> Get-WmiObject -Class Win32_OperatingSystem LastBootUpTime


__GENUS          : 2
__CLASS          : Win32_OperatingSystem
__SUPERCLASS     :
__DYNASTY        :
__RELPATH        : Win32_OperatingSystem=@
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
LastBootUpTime   : 20200611194021.696016-360
PSComputerName   :

Gemorroj added a commit that referenced this pull request Jul 19, 2020
@Gemorroj
Copy link
Owner

Thanks a lot! I got it. That's problem with negative offset.

@Gemorroj Gemorroj closed this Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants