/** * Instantiate a concrete instance of the given type. * * @param string $concrete * @param array $parameters * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function build($concrete, array $parameters = []) { // If the concrete type is actually a Closure, we will just execute it and // hand back the results of the functions, which allows functions to be // used as resolvers for more fine-tuned resolution of these objects. if ($concrete instanceof Closure) { return $concrete($this, $parameters); } $reflector = new ReflectionClass($concrete); // If the type is not instantiable, the developer is attempting to resolve // an abstract type such as an Interface of Abstract Class and there is // no binding registered for the abstractions so we need to bail out. if (! $reflector->isInstantiable()) { if (! empty($this->buildStack)) { $previous = implode(', ', $this->buildStack); $message = "Target [$concrete] is not instantiable while building [$previous]."; } else { $message = "Target [$concrete] is not instantiable."; } throw new BindingResolutionException($message); } $this->buildStack[] = $concrete; $constructor = $reflector->getConstructor();
/** * Instantiate a concrete instance of the given type. * * @param string $concrete * @param array $parameters * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function build($concrete, array $parameters = []) { // If the concrete type is actually a Closure, we will just execute it and // hand back the results of the functions, which allows functions to be // used as resolvers for more fine-tuned resolution of these objects. if ($concrete instanceof Closure) { return $concrete($this, $parameters); } $reflector = new ReflectionClass($concrete); // If the type is not instantiable, the developer is attempting to resolve // an abstract type such as an Interface of Abstract Class and there is // no binding registered for the abstractions so we need to bail out. if (! $reflector->isInstantiable()) { if (! empty($this->buildStack)) { $previous = implode(', ', $this->buildStack); $message = "Target [$concrete] is not instantiable while building [$previous]."; } else { $message = "Target [$concrete] is not instantiable."; } throw new BindingResolutionException($message); } $this->buildStack[] = $concrete; $constructor = $reflector->getConstructor();
$args = $this->isRunThroughCommandLineInterface() && isset($_SERVER['argv']) ? $_SERVER['argv'] : null; $detector = new EnvironmentDetector(); return $this->environment = $detector->detect($environments, $args); } /** * Instantiate a concrete instance of the given type. * * @param string $concrete * @param array $parameters * * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function build($concrete, array $parameters = []) { $object = parent::build($concrete, $parameters); if (is_object($object)) { if ($object instanceof ApplicationAwareInterface) { $object->setApplication($this); } if ($object instanceof LoggerAwareInterface) { $logger = $this->make('log/factory')->createLogger($object->getLoggerChannel()); $object->setLogger($logger); } elseif ($object instanceof PsrLoggerAwareInterface) { $logger = $this->make('log/factory')->createLogger(Channels::CHANNEL_APPLICATION); $object->setLogger($logger); } } return $object; } /** * @return RuntimeInterface */
* @return mixed */ public function make($abstract, array $parameters = []) { $abstract = $this->getAlias($this->normalize($abstract)); // If an instance of the type is currently being managed as a singleton we'll // just return an existing instance instead of instantiating new instances // so the developer can keep using the same objects instance every time. if (isset($this->instances[$abstract])) { return $this->instances[$abstract]; } $concrete = $this->getConcrete($abstract); // We're ready to instantiate an instance of the concrete type registered for // the binding. This will instantiate the types, as well as resolve any of // its "nested" dependencies recursively until all have gotten resolved. if ($this->isBuildable($concrete, $abstract)) { $object = $this->build($concrete, $parameters); } else { $object = $this->make($concrete, $parameters); } // If we defined any extenders for this type, we'll need to spin through them // and apply them to the object being built. This allows for the extension // of services, such as changing configuration or decorating the object. foreach ($this->getExtenders($abstract) as $extender) { $object = $extender($object, $this); } // If the requested type is registered as a singleton we'll want to cache off // the instances in "memory" so we can return it later without creating an // entirely new instance of an object on each subsequent request for it. if ($this->isShared($abstract)) { $this->instances[$abstract] = $object; } $this->fireResolvingCallbacks($abstract, $object);
{ $app = Application::getFacadeApplication(); $db = $app->make(Connection::class); $permissionkeys = []; $txt = $app->make('helper/text'); $e = $db->executeQuery(<<<'EOT' select pkID, pkName, pkDescription, pkHandle, pkCategoryHandle, pkCanTriggerWorkflow, pkHasCustomClass, PermissionKeys.pkCategoryID, PermissionKeyCategories.pkgID from PermissionKeys inner join PermissionKeyCategories on PermissionKeyCategories.pkCategoryID = PermissionKeys.pkCategoryID EOT ); while (($r = $e->fetch(PDO::FETCH_ASSOC)) !== false) { if ($r['pkHasCustomClass']) { $class = '\\Core\\Permission\\Key\\' . $txt->camelcase($r['pkHandle'] . '_' . $r['pkCategoryHandle']) . 'Key'; } else { $class = '\\Core\\Permission\\Key\\' . $txt->camelcase($r['pkCategoryHandle']) . 'Key'; } $pkgHandle = $r['pkgID'] ? PackageList::getHandle($r['pkgID']) : null; $class = core_class($class, $pkgHandle); $pk = $app->make($class); $pk->setPropertiesFromArray($r); $permissionkeys[$r['pkHandle']] = $pk; $permissionkeys[$r['pkID']] = $pk; } $cache = $app->make('cache/request'); if ($cache->isEnabled()) { $cache->getItem('permission_keys')->set($permissionkeys)->save(); } return $permissionkeys; } /** * Does this permission key have a form (located at elements/permission/keys/<handle>.php)? * * @return bool */ public function hasCustomOptionsForm() {
/** * Get a permission key given its handle. * * @param string $pkHandle * * @return \Concrete\Core\Permission\Key\Key|null */ public static function getByHandle($pkHandle) { $keys = null; $app = Application::getFacadeApplication(); $cache = $app->make('cache/request'); if ($cache->isEnabled()) { $item = $cache->getItem('permission_keys'); if (!$item->isMiss()) { $keys = $item->get(); } } if ($keys === null) { $keys = self::loadAll(); } return isset($keys[$pkHandle]) ? $keys[$pkHandle] : null; } /** * Adds an permission key. * * @param string $pkCategoryHandle * @param string $pkHandle * @param string $pkName * @param string $pkDescription * @param bool $pkCanTriggerWorkflow * @param bool $pkHasCustomClass * @param \Concrete\Core\Entity\Package|\Concrete\Core\Package\Package|null $pkg */ public static function add($pkCategoryHandle, $pkHandle, $pkName, $pkDescription, $pkCanTriggerWorkflow, $pkHasCustomClass, $pkg = false) { $app = Application::getFacadeApplication(); $db = $app->make(Connection::class);
$list[] = static::getByID($row['pkCategoryID']); } $r->Close(); return $list; } public function getPermissionKeyClass() { $className = core_class('\\Core\\Permission\\Key\\' . Core::make("helper/text")->camelcase($this->pkCategoryHandle) . 'Key', $this->getPackageHandle() ); return $className; } public function getPermissionKeyByHandle($pkHandle) { $ak = call_user_func(array($this->getPermissionKeyClass(), 'getByHandle'), $pkHandle); return $ak; } public function getPermissionKeyByID($pkID) { $ak = call_user_func(array($this->getPermissionKeyClass(), 'getByID'), $pkID); return $ak; } public function getToolsURL($task = false) { if (!$task) { $task = 'save_permission'; } $uh = Core::make('helper/concrete/urls'); $akc = static::getByID($this->getPermissionKeyCategoryID()); $url = $uh->getToolsURL('permissions/categories/' . $this->pkCategoryHandle, $akc->getPackageHandle()); $token = Core::make('helper/validation/token')->getParameter($task);
$list[] = static::getByID($row['pkCategoryID']); } $r->Close(); return $list; } public function getPermissionKeyClass() { $className = core_class('\\Core\\Permission\\Key\\' . Core::make("helper/text")->camelcase($this->pkCategoryHandle) . 'Key', $this->getPackageHandle() ); return $className; } public function getPermissionKeyByHandle($pkHandle) { $ak = call_user_func(array($this->getPermissionKeyClass(), 'getByHandle'), $pkHandle); return $ak; } public function getPermissionKeyByID($pkID) { $ak = call_user_func(array($this->getPermissionKeyClass(), 'getByID'), $pkID); return $ak; } public function getToolsURL($task = false) { if (!$task) { $task = 'save_permission'; } $uh = Core::make('helper/concrete/urls'); $akc = static::getByID($this->getPermissionKeyCategoryID()); $url = $uh->getToolsURL('permissions/categories/' . $this->pkCategoryHandle, $akc->getPackageHandle()); $token = Core::make('helper/validation/token')->getParameter($task);
/** * This function returns true if the user has permission to the object, or false if they do not have access. * * @param string $permissionHandle A Permission Key Handle * @param array $args Arguments to pass to the PermissionKey object's validate function * * @return bool * * @throws Exception */ public function validate($permissionHandle, $args = array()) { $u = new User(); if ($u->isSuperUser()) { return true; } if (!is_object($this->category)) { throw new Exception(t('Unable to get category for permission %s', $permissionHandle)); } $pk = $this->category->getPermissionKeyByHandle($permissionHandle); if (!$pk) { throw new Exception(t('Unable to get permission key for %s', $permissionHandle)); } $pk->setPermissionObject($this->object); return call_user_func_array(array($pk, 'validate'), $args); } public function __call($f, $a) { $permission = substr($f, 3); /** @var \Concrete\Core\Utility\Service\Text $textHelper */ $textHelper = Core::make('helper/text'); $permission = $textHelper->uncamelcase($permission); return $this->validate($permission, $a); } }
class FileFolderResponse extends TreeNodeResponse { public function canViewTreeNode() { return $this->validate('search_file_folder'); } /** * @deprecated */ public function canAccessFileManager() { return $this->canSearchFiles(); } public function canSearchFiles() { return $this->validate('search_file_folder'); } public function canDeleteTreeNode() { return $this->validate('delete_file_folder'); } public function canAddTreeSubNode() { return $this->validate('add_file'); } public function canDuplicateTreeNode() { return false; } public function canEditTreeNode() { return $this->validate('edit_file_folder');
<?php namespace Concrete\Core\Permission\Response; use User; use FileSet; class FileFolderResponse extends TreeNodeResponse { public function canViewTreeNode() { return $this->validate('search_file_folder'); } /** * @deprecated */ public function canAccessFileManager() { return $this->canSearchFiles(); } public function canSearchFiles() { return $this->validate('search_file_folder'); } public function canDeleteTreeNode() { return $this->validate('delete_file_folder'); } public function canAddTreeSubNode() { return $this->validate('add_file'); } public function canDuplicateTreeNode() { return false;
if ($r) { $this->error = $r; } } } /** * We take any permissions function run on the permissions class and send it into the category object. * * @param string $f The method name * @param array $a The method arguments * * @return array|object|int */ public function __call($f, $a) { if ($this->response) { switch (count($a)) { case 0: $r = $this->response->{$f}(); break; case 1: $r = $this->response->{$f}($a[0]); break; case 2: $r = $this->response->{$f}($a[0], $a[1]); break; default: $r = call_user_func_array([$this->response, $f], $a); break; } } else { $app = Application::getFacadeApplication(); // handles task permissions $permission = $app->make('helper/text')->uncamelcase($f); $pk = PermissionKey::getByHandle($permission); if (!$pk) { throw new Exception(t('Unable to get permission key for %s', $permission)); } switch (count($a)) {
$selectedHiddenPlugins = []; if (is_array($config->get('editor.ckeditor4.plugins.selected_default'))) { $defaultPlugins = $config->get('editor.ckeditor4.plugins.selected_default'); } if (is_array($config->get('editor.ckeditor4.plugins.selected_hidden'))) { $selectedHiddenPlugins = $config->get('editor.ckeditor4.plugins.selected_hidden'); } $selectedPlugins = array_merge($defaultPlugins, $selectedHiddenPlugins); } $pluginManager->select($selectedPlugins); $this->registerCkeditorPlugins($pluginManager); $this->registerCorePlugins($pluginManager); $editor = new CkeditorEditor($config, $pluginManager, $styles); $editor->setToken($app->make('token')->generate('editor')); $filePermission = FilePermissions::getGlobal(); $taskPermission = new TaskPermission(); $editor->setAllowFileManager( $filePermission->canAccessFileManager() && $config->get('editor.concrete.enable_filemanager') ); $editor->setAllowSitemap( $taskPermission->canAccessSitemap() && $config->get('editor.concrete.enable_sitemap') ); return $editor; } ); $this->app->alias(EditorInterface::class, 'editor'); } protected function registerCkeditorPlugins(PluginManager $pluginManager) { $loc = Localization::getInstance(); $loc->pushActiveContext(Localization::CONTEXT_UI); try { $pluginList = [ // https://ckeditor.com/cke4/addon/about
$selectedHiddenPlugins = []; if (is_array($config->get('editor.ckeditor4.plugins.selected_default'))) { $defaultPlugins = $config->get('editor.ckeditor4.plugins.selected_default'); } if (is_array($config->get('editor.ckeditor4.plugins.selected_hidden'))) { $selectedHiddenPlugins = $config->get('editor.ckeditor4.plugins.selected_hidden'); } $selectedPlugins = array_merge($defaultPlugins, $selectedHiddenPlugins); } $pluginManager->select($selectedPlugins); $this->registerCkeditorPlugins($pluginManager); $this->registerCorePlugins($pluginManager); $editor = new CkeditorEditor($config, $pluginManager, $styles); $editor->setToken($app->make('token')->generate('editor')); $filePermission = FilePermissions::getGlobal(); $taskPermission = new TaskPermission(); $editor->setAllowFileManager( $filePermission->canAccessFileManager() && $config->get('editor.concrete.enable_filemanager') ); $editor->setAllowSitemap( $taskPermission->canAccessSitemap() && $config->get('editor.concrete.enable_sitemap') ); return $editor; } ); $this->app->alias(EditorInterface::class, 'editor'); } protected function registerCkeditorPlugins(PluginManager $pluginManager) { $loc = Localization::getInstance(); $loc->pushActiveContext(Localization::CONTEXT_UI); try { $pluginList = [ // https://ckeditor.com/cke4/addon/about
return []; } /** * Instantiate a concrete instance of the given type. * * @param string $concrete * @param array $parameters * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function build($concrete, array $parameters = []) { // If the concrete type is actually a Closure, we will just execute it and // hand back the results of the functions, which allows functions to be // used as resolvers for more fine-tuned resolution of these objects. if ($concrete instanceof Closure) { return $concrete($this, $parameters); } $reflector = new ReflectionClass($concrete); // If the type is not instantiable, the developer is attempting to resolve // an abstract type such as an Interface of Abstract Class and there is // no binding registered for the abstractions so we need to bail out. if (! $reflector->isInstantiable()) { if (! empty($this->buildStack)) { $previous = implode(', ', $this->buildStack); $message = "Target [$concrete] is not instantiable while building [$previous]."; } else { $message = "Target [$concrete] is not instantiable."; } throw new BindingResolutionException($message); } $this->buildStack[] = $concrete;
$args = $this->isRunThroughCommandLineInterface() && isset($_SERVER['argv']) ? $_SERVER['argv'] : null; $detector = new EnvironmentDetector(); return $this->environment = $detector->detect($environments, $args); } /** * Instantiate a concrete instance of the given type. * * @param string $concrete * @param array $parameters * * @return mixed * * @throws \Illuminate\Contracts\Container\BindingResolutionException */ public function build($concrete, array $parameters = []) { $object = parent::build($concrete, $parameters); if (is_object($object)) { if ($object instanceof ApplicationAwareInterface) { $object->setApplication($this); } if ($object instanceof LoggerAwareInterface) { $logger = $this->make('log/factory')->createLogger($object->getLoggerChannel()); $object->setLogger($logger); } elseif ($object instanceof PsrLoggerAwareInterface) { $logger = $this->make('log/factory')->createLogger(Channels::CHANNEL_APPLICATION); $object->setLogger($logger); } } return $object; } /** * @return RuntimeInterface */
* @return mixed */ public function make($abstract, array $parameters = []) { $abstract = $this->getAlias($this->normalize($abstract)); // If an instance of the type is currently being managed as a singleton we'll // just return an existing instance instead of instantiating new instances // so the developer can keep using the same objects instance every time. if (isset($this->instances[$abstract])) { return $this->instances[$abstract]; } $concrete = $this->getConcrete($abstract); // We're ready to instantiate an instance of the concrete type registered for // the binding. This will instantiate the types, as well as resolve any of // its "nested" dependencies recursively until all have gotten resolved. if ($this->isBuildable($concrete, $abstract)) { $object = $this->build($concrete, $parameters); } else { $object = $this->make($concrete, $parameters); } // If we defined any extenders for this type, we'll need to spin through them // and apply them to the object being built. This allows for the extension // of services, such as changing configuration or decorating the object. foreach ($this->getExtenders($abstract) as $extender) { $object = $extender($object, $this); } // If the requested type is registered as a singleton we'll want to cache off // the instances in "memory" so we can return it later without creating an // entirely new instance of an object on each subsequent request for it. if ($this->isShared($abstract)) { $this->instances[$abstract] = $object; } $this->fireResolvingCallbacks($abstract, $object);
* Handle dynamic, static calls to the object. * * @param string $method * @param array $args * * @return mixed */ public static function __callStatic($method, $args) { $instance = static::resolveFacadeInstance(static::getFacadeAccessor()); if (!method_exists($instance, $method) && !method_exists($instance, '__call')) { throw new \Exception(t('Invalid Method on class %s: %s.', get_class($instance), $method)); } switch (count($args)) { case 0: return $instance->$method(); case 1: return $instance->$method($args[0]); case 2: return $instance->$method($args[0], $args[1]); case 3: return $instance->$method($args[0], $args[1], $args[2]); case 4: return $instance->$method($args[0], $args[1], $args[2], $args[3]); default: return call_user_func_array(array($instance, $method), $args); } } }
$al->register('css', 'bootstrapswitch', 'css/bootstrap-switch.min.css', array('version' => '3.3.2', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => false), $this ); $al->register('javascript', 'editor/plugin/tooltips', 'js/tooltips.js', array(), 'fundamental' ); $al->register('css', 'editor/plugin/tooltips', 'css/tooltips.css', array(), 'fundamental' ); $al->registerGroup('editor/plugin/tooltips', array( array('javascript', 'editor/plugin/tooltips'), array('css', 'editor/plugin/tooltips') )); $plugin = new Plugin(); $plugin->setKey('tooltips'); $plugin->setName('Tooltips'); $plugin->requireAsset('editor/plugin/tooltips'); Core::make('editor')->getPluginManager()->register($plugin); // Custom route for Google fonts CSS overrides Route::register( '/fundamental/css/googlefonts.css', '\Concrete\Package\Fundamental\Controller\fonts::make' ); $app = Core::make('app'); $provider = new \Concrete\Package\Fundamental\Help\HelpServiceProvider($app); $provider->register(); if(Config::get('c5hub.fundamental.general.help_link') == true) { $menuHelper = Core::make('helper/concrete/ui/menu'); $menuHelper->addPageHeaderMenuItem('help', 'fundamental', array('position' => 'right', 'href' => 'http://fundamental.c5hub.com/help', 'label' => ' Help', 'icon' => 'life-ring', 'linkAttributes' => array('class' => 'help', 'title' => 'Read the theme documentation', 'target' => '_blank'))); } } protected function getIconClasses() { $iconLessFile = DIR_BASE_CORE . '/css/build/vendor/font-awesome/variables.less'; $icons = array();
$al->register('css', 'bootstrapswitch', 'css/bootstrap-switch.min.css', array('version' => '3.3.2', 'position' => Asset::ASSET_POSITION_FOOTER, 'minify' => false, 'combine' => false), $this ); $al->register('javascript', 'editor/plugin/tooltips', 'js/tooltips.js', array(), 'fundamental' ); $al->register('css', 'editor/plugin/tooltips', 'css/tooltips.css', array(), 'fundamental' ); $al->registerGroup('editor/plugin/tooltips', array( array('javascript', 'editor/plugin/tooltips'), array('css', 'editor/plugin/tooltips') )); $plugin = new Plugin(); $plugin->setKey('tooltips'); $plugin->setName('Tooltips'); $plugin->requireAsset('editor/plugin/tooltips'); Core::make('editor')->getPluginManager()->register($plugin); // Custom route for Google fonts CSS overrides Route::register( '/fundamental/css/googlefonts.css', '\Concrete\Package\Fundamental\Controller\fonts::make' ); $app = Core::make('app'); $provider = new \Concrete\Package\Fundamental\Help\HelpServiceProvider($app); $provider->register(); if(Config::get('c5hub.fundamental.general.help_link') == true) { $menuHelper = Core::make('helper/concrete/ui/menu'); $menuHelper->addPageHeaderMenuItem('help', 'fundamental', array('position' => 'right', 'href' => 'http://fundamental.c5hub.com/help', 'label' => ' Help', 'icon' => 'life-ring', 'linkAttributes' => array('class' => 'help', 'title' => 'Read the theme documentation', 'target' => '_blank'))); } } protected function getIconClasses() { $iconLessFile = DIR_BASE_CORE . '/css/build/vendor/font-awesome/variables.less'; $icons = array();
$configUpdater = new EntityManagerConfigUpdater($entityManager); foreach ($this->packages as $pkg) { if ($config->get('concrete.updates.enable_auto_update_packages')) { $dbPkg = \Package::getByHandle($pkg->getPackageHandle()); $pkgInstalledVersion = $dbPkg->getPackageVersion(); $pkgFileVersion = $pkg->getPackageVersion(); if (version_compare($pkgFileVersion, $pkgInstalledVersion, '>')) { $loc->pushActiveContext(Localization::CONTEXT_SYSTEM); $dbPkg->upgradeCoreData(); $dbPkg->upgrade(); $loc->popActiveContext(); } } } $packagesWithOnAfterStart = []; $service = $this->make(PackageService::class); foreach ($this->packages as $pkg) { if (method_exists($pkg, 'on_start')) { $pkg->on_start(); } $service->bootPackageEntityManager($pkg); if (method_exists($pkg, 'on_after_packages_start')) { $packagesWithOnAfterStart[] = $pkg; } } foreach ($packagesWithOnAfterStart as $pkg) { $pkg->on_after_packages_start(); } } /** * Ensure we have a cache directory. */ public function setupFilesystem() { $config = $this['config']; if (!is_dir($config->get('concrete.cache.directory'))) { @mkdir($config->get('concrete.cache.directory'), $config->get('concrete.filesystem.permissions.directory'));
* Create the request object to use. */ protected function createRequest() { $request = Request::createFromGlobals(); $request::setInstance($request); return $request; } /** * Setup concrete5 packages. * * @deprecated In a future major version this will be part of HTTP middleware * * @return Response|void Returns a response if an error occurs */ protected function setupPackages() { $this->app->setupPackages(); } /** * Pre-load class aliases * This is needed to avoid the problem of calling functions that accept a class alias as a parameter, * but that alias isn't still auto-loaded. For example, that would result in the following error: * Argument 1 passed to functionName() must be an instance of Area, instance of Concrete\Core\Area\Area given. * * @deprecated Don't use this method: it will be removed in future concrete5 versions */ protected function preloadClassAliases() { ClassAliasList::getInstance()->resolveRequired(); } /** * Load in the `/application/bootstrap/app.php` file. * * @deprecated In a future major version this will be part of HTTP middleware *
* @return Response|void Returns a response if an error occurs */ protected function handlePermissionKeys() { /* @todo Replace this with a testable service */ Key::loadAll(); } /** * Try a list of steps. If a response is returned, halt progression and return the response;. * * @param string[] $steps * * @return Response|null */ protected function trySteps(array $steps) { foreach ($steps as $step) { // Run each step and return if there's a result if ($result = $this->$step()) { return $result; } } return null; } /** * Get the config repository to use. * * @deprecated In a future major version this will be part of HTTP middleware * * @return Repository */ protected function getConfig() { if (!$this->config) { $this->config = $this->getDefaultConfig(); }
// Load site specific timezones. Has to come after packages because it // instantiates the site service, which sometimes packages need to override. 'initializeSiteTimezone', // Define legacy urls, this may be the first thing that loads the entity manager 'initializeLegacyUrlDefinitions', // Register legacy tools routes 'registerLegacyRoutes', // Register legacy config values 'registerLegacyConfigValues', // Handle loading permission keys 'handlePermissionKeys', // Handle eventing 'handleEventing', ]); } else { $this->initializeSystemTimezone(); $this->preloadClassAliases(); } // Create the request to use $request = $this->createRequest(); if (!$response) { $response = $this->server->handleRequest($request); } // Prepare and return the response return $response->prepare($request); } /** * Define the base url if not defined * This will define `BASE_URL` to whatever is resolved from the resolver. *
$this->status = self::STATUS_ACTIVE; } } /** * Begin the runtime. */ public function run() { switch ($this->status) { case self::STATUS_ENDED: // We've already ended, lets just return return; case self::STATUS_INACTIVE: throw new \RuntimeException('Runtime has not yet booted.'); } $runner = $this->getRunner(); $response = $runner->run(); if ($response) { $this->sendResponse($response); } return $response; } /** * The method that handles properly sending a response. * * @param \Symfony\Component\HttpFoundation\Response $response */ protected function sendResponse(Response $response) { $response->send(); // Set the status to ended $this->status = self::STATUS_ENDED; }
* Include all autoloaders. * ---------------------------------------------------------------------------- */ require __DIR__ . '/bootstrap/autoload.php'; /* * ---------------------------------------------------------------------------- * Begin concrete5 startup. * ---------------------------------------------------------------------------- */ $app = require __DIR__ . '/bootstrap/start.php'; /** @var \Concrete\Core\Application\Application $app */ /* * ---------------------------------------------------------------------------- * Run the runtime. * ---------------------------------------------------------------------------- */ $runtime = $app->getRuntime(); if ($response = $runtime->run()) { /* * ------------------------------------------------------------------------ * Shut it down. * ------------------------------------------------------------------------ */ $app->shutdown(); } else { return $app; }
<?php require 'concrete/dispatcher.php';
Key | Value |
Version | 8.5.2 |
Installed Version | 8.5.2 |
Key | Value |
concrete.version | 8.5.2 |
concrete.version_installed | 8.5.2 |
concrete.version_db | 20190925072210 |
concrete.installed | true |
concrete.locale | en_US |
concrete.charset | UTF-8 |
concrete.charset_bom | |
concrete.maintenance_mode | false |
concrete.debug.display_errors | true |
concrete.debug.detail | debug |
concrete.debug.error_reporting | null |
concrete.proxy.host | null |
concrete.proxy.port | null |
concrete.proxy.user | null |
concrete.proxy.password | null |
concrete.upload.extensions | *.flv;*.jpg;*.gif;*.jpeg;*.ico;*.docx;*.xla;*.png;*.psd;*.swf;*.doc;*.txt;*.xls;*.xlsx;*.csv;*.pdf;*.tiff;*.rtf;*.m4a;*.mov;*.wmv;*.mpeg;*.mpg;*.wav;*.3gp;*.avi;*.m4v;*.mp4;*.mp3;*.qt;*.ppt;*.pptx;*.kml;*.xml;*.svg;*.webm;*.ogg;*.ogv |
concrete.upload.chunking.enabled | true |
concrete.upload.chunking.chunkSize | null |
concrete.export.csv.include_bom | false |
concrete.interface.panel.page_relations | false |
concrete.mail.method | PHP_MAIL |
concrete.mail.methods.smtp.server | |
concrete.mail.methods.smtp.port | |
concrete.mail.methods.smtp.username | |
concrete.mail.methods.smtp.password | |
concrete.mail.methods.smtp.encryption | |
concrete.mail.methods.smtp.messages_per_connection | null |
concrete.cache.enabled | true |
concrete.cache.lifetime | 21600 |
concrete.cache.overrides | true |
concrete.cache.blocks | true |
concrete.cache.assets | false |
concrete.cache.theme_css | true |
concrete.cache.pages | false |
concrete.cache.doctrine_dev_mode | false |
concrete.cache.full_page_lifetime | default |
concrete.cache.full_page_lifetime_value | null |
concrete.cache.full_contents_assets_hash | false |
concrete.cache.directory | /home/sterlin5/dev.sterlingmontessori.org/public_html/application/files/cache |
concrete.cache.directory_relative | null |
concrete.cache.page.directory | /home/sterlin5/dev.sterlingmontessori.org/public_html/application/files/cache/pages |
concrete.cache.page.adapter | file |
concrete.cache.levels.overrides.drivers.core_ephemeral.class | \Stash\Driver\Ephemeral |
concrete.cache.levels.overrides.drivers.core_filesystem.class | Concrete\Core\Cache\Driver\FileSystemStashDriver |
concrete.cache.levels.overrides.drivers.core_filesystem.options.path | /home/sterlin5/dev.sterlingmontessori.org/public_html/application/files/cache/overrides |
concrete.cache.levels.overrides.drivers.core_filesystem.options.dirPermissions | 493 |
concrete.cache.levels.overrides.drivers.core_filesystem.options.filePermissions | 420 |
concrete.cache.levels.overrides.drivers.redis.class | Concrete\Core\Cache\Driver\RedisStashDriver |
concrete.cache.levels.overrides.drivers.redis.options.prefix | c5_overrides |
concrete.cache.levels.overrides.drivers.redis.options.database | 0 |
concrete.cache.levels.overrides.preferred_driver | core_filesystem |
concrete.cache.levels.expensive.drivers.core_ephemeral.class | \Stash\Driver\Ephemeral |
concrete.cache.levels.expensive.drivers.core_filesystem.class | Concrete\Core\Cache\Driver\FileSystemStashDriver |
concrete.cache.levels.expensive.drivers.core_filesystem.options.path | /home/sterlin5/dev.sterlingmontessori.org/public_html/application/files/cache/expensive |
concrete.cache.levels.expensive.drivers.core_filesystem.options.dirPermissions | 493 |
concrete.cache.levels.expensive.drivers.core_filesystem.options.filePermissions | 420 |
concrete.cache.levels.expensive.drivers.redis.class | Concrete\Core\Cache\Driver\RedisStashDriver |
concrete.cache.levels.expensive.drivers.redis.options.prefix | c5_expensive |
concrete.cache.levels.expensive.drivers.redis.options.database | 0 |
concrete.cache.levels.expensive.preferred_driver | core_filesystem |
concrete.cache.levels.object.drivers.core_ephemeral.class | \Stash\Driver\Ephemeral |
concrete.cache.levels.object.drivers.redis.class | Concrete\Core\Cache\Driver\RedisStashDriver |
concrete.cache.levels.object.drivers.redis.options.prefix | c5_object |
concrete.cache.levels.object.drivers.redis.options.database | 0 |
concrete.cache.levels.object.preferred_driver | core_ephemeral |
concrete.cache.clear.thumbnails | true |
concrete.design.enable_custom | true |
concrete.design.enable_layouts | true |
concrete.log.emails | true |
concrete.log.errors | true |
concrete.log.spam | false |
concrete.log.enable_dashboard_report | true |
concrete.log.configuration.mode | simple |
concrete.log.configuration.simple.core_logging_level | NOTICE |
concrete.log.configuration.simple.handler | database |
concrete.log.configuration.simple.file.file | |
concrete.jobs.enable_scheduling | true |
concrete.filesystem.temp_directory | null |
concrete.filesystem.permissions.file | 420 |
concrete.filesystem.permissions.directory | 493 |
concrete.email.enabled | true |
concrete.email.default.address | concrete5-noreply@concrete5 |
concrete.email.default.name | |
concrete.email.form_block.address | false |
concrete.email.forgot_password.address | null |
concrete.email.forgot_password.name | null |
concrete.email.validate_registration.address | null |
concrete.email.validate_registration.name | null |
concrete.email.workflow_notification.address | null |
concrete.email.workflow_notification.name | null |
concrete.form.store_form_submissions | auto |
concrete.marketplace.enabled | true |
concrete.marketplace.request_timeout | 30 |
concrete.marketplace.token | null |
concrete.marketplace.site_token | null |
concrete.marketplace.intelligent_search | true |
concrete.marketplace.log_requests | false |
concrete.external.intelligent_search_help | true |
concrete.external.news | true |
concrete.external.news_overlay | true |
concrete.misc.user_timezones | false |
concrete.misc.package_backup_directory | /home/sterlin5/dev.sterlingmontessori.org/public_html/application/files/trash |
concrete.misc.enable_progressive_page_reindex | true |
concrete.misc.mobile_theme_id | 0 |
concrete.misc.sitemap_approve_immediately | true |
concrete.misc.enable_translate_locale_en_us | false |
concrete.misc.page_search_index_lifetime | 259200 |
concrete.misc.enable_trash_can | true |
concrete.misc.app_version_display_in_header | true |
concrete.misc.default_jpeg_image_compression | 80 |
concrete.misc.default_png_image_compression | 9 |
concrete.misc.default_thumbnail_format | auto |
concrete.misc.inplace_image_operations_limit | 4194304 |
concrete.misc.basic_thumbnailer_generation_strategy | now |
concrete.misc.help_overlay | true |
concrete.misc.require_version_comments | false |
concrete.misc.enable_move_blocktypes_across_sets | false |
concrete.misc.image_editor_cors_policy.enable_cross_origin | false |
concrete.misc.image_editor_cors_policy.anonymous_request | true |
concrete.misc.generator_tag_display_in_header | true |
concrete.misc.login_redirect | DESKTOP |
concrete.misc.access_entity_updated | 1587580055 |
concrete.misc.latest_version | 8.5.2 |
concrete.misc.do_page_reindex_check | false |
concrete.theme.compress_preprocessor_output | true |
concrete.theme.generate_less_sourcemap | false |
concrete.updates.enable_auto_update_packages | false |
concrete.updates.enable_permissions_protection | true |
concrete.updates.check_threshold | 172800 |
concrete.updates.services.get_available_updates | http://www.concrete5.org/tools/update_core |
concrete.updates.services.inspect_update | http://www.concrete5.org/tools/inspect_update |
concrete.updates.skip_core | false |
concrete.paths.trash | /!trash |
concrete.paths.drafts | /!drafts |
concrete.icons.page_template.width | 120 |
concrete.icons.page_template.height | 90 |
concrete.icons.theme_thumbnail.width | 120 |
concrete.icons.theme_thumbnail.height | 90 |
concrete.icons.file_manager_listing.handle | file_manager_listing |
concrete.icons.file_manager_listing.width | 60 |
concrete.icons.file_manager_listing.height | 60 |
concrete.icons.file_manager_detail.handle | file_manager_detail |
concrete.icons.file_manager_detail.width | 400 |
concrete.icons.file_manager_detail.height | 400 |
concrete.icons.user_avatar.width | 80 |
concrete.icons.user_avatar.height | 80 |
concrete.icons.user_avatar.default | /concrete/images/avatar_none.png |
concrete.file_manager.images.use_exif_data_to_rotate_images | false |
concrete.file_manager.images.manipulation_library | gd |
concrete.file_manager.images.create_high_dpi_thumbnails | true |
concrete.file_manager.images.preview_image_size | small |
concrete.file_manager.images.preview_image_popover | true |
concrete.file_manager.images.svg_sanitization.enabled | true |
concrete.file_manager.images.svg_sanitization.allowed_tags | |
concrete.file_manager.images.svg_sanitization.allowed_attributes | |
concrete.file_manager.images.image_editor_save_area_background_color | |
concrete.file_manager.items_per_page_options.0 | 10 |
concrete.file_manager.items_per_page_options.1 | 25 |
concrete.file_manager.items_per_page_options.2 | 50 |
concrete.file_manager.items_per_page_options.3 | 100 |
concrete.file_manager.items_per_page_options.4 | 250 |
concrete.file_manager.results | 10 |
concrete.search_users.results | 10 |
concrete.sitemap_xml.file | sitemap.xml |
concrete.sitemap_xml.frequency | weekly |
concrete.sitemap_xml.priority | 0.5 |
concrete.accessibility.toolbar_titles | false |
concrete.accessibility.toolbar_large_font | false |
concrete.accessibility.display_help_system | true |
concrete.accessibility.toolbar_tooltips | true |
concrete.i18n.choose_language_login | false |
concrete.i18n.auto_install_package_languages | true |
concrete.i18n.community_translation.entry_point | http://translate.concrete5.org/api |
concrete.i18n.community_translation.api_token | |
concrete.i18n.community_translation.progress_limit | 60 |
concrete.i18n.community_translation.cache_lifetime | 3600 |
concrete.i18n.community_translation.package_url | https://translate.concrete5.org/translate/package |
concrete.urls.concrete5 | http://www.concrete5.org |
concrete.urls.concrete5_secure | https://www.concrete5.org |
concrete.urls.newsflow | http://newsflow.concrete5.org |
concrete.urls.background_feed | //backgroundimages.concrete5.org/wallpaper |
concrete.urls.privacy_policy | //www.concrete5.org/legal/privacy-policy |
concrete.urls.background_feed_secure | https://backgroundimages.concrete5.org/wallpaper |
concrete.urls.background_info | http://backgroundimages.concrete5.org/get_image_data.php |
concrete.urls.videos | https://www.youtube.com/user/concrete5cms/videos |
concrete.urls.help.developer | http://documentation.concrete5.org/developers |
concrete.urls.help.user | http://documentation.concrete5.org/editors |
concrete.urls.help.forum | http://www.concrete5.org/community/forums |
concrete.urls.help.slack | https://www.concrete5.org/slack |
concrete.urls.paths.menu_help_service | /tools/get_remote_help_list/ |
concrete.urls.paths.site_page | /private/sites |
concrete.urls.paths.newsflow_slot_content | /tools/slot_content/ |
concrete.urls.paths.marketplace.connect | /marketplace/connect |
concrete.urls.paths.marketplace.connect_success | /marketplace/connect/-/connected |
concrete.urls.paths.marketplace.connect_validate | /marketplace/connect/-/validate |
concrete.urls.paths.marketplace.connect_new_token | /marketplace/connect/-/generate_token |
concrete.urls.paths.marketplace.checkout | /cart/-/add |
concrete.urls.paths.marketplace.purchases | /marketplace/connect/-/get_available_licenses |
concrete.urls.paths.marketplace.item_information | /marketplace/connect/-/get_item_information |
concrete.urls.paths.marketplace.item_free_license | /marketplace/connect/-/enable_free_license |
concrete.urls.paths.marketplace.remote_item_list | /marketplace/ |
concrete.white_label.logo | false |
concrete.white_label.name | false |
concrete.white_label.background_image | null |
concrete.session.name | CONCRETE5 |
concrete.session.handler | file |
concrete.session.redis.database | 1 |
concrete.session.save_path | null |
concrete.session.max_lifetime | 7200 |
concrete.session.cookie.cookie_path | false |
concrete.session.cookie.cookie_lifetime | 0 |
concrete.session.cookie.cookie_domain | false |
concrete.session.cookie.cookie_secure | false |
concrete.session.cookie.cookie_httponly | true |
concrete.session.remember_me.lifetime | 1209600 |
concrete.user.registration.enabled | false |
concrete.user.registration.type | disabled |
concrete.user.registration.captcha | true |
concrete.user.registration.email_registration | false |
concrete.user.registration.display_username_field | true |
concrete.user.registration.display_confirm_password_field | true |
concrete.user.registration.validate_email | false |
concrete.user.registration.approval | false |
concrete.user.registration.notification | false |
concrete.user.group.badge.default_point_value | 50 |
concrete.user.username.maximum | 64 |
concrete.user.username.minimum | 3 |
concrete.user.username.allowed_characters.boundary | A-Za-z0-9 |
concrete.user.username.allowed_characters.middle | A-Za-z0-9_\. |
concrete.user.username.allowed_characters.requirement_string | A username may only contain letters, numbers, dots (not at the beginning/end), and underscores (not at the beginning/end). |
concrete.user.username.allowed_characters.error_string | A username may only contain letters, numbers, dots (not at the beginning/end), and underscores (not at the beginning/end). |
concrete.user.password.maximum | 128 |
concrete.user.password.minimum | 5 |
concrete.user.password.required_special_characters | 0 |
concrete.user.password.required_lower_case | 0 |
concrete.user.password.required_upper_case | 0 |
concrete.user.password.reuse | 0 |
concrete.user.password.hash_portable | false |
concrete.user.password.hash_cost_log2 | 12 |
concrete.user.password.legacy_salt | |
concrete.user.email.test_mx_record | false |
concrete.user.email.strict | true |
concrete.user.private_messages.throttle_max | 20 |
concrete.user.private_messages.throttle_max_timespan | 15 |
concrete.user.deactivation.enable_login_threshold_deactivation | false |
concrete.user.deactivation.login.threshold | 120 |
concrete.user.deactivation.authentication_failure.enabled | false |
concrete.user.deactivation.authentication_failure.amount | 5 |
concrete.user.deactivation.authentication_failure.duration | 300 |
concrete.user.deactivation.message | This user is inactive. Please contact us regarding this account. |
concrete.spam.whitelist_group | 0 |
concrete.spam.notify_email | |
concrete.calendar.colors.text | #ffffff |
concrete.calendar.colors.background | #3A87AD |
concrete.security.session.invalidate_on_user_agent_mismatch | true |
concrete.security.session.invalidate_on_ip_mismatch | true |
concrete.security.session.invalidate_inactive_users.enabled | false |
concrete.security.session.invalidate_inactive_users.time | 300 |
concrete.security.ban.ip.enabled | true |
concrete.security.ban.ip.attempts | 5 |
concrete.security.ban.ip.time | 300 |
concrete.security.ban.ip.length | 10 |
concrete.security.misc.x_frame_options | SAMEORIGIN |
concrete.permissions.forward_to_login | true |
concrete.permissions.model | advanced |
concrete.seo.exclude_words | a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with |
concrete.seo.url_rewriting | false |
concrete.seo.url_rewriting_all | false |
concrete.seo.redirect_to_canonical_url | false |
concrete.seo.canonical_url | null |
concrete.seo.canonical_url_alternative | null |
concrete.seo.trailing_slash | false |
concrete.seo.title_format | %2$s :: %1$s |
concrete.seo.title_segment_separator | :: |
concrete.seo.page_path_separator | - |
concrete.seo.group_name_separator | / |
concrete.seo.segment_max_length | 128 |
concrete.seo.paging_string | ccm_paging_p |
concrete.statistics.track_downloads | true |
concrete.limits.sitemap_pages | 100 |
concrete.limits.delete_pages | 100 |
concrete.limits.copy_pages | 10 |
concrete.limits.page_search_index_batch | 200 |
concrete.limits.job_queue_batch | 10 |
concrete.limits.style_customizer.size_min | -50 |
concrete.limits.style_customizer.size_max | 200 |
concrete.page.search.always_reindex | false |
concrete.composer.idle_timeout | 1 |
concrete.api.enabled | false |
concrete.api.grant_types.client_credentials | true |
concrete.api.grant_types.authorization_code | true |
concrete.api.grant_types.password_credentials | false |
concrete.mutex.semaphore.priority | 100 |
concrete.mutex.semaphore.class | Concrete\Core\System\Mutex\SemaphoreMutex |
concrete.mutex.file_lock.priority | 50 |
concrete.mutex.file_lock.class | Concrete\Core\System\Mutex\FileLockMutex |
concrete.version_db_installed | 20190925072210 |
Key | Value |
USER | sterlin5 |
HOME | /home/sterlin5 |
FCGI_ROLE | RESPONDER |
UNIQUE_ID | ZgXR80dT2Nt7U-rYbgiN0wAAAAc |
SCRIPT_URL | /index.php/download_file/view/1005/369 |
SCRIPT_URI | http://cs.sterlingmontessori.org/index.php/download_file/view/1005/369 |
proxy-nokeepalive | 1 |
HTTP_ACCEPT | */* |
HTTP_USER_AGENT | claudebot |
HTTP_HOST | cs.sterlingmontessori.org |
PATH | /usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin |
SERVER_SIGNATURE | |
SERVER_SOFTWARE | Apache |
SERVER_NAME | cs.sterlingmontessori.org |
SERVER_ADDR | 216.37.42.18 |
SERVER_PORT | 80 |
REMOTE_ADDR | 3.238.87.31 |
DOCUMENT_ROOT | /home/sterlin5/dev.sterlingmontessori.org/public_html |
REQUEST_SCHEME | http |
CONTEXT_PREFIX | |
CONTEXT_DOCUMENT_ROOT | /home/sterlin5/dev.sterlingmontessori.org/public_html |
SERVER_ADMIN | webmaster@cs.sterlingmontessori.org |
SCRIPT_FILENAME | /home/sterlin5/dev.sterlingmontessori.org/public_html/index.php |
REMOTE_PORT | 59508 |
GATEWAY_INTERFACE | CGI/1.1 |
SERVER_PROTOCOL | HTTP/1.1 |
REQUEST_METHOD | GET |
QUERY_STRING | |
REQUEST_URI | /index.php/download_file/view/1005/369 |
SCRIPT_NAME | /index.php |
PATH_INFO | /download_file/view/1005/369 |
PATH_TRANSLATED | /home/sterlin5/dev.sterlingmontessori.org/public_html/download_file/view/1005/369 |
PHP_SELF | /index.php/download_file/view/1005/369 |
REQUEST_TIME_FLOAT | 1711657459.8528 |
REQUEST_TIME | 1711657459 |
argv | Array ( ) |
argc | 0 |