Jump to content

Command line installer


Hari KT
 Share

Recommended Posts

Hi, 

I was trying to build a command line installer for processwire . The script basically uses the install.php .

case 0: 
    $this->initProfile(); 
    break;
case 1: 
    $this->compatibilityCheck(); 
    break;
case 2: 
    $this->dbConfig();  
    break;
case 4: 
    $this->dbSaveConfig();  
    break;
case 5: 
    require("./index.php"); 
    $this->adminAccountSave($wire); 
    break;

What I am having trouble is at step 5 where it tries to create the user account. 

It throws an exception

Error: Exception: You do not have permission to execute this module - ProcessPageView (in /var/www/pwtest/hello/wire/core/Modules.php line 875)

when 

require 'index.php';

is called. Is there something special to make the `index.php` throwing without an error ?

Thank you

Link to comment
Share on other sites

@Kongondo sure. I will update here.

Quick things : 

* The ok() , err() methods were changed to log to PSR-3 logger.

* All the $_POST values were changed to accept from the method. Eg dbSaveConfig($post) .

$installer = new Installer($psr3logger);
$installer->
$installer->dbSaveConfig($post);

As it is not using global values like `$_POST` and `$_SERVER` all values are passed to methods. Hope this helps!

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

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...