Welcome Guest. Please Login or Register  


You are here: Index > Softaculous Auto Installer > General Support > Topic : How to edit a file in the custom package in the run time



Threaded Mode | Print  

 How to edit a file in the custom package in the run time, Hello, I need to add a file on the custom condition (7 Replies, Read 12079 times)
m.hamdy87
Group: Member
Post Group: Newbie
Posts: 7
Status:
Hello,

I used some kind of Softacolous filters to run a function like this one http://www.softaculous.com/docs/developers/making-custom-package/#3-install-php:~:text=swget(%24parameter1%2C%20%24parameter2,save%20it%20here

But not get an effect on the package files.

Is there something wrong and/or where to run this function in the code?

Thanks
IP: --   

How to edit a file in the custom package in the run time
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5652
Status:
Hi,

The swget function is used when you want to make a curl call to a URL.

If you want to create/edit a file please use fopen/fwrite etc functions.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

How to edit a file in the custom package in the run time
m.hamdy87
Group: Member
Post Group: Newbie
Posts: 7
Status:
Thanks for your reply

I already used this function but no effect, So it could be a problem in the location or the filter used ex:

insert_filter('pre_install', 'my_pre_install', 1);

function my_pre_install(){
    global $soft, $software, $globals;
   
    // Do stuff here e.g. is as follows
    if($soft == 10001){ 
        $parameter1 = "/var/softaculous/mywp/mywpt.sql";
        sdb_import($parameter1);     
        swrite($parameter1, "Data", 1);

      }
   
}

Please Advice!
Thanks in advance
IP: --   

How to edit a file in the custom package in the run time
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5652
Status:
Hi,

Softaculous process runs as a cpanel user process and the user does not have write access to /var/softaculous folder hence the write fails.

Please try to write in a folder that is writable by the user.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

How to edit a file in the custom package in the run time
m.hamdy87
Group: Member
Post Group: Newbie
Posts: 7
Status:
Thanks too much Brijesh for your feedback it's totally correct.

And please if you have an amazing idea to achieve that I will be very grateful to write on the root from the user via a bridge ex: PHP Daemon or anything do you recommend.
IP: --   

How to edit a file in the custom package in the run time
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5652
Status:
Hi,

It is not possible to edit root owned files as a user process.

Can you please share what data you want to change in the SQL file ? Maybe you can try executing SQL query in your custom script installer.

You will get the database credentials in the following variables :
$__settings['softdbhost'] - Database Host
$__settings['softdbuser'] - Database User
$__settings['softdbpass'] - Database Password
$__settings['softdb'] - Database Name

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

How to edit a file in the custom package in the run time
m.hamdy87
Group: Member
Post Group: Newbie
Posts: 7
Status:
Hi,

it will be a completely new file, there's a big idea behind that.

Is that possible to make a call please?

Thanks
IP: --   

How to edit a file in the custom package in the run time
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5652
Status:
Hi,

Sorry for the delay in response.

You can open a support ticket with us :
https://softaculous.deskuss.com/open.php

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is April 27, 2024, 6:36 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.028