Exemplo n.º 1
0
/**
 * makefile template
 */
function makeMakefile($token, $v, $core, $modules, $themes, $libs, $opts)
{
    $opts['version'] = $v;
    $makefile = '; ----------------
; Generated makefile from http://drushmake.me
; Permanent URL: ' . fileURL($token, $opts) . '
; ----------------
;
; This is a working makefile - try it! Any line starting with a `;` is a comment.
  
; Core version
; ------------
; Each makefile should begin by declaring the core version of Drupal that all
; projects should be compatible with.
  
core = ' . $opts['version'] . '.x
  
; API version
; ------------
; Every makefile needs to declare its Drush Make API version. This version of
; drush make uses API version `2`.
  
api = 2
  
; Core project
; ------------
; In order for your makefile to generate a full Drupal site, you must include
; a core project. This is usually Drupal core, but you can also specify
; alternative core projects like Pressflow. Note that makefiles included with
; install profiles *should not* include a core project.
  
' . makeCore($core, $opts) . '
  
  
; Modules
; --------
' . makeModules($modules, $opts) . '
  

; Themes
; --------
' . makeThemes($themes, $opts) . '
  
  
; Libraries
; ---------
' . makeLibs($libs, $opts) . '

';
    // end of makefile
    return $makefile;
}
Exemplo n.º 2
0
  /* debug
  print '<pre>'."\r\n";
  print $token." -token\r\n";
  print $version." -version\r\n";
  print $core."\r\n";
  print $modules."\r\n";
  print $themes."\r\n";
  print $libs."\r\n";
  print $opts."\r\n";
  print '</pre>'."\r\n";
  exit;
  //*/


  // store in db
  $storeSQL = sprintf("INSERT INTO `makefiles` (token,version,core,modules,themes,libs,opts) VALUES ('%s','%s','%s','%s','%s','%s','%s'); ",$token,$version,$core,$modules,$themes,$libs,$opts);
  $storeResult = mysql_query($storeSQL) or die(mysql_error());

  // sharing.. later
  if ($storeResult) {$share = TRUE; }
  else {$share = FALSE; }

}

// redirect
header("Location: ".fileURL($token));

ob_flush();

?>
Exemplo n.º 3
0
      print $modules."\r\n";
      print $themes."\r\n";
      print $libs."\r\n";
      print $opts."\r\n";
      print '</pre>'."\r\n";
      exit;
      //*/
    // store in db
    $storeSQL = sprintf("INSERT INTO `makefiles` (token,version,core,modules,themes,libs,opts) VALUES ('%s','%s','%s','%s','%s','%s','%s'); ", $token, $version, $core, $modules, $themes, $libs, $opts);
    $storeResult = mysql_query($storeSQL) or die(mysql_error());
    // store makefile alias
    if ($storeResult && !empty($_REQUEST['makefile']['opts']['alias'])) {
        // security
        $alias = $urlOpts['alias'] = sanitize('alias', $_REQUEST['makefile']['opts']['alias']);
        // store alias
        $shareSQL = sprintf("INSERT INTO aliases (token, alias) VALUES ('%s','%s');", $token, $alias);
        $shareResult = mysql_query($shareSQL) or die(mysql_error());
        // tell the next page what we did
        $share = TRUE;
    } else {
        // tell the next page what we did
        $share = FALSE;
    }
}
// redirect appropriately
if ($share) {
    header("Location: " . fileURL($alias, $urlOpts));
} else {
    header("Location: " . fileURL($token, $urlOpts));
}
ob_flush();
Exemplo n.º 4
0
</textarea>

		<?php 
    } else {
        ?>

  		<h2>Your makefile is ready</h2>
  		<p>We've saved it for you as well!</p>
  		<ul>
  		  <li><a href="<?php 
        print fileURL($token, $opts);
        ?>
">Bookmark</a></li>
  		  <li><a href="<?php 
        $opts['raw'] = 'raw';
        print fileURL($token, $opts);
        ?>
">raw makefile</a></li>
  		  <li>or (in the future) update previous makefiles</li>
  		</ul>
      <textarea name="makefile" id="makefile"><?php 
        print $makefile;
        ?>
</textarea>

		<?php 
    }
    ?>
	</div>
	
	<div class="grid_12" id="deploy">
Exemplo n.º 5
0
				<li><a href="/index.php#generate">generate</a></li>
				<li><a href="http://drupal.org/project/drush_make">make</a></li>
			</ol>
		</nav>
	</header>
	
	<div class="grid_12" id="what">
		<?php if (isset($fail)){ ?>
  		<h2>Dang it...</h2>
  		<textarea name="makefile" id="makefile" class="<?php print $fail ?>"><?php print $error; ?></textarea>
		<?php } else { ?>
  		<h2>Your makefile is ready</h2>
  		<p>We've saved it for you as well!</p>
  		<ul>
  		  <li><a href="<?php print fileURL($token); ?>">Bookmark</a></li>
  		  <li><a href="<?php print fileURL($token,'raw'); ?>">raw makefile</a></li>
  		  <li>or (in the future) update previous makefiles</li>
  		</ul>
      <textarea name="makefile" id="makefile"><?php print $makefile; ?></textarea>
		<?php } ?>
	</div>
	
	<div class="grid_12" id="deploy">
		<h2>Deploy your makefile</h2>
		<p><a href="http://drupal.org/project/drush">Drush</a> and <a href="http://drupal.org/project/drush_make">Drush Make</a> turn your makefile into a Drupal installation. Then you can get building!</p>
	</div>
	
  <?php include('footer.php'); ?>

</body>
</html>