프로젝트에 나뭇 가지를 설치하고 싶지만 서버에 명령 줄에 대한 액세스 권한이 없습니다. ftp를 통해서만 파일을 업로드 할 수 있습니다. 이것은 나뭇 가지 lib를 수동으로 설치해야한다는 것을 의미합니다. 즉 Autoload.php 파일을 직접 만듭니다. 나는 철저히 조사했지만이 주제에 관한 정보는 거의 없다. 다른 프로젝트에서 "차용 한"다음 자동로드를 시도했지만 작동하는 설정이 생성되지 않습니다.작곡가를 사용하지 않고 나뭇 가지를 설치하는 방법
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Autoloads Twig classes.
*
* @author Fabien Potencier <[email protected]>
*/
class Twig_Autoloader
{
/**
* Registers Twig_Autoloader as an SPL autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not.
*/
public static function register($prepend = false)
{
if (version_compare(phpversion(), '5.3.0', '>=')) {
spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
} else {
spl_autoload_register(array(__CLASS__, 'autoload'));
}
}
/**
* Handles autoloading of classes.
*
* @param string $class A class name.
*/
public static function autoload($class)
{
if (0 !== strpos($class, 'Twig')) {
return;
}
if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) {
require $file;
}
}
}
아무 도움이됩니다.
지역 개발 사본이 있습니까? Composer를 사용하여 로컬로 설치 한 다음 배포 프로세스가 무엇이든간에 새 버전을 배포 할 수 있습니다. – Chris
다른 호스팅 제공 업체를 찾을 수 있습니까? – user2182349