function do_create() { global $context, $create_path, $txt, $sourcedir, $boardurl; if (!file_exists($create_path)) { @mkdir($create_path); } if (!file_exists($create_path) || !is_writable($create_path)) { fatal_error($txt['path_not_writable'], false); } $context['clean_name'] = htmlspecialchars(str_replace(array(' ', ',', ':', '.', ';', '#', '@', '='), array('_'), $context['mod_name'])); $current_path = $create_path . '/' . $context['clean_name']; // Let's start fresh everytime if (file_exists($current_path)) { require_once $sourcedir . '/Subs-Package.php'; deltree($current_path); } @mkdir($current_path); if (!file_exists($current_path) || !is_writable($current_path)) { fatal_error($txt['path_not_writable'], false); } $context['current_path'] = $current_path; if (!prepare_files()) { return; } create_mod_xml(); create_package_xml(); // Everything seems fine, now it's time to package everything create_package(); $context['creation_done'] = true; $context['download_url'] = $boardurl . '/patch_to_mod.php?download=' . $context['clean_name']; }
echo "Removing squid last install\n"; remove_squid(); echo "Make install\n"; if ($GLOBALS["VERBOSE"]) { system("make install"); } if (!$GLOBALS["VERBOSE"]) { shell_exec("make install"); } } if (!is_file("/usr/sbin/squid")) { system_admin_events("Installing the new squid-cache {$v} failed", __FUNCTION__, __FILE__, __LINE__, "software"); echo "Failed\n"; } shell_exec("/bin/chown -R squid:squid /usr/share/squid3"); create_package($t); function create_package($t) { $unix = new unix(); $wget = $unix->find_program("wget"); $tar = $unix->find_program("tar"); $rm = $unix->find_program("rm"); $cp = $unix->find_program("cp"); $Architecture = Architecture(); $version = squid_version(); shell_exec("wget http://www.articatech.net/download/anthony-icons.tar.gz -O /tmp/anthony-icons.tar.gz"); @mkdir("/usr/share/squid3/icons", 0755, true); shell_exec("tar -xf /tmp/anthony-icons.tar.gz -C /usr/share/squid3/icons/"); shell_exec("/bin/chown -R squid:squid /usr/share/squid3/icons/"); mkdir("/root/squid-builder/usr/share/squid3", 0755, true); mkdir("/root/squid-builder/etc/squid3", 0755, true);
$configure = @implode(" ", $cmds); if ($GLOBALS["SHOW_COMPILE_ONLY"]) { echo $configure . "\n"; die; } echo "Executing `{$configure}`\n"; if (!$GLOBALS["NO_COMPILE"]) { echo "configuring...\n"; shell_exec($configure); echo "make...\n"; shell_exec("make"); echo "make install...\n"; echo "Make install\n"; shell_exec("make install"); } create_package(); function SAMBA_VERSION() { $unix = new unix(); $winbind = $unix->find_program("winbindd"); exec("{$winbind} -V 2>&1", $results); if (preg_match("#Version\\s+([0-9\\.]+)#i", @implode("", $results), $re)) { return $re[1]; } } function DebianVersion() { $ver = trim(@file_get_contents("/etc/debian_version")); preg_match("#^([0-9]+)\\.#", $ver, $re); if (preg_match("#squeeze\\/sid#", $ver)) { return 6;
create_controller($argv[3], $argv[4]); break; case 'model': create_model($argv[3]); break; case 'routing': create_routing($argv[3]); break; case 'crud': create_crude($argv[3], $argv[4]); break; case 'tables': create_tables(); break; case 'package': create_package($argv[3], $argv[4]); break; default: help(); break; } break; default: help(); break; } } else { help(); } function create_package($folder, $package) {
echo $configure . "\n"; die; } echo "Executing `{$configure}`\n"; if (!$GLOBALS["NO_COMPILE"]) { echo "configuring...\n"; system($configure); echo "make...\n"; system("make upgrade"); echo "make non-interactive-package...\n"; echo "Make non-interactive-package\n"; system("make non-interactive-package /"); echo "Done...\n"; } echo "Creating package...\n"; $package = create_package(); echo "package created was \"{$package}\"\n"; if (is_file("/root/ftp-password")) { echo "Uploading {$package}...\n"; shell_exec("curl -T {$package} ftp://www.articatech.net/download/ --user " . @file_get_contents("/root/ftp-password")); if (is_file("/root/rebuild-artica")) { shell_exec("{$wget} \"" . @file_get_contents("/root/rebuild-artica") . "\" -O /tmp/rebuild.html"); } } function POSTFIX_VERSION() { exec("/usr/sbin/postconf -h mail_version 2>&1", $results); while (list($num, $ligne) = each($results)) { if (preg_match("#^([0-9\\.\\-]+)#", $ligne, $re)) { return $re[1]; }
<?php // test/unit/model/PackageTest.php include dirname(__FILE__) . '/../../bootstrap/Doctrine.php'; $t = new lime_test(2); # save() $t->comment('-> save()'); # Add a record to the package class and test the existence via DQL $package = create_package(array('name' => 'testpackage')); $package->save(); $q = Doctrine_Query::create()->from('Package p')->where('p.name = ?', testpackage); $package = $q->fetchOne(); $t->is($q->count(), 1, '-> save() saved package \'testpackage\' and found via DQL'); # Add a record to the package class with an empty name and test the existence via DQL $package = create_package(array('name' => '')); $package->save(); $q = Doctrine_Query::create()->from('Package p')->where('p.name = ?', ''); $t->is($q->count(), 1, '-> save() saved package.name \'\' (empty name) and found via DQL'); function create_package($defaults = array()) { $package = new Package(); $package->fromArray($defaults); return $package; }