• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getBaseURL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getBaseURL函数的典型用法代码示例。如果您正苦于以下问题:PHP getBaseURL函数的具体用法?PHP getBaseURL怎么用?PHP getBaseURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getBaseURL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __register_template

 function __register_template()
 {
     global $conf;
     if (!empty($_REQUEST['q'])) {
         require_once DOKU_INC . 'inc/JSON.php';
         $json = new JSON();
         $tempREQUEST = (array) $json->dec(stripslashes($_REQUEST['q']));
     } else {
         if (!empty($_REQUEST['template'])) {
             $tempREQUEST = $_REQUEST;
         } else {
             if (preg_match("/(js|css)\\.php\$/", $_SERVER['SCRIPT_NAME']) && isset($_SERVER['HTTP_REFERER'])) {
                 // this is a css or script, nothing before matched and we have a referrer.
                 // lets asume we came from the dokuwiki page.
                 // Parse the Referrer URL
                 $url = parse_url($_SERVER['HTTP_REFERER']);
                 parse_str($url['query'], $tempREQUEST);
             } else {
                 return;
             }
         }
     }
     // define Template baseURL
     if (empty($tempREQUEST['template'])) {
         return;
     }
     $tplDir = DOKU_INC . 'lib/tpl/' . $tempREQUEST['template'] . '/';
     if (!file_exists($tplDir)) {
         return;
     }
     // Set hint for Dokuwiki_Started event
     if (!defined('SITEEXPORT_TPL')) {
         define('SITEEXPORT_TPL', $tempREQUEST['template']);
     }
     // define baseURL
     // This should be DEPRECATED - as it is in init.php which suggest tpl_basedir and tpl_incdir
     /* **************************************************************************************** */
     if (!defined('DOKU_REL')) {
         define('DOKU_REL', getBaseURL(false));
     }
     if (!defined('DOKU_URL')) {
         define('DOKU_URL', getBaseURL(true));
     }
     if (!defined('DOKU_BASE')) {
         if (isset($conf['canonical'])) {
             define('DOKU_BASE', DOKU_URL);
         } else {
             define('DOKU_BASE', DOKU_REL);
         }
     }
     // This should be DEPRECATED - as it is in init.php which suggest tpl_basedir and tpl_incdir
     if (!defined('DOKU_TPL')) {
         define('DOKU_TPL', (empty($tempREQUEST['base']) ? DOKU_BASE : $tempREQUEST['base']) . 'lib/tpl/' . $tempREQUEST['template'] . '/');
     }
     if (!defined('DOKU_TPLINC')) {
         define('DOKU_TPLINC', $tplDir);
     }
     /* **************************************************************************************** */
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:59,代码来源:preload.php


示例2: collectParameters

function collectParameters()
{
    $parameters = new stdClass();
    $parameters->app_id = filter_input(INPUT_GET, "app_id");
    $parameters->account_id = filter_input(INPUT_GET, "account_id");
    $parameters->api_key = filter_input(INPUT_GET, "api_key");
    $parameters->baseURL = getBaseURL(true);
    return $parameters;
}
开发者ID:JulioOrdonezV,项目名称:pvcloud,代码行数:9,代码来源:vse_api_generate.php


示例3: redirectHash

function redirectHash($hash)
{
    $hash = assertValidHash($hash);
    $link = getBaseURL() . "#{$hash}";
    header("Location: {$link}");
    echo "Redirecting to <a href=\"{$link}\">{$link}</a>. ";
    echo "Click on that link if you're not redirected.";
    die;
}
开发者ID:AndrewWang996,项目名称:courseroad,代码行数:9,代码来源:functions.php


示例4: redirect

 public static function redirect($name)
 {
     if (!isset($_SESSION[$name])) {
         $config = eval(substr(file_get_contents(SYSC . 'config.php'), 5));
         if (!isset($config["route_defauls"]["login"])) {
             throw new Exception("Please specify route_defauls-login in config file.");
         }
         redirect(getBaseURL($config["route_defauls"]["login"]) . "?redirect=" . urlencode(System::getCurrentURL()));
     }
 }
开发者ID:janibhautik,项目名称:micro-struct,代码行数:10,代码来源:Session.php


示例5: sendPWRecoveryEmail

 /**
  * 
  * @param be_account $account
  */
 private static function sendPWRecoveryEmail($account)
 {
     $recoveryURL = getBaseURL("pvcloud") . "#/passwordrecovery/{$account->account_id}/{$account->confirmation_guid}";
     $message = "Le comunicamos que el proceso de recuperación de contraseña fue completado con éxito.\n\n";
     $to = $account->email;
     $subject = "pvCloud - Recuperación de Contraseña Completada";
     $enter = "\r\n";
     $headers = "From: [email protected] {$enter}";
     $headers .= "MIME-Version: 1.0 {$enter}";
     $headers .= "Content-type: text/plain; charset=utf-8 {$enter}";
     $result = mail($to, $subject, $message, $headers);
 }
开发者ID:JulioOrdonezV,项目名称:pvcloud,代码行数:16,代码来源:account_password_recovery_execute.php


示例6: sendPWRecoveryEmail

 /**
  * 
  * @param be_account $account
  */
 private static function sendPWRecoveryEmail($account)
 {
     $recoveryURL = getBaseURL("pvcloud") . "#/passwordrecovery/{$account->account_id}/{$account->confirmation_guid}";
     $message = "Hemos recibido una solicitud de recuperación de contraseña para su cuenta en pvCloud.\n\n";
     $message .= "Para recuperar su contraseña sírvase acceder al siguiente enlace dentro de las próximas 24 horas.\n\n";
     $message .= $recoveryURL . "\n\n";
     $message .= "Si usted no necesita recuperar su contraseña, por favor ignore este mensaje.\n\n";
     $message .= "Si usted no solicitó un cambio de contraseña, puede que alguien esté intentando violentar su cuenta;\n\n";
     $message .= "en cuyo caso por favor reporte el incidente a [email protected]\n\n";
     $to = $account->email;
     $subject = "pvCloud - Recuperación de Contraseña";
     $enter = "\r\n";
     $headers = "From: [email protected] {$enter}";
     $headers .= "MIME-Version: 1.0 {$enter}";
     $headers .= "Content-type: text/plain; charset=utf-8 {$enter}";
     $result = mail($to, $subject, $message, $headers);
 }
开发者ID:JulioOrdonezV,项目名称:pvcloud,代码行数:21,代码来源:account_password_recovery_request.php


示例7: checkUser

 /**
  * Caso exista o cookie de autenticação, verifica se o token é válido
  */
 public static function checkUser()
 {
     $user = self::user();
     if ($user == null) {
         \Log::warning('Usuário do cookie inválido. Removendo cookie');
         // remove o cookie
         \Controllers\SessionsController::destroySessionCookie();
     } else {
         $data = \Controllers\SessionsController::extractCookieInfo();
         $cookieToken = isset($data['token']) ? $data['token'] : null;
         $dbToken = $user->getToken();
         if ($data == null || $cookieToken != $dbToken) {
             \Log::warning('Token do cookie inválido. Removendo cookie');
             // remove o cookie
             \Controllers\SessionsController::destroySessionCookie();
             redirect(getBaseURL());
         }
     }
 }
开发者ID:beingsane,项目名称:UltimatePHPerguntas,代码行数:22,代码来源:Auth.php


示例8: handle_feed_item

 /**
  * Removes draft entries from feeds
  *
  * @author Michael Klier <[email protected]>
  */
 function handle_feed_item(&$event, $param)
 {
     global $conf;
     $url = parse_url($event->data['item']->link);
     $base_url = getBaseURL();
     // determine page id by rewrite mode
     switch ($conf['userewrite']) {
         case 0:
             preg_match('#id=([^&]*)#', $url['query'], $match);
             if ($base_url != '/') {
                 $id = cleanID(str_replace($base_url, '', $match[1]));
             } else {
                 $id = cleanID($match[1]);
             }
             break;
         case 1:
             if ($base_url != '/') {
                 $id = cleanID(str_replace('/', ':', str_replace($base_url, '', $url['path'])));
             } else {
                 $id = cleanID(str_replace('/', ':', $url['path']));
             }
             break;
         case 2:
             preg_match('#doku.php/([^&]*)#', $url['path'], $match);
             if ($base_url != '/') {
                 $id = cleanID(str_replace($base_url, '', $match[1]));
             } else {
                 $id = cleanID($match[1]);
             }
             break;
     }
     // don't add drafts to the feed
     if (p_get_metadata($id, 'type') == 'draft') {
         $event->preventDefault();
         return;
     }
 }
开发者ID:kosenconf,项目名称:kcweb,代码行数:42,代码来源:action.php


示例9: test12

 /**
  * Absolute URL with IPv6 domain name.
  * lighttpd, fastcgi
  *
  * data provided by Michael Hamann <[email protected]>
  */
 function test12()
 {
     global $conf;
     $conf['basedir'] = '';
     $conf['baseurl'] = '';
     $conf['canonical'] = 0;
     $_SERVER['DOCUMENT_ROOT'] = '/srv/http/';
     $_SERVER['HTTP_HOST'] = '[fd00::6592:39ed:a2ed:2c78]';
     $_SERVER['SCRIPT_FILENAME'] = '/srv/http/~michitux/dokuwiki/doku.php';
     $_SERVER['REQUEST_URI'] = '/~michitux/dokuwiki/doku.php?do=debug';
     $_SERVER['SCRIPT_NAME'] = '/~michitux/dokuwiki/doku.php';
     $_SERVER['PATH_INFO'] = null;
     $_SERVER['PATH_TRANSLATED'] = null;
     $_SERVER['PHP_SELF'] = '/~michitux/dokuwiki/doku.php';
     $_SERVER['SERVER_PORT'] = '80';
     $_SERVER['SERVER_NAME'] = '[fd00';
     $this->assertEquals(getBaseURL(true), 'http://[fd00::6592:39ed:a2ed:2c78]/~michitux/dokuwiki/');
 }
开发者ID:richmahn,项目名称:Door43,代码行数:24,代码来源:init_getbaseurl.test.php


示例10: getMainURL

 /**
  * Get the website of the restaurant
  */
 public function getMainURL()
 {
     return getBaseURL($this->getBaseMenuURL());
 }
开发者ID:biwax,项目名称:OVOMA,代码行数:7,代码来源:class.BaseParser.php


示例11: getCurrentURL

/**
 * Retorna a URL atual
 * @return string URL atual
 */
function getCurrentURL()
{
    return getBaseURL() . $_SERVER['REQUEST_URI'];
}
开发者ID:beingsane,项目名称:UltimatePHPerguntas,代码行数:8,代码来源:functions.php


示例12: getBaseURL

<?php

// Raidplaner RSS Feed
// This is a demo implementation of an RSS feed, but it can be used as is, too.
//
// Usage:
// feed.php?token=<private token>&timezone=<timezone>
//
// Timezone is optional and has to be compatible to date_default_timezone_set().
require_once "lib/private/api.php";
require_once "lib/private/out.class.php";
Out::writeHeadersXML();
echo '<rss version="2.0">';
// Build RSS header
$BaseURL = getBaseURL();
$Out = new Out();
$Out->pushValue("title", "Raidplaner RSS feed");
$Out->pushValue("link", $BaseURL . "index.php");
$Out->pushValue("description", "Upcoming raids for the next 2 weeks.");
$Out->pushValue("language", "en-en");
$Out->pushValue("copyright", "packedpixel");
$Out->pushValue("pubDate", date(DATE_RSS));
// Requires private token to be visible
$Token = isset($_REQUEST["token"]) ? $_REQUEST["token"] : null;
if (Api::testPrivateToken($Token)) {
    // Setting the correct timezones
    $Timezone = isset($_REQUEST["timezone"]) ? $_REQUEST["timezone"] : date_default_timezone_get();
    // Query API
    date_default_timezone_set("UTC");
    $Parameters = array("start" => time() - 24 * 60 * 60, "end" => time() + 14 * 24 * 60 * 60, "limit" => 0, "closed" => true, "canceled" => true);
    $Locations = Api::queryLocation(null);
开发者ID:zatoshi,项目名称:raidplaner,代码行数:31,代码来源:feed.php


示例13: mysqli_fetch_assoc

    $appointmentInfo = mysqli_fetch_assoc($result);
    // delete record
    sendQuery("DELETE FROM Schedules WHERE Timestamp='{$timestamp}'");
    sendEmail('TokBox Demo', '[email protected]', $appointmentInfo['Name'], $appointmentInfo['Email'], "Cancelled: Your TokBox appointment on " . $appointmentInfo['Timestring'], "Your appointment on " . $appointmentInfo['Timestring'] . ". has been cancelled. We are sorry for the inconvenience, please reschedule on " . getBaseURL() . "/index.php/");
    header("Content-Type: application/json");
    echo json_encode($appointmentInfo);
});
$app->post('/schedule', function () use($app, $con, $opentok) {
    $name = $app->request->post("name");
    $email = $app->request->post("email");
    $comment = $app->request->post("comment");
    $timestamp = $app->request->post("timestamp");
    $daystring = $app->request->post("daystring");
    $session = $opentok->createSession();
    $sessionId = $session->getSessionId();
    $timestring = $app->request->post("timestring");
    $query = sprintf("INSERT INTO Schedules (Name, Email, Comment, Timestamp, Daystring, Sessionid, Timestring) VALUES ('%s', '%s', '%s', '%d', '%s', '%s', '%s')", mysqli_real_escape_string($con, $name), mysqli_real_escape_string($con, $email), mysqli_real_escape_string($con, $comment), intval($timestamp), mysqli_real_escape_string($con, $daystring), mysqli_real_escape_string($con, $sessionId), mysqli_real_escape_string($con, $timestring));
    sendQuery($query);
    sendEmail('TokBox Demo', '[email protected]', $name, $email, "Your TokBox appointment on " . $timestring, "You are confirmed for your appointment on " . $timestring . ". On the day of your appointment, go here: " . getBaseURL() . "/index.php/chat/" . $sessionId);
    $app->render('schedule.php');
});
$app->get('/rep', function () use($app) {
    $app->render('rep.php');
});
$app->get('/chat/:session_id', function ($session_id) use($app, $con, $apiKey, $opentok) {
    $result = sendQuery("SELECT * FROM Schedules WHERE Sessionid='{$session_id}'");
    $appointmentInfo = mysqli_fetch_assoc($result);
    $token = $opentok->generateToken($session_id);
    $app->render('chat.php', array('name' => $appointmentInfo['Name'], 'email' => $appointmentInfo['Email'], 'comment' => $appointmentInfo['Comment'], 'apiKey' => $apiKey, 'session_id' => $session_id, 'token' => $token));
});
$app->run();
开发者ID:aullman,项目名称:schedulekit-php,代码行数:31,代码来源:index.php


