protected function seedConfig() { // Enable/disable avatars depending on file_uploads setting in PHP configuration $avatars = in_array(strtolower(@ini_get('file_uploads')), array('on', 'true', '1')) ? 1 : 0; // Insert config data $config = array('o_cur_version' => FLUXBB_VERSION, 'o_board_title' => trans('fluxbb::seed_data.board_title'), 'o_board_desc' => trans('fluxbb::seed_data.board_desc'), 'o_default_timezone' => 0, 'o_time_format' => 'H:i:s', 'o_date_format' => 'Y-m-d', 'o_timeout_visit' => 1800, 'o_timeout_online' => 300, 'o_redirect_delay' => 1, 'o_show_version' => 0, 'o_show_user_info' => 1, 'o_show_post_count' => 1, 'o_signatures' => 1, 'o_smilies' => 1, 'o_smilies_sig' => 1, 'o_make_links' => 1, 'o_default_lang' => Laravel\Config::get('application.language'), 'o_default_style' => 'Air', 'o_default_user_group' => 4, 'o_topic_review' => 15, 'o_disp_topics_default' => 30, 'o_disp_posts_default' => 25, 'o_indent_num_spaces' => 4, 'o_quote_depth' => 3, 'o_quickpost' => 1, 'o_users_online' => 1, 'o_show_dot' => 0, 'o_topic_views' => 1, 'o_quickjump' => 1, 'o_gzip' => 0, 'o_additional_navlinks' => '', 'o_report_method' => 0, 'o_regs_report' => 0, 'o_default_email_setting' => 1, 'o_mailing_list' => 'email', 'o_avatars' => $avatars, 'o_avatars_dir' => 'img/avatars', 'o_avatars_width' => 60, 'o_avatars_height' => 60, 'o_avatars_size' => 10240, 'o_search_all_forums' => 1, 'o_admin_email' => 'email', 'o_webmaster_email' => 'email', 'o_forum_subscriptions' => 1, 'o_topic_subscriptions' => 1, 'o_smtp_host' => null, 'o_smtp_user' => null, 'o_smtp_pass' => null, 'o_smtp_ssl' => 0, 'o_regs_allow' => 1, 'o_regs_verify' => 0, 'o_announcement' => 0, 'o_announcement_message' => trans('fluxbb::seed_data.announcement'), 'o_rules' => 0, 'o_rules_message' => trans('fluxbb::seed_data.rules'), 'o_maintenance' => 0, 'o_maintenance_message' => trans('fluxbb::seed_data.maintenance_message'), 'o_default_dst' => 0, 'o_feed_type' => 2, 'o_feed_ttl' => 0, 'p_message_bbcode' => 1, 'p_message_img_tag' => 1, 'p_message_all_caps' => 1, 'p_subject_all_caps' => 1, 'p_sig_all_caps' => 1, 'p_sig_bbcode' => 1, 'p_sig_img_tag' => 0, 'p_sig_length' => 400, 'p_sig_lines' => 4, 'p_allow_banned_email' => 1, 'p_allow_dupe_email' => 0, 'p_force_guest_email' => 1); foreach ($config as $conf_name => $conf_value) { Config::set($conf_name, $conf_value); } Config::save(); }
public function resource($arguments) { $pluralize = new Laravel\Pluralizer(Laravel\Config::get('strings')); foreach ($arguments as $key => $model) { $content = array(); $nameClass = ucwords($model); $content[] = "<?php namespace Admin;"; $content[] = "class {$nameClass} extends Appmodel{"; $content[] = "\tpublic static \$table ='" . Str::plural($model) . "'; "; $content[] = "\tpublic \$index= array(); "; $content[] = "\tpublic \$new=array(); "; $content[] = "\tpublic \$edit= array(); "; $content[] = "\tpublic \$show= array(); "; $content[] = "\tpublic \$rules= array(); "; $content[] = "}"; $DS = DIRECTORY_SEPARATOR; $path = path('bundle') . $DS . "lara_admin" . $DS . "models" . $DS . strtolower($model) . ".php"; if (!file_exists($path)) { file_put_contents($path, implode(" \n ", $content)); echo "done"; } else { echo " already exists. send force like third parameter"; } } }
*/ Laravel\Event::listen(Laravel\Config::loader, function ($bundle, $file) { return Laravel\Config::file($bundle, $file); }); /* |-------------------------------------------------------------------------- | Register Class Aliases |-------------------------------------------------------------------------- | | Aliases allow you to use classes without always specifying their fully | namespaced path. This is convenient for working with any library that | makes a heavy use of namespace for class organization. Here we will | simply register the configured class aliases. | */ $aliases = Laravel\Config::get('application.aliases'); Laravel\Autoloader::$aliases = $aliases; /* |-------------------------------------------------------------------------- | Auto-Loader Mappings |-------------------------------------------------------------------------- | | Registering a mapping couldn't be easier. Just pass an array of class | to path maps into the "map" function of Autoloader. Then, when you | want to use that class, just use it. It's simple! | */ Autoloader::map(array('Base_Controller' => path('app') . 'controllers/base.php')); /* |-------------------------------------------------------------------------- | Auto-Loader Directories
/** * Test the Payload::save method. * * @group laravel */ public function testSaveMethodCorrectlyCallsDriver() { $payload = $this->getPayload(); $session = $this->getSession(); $payload->session = $session; $payload->exists = true; $config = Laravel\Config::get('session'); $expect = $session; $expect['data'][':old:'] = $session['data'][':new:']; $expect['data'][':new:'] = array(); $payload->driver->expects($this->once())->method('save')->with($this->equalTo($expect), $this->equalTo($config), $this->equalTo(true)); $payload->save(); $this->assertEquals($session['data'][':new:'], $payload->session['data'][':old:']); }
spl_autoload_register(function ($class) { if (substr($class, 0, 7) === 'Dropbox') { $class = str_replace('\\', '/', $class); require_once __DIR__ . '/' . $class . '.php'; } }); $app_key = Laravel\Config::get('dropbox::config.app_key'); $app_secret = Laravel\Config::get('dropbox::config.app_secret'); $encryption_key = Laravel\Config::get('dropbox::config.encryption_key'); if (empty($app_key) || empty($app_secret)) { throw new \Dropbox\Exception('Please set your Dropbox App key & secret.'); } if (strlen($encryption_key) !== 32) { throw new \Dropbox\Exception('Expecting a 32 byte Dropbox encryption key, got ' . strlen($encryption_key)); } // Check whether to use HTTPS and set the callback URL $protocol = isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) ? 'https' : 'http'; $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/'; $http_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '127.0.0.1'; $callback = $protocol . '://' . $http_host . $request_uri; // Instantiate the required Dropbox objects $encrypter = new \Dropbox\OAuth\Storage\Encrypter($encryption_key); $storage = new \Dropbox\OAuth\Storage\Session($encrypter); if ($access_token = Config::get('dropbox::config.access_token')) { $storage->set((object) $access_token, 'access_token'); } $OAuth = new \Dropbox\OAuth\Consumer\Curl($app_key, $app_secret, $storage, $callback); $dropbox = new \Dropbox\API($OAuth, Laravel\Config::get('dropbox::config.root')); IoC::instance('dropbox::session', $storage); IoC::instance('dropbox::api', $dropbox); });