Jump to content

Access WireHttp Class over CLI


markus_blue_tomato
 Share

Recommended Posts

I try to access wie WireHttp Class in a script executed on the command line but I'm failing hard and don't know why. Access to the Pages Class works well.

<?php

// include PW API
include(__DIR__ . "/index.php");

var_dump($wire->pages);

var_dump($wire->http);
php test.php 
object(ProcessWire\Pages)#172 (0) {
}
NULL

Does anyone know why? ? I tried also new WireHttp(), wire('http'), $http...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...