示例14: delete

 /**
  * Remove uma pergunta
  * @param  int $id ID da pergunta
  */
 public static function delete($id)
 {
     // impede acesso por não administradores
     \Auth::denyNonAdminUser();
     if (\Models\Question::delete((int) $id)) {
         redirect(getBaseURL());
     } else {
         echo "Erro ao remover pergunta";
     }
 }
开发者ID:beingsane,项目名称:UltimatePHPerguntas,代码行数:14,代码来源:QuestionsController.php


示例15: getPDFURL

 /**
  * pattern: first <a> with class 'wa-but-txt '
  */
 protected function getPDFURL()
 {
     $doc = parent::getDOMDocument();
     $finder = new DomXPath($doc);
     $spaner = $finder->query("//*[contains(@class, 'wa-but-txt ')]");
     // get first <a>
     if ($spaner->length > 0) {
         $pdfLink = $spaner->item(0);
         return getBaseURL($this->getBaseMenuURL()) . $pdfLink->getAttribute('href');
     }
     return null;
 }
开发者ID:biwax,项目名称:OVOMA,代码行数:15,代码来源:class.Restaurants.php


示例16: processLoginForm

 /**
  * Processa o formulário de login
  */
 protected static function processLoginForm()
 {
     // proteção contra CSRF
     \CSRF::Check();
     $email = isset($_POST['email']) ? $_POST['email'] : null;
     $password = isset($_POST['password']) ? $_POST['password'] : null;
     $hashedPassword = \Hash::password($password);
     $errors = [];
     if (empty($email)) {
         $errors[] = 'Informe seu email';
     }
     if (empty($password)) {
         $errors[] = 'Informe sua senha';
     }
     if (count($errors) > 0) {
         return \View::make('login', compact('errors'));
     }
     $DB = new \DB();
     $sql = "SELECT id, password, status FROM users WHERE email = :email";
     $stmt = $DB->prepare($sql);
     $stmt->bindParam(':email', $email);
     $stmt->execute();
     $rows = $stmt->fetchAll(\PDO::FETCH_OBJ);
     if (count($rows) <= 0) {
         $errors[] = 'Usuário não encontrado';
     } else {
         $user = $rows[0];
         if ($hashedPassword != $user->password) {
             $errors[] = 'Senha incorreta';
         } elseif ($user->status != \Models\User::STATUS_ACTIVE) {
             $errors[] = 'Ative sua conta antes de fazer login';
         } else {
             // busca os dados do usuário para criar os dados no cookie
             $objUser = new \Models\User();
             $objUser->find($user->id);
             // gera um token de acesso
             $token = $objUser->generateToken();
             // salva o cookie com os dados do usuário
             self::saveSessionCookieForUser($objUser);
             // redireciona para a página inicial
             redirect(getBaseURL());
         }
     }
     if (count($errors) > 0) {
         return \View::make('login', compact('errors'));
     }
 }
