当前位置: 首页>>代码示例>>PHP>>正文


PHP Container::getLogDir方法代码示例

本文整理汇总了PHP中Chamilo\CoreBundle\Framework\Container::getLogDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::getLogDir方法的具体用法?PHP Container::getLogDir怎么用?PHP Container::getLogDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Chamilo\CoreBundle\Framework\Container的用法示例。


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

示例1: api_get_path


//.........这里部分代码省略.........
 * api_get_path(CONFIGURATION_PATH)             /var/www/chamilo/main/inc/conf/
 * api_get_path(SYS_LANG_PATH)                  /var/www/chamilo/main/lang/
 * api_get_path(SYS_PLUGIN_PATH)                /var/www/chamilo/plugin/
 * api_get_path(SYS_TEST_PATH)                  /var/www/chamilo/tests/
 * api_get_path(SYS_TEMPLATE_PATH)              /var/www/chamilo/main/template/
 *
 * api_get_path(WEB_SERVER_ROOT_PATH)           http://www.mychamilo.org/
 *
 * api_get_path(WEB_PUBLIC_PATH)                http://www.mychamilo.org/chamilo/web/
 * api_get_path(WEB_PATH)                       http://www.mychamilo.org/chamilo/
 * api_get_path(WEB_COURSE_PATH)                http://www.mychamilo.org/chamilo/courses/
 * api_get_path(WEB_CODE_PATH)                  http://www.mychamilo.org/chamilo/main/
 * api_get_path(WEB_PLUGIN_PATH)                http://www.mychamilo.org/chamilo/plugin/
 * api_get_path(WEB_ARCHIVE_PATH)               http://www.mychamilo.org/chamilo/archive/
 * api_get_path(WEB_IMG_PATH)                   http://www.mychamilo.org/chamilo/web/chamilo/img/
 * api_get_path(SYS_IMG_PATH)                   /var/www/chamilo/web/bundles/chamilocore/img/
 *
 * api_get_path(WEB_CSS_PATH)                   http://www.mychamilo.org/chamilo/main/css/
 * api_get_path(WEB_LIBRARY_PATH)               http://www.mychamilo.org/chamilo/main/inc/lib/
 * api_get_path(WEB_LIBRARY_JS_PATH)            http://www.mychamilo.org/chamilo/web/Chamilo/javascript
 * api_get_path(WEB_TEMPLATE_PATH)              http://www.mychamilo.org/chamilo/main/template/
 *
 *
 * We can convert arbitrary paths, that are not registered (no defined constant).
 * For guaranteed result, these paths should point inside the system Chamilo.
 * Some random examples:
 * api_get_path(TO_WEB, $_SERVER['REQUEST_URI'])
 * api_get_path(TO_SYS, $_SERVER['PHP_SELF'])
 * api_get_path(TO_REL, __FILE__)
 * ...
 */
