本文整理汇总了PHP中Repository::load_map方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::load_map方法的具体用法?PHP Repository::load_map怎么用?PHP Repository::load_map使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::load_map方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
/**
* setupを開始する
*/
public static function start()
{
Repository::load_map(getcwd() . "/__repository__.xml");
$req = new Request("_inc_session_=false");
if (!$req->is_cli()) {
exit;
}
if (!is_file(File::absolute(getcwd(), "__settings__.php"))) {
$app_install = Command::stdin("install application");
if (!empty($app_install)) {
try {
self::download($app_install);
} catch (RuntimeException $e) {
self::error_print("not foud application " . $app_install);
exit;
}
}
}
$settings_path = File::absolute(getcwd(), "__settings__.php");
if (!is_file($settings_path)) {
$ref = new ReflectionClass("Object");
$jump_path = str_replace("\\", "/", dirname(dirname($ref->getFileName())));
$pwd = str_replace("\\", "/", getcwd());
$url = Command::stdin("application url", "http://localhost/" . basename(getcwd()));
if (!empty($url) && substr($url, -1) != "/") {
$url .= "/";
}
$work = Command::stdin("working directory", App::work());
$mode = Command::stdin("application mode");
App::config_path($pwd, $url, $work, $mode);
$config = sprintf(Text::plain('
<?php
require_once("%s/jump.php");
App::config_path(__FILE__,"%s","%s","%s");
'), $jump_path, $url, $work, $mode);
File::write($settings_path, $config . "\n");
} else {
$maxlen = 0;
$cmd = $value = null;
if ($req->is_vars()) {
$keys = array_keys($req->vars());
$cmd = array_shift($keys);
$value = $req->in_vars($cmd);
}
self::search_cmd($req, $cmd, $value, $maxlen, __CLASS__);
foreach (Lib::classes(true, true) as $path => $name) {
self::search_cmd($req, $cmd, $value, $maxlen, $path);
}
self::info($maxlen);
}
}
示例2: config_path
/**
* 初期定義
*
* @param string $path アプリケーションのルートパス
* @param string $url アプリケーションのURL
* @param string $work 一時ファイルを書き出すパス
* @param string $mode モード
*/
public static function config_path($path, $url = null, $work = null, $mode = null)
{
if (empty($path)) {
$debug = debug_backtrace(false);
$debug = array_pop($debug);
$path = $debug['file'];
}
if (is_file($path)) {
$path = dirname($path);
}
self::$path = preg_replace("/^(.+)\\/\$/", "\\1", str_replace("\\", "/", $path)) . "/";
if (isset($work)) {
if (is_file($work)) {
$work = dirname($work);
}
self::$work = preg_replace("/^(.+)\\/\$/", "\\1", str_replace("\\", "/", $work)) . "/";
} else {
self::$work = self::$path . 'work/';
}
if (!empty($url)) {
self::$url = preg_replace("/^(.+)\\/\$/", "\\1", $url) . "/";
self::$surl = preg_replace("/^http:\\/\\/(.+)\$/", "https://\$1", self::$url);
}
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
list($lang) = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
list($lang) = explode('-', $lang);
self::lang($lang);
self::set_messages(self::$path);
}
self::$mode = empty($mode) ? 'noname' : $mode;
if (is_file(App::path('__repository__.xml'))) {
Repository::load_map(App::path('__repository__.xml'));
}
if (is_file(App::path('__common__.php'))) {
require_once App::path('__common__.php');
}
if (is_file(App::path('__common_' . $mode) . '__.php')) {
require_once App::path('__common_' . $mode . '__.php');
}
}