开发者ID:beingsane,项目名称:UltimatePHPerguntas,代码行数:50,代码来源:SessionsController.php


示例17: md5

if (isset($urlGET) && $urlGET != "NONE" && isUrl($urlGET)) {
    $randomData = md5(uniqid(mt_rand(), false));
    $currentHash = md5($urlGET . $randomData, false);
    $currentUrl = $urlGET;
    unset($urlGET);
} else {
    if (isset($urlPOST) && $urlPOST != "NONE" && isUrl($urlPOST)) {
        $randomData = md5(uniqid(mt_rand(), false));
        $currentHash = md5($urlPOST . $randomData, false);
        $currentUrl = $urlPOST;
        unset($urlPOST);
    }
}
header('Content-type: application/json');
if ($currentHash != null && $currentUrl != null) {
    $conection = @mysql_connect("localhost", "user", "pass") or die("error connection");
    @mysql_select_db("pocs", $conection) or die("error select db");
    $sql = "INSERT INTO shortener (hash, url) VALUES ('{$currentHash}','{$currentUrl}')";
    @mysql_query($sql) or die("error query");
    @mysql_close($conection) or die("error close");
    $response["url"] = getBaseURL() . "redirect.php?url={$currentHash}";
    $response["response"] = "Shorting URL Successful";
    $response["code"] = 1;
} else {
    $response["response"] = "Invalid URL";
    $response["code"] = 0;
    $response["url"] = "";
}
echo json_encode($response);
unset($response);
exit;
开发者ID:JhetoX,项目名称:URLRandomShortener,代码行数:31,代码来源:api.php


