SDK

Softaculous_SDK Class

You can find the class in PATH/TO/softaculous/enduser/sdk.php
OR
You can download it from here and add it to the above mentioned path:
File:Softaculous Development Kit.zip

Initializing and Authentication

include_once('sdk.php');
$new = new Softaculous_SDK();
$new->login = 'https://user:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

This will load the Class in $new and we are setting the LOGIN URL as without authentication you will not be able to access Softaculous. The code here is an example of cPanel. cPanel allows User Authentication via the URL itself and many other panels also.

https://user:password@domain.com:2083

If your panel has some different method, you must first implement that code and then proceed.

List Installed Scripts

funtion list_installed_scripts()
  • This function has no parameters, it will get you the list of scripts.

eg:

$new->list_installed_scripts();
print_r($new->iscripts);
  • Will give you the output :
Array (     
[1] => Array
(
[name] => Zikula
[softname] => zikula
[desc] => Zikula is a Web Application Toolkit, which allows you to run impressive websites and build powerful online applications.
[ins] => 1
[cat] => cms
[type] => php
[ver] => 1.2.8
)
[2] => Array
(
[name] => phpBB
[softname] => phpbb
[desc] => The most widely used Open Source forum solution
[ins] => 1
[cat] => forums
[type] => php
[ver] => 3.0.10
)
.
.
.
  • In the above output, Keys like 1, 2, etc are the Script ID’s used often in the Softaculous_SDK while taking backup, importing, etc.
  • softname in the above example is the Softaculous Name for the software. It’s value is same as the directory present in the /var/softaculous/[softname] for each script.

Eg:

/var/softaculous/wp
  • Where wp is the softname for WordPress.

List Installations

function installations()
  • This function has no parameters, it will give you the list of installations on your server. 

eg:

$installations = $new->installations();
print_r($installations);
  • Will give you the output :
Array 
(
[388] => Array
(
[388_98198] => Array
(
[sid] => 388
[ver] => 2.3.5.0
[itime] => 1342264725
[softpath] => /home/USERNAME/public_html/ocs869
[softurl] => http://domain.com/ocs869
[softdomain] => domain.com
[softdatadir] => /home/USERNAME/ocs869
[softdb] => soft_ocs869
[softdbuser] => soft_ocs869
[softdbhost] => localhost
[softdbpass] => id17r2P6St
[dbcreated] => 1
[fileindex] => Array
(
[0] => cache
[1] => classes
[2] => config.TEMPLATE.inc.php
[3] => config.inc.php
[4] => controllers
[5] => dbscripts
[6] => docs
[7] => favicon.ico
[8] => help
[9] => index.php
[10] => js
[11] => lib
[12] => locale
[13] => pages
[14] => plugins
[15] => public
[16] => registry
[17] => robots.txt
[18] => rt
[19] => styles
[20] => templates
[21] => tools
)
[insid] => 388_98198
)
)
[386] => Array
(
[386_86211] => Array
(
[sid] => 386
[ver] => 4.1
[itime] => 1342437201
[softpath] => /home/USERNAME/public_html/qcms40
[softurl] => http://domain.com/qcms40
[softdomain] => domain.com
[fileindex] => Array
(
[0] => actions
[1] => admin.php
[2] => core
[3] => database
[4] => files
[5] => index.php
[6] => mobile.php
[7] => plugins
[8] => read-me.txt
[9] => templates
)
[insid] => 386_86211
)
)
.
.
.

  • Here :

Keys like 388 and 386 are the Script ID’s.
values like 388_98198 and 386_86211 are the Installation ID’s

  • Installation ID’s are commonly used in this SDK for backup, upgrade, etc.

List Backups

funtion list_backups()
  • This function has no parameters, it will list the backups made on your server.

eg :

$backups = $new->list_backups();
print_r($backups);

Will give output :

Array 
(
[26] => Array
(
[26_60832] => Array
(
[0] => Array
(
[name] => wp.26_60832.2012-07-26_10-13-33.zip
[path] => /home/USERNAME/softaculous_backups/wp.26_60832.2012-07-26_10-13-33.zip
[time] => 1343312013
[size] => 4968335
[sid] => 26
[ver] => 3.4.1
[itime] => 1343282816
[softpath] => /home/USERNAME/public_html/wp782
[softurl] => http://domain.com/wp782
[softdomain] => domain.com
[softdb] => soft_wp782
[softdbuser] => soft_wp782
[softdbhost] => localhost
[softdbpass] => aP6btS8d1p
[dbcreated] => 1
[fileindex] => Array
(
[0] => index.php
[1] => license.txt
[2] => readme.html
[3] => wp-activate.php
[4] => wp-admin
[5] => wp-app.php
[6] => wp-blog-header.php
[7] => wp-comments-post.php
[8] => wp-config-sample.php
[9] => wp-content
[10] => wp-cron.php
[11] => wp-includes
[12] => wp-links-opml.php
[13] => wp-load.php
[14] => wp-login.php
[15] => wp-mail.php
[16] => wp-settings.php
[17] => wp-signup.php
[18] => wp-trackback.php
[19] => xmlrpc.php
[20] => .htaccess
[21] => wp-config.php
)
[insid] => 26_60832
[backup_db] => 1
[backup_dir] => 1
[backup_datadir] =>
[backup_wwwdir] =>
[ssk] => xb6aamsdjfoelhff4olxuldtj5jklvom
[email] => admin@domain.com
)
)
)
.
.
.
  • 26 in the above example is the Script ID of WordPress.
  • 26_60832 is the Installation ID.
  • wp.26_60832.2012-07-26_10-13-33.zip is the Backup Name.
  • Backup Name is generally used for restoring the backup.
  • For each Backup, Backup Info is given along with its Installation Details as you can see in above example.

Result Format

  • Result of the SDK call can be in three formats:
    • Serialize
    • JSON
    • XML

Serialize

$this->format = 'serialize'; // Serialize is default.
  • Below example is of Import SDK. WordPress Installation has been imported into Softaculous.
<?php
@set_time_limit(100);

//Include Class
include_once('sdk.php');

$new = new Softaculous_SDK();

// Login Page
$new->login = 'https://user:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

$data['softdomain'] = 'domain.com'; // Domain Name

$data['softdirectory'] = 'wp459'; // Directory of the installation

// Submit the details
$res = $new->import(26, $data); // Import Function. 26 is Script ID of WordPress.
echo $res;

?>

Will give you the output :

a:6:{s:5:"title";s:28:"Softaculous - Softaculous - ";s:4:"done";b:1;s:4:"info";a:6:{s:8:"overview";s:877:"<img src=\"logo.png\" style=\"float:right;\" alt=\"\" /><font size=\"5\" color=\"#182e7a\">WordPress</font> is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time.<br /><br />
		More simply, WordPress is what you use when you want to work with your blogging software, not fight it.
		<br /><br />WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer users than you can count on your fingers and toes. Since then it has grown to be the largest self-hosted blogging tool in the world, used on hundreds of thousands of sites and seen by tens of millions of people every day.
		<br /><br />
		The GPL from the <a href=\"http://www.fsf.org/\">Free Software Foundation</a> is the license that the WordPress software is under.";s:8:"features";s:5413:"<ul>
				<li><strong>Full standards compliance</strong> : We have gone to great lengths to make sure every bit of WordPress generated code is in full compliance with the standards of the <a href=\"http://w3.org\">W3C</a>. This is important not only for interoperability with today's browser but also for forward compatibility with the tools of the next generation. Your web site is a beautiful thing, and you should demand nothing less.</li>
				<li><strong>No rebuilding</strong> : Changes you make to your templates or entries are reflected immediately on your site, with no need for regenerating static pages.</li>
				<li><strong>WordPress Pages</strong> : Pages allow you to manage non-blog content easily, so for example you could have a static \"About\" page that you manage through WordPress. For an idea of how powerful this is, the entire WordPress.org site could be run off WordPress alone. (We don't for technical mirroring reasons.)</li>

				<li><strong>WordPress Links</strong> : Links allows you to create, maintain, and update any number of blogrolls through your administration interface. This is much faster than calling an external blogroll manager.</li>
				<li><strong>WordPress Themes</strong> : WordPress comes with a <a href=\"http://codex.wordpress.org/Using_Themes\">full theme system</a> which makes designing everything from the simplest blog to the most complicated webzine a piece of cake, and you can even have multiple themes with totally different looks that you switch with a single click. Have a new design every day.</li>
				<li><strong>Cross-blog communication tools</strong> : WordPress fully supports both the <a href=\"http://www.movabletype.org/docs/mttrackback.html\">Trackback</a> and <a href=\"http://www.hixie.ch/specs/pingback/pingback-1.0\">Pingback</a> standards, and we are committed to supporting future standards as they develop.</li>

				<li><strong>Comments</strong> : Visitors to your site can leave comments on individual entries, and through Trackback or Pingback can comment on their own site. You can enable or disable comments on a per-post basis.</li>
				<li><strong>Spam protection</strong> : Out of the box WordPress comes with very robust tools such as an integrated blacklist and open proxy checker to manage and eliminate comment spam on your blog, and there is also a rich array of plugins that can take this functionality a step further.</li>
				<li><strong>Full user registration</strong> : WordPress has a built-in user registration system that (if you choose) can allow people to register and maintain profiles and leave authenticated comments on your blog. You can optionally close comments for non-registered users. There are also plugins that hide posts from lower level users.</li>
				<li><strong>Password Protected Posts</strong> : You can give passwords to individual posts to hide them from the public. You can also have private posts which are viewable only by their author.</li>
				<li><strong>Easy installation and upgrades</strong> : Installing WordPress and upgrading from previous versions and other software is a piece of cake. Try it and you'll wonder why all web software isn't this easy.</li>
				<li><strong>Easy Importing</strong> : We currently have importers for Movable Type, Textpattern, Greymatter, Blogger, and b2. Work on importers for Nucleus and pMachine are under way. </li>

				<li><strong>XML-RPC interface</strong> : WordPress currently supports an extended version of the <a href=\"http://plant.blogger.com/api/\">Blogger API</a>, MetaWeblog API, and finally the MovableType API. You can even use clients designed for other platforms like <a href=\"http://zempt.com/\">Zempt</a>.</li>
				<li><strong>Workflow</strong> : You can have types of users that can only post drafts, not publish to the front page.</li>
				<li><strong>Typographical niceties </strong>: WordPress uses the <a href=\"http://photomatt.net/tools/texturize\">Texturize</a> engine to intelligently convert plain ASCII into typographically correct XHTML entities. This includes quotes, apostrophes, ellipses, em and en dashes, multiplication symbols, and ampersands. For information about the proper use of such entities see Peter Sheerin's article <a href=\"http://alistapart.com/stories/emen/\">The Trouble With Em 'n En</a>.</li>

				<li><strong>Intelligent text formatting</strong> : If you've dealt with systems that convert new lines to line breaks before you know why they have a bad name: if you have any sort of HTML they butcher it by putting tags after every new line indiscriminately, breaking your formatting and validation. Our function for this intelligently avoids places where you already have breaks and block-level HTML tags, so you can leave it on without worrying about it breaking your code.</li>
				<li><strong>Multiple authors</strong> : WordPress' highly advanced user system allows up to 10 levels of users, with different levels having different (and configurable) privileges with regard to publishing, editing, options, and other users.</li>
				<li><strong>Bookmarklets</strong> : Cross-browser bookmarklets make it easy to publish to your blog or add links to your blogroll with a minimum of effort.</li>
				<li><strong>Ping away</strong> : WordPress supports pinging <a href=\"http://www.pingomatic.com/\">Ping-O-Matic</a>, which means maximum exposure for your blog to search engines.</li>
			</ul>";s:4:"demo";s:42:"http://www.softaculous.com/demos/WordPress";s:7:"ratings";s:52:"http://www.softaculous.com/softwares/blogs/WordPress";s:7:"support";s:25:"http://www.wordpress.org/";s:8:"spacereq";s:0:"";}s:8:"software";a:10:{s:4:"name";s:9:"WordPress";s:8:"softname";s:2:"wp";s:4:"desc";s:109:"WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability.";s:3:"ins";i:1;s:3:"cat";s:5:"blogs";s:4:"type";s:3:"php";s:3:"ver";s:3:"3.4";s:4:"path";s:48:"/var/softaculous/wp";s:8:"spacereq";s:0:"";s:8:"adminurl";s:9:"wp-admin/";}s:7:"timenow";i:1343796458;s:10:"time_taken";s:5:"0.008";}

JSON

$this->format = 'json'; // Serialize is default.
  • Below example is of Import SDK. WordPress Installation has been imported into Softaculous.
<?php
@set_time_limit(100);

//Include Class
include_once('sdk.php');

$new = new Softaculous_SDK();

$new->format = 'json';

// Login Page
$new->login = 'https://user:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

$data['softdomain'] = 'domain.com'; // Domain Name

$data['softdirectory'] = 'wp459'; // Directory of the installation

// Submit the details
$res = $new->import(26, $data); // Import Function. 26 is Script ID of WordPress.
echo $res;

?>

Will give you the output :

{ "done" : true,
  "info" : { "demo" : "http://www.softaculous.com/demos/WordPress",
      "features" : "<ul>\n\t\t\t\t<li><strong>Full standards compliance</strong> : We have gone to great lengths to make sure every bit of WordPress generated code is in full compliance with the standards of the <a href=\\\"http://w3.org\\\">W3C</a>. This is important not only for interoperability with today's browser but also for forward compatibility with the tools of the next generation. Your web site is a beautiful thing, and you should demand nothing less.</li>\n\t\t\t\t<li><strong>No rebuilding</strong> : Changes you make to your templates or entries are reflected immediately on your site, with no need for regenerating static pages.</li>\n\t\t\t\t<li><strong>WordPress Pages</strong> : Pages allow you to manage non-blog content easily, so for example you could have a static \\\"About\\\" page that you manage through WordPress. For an idea of how powerful this is, the entire WordPress.org site could be run off WordPress alone. (We don't for technical mirroring reasons.)</li>\n\n\t\t\t\t<li><strong>WordPress Links</strong> : Links allows you to create, maintain, and update any number of blogrolls through your administration interface. This is much faster than calling an external blogroll manager.</li>\n\t\t\t\t<li><strong>WordPress Themes</strong> : WordPress comes with a <a href=\\\"http://codex.wordpress.org/Using_Themes\\\">full theme system</a> which makes designing everything from the simplest blog to the most complicated webzine a piece of cake, and you can even have multiple themes with totally different looks that you switch with a single click. Have a new design every day.</li>\n\t\t\t\t<li><strong>Cross-blog communication tools</strong> : WordPress fully supports both the <a href=\\\"http://www.movabletype.org/docs/mttrackback.html\\\">Trackback</a> and <a href=\\\"http://www.hixie.ch/specs/pingback/pingback-1.0\\\">Pingback</a> standards, and we are committed to supporting future standards as they develop.</li>\n\n\t\t\t\t<li><strong>Comments</strong> : Visitors to your site can leave comments on individual entries, and through Trackback or Pingback can comment on their own site. You can enable or disable comments on a per-post basis.</li>\n\t\t\t\t<li><strong>Spam protection</strong> : Out of the box WordPress comes with very robust tools such as an integrated blacklist and open proxy checker to manage and eliminate comment spam on your blog, and there is also a rich array of plugins that can take this functionality a step further.</li>\n\t\t\t\t<li><strong>Full user registration</strong> : WordPress has a built-in user registration system that (if you choose) can allow people to register and maintain profiles and leave authenticated comments on your blog. You can optionally close comments for non-registered users. There are also plugins that hide posts from lower level users.</li>\n\t\t\t\t<li><strong>Password Protected Posts</strong> : You can give passwords to individual posts to hide them from the public. You can also have private posts which are viewable only by their author.</li>\n\t\t\t\t<li><strong>Easy installation and upgrades</strong> : Installing WordPress and upgrading from previous versions and other software is a piece of cake. Try it and you'll wonder why all web software isn't this easy.</li>\n\t\t\t\t<li><strong>Easy Importing</strong> : We currently have importers for Movable Type, Textpattern, Greymatter, Blogger, and b2. Work on importers for Nucleus and pMachine are under way. </li>\n\n\t\t\t\t<li><strong>XML-RPC interface</strong> : WordPress currently supports an extended version of the <a href=\\\"http://plant.blogger.com/api/\\\">Blogger API</a>, MetaWeblog API, and finally the MovableType API. You can even use clients designed for other platforms like <a href=\\\"http://zempt.com/\\\">Zempt</a>.</li>\n\t\t\t\t<li><strong>Workflow</strong> : You can have types of users that can only post drafts, not publish to the front page.</li>\n\t\t\t\t<li><strong>Typographical niceties </strong>: WordPress uses the <a href=\\\"http://photomatt.net/tools/texturize\\\">Texturize</a> engine to intelligently convert plain ASCII into typographically correct XHTML entities. This includes quotes, apostrophes, ellipses, em and en dashes, multiplication symbols, and ampersands. For information about the proper use of such entities see Peter Sheerin's article <a href=\\\"http://alistapart.com/stories/emen/\\\">The Trouble With Em 'n En</a>.</li>\n\n\t\t\t\t<li><strong>Intelligent text formatting</strong> : If you've dealt with systems that convert new lines to line breaks before you know why they have a bad name: if you have any sort of HTML they butcher it by putting tags after every new line indiscriminately, breaking your formatting and validation. Our function for this intelligently avoids places where you already have breaks and block-level HTML tags, so you can leave it on without worrying about it breaking your code.</li>\n\t\t\t\t<li><strong>Multiple authors</strong> : WordPress' highly advanced user system allows up to 10 levels of users, with different levels having different (and configurable) privileges with regard to publishing, editing, options, and other users.</li>\n\t\t\t\t<li><strong>Bookmarklets</strong> : Cross-browser bookmarklets make it easy to publish to your blog or add links to your blogroll with a minimum of effort.</li>\n\t\t\t\t<li><strong>Ping away</strong> : WordPress supports pinging <a href=\\\"http://www.pingomatic.com/\\\">Ping-O-Matic</a>, which means maximum exposure for your blog to search engines.</li>\n\t\t\t</ul>",
      "overview" : "<img src=\\\"logo.png\\\" style=\\\"float:right;\\\" alt=\\\"\\\" /><font size=\\\"5\\\" color=\\\"#182e7a\\\">WordPress</font> is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time.<br /><br />\n\t\tMore simply, WordPress is what you use when you want to work with your blogging software, not fight it.\n\t\t<br /><br />WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer users than you can count on your fingers and toes. Since then it has grown to be the largest self-hosted blogging tool in the world, used on hundreds of thousands of sites and seen by tens of millions of people every day.\n\t\t<br /><br />\n\t\tThe GPL from the <a href=\\\"http://www.fsf.org/\\\">Free Software Foundation</a> is the license that the WordPress software is under.",
      "ratings" : "http://www.softaculous.com/softwares/blogs/WordPress",
      "spacereq" : "",
      "support" : "http://www.wordpress.org/"
    },
  "software" : { "adminurl" : "wp-admin/",
      "cat" : "blogs",
      "desc" : "WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability.",
      "ins" : 1,
      "name" : "WordPress",
      "path" : "/var/softaculous/wp",
      "softname" : "wp",
      "spacereq" : "",
      "type" : "php",
      "ver" : "3.4"
    },
  "time_taken" : "0.008",
  "timenow" : 1343800621,
  "title" : "Softaculous - Softaculous - "
}

XML

$this->format = 'xml'; // Serialize is default.
  • Below example is of Import SDK. WordPress Installation has been imported into Softaculous.
<?php
@set_time_limit(100);

//Include Class
include_once('sdk.php');

$new = new Softaculous_SDK();

$new->format = 'xml';

// Login Page
$new->login = 'https://user:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

$data['softdomain'] = 'domain.com'; // Domain Name

$data['softdirectory'] = 'wp459'; // Directory of the installation

// Submit the details
$res = $new->import(26, $data); // Import Function. 26 is Script ID of WordPress.
echo $res;

?>

Will give you the output :

<?xml version="1.0" ?>
<xml>
  <title>
    Softaculous - Softaculous - 
  </title>
  <done>
    1
  </done>
  <info>
    <overview>
      <img src=\"logo.png\" style=\"float:right;\" alt=\"\" /><font size=\"5\" color=\"#182e7a\">WordPress</font> is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time.<br /><br /> More simply, WordPress is what you use when you want to work with your blogging software, not fight it. <br /><br />WordPress started in 2003 with a single bit of code to enhance the typography of everyday writing and with fewer users than you can count on your fingers and toes. Since then it has grown to be the largest self-hosted blogging tool in the world, used on hundreds of thousands of sites and seen by tens of millions of people every day. <br /><br /> The GPL from the <a href=\"http://www.fsf.org/\">Free Software Foundation</a> is the license that the WordPress software is under.
    </overview>
    <features>
      <ul><li><strong>Full standards compliance</strong> : We have gone to great lengths to make sure every bit of WordPress generated code is in full compliance with the standards of the <a href=\"http://w3.org\">W3C</a>. This is important not only for interoperability with today's browser but also for forward compatibility with the tools of the next generation. Your web site is a beautiful thing, and you should demand nothing less.</li><li><strong>No rebuilding</strong> : Changes you make to your templates or entries are reflected immediately on your site, with no need for regenerating static pages.</li><li><strong>WordPress Pages</strong> : Pages allow you to manage non-blog content easily, so for example you could have a static \"About\" page that you manage through WordPress. For an idea of how powerful this is, the entire WordPress.org site could be run off WordPress alone. (We don't for technical mirroring reasons.)</li><li><strong>WordPress Links</strong> : Links allows you to create, maintain, and update any number of blogrolls through your administration interface. This is much faster than calling an external blogroll manager.</li><li><strong>WordPress Themes</strong> : WordPress comes with a <a href=\"http://codex.wordpress.org/Using_Themes\">full theme system</a> which makes designing everything from the simplest blog to the most complicated webzine a piece of cake, and you can even have multiple themes with totally different looks that you switch with a single click. Have a new design every day.</li><li><strong>Cross-blog communication tools</strong> : WordPress fully supports both the <a href=\"http://www.movabletype.org/docs/mttrackback.html\">Trackback</a> and <a href=\"http://www.hixie.ch/specs/pingback/pingback-1.0\">Pingback</a> standards, and we are committed to supporting future standards as they develop.</li><li><strong>Comments</strong> : Visitors to your site can leave comments on individual entries, and through Trackback or Pingback can comment on their own site. You can enable or disable comments on a per-post basis.</li><li><strong>Spam protection</strong> : Out of the box WordPress comes with very robust tools such as an integrated blacklist and open proxy checker to manage and eliminate comment spam on your blog, and there is also a rich array of plugins that can take this functionality a step further.</li><li><strong>Full user registration</strong> : WordPress has a built-in user registration system that (if you choose) can allow people to register and maintain profiles and leave authenticated comments on your blog. You can optionally close comments for non-registered users. There are also plugins that hide posts from lower level users.</li><li><strong>Password Protected Posts</strong> : You can give passwords to individual posts to hide them from the public. You can also have private posts which are viewable only by their author.</li><li><strong>Easy installation and upgrades</strong> : Installing WordPress and upgrading from previous versions and other software is a piece of cake. Try it and you'll wonder why all web software isn't this easy.</li><li><strong>Easy Importing</strong> : We currently have importers for Movable Type, Textpattern, Greymatter, Blogger, and b2. Work on importers for Nucleus and pMachine are under way. </li><li><strong>XML-RPC interface</strong> : WordPress currently supports an extended version of the <a href=\"http://plant.blogger.com/api/\">Blogger API</a>, MetaWeblog API, and finally the MovableType API. You can even use clients designed for other platforms like <a href=\"http://zempt.com/\">Zempt</a>.</li><li><strong>Workflow</strong> : You can have types of users that can only post drafts, not publish to the front page.</li><li><strong>Typographical niceties </strong>: WordPress uses the <a href=\"http://photomatt.net/tools/texturize\">Texturize</a> engine to intelligently convert plain ASCII into typographically correct XHTML entities. This includes quotes, apostrophes, ellipses, em and en dashes, multiplication symbols, and ampersands. For information about the proper use of such entities see Peter Sheerin's article <a href=\"http://alistapart.com/stories/emen/\">The Trouble With Em 'n En</a>.</li><li><strong>Intelligent text formatting</strong> : If you've dealt with systems that convert new lines to line breaks before you know why they have a bad name: if you have any sort of HTML they butcher it by putting tags after every new line indiscriminately, breaking your formatting and validation. Our function for this intelligently avoids places where you already have breaks and block-level HTML tags, so you can leave it on without worrying about it breaking your code.</li><li><strong>Multiple authors</strong> : WordPress' highly advanced user system allows up to 10 levels of users, with different levels having different (and configurable) privileges with regard to publishing, editing, options, and other users.</li><li><strong>Bookmarklets</strong> : Cross-browser bookmarklets make it easy to publish to your blog or add links to your blogroll with a minimum of effort.</li><li><strong>Ping away</strong> : WordPress supports pinging <a href=\"http://www.pingomatic.com/\">Ping-O-Matic</a>, which means maximum exposure for your blog to search engines.</li></ul>
    </features>
    <demo>
      http://www.softaculous.com/demos/WordPress
    </demo>
    <ratings>
      http://www.softaculous.com/softwares/blogs/WordPress
    </ratings>
    <support>
      http://www.wordpress.org/
    </support>
    <spacereq/>
  </info>
  <software>
    <name>
      WordPress
    </name>
    <softname>
      wp
    </softname>
    <desc>
      WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability.
    </desc>
    <ins>
      1
    </ins>
    <cat>
      blogs
    </cat>
    <type>
      php
    </type>
    <ver>
      3.4
    </ver>
    <path>
      /var/softaculous/wp
    </path>
    <spacereq/>
    <adminurl>
      wp-admin/
    </adminurl>
  </software>
  <timenow>
    1343802693
  </timenow>
  <time_taken>
    0.022
  </time_taken>
</xml>

Install SDK

function install($sid, $data = array())
  • This will install the scripts/software available in Softaculous.

Parameters :

  • $sid is the Script ID, which can be obtained from List Installed Scripts
  • $data is the DATA to post. If $data is empty, result will be the Software Information
    • $data[‘softdomain’] – Domain in which you are installing. OPTIONAL – By Default the primary domain will be used. Value should be String
    • $data[‘softdirectory’] – Directory in which installation will be placed. OPTIONAL – By default it will be installed in the /public_html folder. Value should be String
    • $data[‘softdb’] – Database Name for this installation. [Softaculous will create it for you]. Value should be String
    • $data[‘dbusername’] – Database Username. Value should be String
    • $data[‘dbuserpass’] – Username Password. Value should be String
    • $data[‘admin_username’] – Admin Username for WordPress. Value should be String
    • $data[‘admin_pass’] – Password for Admin Username. Value should be String
    • $data[‘admin_email’] – Admin Email ID. Value should be String
    • $data[‘site_name’] – Site Name. Value should be String
    • $data[‘language’] – Language. Value should be String. The language code can be found here. Scripts Language Codes
    • $data[‘site_desc’] – Site Desription. Value should be String
    • $data[‘overwrite_existing’] – Overwrite Existing files if there is a match found. Value should be 1 to overwrite it. OPTIONAL – By default Softaculous will throw an error if there is an existing folder of file found in the Installation Directory.
  • Above example is for WordPress, data to post will vary for different script. You can find the the value to post in install.xml of each script located in /var/softaculous/

Return Values :

  • Result will be in the format as specified in $this->format. By default it is serialized.

If the format is serialized:

  • If Installation was successful, after unserializing the result,
    • $result[‘done’] should be 1.
    • $result[‘error’] should be empty.
  • If Installation was not successful, after unserializing the result,
    • $result[‘done’] should be 0.
    • $result[‘error’] should be an array with error message.

Eg:

$new = new Softaculous_SDK();
$new->login = 'https://username:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php'; // cPanel example Login
$data['softdomain'] = 'domain.com'; // OPTIONAL - By Default the primary domain will be used
$data['softdirectory'] = 'wp222'; // OPTIONAL - By default it will be installed in the /public_html folder
$data['admin_pass'] = 'pass';
$data['admin_email'] = 'admin@domain.com';
$data['softdb'] = 'wp222';
$data['dbusername'] = 'wp222';
$data['dbuserpass'] = 'wp222';
$data['site_name'] = 'Wordpess wp222';
$data['admin_username'] = 'admin';
$data['language'] = 'en';
$data['site_desc'] = 'WordPress SDK Test';

$res = $new->install(26, $data); // 26 is the SCRIPT ID for WordPress
$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Installed';
}else{
	echo 'Installation Failed<br/>';
	if(!empty($res['error'])){
		print_r($res['error']);
	}
}

Import SDK

function import($sid, $data = array())
  • This will import the installations already installed on your server.

Parameters :

  • $sid is the Script ID, which can be obtained from List Installed Scripts. It tells Softaculous which script is being imported.
  • $data is the DATA to post.
    • $data[‘softdomain’] – Domain Name from which you want import installation. Value should be String
    • $data[‘softdirectory’] – Directory in which installation is present. Value should be String
  • To import only softdomain & softdirectory are required by Softaculous.

Return Values :

  • Result will be in the format as specified in $this->format. By default it is serialized.

If the format is serialized:

  • If Installation was successful, after unserializing the result,
    • $result[‘done’] should be 1.
    • $result[‘error’] should be empty.
  • If Installation was not successful, after unserializing the result,
    • $result[‘done’] should be 0.
    • $result[‘error’] should be an array with error message.

Eg:

$new = new Softaculous_SDK();

// Login Page
$new->login = 'https://username:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

$data['softdomain'] = 'domain.com'; // Domain Name

$data['softdirectory'] = 'wp221'; // Directory of the installation

// Submit the details
$res = $new->import(26, $data); // 26 is SCRIPT ID for WordPress.
$res = unserialize($res); // Unserialize the serialized array
if(!empty($res['done'])){
	echo 'Imported';
}else{
	print_r($res['error']); // Reason why Import was not successful
}

Restore SDK

function restore($name, $data = array())
  • This will Restore the Backup of installation from the list of Backups List.

Parameters :

  • $name is the Backup Name, which can be obtained from List Backups. It tells Softaculous which Backup is being restored.
  • $data is the DATA to post.
    • $data[‘restore_dir’] – Restore Directory. 1 or 0 should be the value. 1 if you want to Restore the Directory.
    • $data[‘restore_db’] – Restore Database. 1 or 0 should be the value. 1 if you want to Restore the Database.
    • $data[‘restore_datadir’] – Restore Data Directory. 1 or 0 should be the value. 1 if you want to Restore the Data Directory.
    • $data[‘restore_wwwdir’] – Restore WWW Directory. 1 or 0 should be the value. 1 if you want to Restore the WWW Directory.
  • Not all scripts have database or data directory or www directory. It depends on which script you are trying to restore.

Return Values :

  • Result will be in the format as specified in $this->format. By default it is serialized.

If the format is serialized:

  • If Installation was successful, after unserializing the result,
    • $result[‘done’] should be 1.
    • $result[‘error’] should be empty.
  • If Installation was not successful, after unserializing the result,
    • $result[‘done’] should be 0.
    • $result[‘error’] should be an array with error message.

Eg:

$new = new Softaculous_SDK();
$new->login = 'https://username:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

$data['restore_dir'] = 1;
$data['restore_db'] = 1;
$data['restore_datadir'] = 0;
$data['restore_wwwdir'] = 0;

$res = $new->restore('wp.26_60832.2012-07-26_10-13-33.zip', $data); // wp.26_60832.2012-07-26_10-13-33.zip is the Backup Name

$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Restored';
}else{
	echo 'Restoration Failed<br/>';
	print_r($res['error']);
}

Backup SDK

function backup($insid, $data = array())
  • This will take the Backup of installation. Softaculous performs backup process in the background, so you will get an mail

Parameters :

  • $insid is the Installation ID, which can be obtained from List Scripts. It tells Softaculous which Installation is being Backuped.
  • $data is the DATA to post.
    • $data[‘backup_dir’] – Backup Directory. 1 or 0 should be the value. 1 if you want to Backup the Directory.
    • $data[‘backup_db’] – Backup Database. 1 or 0 should be the value. 1 if you want to Backup the Datbase.
    • $data[‘backup_datadir’] – Backup Data Directory. 1 or 0 should be the value. 1 if you want to Backup the Data Directory.
    • $data[‘backup_wwwdir’] – Backup WWW Directory. 1 or 0 should be the value. 1 if you want to Backup the WWW Directory.
  • Not all scripts have database or data directory or www directory. It depends on which script you are trying to Backup.

Return Values :

  • Result will be in the format as specified in $this->format. By default it is serialized.

If the format is serialized:

  • If Installation was successful, after unserializing the result,
    • $result[‘done’] should be 1.
    • $result[‘error’] should be empty.
  • If Installation was not successful, after unserializing the result,
    • $result[‘done’] should be 0.
    • $result[‘error’] should be an array with error message.

Eg:

$new = new Softaculous_SDK();
$new->login = 'https://username:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

$data['backup_dir'] = 1;

$data['backup_db'] = 1;

$data['backup_datadir'] = 0;

$data['backup_wwwdir'] = 0;

$res = $new->backup('26_37054', $data);

$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Backing up the installation.';
}else{
	echo 'Backup Failed<br/>';
	print_r($res['error']);
}

Remove SDK

function remove($insid, $data = array())
  • This will remove an installation.

Parameters :

  • $insid is the Installation ID, which can be obtained from List Scripts. It tells Softaculous which Installation is being Removed.
  • $data is the DATA to post.
    • $data[‘remove_dir’] – Remove Directory. 1 or 0 should be the value. 1 if you want to Remove the Directory.
    • $data[‘remove_db’] – Remove Database. 1 or 0 should be the value. 1 if you want to Remove the Database.
    • $data[‘remove_datadir’] – Remove Data Directory. 1 or 0 should be the value. 1 if you want to Remove the Data Directory.
    • $data[‘remove_wwwdir’] – Remove WWW Directory. 1 or 0 should be the value. 1 if you want to Remove the WWW Directory.
  • Not all scripts have database or data directory or www directory. It depends on which script you are trying to Remove.

Return Values :

  • Result will be in the format as specified in $this->format. By default it is serialized.

If the format is serialized:

  • If Installation was successful, after unserializing the result,
    • $result[‘done’] should be 1.
    • $result[‘error’] should be empty.
  • If Installation was not successful, after unserializing the result,
    • $result[‘done’] should be 0.
    • $result[‘error’] should be an array with error message.

Eg:

$new = new Softaculous_SDK();
$new->login = 'https://username:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

$data['remove_dir'] = 1;

$data['remove_db'] = 1;

$data['remove_datadir'] = 0;

$data['remove_wwwdir'] = 0;

$res = $new->remove('26_37054', $data);

$res = unserialize($res);
if(!empty($res['done'])){
	echo 'Removed';
}else{
	echo 'Removing Unsuccessful<br/>';
	print_r($res['error']);
}

Upgrade SDK

function upgrade($insid, $data = array())
  • This will upgrade an installation, if upgrade is available.

Parameters :

  • $insid is the Installation ID, which can be obtained from List Installed Scripts. It tells Softaculous which Installation is being upgraded.
  • $data is the DATA to post. If $data is empty, output is upgrade information.
    • $data[‘softbranch’] – Script ID of the script updrading to. Int should be the value. Used only if the installation is upgradable to more than one version. It can be obtained in $result[‘upgradableto’] by keeping $data empty.

Return Values :

  • Result will be in the format as specified in $this->format. By default it is serialized.

If the format is serialized:

  • If no DATA is posted i.e if $data is empty,
    • $result[‘upgradableto’] is an array in which Key is Script ID & Value is the version.
  • If Upgradation was successful, after unserializing the result,
    • $result[‘done’] should be 1.
    • $result[‘error’] should be empty.
    • $result[‘setup’] should be empty.
  • If Upgradation was not successful, after unserializing the result,
    • $result[‘done’] should be 0.
    • $result[‘error’] should be an array with error message.
  • If Upgradation was successful, but requires one more step to complete the upgrade process then after unserializing the result,
    • $result[‘done’] should be 1.
    • $result[‘error’] should be empty.
    • $result[‘setup’] should be String. This is a URL which should be visited to complete the upgrade process.

Eg:

$new = new Softaculous_SDK();
$new->login = 'https://username:password@domain.com:2083/frontend/paper_lantern/softaculous/index.live.php';

$data['softbranch'] = '382'; // Script ID of the script you want to upgrade.

$res = $new->upgrade('92_69417', $data);
$_res = unserialize($res);
	
if(!empty($_res['done'])){
	echo 'Upgraded';
}else{
        echo 'Upgrade Failed<br/>';
        print_r($res['error']);
}

if(!empty($_res['setupcontinue'])){
        echo $_res['setupcontinue'].' Please visit the following link to complete the upgrade process.';
}
Was this helpful to you?