tinx icon indicating copy to clipboard operation
tinx copied to clipboard

Reload does not reload files

Open ecornbower opened this issue 8 years ago • 4 comments

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!

ecornbower avatar Sep 24 '18 18:09 ecornbower

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 avatar Sep 25 '18 03:09 furey

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.

furey avatar Sep 25 '18 04:09 furey

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.

ecornbower avatar Sep 25 '18 15:09 ecornbower

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 avatar Mar 19 '19 05:03 furey