示例18: store

 /**
  * Registra o usuário
  */
 public static function store()
 {
     \CSRF::Check();
     $nickname = isset($_POST['nickname']) ? $_POST['nickname'] : null;
     $email = isset($_POST['email']) ? $_POST['email'] : null;
     $password = isset($_POST['password']) ? $_POST['password'] : null;
     $passwordConfirmation = isset($_POST['password_confirmation']) ? $_POST['password_confirmation'] : null;
     $hashedPassword = \Hash::password($password);
     $hasErrors = false;
     $errorMessages = [];
     if ($nickname == null) {
         $errorMessages[] = "Informe seu apelido";
         $hasErrors = true;
     }
     if ($email == null) {
         $errorMessages[] = "Informe seu email";
         $hasErrors = true;
     }
     if ($password == null) {
         $errorMessages[] = "Informe uma senha";
         $hasErrors = true;
     }
     if ($passwordConfirmation == null) {
         $errorMessages[] = "Confirme sua senha";
         $hasErrors = true;
     }
     if ($password != $passwordConfirmation) {
         $errorMessages[] = "Senhas não coincidem";
         $hasErrors = true;
     }
     if ($hasErrors) {
         return \View::make('user.create', compact('errorMessages'));
     }
     $sql = "INSERT INTO users(name, nickname, email, password, status, admin, created_at, updated_at) VALUES(:name, :nickname, :email, :password, :status, :admin, :created_at, :updated_at)";
     $DB = new \DB();
     $stmt = $DB->prepare($sql);
     $date = date('Y-m-d H:i:s');
     $stmt->bindParam(':name', $name);
     $stmt->bindParam(':nickname', $nickname);
     $stmt->bindParam(':email', $email);
     $stmt->bindParam(':password', $hashedPassword);
     $stmt->bindValue(':status', \Models\User::STATUS_ACTIVE, \PDO::PARAM_INT);
     $stmt->bindValue(':admin', '0');
     $stmt->bindParam(':created_at', $date);
     $stmt->bindParam(':updated_at', $date);
     if ($stmt->execute()) {
         // em vez de apenas exibir uma mensagem de sucesso, faremos um redirecionamento.
         // isso é melhor pois evita que o usuário atualize a página e crie uma nova conta
         redirect(getBaseURL() . '/cadastro_finalizado');
     } else {
         list($error, $sgbdErrorCode, $sgbdErrorMessage) = $stmt->errorInfo();
         if ($sgbdErrorCode == 1062) {
             // erro 1062 é o código do MySQL de violação de chave única
             // veja mais em: http://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html
             if (preg_match("/for key .?nickname/iu", $sgbdErrorMessage)) {
                 // nickname já em uso
                 $errorMessages[] = "Apelido já está em uso";
             } else {
                 // email já em uso
                 $errorMessages[] = "Email já está em uso";
             }
         }
         return \View::make('user.create', compact('errorMessages'));
     }
 }
