/** * Create a new Controller instance. */ public function __construct() { // Setup the used Template to default, if it is not already defined. if (!isset($this->template)) { $this->template = Config::get('app.template'); } }
/** * Create a new URL Generator instance. * * @param \Nova\Routing\RouteCollection $routes * @param \Symfony\Component\HttpFoundation\Request $request * @return void */ public function __construct(RouteCollection $routes, Request $request) { $this->routes = $routes; $this->setRequest($request); // Wheter or not are used the Unnamed Parameters. if ('unnamed' == Config::get('routing.parameters', 'named')) { $this->legacyRouting = true; } }
public static function process($fetch = false) { $config = Config::get('profiler'); if ($config['useForensics'] != true) { return null; } // The QuickProfiller was enabled into Configuration. $profiler = new static(); return $profiler->display($fetch); }
/** * Change the Framework Language. */ public function change($language) { $languages = Config::get('languages'); // Only set language if it's in the Languages array if (preg_match('/[a-z]/', $language) && in_array($language, array_keys($languages))) { Session::set('language', $language); // Store the current Language in a Cookie lasting five years. Cookie::queue(PREFIX . 'language', $language, Cookie::FIVEYEARS); } return Redirect::back(); }
protected function execute(InputInterface $input, OutputInterface $output) { $error = false; $path = Config::get('cache.path', 'app/Storage/Cache'); if (!is_dir($path)) { $output->writeln("<error>Cache directory does not exist. path: {$path}</>"); $error = true; } self::cleanCache($path); $output->writeln("<info>Cache directory has been cleaned. path: {$path}</>"); }
/** * Register the Assets Dispatcher. */ public function registerAssetsDispatcher() { // NOTE: When this method is executed, the Config Store is not yet available. $driver = Config::get('routing.assets.driver', 'default'); if ($driver == 'custom') { $className = Config::get('routing.assets.dispatcher'); } else { $className = 'Nova\\Routing\\Assets\\' . ucfirst($driver) . 'Dispatcher'; } // Bind the calculated class name to the Assets Dispatcher Interface. $this->app->bind('Nova\\Routing\\Assets\\DispatcherInterface', $className); }
public function index($token) { if ($this->token != $token) { return Response::make('', 403); // Error 403 (Access denied) } // Get the execution date and time as translated string. $format = __d('system', '%d %b %Y, %R'); $date = Carbon::now()->formatLocalized($format); // Execute the CRON tasks. $result = $this->executeCron(); // Create the page information. $title = __d('system', '{0} - Cron executed on {1}', Config::get('app.name'), $date); return $this->getView()->with('title', $title)->with('content', $result); }
protected function execute(InputInterface $input, OutputInterface $output) { $error = false; $path = Config::get('session.files', 'app/Storage/Sessions'); if ($input->getArgument('lifeTime')) { $lifeTime = $input->getArgument('lifeTime'); } else { $lifeTime = Config::get('session.lifetime', 180); } if (!is_dir($path)) { $output->writeln("<error>Session directory does not exist. path: {$path}</>"); $error = true; } self::clearSessions($path, $lifeTime); $output->writeln("<info>The sessions have been cleared. Lifetime: {$lifeTime}, path: {$path}</>"); }
/** * Return a default View instance. * * @return \Nova\View\View * @throws \BadMethodCallException */ protected function getView(array $data = array()) { list(, $caller) = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); // Retrieve the called Controller method from the caller. $method = $caller['function']; // Transform the complete class name on a path like variable. $path = str_replace('\\', '/', static::class); // Check for a valid controller on Application. if (preg_match('#^App/Controllers/(.*)$#i', $path, $matches)) { $view = $matches[1] . '/' . ucfirst($method); return View::make($view, $data); } // Retrieve the Modules namespace from their configuration. $namespace = Config::get('modules.namespace', 'App\\Modules\\'); // Transform the Modules namespace on a path like variable. $basePath = str_replace('\\', '/', rtrim($namespace, '\\')); // Check for a valid controller on Modules. if (preg_match('#^' . $basePath . '/(.+)/Controllers/(.*)$#i', $path, $matches)) { $view = $matches[2] . '/' . ucfirst($method); return View::make($view, $data, $matches[1]); } // If we arrived there, the called class is not a Controller; go Exception. throw new BadMethodCallException('Invalid Controller namespace: ' . static::class); }
/** * Find the View file. * * @param string $view * @param string $template * @return string */ protected function find($view, $template = null) { // Calculate the current Template name. $template = $template ?: Config::get('app.template'); // Calculate the search path. $path = sprintf('Templates/%s/%s', $template, $view); // Make the path absolute and adjust the directory separator. $path = str_replace('/', DS, APPDIR . $path); // Find the View file depending on the Language direction. $language = $this->getLanguage(); if ($language->direction() == 'rtl') { // Search for the View file used on the RTL languages. $filePath = $this->finder->find($path . '-rtl'); } else { $filePath = null; } if (is_null($filePath)) { $filePath = $this->finder->find($path); } if (!is_null($filePath)) { return $filePath; } throw new \InvalidArgumentException("Unable to load the view '" . $view . "' on template '" . $template . "'.", 1); }
protected function __construct() { $this->config = Config::get('profiler', array()); }
<?php /** * Config - the Module's specific Configuration. * * @author David Carr - dave@daveismyname.com * @author Edwin Hoksberg - info@edwinhoksberg.nl * @version 3.0 */ use Nova\Config\Config; /** * Configuration constants and options. */ Config::set('cron', array('token' => 'SomeRandomStringThere_1234567890'));
<?php /** * Modules Configuration * * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; Config::set('modules', array('path' => app_path('Modules'), 'enabled' => true, 'namespace' => 'App\\Modules\\', 'driver' => 'local', 'custom_driver' => 'App\\Repositories\\Modules\\CustomRepository'));
<?php /** * Database configuration * * @author David Carr - dave@daveismyname.com * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; /** * Setup the Database configuration. */ Config::set('database', array('fetch' => PDO::FETCH_CLASS, 'default' => 'mysql', 'connections' => array('sqlite' => array('driver' => 'sqlite', 'database' => APPDIR . 'Storage' . DS . 'database.sqlite', 'prefix' => ''), 'mysql' => array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'nova', 'username' => 'nova', 'password' => 'password', 'prefix' => PREFIX, 'charset' => 'utf8', 'collation' => 'utf8_general_ci'), 'pgsql' => array('driver' => 'pgsql', 'host' => 'localhost', 'database' => 'nova', 'username' => 'nova', 'password' => 'password', 'charset' => 'utf8', 'prefix' => PREFIX, 'schema' => 'public')), 'migrations' => 'migrations', 'redis' => array('cluster' => false, 'default' => array('host' => '127.0.0.1', 'port' => 6379, 'database' => 0))));
<?php /** * Cache configuration * * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; Config::set('cache', array('driver' => 'file', 'path' => storage_path() . DS . 'Cache', 'connection' => null, 'table' => 'cache', 'memcached' => array(array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100)), 'prefix' => 'nova'));
<?php /** * Active Modules * * @author David Carr - dave@daveismyname.com * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; Config::set('modules', array('path' => APPDIR . 'Modules', 'namespace' => 'App\\Modules\\', 'modules' => array('files' => array('namespace' => 'Files', 'enabled' => true, 'order' => 1))));
<?php /** * Active Modules * * @author David Carr - dave@daveismyname.com * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; Config::set('modules', array('path' => APPDIR . 'Modules', 'namespace' => 'App\\Modules\\', 'modules' => array('demos' => array('namespace' => 'Demos', 'enabled' => true, 'order' => 10001), 'files' => array('namespace' => 'Files', 'enabled' => true, 'order' => 9001), 'system' => array('namespace' => 'System', 'enabled' => true, 'order' => 8001), 'users' => array('namespace' => 'Users', 'enabled' => true, 'order' => 9001))));
<?php /** * Mailer Configuration * * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; Config::set('mail', array('driver' => 'smtp', 'host' => '', 'port' => 587, 'from' => array('address' => '*****@*****.**', 'name' => 'The Nova Staff'), 'encryption' => 'tls', 'username' => '', 'password' => '', 'sendmail' => '/usr/sbin/sendmail -bs', 'pretend' => true));
<?php use Nova\Config\Config; /** * Setup the Profiler configuration */ Config::set('profiler', array('useForensics' => false, 'withDatabase' => true));
<?php /** * All known Languages * * @author David Carr - dave@daveismyname.com * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; Config::set('languages', array('cs' => array('info' => 'Czech', 'name' => 'čeština', 'locale' => 'cs_CZ', 'dir' => 'ltr'), 'da' => array('info' => 'Danish', 'name' => 'Dansk', 'locale' => 'da_DK', 'dir' => 'ltr'), 'de' => array('info' => 'German', 'name' => 'Deutsch', 'locale' => 'de_DE', 'dir' => 'ltr'), 'en' => array('info' => 'English', 'name' => 'English', 'locale' => 'en_US', 'dir' => 'ltr'), 'es' => array('info' => 'Spanish', 'name' => 'Español', 'locale' => 'es_ES', 'dir' => 'ltr'), 'fa' => array('info' => 'Persian', 'name' => 'پارسی', 'locale' => 'fa_IR', 'dir' => 'rtl'), 'fr' => array('info' => 'French', 'name' => 'Français', 'locale' => 'fr_FR', 'dir' => 'ltr'), 'it' => array('info' => 'Italian', 'name' => 'italiano', 'locale' => 'it_IT', 'dir' => 'ltr'), 'ja' => array('info' => 'Japanesse', 'name' => '日本語', 'locale' => 'ja_JA', 'dir' => 'ltr'), 'nl' => array('info' => 'Dutch', 'name' => 'Nederlands', 'locale' => 'nl_NL', 'dir' => 'ltr'), 'pl' => array('info' => 'Polish', 'name' => 'polski', 'locale' => 'pl_PL', 'dir' => 'ltr'), 'ro' => array('info' => 'Romanian', 'name' => 'Română', 'locale' => 'ro_RO', 'dir' => 'ltr'), 'ru' => array('info' => 'Russian', 'name' => 'ру́сский', 'locale' => 'ru_RU', 'dir' => 'ltr')));
<?php /** * Application Configuration * * @author David Carr - dave@daveismyname.com * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; /** * The Application configuration. */ Config::set('app', array('debug' => ENVIRONMENT == 'development', 'url' => 'http://www.novabasic.dev/', 'email' => '*****@*****.**', 'path' => '/', 'name' => 'Nova 4.0-dev', 'template' => 'Default', 'locale' => 'en', 'timezone' => 'Europe/London', 'key' => 'SomeRandomStringThere_1234567890', 'csrf' => true, 'providers' => array('Nova\\Foundation\\Providers\\ForgeServiceProvider', 'Nova\\Session\\CommandsServiceProvider', 'Nova\\Foundation\\Providers\\ConsoleSupportServiceProvider', 'Nova\\Routing\\ControllerServiceProvider', 'Nova\\Module\\ModuleServiceProvider', 'Nova\\Auth\\AuthServiceProvider', 'Nova\\Cache\\CacheServiceProvider', 'Nova\\Routing\\RoutingServiceProvider', 'Nova\\Cookie\\CookieServiceProvider', 'Nova\\Database\\DatabaseServiceProvider', 'Nova\\Encryption\\EncryptionServiceProvider', 'Nova\\Filesystem\\FilesystemServiceProvider', 'Nova\\Hashing\\HashServiceProvider', 'Nova\\Language\\LanguageServiceProvider', 'Nova\\Log\\LogServiceProvider', 'Nova\\Mail\\MailServiceProvider', 'Nova\\Database\\MigrationServiceProvider', 'Nova\\Pagination\\PaginationServiceProvider', 'Nova\\Redis\\RedisServiceProvider', 'Nova\\Auth\\Reminders\\ReminderServiceProvider', 'Nova\\Database\\SeedServiceProvider', 'Nova\\Session\\SessionServiceProvider', 'Nova\\Validation\\ValidationServiceProvider', 'Nova\\Html\\HtmlServiceProvider', 'Nova\\View\\ViewServiceProvider', 'Nova\\Template\\TemplateServiceProvider', 'Nova\\Cron\\CronServiceProvider'), 'manifest' => storage_path(), 'aliases' => array('Assets' => 'Nova\\Helpers\\Assets', 'Date' => 'Nova\\Helpers\\Date', 'Document' => 'Nova\\Helpers\\Document', 'Ftp' => 'Nova\\Helpers\\Ftp', 'GeoCode' => 'Nova\\Helpers\\GeoCode', 'Inflector' => 'Nova\\Helpers\\Inflector', 'Number' => 'Nova\\Helpers\\Number', 'RainCaptcha' => 'Nova\\Helpers\\RainCaptcha', 'ReservedWords' => 'Nova\\Helpers\\ReservedWords', 'SimpleCurl' => 'Nova\\Helpers\\SimpleCurl', 'TableBuilder' => 'Nova\\Helpers\\TableBuilder', 'Tags' => 'Nova\\Helpers\\Tags', 'Console' => 'Nova\\Forensics\\Console', 'Arr' => 'Nova\\Support\\Arr', 'Str' => 'Nova\\Support\\Str', 'Seeder' => 'Nova\\Database\\Seeder', 'App' => 'Nova\\Support\\Facades\\App', 'Forge' => 'Nova\\Support\\Facades\\Forge', 'Auth' => 'Nova\\Support\\Facades\\Auth', 'Cache' => 'Nova\\Support\\Facades\\Cache', 'Config' => 'Nova\\Support\\Facades\\Config', 'Cookie' => 'Nova\\Support\\Facades\\Cookie', 'Crypt' => 'Nova\\Support\\Facades\\Crypt', 'DB' => 'Nova\\Support\\Facades\\DB', 'Event' => 'Nova\\Support\\Facades\\Event', 'File' => 'Nova\\Support\\Facades\\File', 'Hash' => 'Nova\\Support\\Facades\\Hash', 'Input' => 'Nova\\Support\\Facades\\Input', 'Language' => 'Nova\\Support\\Facades\\Language', 'Mail' => 'Nova\\Support\\Facades\\Mail', 'Paginator' => 'Nova\\Support\\Facades\\Paginator', 'Password' => 'Nova\\Support\\Facades\\Password', 'Redirect' => 'Nova\\Support\\Facades\\Redirect', 'Redis' => 'Nova\\Support\\Facades\\Redis', 'Request' => 'Nova\\Support\\Facades\\Request', 'Response' => 'Nova\\Support\\Facades\\Response', 'Route' => 'Nova\\Support\\Facades\\Route', 'Schema' => 'Nova\\Support\\Facades\\Schema', 'Session' => 'Nova\\Support\\Facades\\Session', 'Validator' => 'Nova\\Support\\Facades\\Validator', 'Log' => 'Nova\\Support\\Facades\\Log', 'URL' => 'Nova\\Support\\Facades\\URL', 'Form' => 'Nova\\Support\\Facades\\Form', 'HTML' => 'Nova\\Support\\Facades\\HTML', 'Template' => 'Nova\\Support\\Facades\\Template', 'View' => 'Nova\\Support\\Facades\\View', 'Module' => 'Nova\\Support\\Facades\\Module', 'Cron' => 'Nova\\Support\\Facades\\Cron')));
public function __construct() { $this->config = Config::get('recaptcha', array()); }
/** * Set a given configuration value. * * @param string $key * @param mixed $value * @return void */ public function set($key, $value) { Config::set($key, $value); }
<?php /** * Session Configuration. * * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; Config::set('session', array('driver' => 'file', 'table' => 'sessions', 'connection' => null, 'lifetime' => 180, 'expireOnClose' => false, 'files' => STORAGE_PATH . 'Sessions', 'lottery' => array(2, 100), 'cookie' => PREFIX . 'session', 'path' => '/', 'domain' => null, 'secure' => false));
<?php /** * Config - the Global Configuration loaded BEFORE the Nova Application starts. * * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; /** * PREFER to be used in Database calls or storing Session data, default is 'nova_' */ define('PREFIX', 'nova_'); /** * Setup the Config API Mode. * For using the 'database' mode, you need to have a database, with a table generated by 'scripts/nova_options' */ define('CONFIG_STORE', 'files'); // Supported: "files", "database" /** * Routing configuration */ Config::set('routing', array('assets' => array('driver' => 'default', 'dispatcher' => 'Shared\\Routing\\Assets\\CustomDispatcher', 'cacheTime' => 10800, 'paths' => array('almasaeed2010/adminlte' => array('bootstrap', 'dist', 'plugins'), 'twbs/bootstrap' => 'dist'))));
<?php /** * Config - the Module's specific Configuration. * * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; /** * Configuration constants and options. */ Config::set('elFinder', array('locale' => 'en_US.UTF-8', 'debug' => false, 'roots' => array(array('alias' => 'Site Assets', 'driver' => 'LocalFileSystem', 'path' => ROOTDIR . 'assets/', 'URL' => site_url('assets/'), 'mimeDetect' => 'internal', 'tmbPath' => APPDIR . 'Storage/Files/thumbnails', 'quarantine' => APPDIR . 'Storage/Files/quarantine', 'tmbURL' => site_url('admin/files/thumbnails/'), 'utf8fix' => true, 'tmbCrop' => false, 'tmbSize' => 48, 'acceptedName' => '/^[^\\.].*$/', 'accessControl' => 'access', 'dateFormat' => 'j M Y H:i', 'defaults' => array('read' => true, 'write' => true), 'icon' => site_url('modules/files/assets/img/volume_icon_local.png')), array('alias' => 'Site Root', 'driver' => 'LocalFileSystem', 'path' => ROOTDIR, 'URL' => site_url('admin/files/preview/'), 'mimeDetect' => 'internal', 'tmbPath' => APPDIR . 'Storage/Files/thumbnails', 'quarantine' => APPDIR . 'Storage/Files/quarantine', 'tmbURL' => site_url('admin/files/thumbnails/'), 'utf8fix' => true, 'tmbCrop' => false, 'tmbSize' => 48, 'acceptedName' => '/^[^\\.].*$/', 'accessControl' => 'access', 'dateFormat' => 'j M Y H:i', 'defaults' => array('read' => true, 'write' => false), 'icon' => site_url('modules/files/assets/img/volume_icon_local.png')))));
<?php /** * Application Configuration * * @author David Carr - dave@daveismyname.com * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; /** * The Application configuration. */ Config::set('app', array('debug' => ENVIRONMENT == 'development', 'url' => 'http://*****:*****@novaframework.dev', 'path' => '/', 'name' => 'Nova CMS', 'template' => 'Default', 'color_scheme' => 'blue', 'locale' => 'en', 'timezone' => 'Europe/London', 'key' => 'NAiiTMu3bjmSwGuGjrWYjFZer8Bb7Gza', 'csrf' => true, 'providers' => array('Nova\\Auth\\AuthServiceProvider', 'Nova\\Cache\\CacheServiceProvider', 'Nova\\Routing\\RoutingServiceProvider', 'Nova\\Cookie\\CookieServiceProvider', 'Nova\\Module\\ModuleServiceProvider', 'Nova\\Database\\DatabaseServiceProvider', 'Nova\\Encryption\\EncryptionServiceProvider', 'Nova\\Filesystem\\FilesystemServiceProvider', 'Nova\\Hashing\\HashServiceProvider', 'Nova\\Log\\LogServiceProvider', 'Nova\\Mail\\MailServiceProvider', 'Nova\\Pagination\\PaginationServiceProvider', 'Nova\\Redis\\RedisServiceProvider', 'Nova\\Auth\\Reminders\\ReminderServiceProvider', 'Nova\\Session\\SessionServiceProvider', 'Nova\\Language\\LanguageServiceProvider', 'Nova\\Validation\\ValidationServiceProvider', 'Nova\\Html\\HtmlServiceProvider', 'Nova\\View\\ViewServiceProvider', 'Nova\\Template\\TemplateServiceProvider', 'Nova\\Cron\\CronServiceProvider'), 'manifest' => APPDIR . 'Boot' . DS . 'Cache', 'aliases' => array('Assets' => 'Nova\\Helpers\\Assets', 'Date' => 'Nova\\Helpers\\Date', 'Document' => 'Nova\\Helpers\\Document', 'Ftp' => 'Nova\\Helpers\\Ftp', 'GeoCode' => 'Nova\\Helpers\\GeoCode', 'Inflector' => 'Nova\\Helpers\\Inflector', 'Number' => 'Nova\\Helpers\\Number', 'RainCaptcha' => 'Nova\\Helpers\\RainCaptcha', 'ReservedWords' => 'Nova\\Helpers\\ReservedWords', 'SimpleCurl' => 'Nova\\Helpers\\SimpleCurl', 'TableBuilder' => 'Nova\\Helpers\\TableBuilder', 'Tags' => 'Nova\\Helpers\\Tags', 'PageBlocks' => 'App\\Helpers\\PageBlocks', 'GlobalBlocks' => 'App\\Helpers\\GlobalBlocks', 'Menu' => 'App\\Helpers\\Menu', 'Console' => 'Nova\\Forensics\\Console', 'Arr' => 'Nova\\Support\\Arr', 'Str' => 'Nova\\Support\\Str', 'App' => 'Nova\\Support\\Facades\\App', 'Auth' => 'Nova\\Support\\Facades\\Auth', 'Cache' => 'Nova\\Support\\Facades\\Cache', 'Config' => 'Nova\\Support\\Facades\\Config', 'Cookie' => 'Nova\\Support\\Facades\\Cookie', 'Crypt' => 'Nova\\Support\\Facades\\Crypt', 'DB' => 'Nova\\Support\\Facades\\DB', 'Event' => 'Nova\\Support\\Facades\\Event', 'File' => 'Nova\\Support\\Facades\\File', 'Hash' => 'Nova\\Support\\Facades\\Hash', 'Input' => 'Nova\\Support\\Facades\\Input', 'Language' => 'Nova\\Support\\Facades\\Language', 'Mailer' => 'Nova\\Support\\Facades\\Mailer', 'Paginator' => 'Nova\\Support\\Facades\\Paginator', 'Password' => 'Nova\\Support\\Facades\\Password', 'Redirect' => 'Nova\\Support\\Facades\\Redirect', 'Redis' => 'Nova\\Support\\Facades\\Redis', 'Request' => 'Nova\\Support\\Facades\\Request', 'Response' => 'Nova\\Support\\Facades\\Response', 'Route' => 'Nova\\Support\\Facades\\Route', 'Session' => 'Nova\\Support\\Facades\\Session', 'Validator' => 'Nova\\Support\\Facades\\Validator', 'Log' => 'Nova\\Support\\Facades\\Log', 'URL' => 'Nova\\Support\\Facades\\URL', 'Form' => 'Nova\\Support\\Facades\\Form', 'HTML' => 'Nova\\Support\\Facades\\HTML', 'Template' => 'Nova\\Support\\Facades\\Template', 'View' => 'Nova\\Support\\Facades\\View', 'Cron' => 'Nova\\Support\\Facades\\Cron', 'Module' => 'Nova\\Support\\Facades\\Module')));
<?php /** * Database configuration * * @author David Carr - dave@daveismyname.com * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; /** * Setup the Database configuration. */ Config::set('database', array('fetch' => PDO::FETCH_CLASS, 'default' => 'mysql', 'connections' => array('sqlite' => array('driver' => 'sqlite', 'database' => APPDIR . 'Storage' . DS . 'database.sqlite', 'prefix' => ''), 'mysql' => array('driver' => 'mysql', 'hostname' => 'localhost', 'database' => 'novacms', 'username' => 'root', 'password' => 'root', 'prefix' => PREFIX, 'charset' => 'utf8', 'collation' => 'utf8_general_ci'), 'pgsql' => array('driver' => 'pgsql', 'host' => 'localhost', 'database' => 'nova', 'username' => 'nova', 'password' => 'password', 'charset' => 'utf8', 'prefix' => PREFIX, 'schema' => 'public'))));
/** * Serve a File. * * @param string $path * * @return \Symfony\Component\HttpFoundation\Response */ public function serve($path, SymfonyRequest $request) { if (!file_exists($path)) { return new Response('File Not Found', 404); } else { if (!is_readable($path)) { return new Response('Unauthorized Access', 403); } } // Collect the current file information. $guesser = MimeTypeGuesser::getInstance(); // Even the Symfony's HTTP Foundation have troubles with the CSS and JS files? // // Hard coding the correct mime types for presently needed file extensions. switch ($fileExt = pathinfo($path, PATHINFO_EXTENSION)) { case 'css': $contentType = 'text/css'; break; case 'js': $contentType = 'application/javascript'; break; default: $contentType = $guesser->guess($path); break; } if (str_is('text/*', $contentType) || $contentType == 'application/javascript') { $response = $this->createFileResponse($path, $request); } else { $response = $this->createBinaryFileResponse($path); } // Set the Content type. $response->headers->set('Content-Type', $contentType); // Set the Cache Control. $cacheTime = Config::get('routing.assets.cacheTime', 10800); $response->setTtl(600); $response->setMaxAge($cacheTime); $response->setSharedMaxAge(600); // Prepare against the Request instance. $response->isNotModified($request); return $response; }
<?php /** * Auth configuration * * @author Virgil-Adrian Teaca - virgil@giulianaeassociati.com * @version 3.0 */ use Nova\Config\Config; Config::set('auth', array('driver' => 'extended', 'model' => 'App\\Models\\User', 'table' => 'users', 'reminder' => array('email' => 'Emails/Auth/Reminder', 'table' => 'password_reminders', 'expire' => 60)));