本文整理汇总了PHP中Patchwork\Utf8\Bootup::initAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootup::initAll方法的具体用法?PHP Bootup::initAll怎么用?PHP Bootup::initAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patchwork\Utf8\Bootup
的用法示例。
在下文中一共展示了Bootup::initAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeClasses
/**
* @inheritdoc
*/
public function initializeClasses(SymfonyRequest $symfonyRequest)
{
Utf8\Bootup::initAll();
// Enables the portability layer and configures PHP for UTF-8
Utf8\Bootup::filterRequestUri();
// Redirects to an UTF-8 encoded URL if it's not already the case
Utf8\Bootup::filterRequestInputs();
// Normalizes HTTP inputs to UTF-8 NFC
$file = $this->appPath->getCacheDir() . 'container.php';
$this->dumpContainer($symfonyRequest, $file);
require_once $file;
$this->container = new \ACP3ServiceContainer();
$this->container->set('core.environment.application_path', $this->appPath);
$this->container->set('core.http.symfony_request', $symfonyRequest);
}
示例2: __construct
/**
* Application constructor.
*
* @param object $loader The autoloader instance.
* @param array $config The custom configuration of the application.
* @param string $appPath The application absolute path.
* @param array $classesMap The custom classes map of the application.
*/
public function __construct($loader, array $config = [], $appPath = null, array $classesMap = [])
{
# Utilities
$this->utilities = new Utilities($this);
# Register start time
$this->utilities->registerStartTime();
# Store application path
$this->utilities->setApplicationPath($appPath);
# Store classes map
$this['class'] = $this->utilities->setClassesMap($classesMap);
# Call container constructor
parent::__construct($this->utilities->setConfiguration($config));
# Register core services providers
$this->register(new FilesystemServiceProvider());
$this->register(new FinderServiceProvider());
$this->register(new HttpServiceProvider());
$this->register(new LoggerServiceProvider());
$this->register(new MessagesServiceProvider());
$this->register(new RouterServiceProvider());
$this->register(new SupportServiceProvider());
$this->register(new TemplatingServiceProvider());
$this->register(new TriggersServiceProvider());
# Enables the portablity layer and configures PHP for UTF-8
Utf8Bootup::initAll();
# Redirects to an UTF-8 encoded URL if it's not already the case
Utf8Bootup::filterRequestUri();
# Normalizes HTTP inputs to UTF-8 NFC
Utf8Bootup::filterRequestInputs();
# Print errors in debug mode
if ($this['debug']) {
$whoops = new WhoopsRun();
$whoops->pushHandler(new WhoopsHandler());
$whoops->register();
} else {
ErrorHandler::register($this['phpLogger']);
}
# Only enable Kint in debug mode
\Kint::enabled($this['debug']);
}
示例3:
* ----------------------------------------------------------------------------
*/
use Concrete\Core\Application\Application;
use Concrete\Core\Asset\AssetList;
use Concrete\Core\File\Type\TypeList;
use Concrete\Core\Foundation\ClassAliasList;
use Concrete\Core\Foundation\Service\ProviderList;
use Concrete\Core\Permission\Key\Key as PermissionKey;
use Concrete\Core\Support\Facade\Facade;
use Patchwork\Utf8\Bootup as PatchworkUTF8;
/**
* ----------------------------------------------------------------------------
* Handle text encoding.
* ----------------------------------------------------------------------------
*/
PatchworkUTF8::initAll();
/**
* ----------------------------------------------------------------------------
* Instantiate concrete5.
* ----------------------------------------------------------------------------
*/
/** @var Application $cms */
$cms = (require DIR_APPLICATION . '/bootstrap/start.php');
$cms->instance('app', $cms);
// Bind fully application qualified class names
$cms->instance('Concrete\\Core\\Application\\Application', $cms);
$cms->instance('Illuminate\\Container\\Container', $cms);
/**
* ----------------------------------------------------------------------------
* Bind the IOC container to our facades
* Completely indebted to Taylor Otwell & Laravel for this.
示例4: spl_autoload_register
// increase maximum execution time for php scripts
// (does not work in safe mode)
@set_time_limit(120);
// include composer autoloader (if available)
if (@file_exists(INSTALL_PATH . 'vendor/autoload.php')) {
require INSTALL_PATH . 'vendor/autoload.php';
}
// include Roundcube Framework
require_once 'Roundcube/bootstrap.php';
// register autoloader for rcmail app classes
spl_autoload_register('rcmail_autoload');
// backward compatybility (to be removed)
require_once INSTALL_PATH . 'program/include/bc.php';
// load the UTF-8 portablity layer from Patchwor
if (!function_exists('iconv') || !function_exists('utf8_encode') || !extension_loaded('mbstring')) {
\Patchwork\Utf8\Bootup::initAll();
}
/**
* PHP5 autoloader routine for dynamic class loading
*/
function rcmail_autoload($classname)
{
if (strpos($classname, 'rcmail') === 0) {
$filepath = INSTALL_PATH . "program/include/{$classname}.php";
if (is_readable($filepath)) {
include_once $filepath;
return true;
}
}
return false;
}
示例5: ProviderList
*/
$list = new ProviderList($cms);
$list->registerProviders($config->get('app.providers'));
/**
* ----------------------------------------------------------------------------
* Setup file cache directories. Has to come after we define services
* because we use the file service.
* ----------------------------------------------------------------------------
*/
$cms->setupFilesystem();
/**
* ----------------------------------------------------------------------------
* Handle text encoding.
* ----------------------------------------------------------------------------
*/
Bootup::initAll();
/**
* ----------------------------------------------------------------------------
* Registries for theme paths, assets, routes and file types.
* ----------------------------------------------------------------------------
*/
$asset_list = AssetList::getInstance();
$asset_list->registerMultiple($config->get('app.assets', array()));
$asset_list->registerGroupMultiple($config->get('app.asset_groups', array()));
Route::registerMultiple($config->get('app.routes'));
Route::setThemesByRoutes($config->get('app.theme_paths', array()));
$type_list = TypeList::getInstance();
$type_list->defineMultiple($config->get('app.file_types', array()));
$type_list->defineImporterAttributeMultiple($config->get('app.importer_attributes', array()));
/**
* ----------------------------------------------------------------------------
示例6: boot
/**
* {@inheritdoc}
*/
public function boot()
{
Bootup::initAll();
$this->container->addScope(new Scope(self::SCOPE_BACKEND, 'request'));
$this->container->addScope(new Scope(self::SCOPE_FRONTEND, 'request'));
}
示例7: boot
/**
* {@inheritdoc}
*/
public function boot()
{
Bootup::initAll();
}