开发者ID:beingsane,项目名称:UltimatePHPerguntas,代码行数:68,代码来源:UsersController.php


示例19: onRaidCreate

 public function onRaidCreate($aRaidId)
 {
     if ($this->authenticate()) {
         // Query the given raid, make sure we include canceled and closed
         // raids
         $Parameters = array('raid' => $aRaidId, 'canceled' => true, 'closed' => true);
         $RaidResult = Api::queryRaid($Parameters);
         if (count($RaidResult) > 0) {
             // As we specified a specific raid id, we are only
             // interested in the first (and only) raid.
             // Cache and set UTC timezone just to be sure.
             $Raid = $RaidResult[0];
             $LocationName = $this->mLocations[$Raid['LocationId']];
             $Url = getBaseURL() . 'index.php#raid,' . $aRaidId;
             $Timezone = date_default_timezone_get();
             try {
                 date_default_timezone_set('UTC');
                 $Start = new Google_Service_Calendar_EventDateTime();
                 $Start->setDateTime(date($this->mDateFormat, intval($Raid['Start'])));
                 $Start->setTimeZone('UTC');
                 $End = new Google_Service_Calendar_EventDateTime();
                 $End->setDateTime(date($this->mDateFormat, intval($Raid['End'])));
                 $End->setTimeZone('UTC');
                 $Properties = new Google_Service_Calendar_EventExtendedProperties();
                 $Properties->setShared(array('RaidId' => $aRaidId));
                 $Source = new Google_Service_Calendar_EventSource();
                 $Source->setTitle('Raidplaner link');
                 $Source->setUrl($Url);
                 $Event = new Google_Service_Calendar_Event();
                 $Event->setSummary($LocationName . ' (' . $Raid['Size'] . ')');
                 $Event->setLocation($LocationName);
                 $Event->setDescription($Raid['Description']);
                 $Event->setOriginalStartTime($Start);
                 $Event->setStart($Start);
                 $Event->setEnd($End);
                 $Event->setExtendedProperties($Properties);
                 $Event->setSource($Source);
                 $this->mCalService->events->insert(GOOGLE_CAL_ID, $Event);
             } catch (Exception $Ex) {
                 $Out = Out::getInstance();
                 $Out->pushError($Ex->getMessage());
             }
             date_default_timezone_set($Timezone);
         }
     }
 }
