本文整理汇总了PHP中install函数的典型用法代码示例。如果您正苦于以下问题:PHP install函数的具体用法?PHP install怎么用?PHP install使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了install函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: user_install
function user_install()
{
global $files, $dest_dir;
foreach ($files['user'] as $user_path) {
install($user_path, $dest_dir, false);
}
}
示例2: main
function main()
{
if ($_SERVER['argc'] > 1) {
$option = $_SERVER['argv'][1];
} else {
help();
}
switch ($option) {
case "install":
install();
break;
case "uninstall":
uninstall();
break;
case "newapp":
$_SERVER['argc'] != 3 and help();
newapp($_SERVER['argv'][2]);
break;
case "delapp":
$_SERVER['argc'] != 3 and help();
delapp($_SERVER['argv'][2]);
break;
case "help":
help();
break;
default:
help();
break;
}
}
示例3: apply
private function apply($file, $type)
{
require 'migration/' . $file;
if ($type == 'remove') {
remove();
} else {
install();
}
db()->update_migration->insert(array('id' => $file));
}
示例4: apply
private function apply($file, $type)
{
require $this->dir . $file;
if ($type == 'remove') {
remove($this->db);
} else {
install($this->db);
}
$this->checkTable();
$this->db->migration->insert(array('id' => $file));
}
示例5: plugin_consumables_install
function plugin_consumables_install()
{
global $DB;
include_once GLPI_ROOT . "/plugins/consumables/inc/profile.class.php";
if (!TableExists("glpi_plugin_consumables_requests")) {
include GLPI_ROOT . "/plugins/consumables/install/install.php";
install();
}
PluginConsumablesProfile::initProfile();
PluginConsumablesProfile::createFirstAccess($_SESSION['glpiactiveprofile']['id']);
return true;
}
示例6: bootstrap
function bootstrap()
{
global $user;
session_start();
db_connect();
install();
permission_load();
if (!empty($_SESSION['uid'])) {
$user = user_load($_SESSION['uid']);
} else {
$user->roles = array(1 => 1);
}
}
示例7: download_install
function download_install($key)
{
$GLOBALS["PROGRESS_FILE"] = "/usr/share/artica-postfix/ressources/logs/squid.install.progress";
$GLOBALS["LOG_FILE"] = "/usr/share/artica-postfix/ressources/logs/web/squid.install.progress.txt";
$sock = new sockets();
$ArticaTechNetSquidRepo = unserialize(base64_decode($sock->GET_INFO("ArticaTechNetSquidRepo")));
$array = $ArticaTechNetSquidRepo[$key];
$URL = $array["URL"];
$VERSION = $array["VERSION"];
$FILESIZE = $array["FILESIZE"];
$FILENAME = $array["FILENAME"];
$MD5 = $array["MD5"];
$tarballs_file = "/usr/share/artica-postfix/ressources/conf/upload/{$FILENAME}";
echo "Url......................: {$URL}\n";
echo "Version..................: {$VERSION}\n";
echo "File size................: {$FILESIZE}\n";
echo "Filename.................: {$FILENAME}\n";
echo "MD5......................: {$MD5}\n";
if ($URL == null) {
build_progress("{downloading} {$FILENAME} {failed}...", 110);
die;
}
build_progress("{downloading} {$FILENAME} {please_wait}...", 5);
$curl = new ccurl($URL);
$curl->WriteProgress = true;
$curl->ProgressFunction = "download_progress";
if (!$curl->GetFile($tarballs_file)) {
build_progress("{downloading} {$FILENAME} {failed}...", 110);
@unlink($tarballs_file);
echo $curl->error;
die;
}
build_progress("{checking} {$FILENAME} {please_wait}...", 9);
$filesize = @filesize($tarballs_file);
$md5file = md5_file($tarballs_file);
echo "File size................: {$filesize}\n";
echo "MD5......................: {$md5file}\n";
if ($filesize < 50) {
print_r($curl->CURL_ALL_INFOS);
echo @file_get_contents($tarballs_file);
}
if ($md5file != $MD5) {
@unlink($tarballs_file);
echo "Md5 failed, corrupted file...\n";
build_progress("{checking} {$FILENAME} {failed}...", 110);
die;
}
install($FILENAME);
}
示例8: main
function main(array $args = array())
{
$defaults = array('install-dir' => getcwd());
$args += $defaults;
if (!createFolders($args['install-dir'])) {
return 1;
}
if (!download($args['install-dir'])) {
return 1;
}
if (!install($args['install-dir'])) {
return 1;
}
return 0;
}
示例9: run
function run()
{
if (!extension_loaded('snmp')) {
install();
exit;
}
if (!class_exists("SNMP")) {
exit;
}
$session = new SNMP(SNMP::VERSION_1, "127.0.0.1:3401", "public");
$session->valueretrieval = SNMP_VALUE_PLAIN;
$ifDescr = $session->walk(".1.3.6.1.4.1.3495", TRUE);
// $session->valueretrieval = SNMP_VALUE_LIBRARY;
// $ifType = $session->walk(".1.3.6.1.4.1.3495.1.3", TRUE);
// 2.2.1.10.5
print_r($ifDescr);
}
示例10: run
function run()
{
if (!extension_loaded('snmp')) {
install();
exit;
}
if (!class_exists("SNMP")) {
exit;
}
$session = new SNMP(SNMP::VERSION_1, "127.0.0.1:3401", "public");
$session->valueretrieval = SNMP_VALUE_PLAIN;
$ifDescr = $session->walk(".1.3.6.1.4.1.3495.1.3", TRUE);
$session->valueretrieval = SNMP_VALUE_LIBRARY;
$ifType = $session->walk(".1.3.6.1.4.1.3495.1.3", TRUE);
// 2.2.1.10.5
print_r($ifType);
$result = array();
foreach ($ifDescr as $i => $n) {
$result[$n] = $ifType[$i];
}
print_r($result);
}
示例11: process
function process($argv)
{
if (!isset($argv[1])) {
displayHelp();
exit;
}
switch ($argv[1]) {
case 'install':
install();
break;
case 'add':
add($argv);
break;
case 'rm':
remove($argv);
break;
case 'help':
default:
displayHelp();
break;
}
}
示例12: array_diff
$customModules = array_diff($allModules, $sysModules);
$customModulesParams = initModuleParameters($customModules);
include 'moduleCustom.php';
} elseif ($option == 'installing') {
// 开始安装模块与数据库,注:模块安装有顺序要求,不然插入数据可能会报错
if (isset($_GET['installBegin']) && $_GET['installBegin'] == 1) {
// 异步开始安装
$installModules = $_POST['installModules'];
// 要安装的模块
$installModules = json_decode($installModules);
$installingModule = $_POST['installingModule'];
if (empty($installingModule)) {
$installingModule = $installModules[0];
}
$moduleNums = count($installModules);
$isSuccess = install($installingModule);
// 执行安装模块
if ($isSuccess) {
foreach ($installModules as $k => $module) {
if ($module == $installingModule) {
$index = $k + 1;
if ($index < count($installModules)) {
$nextModule = $installModules[$index];
// 下一个要安装的模块
$nextModuleName = getModuleName($nextModule);
// 下一个要安装的模块名
$process = number_format($index / $moduleNums * 100, 1) . '%';
// 完成度
echo json_encode(array('complete' => 0, 'isSuccess' => 1, 'process' => $process, 'nextModule' => $nextModule, 'nextModuleName' => $nextModuleName));
} else {
echo json_encode(array('complete' => 1, 'process' => '100%'));
示例13: center
/**
* center
*
* @since 1.2.1
* @deprecated 2.0.0
*
* @package Redaxscript
* @category Install
* @author Henry Ruhs
*/
function center()
{
/* check token */
if ($_POST && $_POST['token'] != TOKEN) {
$output = '<div class="box_note note_error">' . l('token_incorrect') . l('point') . '</div>';
echo $output;
return;
}
/* routing */
install_notification();
if (check_install() == 1) {
install();
} else {
install_form();
}
}
示例14: array
{
$dirs = array(DIR_OPENCART . 'image/', DIR_OPENCART . 'system/storage/download/', DIR_OPENCART . 'system/storage/upload/', DIR_OPENCART . 'system/storage/cache/', DIR_OPENCART . 'system/storage/logs/', DIR_OPENCART . 'system/storage/modification/');
exec('chmod o+w -R ' . implode(' ', $dirs));
}
$argv = $_SERVER['argv'];
$script = array_shift($argv);
$subcommand = array_shift($argv);
switch ($subcommand) {
case "install":
try {
$options = get_options($argv);
define('HTTP_OPENCART', $options['http_server']);
$valid = valid($options);
if (!$valid[0]) {
echo "FAILED! Following inputs were missing or invalid: ";
echo implode(', ', $valid[1]) . "\n\n";
exit(1);
}
install($options);
echo "SUCCESS! Opencart successfully installed on your server\n";
echo "Store link: " . $options['http_server'] . "\n";
echo "Admin link: " . $options['http_server'] . "admin/\n\n";
} catch (ErrorException $e) {
echo 'FAILED!: ' . $e->getMessage() . "\n";
exit(1);
}
break;
case "usage":
default:
echo usage();
}
示例15: checkPOST
function checkPOST($args)
{
global $Language;
// Check empty password
if (strlen($args['password']) < 6) {
return '<div>' . $Language->g('Password must be at least 6 characters long') . '</div>';
}
// Check invalid email
if (!Valid::email($args['email']) && $args['noCheckEmail'] == '0') {
return '<div>' . $Language->g('Your email address is invalid') . '</div><div id="jscompleteEmail">' . $Language->g('Proceed anyway') . '</div>';
}
// Sanitize email
$email = sanitize::email($args['email']);
// Install Bludit
install($args['password'], $email, $args['timezone']);
return true;
}