function api_get_path($path_type, $path = null)
{
    $paths = array(SYS_DATA_PATH => 'data/', SYS_WEB_PATH => 'web/', SYS_CONFIG_PATH => 'config/', SYS_LOG_PATH => 'logs/', WEB_DATA_COURSE_PATH => 'courses/', WEB_DATA_PATH => '/', SYS_COURSE_PATH => 'data/', SYS_CSS_PATH => 'bundles/chamilocore/css/', SYS_LANG_PATH => 'lang/', WEB_IMG_PATH => 'bundles/chamilocore/img/', SYS_IMG_PATH => 'web/bundles/chamilocore/img/', WEB_CSS_PATH => 'bundles/chamilocore/css/', SYS_PLUGIN_PATH => 'plugin/', WEB_PLUGIN_PATH => 'plugin/', WEB_ARCHIVE_PATH => 'temp/', INCLUDE_PATH => 'inc/', LIBRARY_PATH => 'inc/lib/', SYS_LIBRARY_JS_PATH => 'bundles/chamilocore/js/', CONFIGURATION_PATH => 'inc/conf/', WEB_LIBRARY_PATH => 'inc/lib/', WEB_LIBRARY_JS_PATH => 'bundles/chamilocore/js/', WEB_AJAX_PATH => 'inc/ajax/', SYS_TEST_PATH => 'tests/', WEB_TEMPLATE_PATH => 'template/', SYS_TEMPLATE_PATH => 'template/');
    $root_web = Container::getUrlGenerator()->generate('home');
    $rootDir = Container::getRootDir();
    // Configuration data for already installed system.
    $root_sys = $rootDir;
    $code_folder = 'main/';
    //$course_folder  = isset($_configuration['course_folder']) ? $_configuration['course_folder'] : null;
    $course_folder = "courses/";
    // Dealing with trailing slashes.
    $root_web = api_add_trailing_slash($root_web);
    $root_sys = api_add_trailing_slash($root_sys);
    //$root_rel       = api_add_trailing_slash($root_rel);
    $code_folder = api_add_trailing_slash($code_folder);
    $course_folder = api_add_trailing_slash($course_folder);
    $root_rel = null;
    // Initialization of a table that contains common-purpose paths.
    $paths[WEB_PATH] = $root_web;
    $webPathNoDev = str_replace('app_dev.php/', '', $paths[WEB_PATH]);
    $paths[WEB_PUBLIC_PATH] = $root_web;
    $paths[SYS_PATH] = $root_sys;
    // Update data path to get it from config file if defined
    $paths[SYS_DATA_PATH] = Container::getDataDir();
    $paths[SYS_LOG_PATH] = Container::getLogDir();
    $paths[SYS_CONFIG_PATH] = Container::getConfigDir();
    $paths[SYS_COURSE_PATH] = Container::getCourseDir();
    $paths[SYS_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[SYS_DATA_PATH] . 'default_course_document/';
    $paths[SYS_WEB_PATH] = $root_sys . 'web/';
    $paths[REL_PATH] = $root_rel;
    $paths[WEB_DATA_PATH] = $paths[WEB_PUBLIC_PATH] . 'data/';
    $paths[WEB_COURSE_PATH] = $root_web . $course_folder;
    $paths[WEB_DATA_COURSE_PATH] = $paths[WEB_DATA_PATH] . $course_folder;
    $paths[REL_COURSE_PATH] = $root_rel . $course_folder;
    $paths[REL_CODE_PATH] = $root_rel . $code_folder;
    $paths[WEB_CODE_PATH] = $root_web . $code_folder;
    $paths[REL_DATA_PATH] = $root_rel . 'data/';
    $paths[WEB_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[WEB_DATA_PATH] . 'default_course_document/';
    $paths[REL_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[REL_DATA_PATH] . 'default_course_document/';
    $paths[SYS_CODE_PATH] = $root_sys . $code_folder;
    // Now we can switch into api_get_path() "terminology".
    $paths[SYS_LANG_PATH] = $paths[SYS_CODE_PATH] . $paths[SYS_LANG_PATH];
    $paths[SYS_PLUGIN_PATH] = $paths[SYS_PATH] . $paths[SYS_PLUGIN_PATH];
    $paths[SYS_ARCHIVE_PATH] = Container::getTempDir();
    $paths[SYS_TEST_PATH] = $paths[SYS_PATH] . $paths[SYS_TEST_PATH];
    $paths[SYS_TEMPLATE_PATH] = $paths[SYS_CODE_PATH] . $paths[SYS_TEMPLATE_PATH];
    $paths[SYS_CSS_PATH] = $paths[SYS_PATH] . $paths[SYS_CSS_PATH];
    $paths[WEB_CSS_PATH] = $paths[WEB_PATH] . $paths[WEB_CSS_PATH];
    $paths[WEB_IMG_PATH] = $paths[WEB_PATH] . $paths[WEB_IMG_PATH];
    $paths[SYS_IMG_PATH] = $paths[SYS_PATH] . $paths[SYS_IMG_PATH];
    $paths[WEB_LIBRARY_PATH] = $paths[WEB_CODE_PATH] . $paths[WEB_LIBRARY_PATH];
    $paths[WEB_LIBRARY_JS_PATH] = $webPathNoDev . $paths[WEB_LIBRARY_JS_PATH];
    $paths[WEB_AJAX_PATH] = $paths[WEB_PUBLIC_PATH] . 'main/' . $paths[WEB_AJAX_PATH];
    $paths[WEB_PLUGIN_PATH] = $paths[WEB_PATH] . $paths[WEB_PLUGIN_PATH];
    $paths[WEB_ARCHIVE_PATH] = $paths[WEB_PATH] . $paths[WEB_ARCHIVE_PATH];
    $paths[WEB_TEMPLATE_PATH] = $paths[WEB_CODE_PATH] . $paths[WEB_TEMPLATE_PATH];
    $paths[INCLUDE_PATH] = $paths[SYS_CODE_PATH] . $paths[INCLUDE_PATH];
    $paths[LIBRARY_PATH] = $paths[SYS_CODE_PATH] . $paths[LIBRARY_PATH];
    $paths[SYS_LIBRARY_JS_PATH] = $paths[SYS_PATH] . $paths[SYS_LIBRARY_JS_PATH];
    $paths[CONFIGURATION_PATH] = $paths[SYS_CODE_PATH] . $paths[CONFIGURATION_PATH];
    // Path conversion to the requested type.
    if (empty($path_type)) {
        return null;
    }
    if (isset($paths[$path_type])) {
        return $paths[$path_type];
    }
    return null;
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:101,代码来源:api.lib.php


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