Exemplo n.º 1
0
/**
 * Install an app or theme from a zip or Github repo.
 */
$page->layout = 'admin';
$this->require_acl('admin', 'designer', 'designer/installer');
$page->title = __('Install App/Theme');
require_once 'apps/designer/lib/Functions.php';
$form = new Form('post', $this);
$page->installer_error = false;
echo $form->handle(function ($form) use($page, $tpl) {
    if (!empty($_POST['github'])) {
        if (github_is_zip($_POST['github'])) {
            ZipInstaller::clean();
            // Retrieve zip file
            $info = ZipInstaller::fetch($_POST['github']);
            if (!$info) {
                ZipInstaller::clean();
                $form->failed = array('zip-install');
                $page->installer_error = ZipInstaller::$error;
                return false;
            }
            // Import from Zip
            $res = ZipInstaller::install($info);
            if (!$res) {
                ZipInstaller::clean();
                $form->failed = array('zip-install');
                $page->installer_error = ZipInstaller::$error;
                return false;
            }
            // Zip successfully installed
Exemplo n.º 2
0
     // Import from Zip
     $res = ZipInstaller::install($url);
     if (!$res) {
         ZipInstaller::clean();
         Cli::out('Error: ' . ZipInstaller::$error, 'error');
         return;
     }
     ZipInstaller::clean();
     Cli::out('Install completed.', 'success');
     return;
 }
 require_once 'apps/designer/lib/Functions.php';
 if (github_is_zip($url)) {
     ZipInstaller::clean();
     // Retrieve zip file
     $info = ZipInstaller::fetch($url);
     if (!$info) {
         ZipInstaller::clean();
         Cli::out('Error: ' . ZipInstaller::$error, 'error');
         return;
     }
     $res = ZipInstaller::install($info);
     if (!$res) {
         ZipInstaller::clean();
         Cli::out('Error: ' . ZipInstaller::$error, 'error');
         return;
     }
     ZipInstaller::clean();
     Cli::out('Install completed.', 'success');
     return;
 } else {