开发者ID:zatoshi,项目名称:raidplaner,代码行数:46,代码来源:gcal.php


示例20: rrmdir

         if (!mkdir($user_settings['frameworklocation'])) {
             echo "<h1>Oh. Shit. Something's wrong.</h1><p>Couldn't create a directory at" . $user_settings['frameworklocation'] . ".</p>";
             break;
         }
     } else {
         if (is_dir($user_settings['frameworklocation'] . '/framework')) {
             rrmdir($user_settings['frameworklocation'] . '/framework');
             //echo 'removed old framework directory at ' . $cash_root_location . '/framework' . '<br />';
         }
     }
 } else {
     echo "<h1>Oh. Shit. Something's wrong.</h1><p>No core location specified.</p>";
     break;
 }
 // modify settings files
 if (!findReplaceInFile('./source/interfaces/php/admin/.htaccess', 'RewriteBase /interfaces/php/admin', 'RewriteBase ' . $admin_dir) || !findReplaceInFile('./source/interfaces/php/admin/constants.php', '$cashmusic_root = $root . "/../../../framework/php/cashmusic.php', '$cashmusic_root = "' . $user_settings['frameworklocation'] . '/framework/cashmusic.php') || !findReplaceInFile('./source/interfaces/php/admin/constants.php', 'define(\'ADMIN_WWW_BASE_PATH\', \'/interfaces/php/admin', 'define(\'ADMIN_WWW_BASE_PATH\', \'' . $admin_dir) || !findReplaceInFile('./source/interfaces/php/api/controller.php', 'dirname(__FILE__).\'/../../../framework/php', '$cashmusic_root = "' . $user_settings['frameworklocation'] . '/framework') || !findReplaceInFile('./source/interfaces/php/demos/index.html', '../../../docs/assets/fonts', 'https://cashmusic.s3.amazonaws.com/permalink/fonts') || !findReplaceInFile('./source/interfaces/php/demos/index.html', '<a href="/interfaces/php/admin/">Admin</a> <a href="/interfaces/php/demos/">Demos</a> <a href="/docs/">Docs</a> <a href="http://github.com/cashmusic/DIY">Github Repo</a>', '<a href="../admin/">Admin</a> <a href="http://cashmusic.github.com/DIY/">Docs</a> <a href="http://github.com/cashmusic/DIY">Github Repo</a>') || !findReplaceInFile('./source/interfaces/php/demos/emailcontestentry/index.php', '../../../../framework/php/cashmusic.php', $user_settings['frameworklocation'] . '/framework/cashmusic.php') || !findReplaceInFile('./source/interfaces/php/demos/emailfordownload/index.php', '../../../../framework/php/cashmusic.php', $user_settings['frameworklocation'] . '/framework/cashmusic.php') || !findReplaceInFile('./source/interfaces/php/demos/filteredsocialfeeds/index.php', '../../../../framework/php/cashmusic.php', $user_settings['frameworklocation'] . '/framework/cashmusic.php') || !findReplaceInFile('./source/interfaces/php/demos/tourdates/index.php', '../../../../framework/php/cashmusic.php', $user_settings['frameworklocation'] . '/framework/cashmusic.php') || !findReplaceInFile('./source/interfaces/php/demos/emailcontestentry/index.php', '../../../../framework/php/settings/debug/cashmusic_debug.php', $user_settings['frameworklocation'] . '/framework/settings/debug/cashmusic_debug.php') || !findReplaceInFile('./source/interfaces/php/demos/emailfordownload/index.php', '../../../../framework/php/settings/debug/cashmusic_debug.php', $user_settings['frameworklocation'] . '/framework/settings/debug/cashmusic_debug.php') || !findReplaceInFile('./source/interfaces/php/demos/filteredsocialfeeds/index.php', '../../../../framework/php/settings/debug/cashmusic_debug.php', $user_settings['frameworklocation'] . '/framework/settings/debug/cashmusic_debug.php') || !findReplaceInFile('./source/interfaces/php/demos/tourdates/index.php', '../../../../framework/php/settings/debug/cashmusic_debug.php', $user_settings['frameworklocation'] . '/framework/settings/debug/cashmusic_debug.php') || !findReplaceInFile('./source/framework/php/settings/cashmusic_template.ini.php', 'driver = "mysql', 'driver = "sqlite') || !findReplaceInFile('./source/framework/php/settings/cashmusic_template.ini.php', 'database = "seed', 'database = "cashmusic.sqlite') || !findReplaceInFile('./source/framework/php/settings/cashmusic_template.ini.php', 'apilocation = "http://localhost:8888/interfaces/php/api/', 'apilocation = "' . getBaseURL() . str_replace('/admin', '/api', $admin_dir)) || !findReplaceInFile('./source/framework/php/settings/cashmusic_template.ini.php', 'salt = "I was born of sun beams; Warming up our limbs', 'salt = "' . $user_settings['systemsalt']) || !findReplaceInFile('./source/framework/php/settings/cashmusic_template.ini.php', 'systememail = "[email protected]', 'systememail = "system@' . $_SERVER['SERVER_NAME'])) {
     echo "<h1>Oh. Shit. Something's wrong.</h1><p>We had trouble editing a few files. Please try again.</p>";
     break;
 }
 // move source files into place
 if (!rename('./source/framework/php/settings/cashmusic_template.ini.php', './source/framework/php/settings/cashmusic.ini.php') || !rename('./source/framework/php', $user_settings['frameworklocation'] . '/framework') || !rename('./source/interfaces/php/admin', './admin') || !rename('./source/interfaces/php/api', './api') || !rename('./source/interfaces/php/demos', './demos') || !rename('./source/interfaces/php/public', './public')) {
     echo '<h1>Oh. Shit. Something\'s wrong.</h1> <p>We couldn\'t move files into place. Please make sure you have write access in ' . 'the directory you specified for the core.</p>';
     break;
 }
 // set up database, add user / password
 $user_password = substr(md5($user_settings['systemsalt'] . 'password'), 4, 7);
 // if the directory was never created then create it now
 if (!file_exists($user_settings['frameworklocation'] . '/db')) {
     mkdir($user_settings['frameworklocation'] . '/db');
 }
 // connect to the new db...will create if not found
开发者ID:nodots,项目名称:DIY,代码行数:31,代码来源:cashmusic_web_installer.php



注:本文中的getBaseURL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getBaseUrl函数代码示例发布时间:2022-05-15
下一篇:
PHP getBaseLanguageFromSurveyID函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap