Skip to content
This repository has been archived by the owner on Dec 14, 2019. It is now read-only.

Reload does not reload files #53

Closed
ecornbower opened this issue Sep 24, 2018 · 4 comments
Closed

Reload does not reload files #53

ecornbower opened this issue Sep 24, 2018 · 4 comments

Comments

@ecornbower
Copy link

Maybe I'm misunderstanding how Tinx is supposed to work, but I had assumed included files would automatically be reloaded. For example:

use App\Utils\GeoIP;
re()

$geo = new GeoIP();
PHP Fatal error:  Class 'GeoIP' not found in Psy Shell code on line 1

Is this a bug, or can Tinx not handle this case? Thanks!

@furey
Copy link
Owner

furey commented Sep 25, 2018

Hi @kcornbower,

Can you please provide the following details so I can look into this further for you?

  • Your Tinx version (composer info ajthinking/tinx)
  • Your PHP version (php -v)
  • Your Laravel version (php artisan -V)
  • Your development environment and version (Valet? Homestead? etc)
  • Your operating system and version (Mac? Windows? etc)

Cheers.

@furey
Copy link
Owner

furey commented Sep 25, 2018

Hi @kcornbower (again),

Recent versions of Laravel Tinker should automatically alias/resolve class paths for you, providing those class paths exist in your vendor/composer/autoload_classmap.php file.

If you either…

  • run composer dump -o before starting Tinx
  • run exec("composer dump -o") && re() in your existing Tinx session

…then run your $geo = new GeoIP(); statement again…

composer-dump-o-and-re

…is the GeoIP class now automatically aliased/resolved for you?

Cheers.

@ecornbower
Copy link
Author

Hi @furey,

Awesome, running the exec command in Tinx solved the problem. Is there any way to have this run automatically? Maybe adding this in the documentation would be helpful, unless I somehow missed it.

@furey
Copy link
Owner

furey commented Mar 19, 2019

Hi @kcornbower,

I've just pushed a new release that adds a reo() function to Tinx implementing the functionality mentioned above, and added a note about it in the README to help users with similar issues in the future.

Cheers.

@furey furey closed this as completed Mar 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants