本文整理汇总了PHP中Director::set_dev_servers方法的典型用法代码示例。如果您正苦于以下问题:PHP Director::set_dev_servers方法的具体用法?PHP Director::set_dev_servers怎么用?PHP Director::set_dev_servers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Director
的用法示例。
在下文中一共展示了Director::set_dev_servers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAccessRestrictionWithNonAdminMember
/**
* Since DataObjectRetroactiveCleanerTask can be destructive,
* make sure that only admins can run it.
*/
public function testAccessRestrictionWithNonAdminMember() {
$devServers = Object::combined_static('Director', 'dev_servers');
Director::set_dev_servers(array('example.com'));
$response = $this->get("dev/tasks/DataObjectRetroactiveCleanerTask");
$selector = 'form[action="Security/LoginForm"]';
$this->assertTrue((bool)$this->cssParser()->getBySelector($selector),
'Non admin members can run DataObjectRetroactiveCleanerTask.');
Director::set_dev_servers($devServers);
}
示例2: array
<?php
global $project;
$project = 'mysite';
global $databaseConfig;
$databaseConfig = array(
"type" => "MySQLDatabase",
"server" => "localhost",
"username" => "root",
"password" => "",
"database" => "SS_mysite",
);
// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.com/doku.php?id=devmode
// for a description of what dev mode does.
Director::set_dev_servers(array(
'localhost',
'127.0.0.1',
));
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.com/themes/
SSViewer::set_theme('mysite');
Security::setDefaultAdmin('admin', 'password');
?>
示例3: array
<?php
global $project;
$project = 'mysite';
// Get the DB connection details
require_once 'dbconn.php';
// Database config
global $databaseConfig;
// Set the database connection details
$databaseConfig = array("type" => 'MySQLDatabase', "server" => $server, "username" => $username, "password" => $password, "database" => $database, "path" => '');
// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.org/doku.php?id=configuration
// for a description of what dev mode does.
Director::set_dev_servers(array('lyc.local', '127.0.0.1'));
Email::setAdminEmail('admin@loveyourcoast.org');
//Director::set_environment_type("dev");
//UploadifyField::show_debug();
//Security::setDefaultAdmin('lydia@toast.co.nz', 't627t');
Security::setDefaultAdmin('loveyourcoast', 'loveyour12345');
MySQLDatabase::set_connection_charset('utf8');
// Set the site locale
i18n::set_locale('en_NZ');
// enable nested URLs for this site (e.g. page/sub-page/)
SiteTree::enable_nested_urls();
//Add the CleanUpRole
//this extends the membership class and gives the
//relationships between member and cleanup
DataObject::add_extension('Member', 'CleanUpRole');
//FB
//FacebookConnect::set_api_key('3c7656ec45da9e30dbac9fca551b9753');
示例4: dirname
<?php
global $project;
$project = 'mysite';
include_once dirname(__FILE__) . '/local.conf.php';
// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.com/doku.php?id=devmode
// for a description of what dev mode does.
Director::set_dev_servers(array('127.0.0.1'));
if (!defined('SS_LOG_FILE')) {
define('SS_LOG_FILE', '/var/log/silverstripe/' . basename(dirname(dirname(__FILE__))) . '.log');
}
SS_Log::add_writer(new SS_LogFileWriter(SS_LOG_FILE), SS_Log::NOTICE, '<=');
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.com/themes/
SSViewer::set_theme('dew');
// enable nested URLs for this site (e.g. page/sub-page/)
SiteTree::enable_nested_urls();
MySQLDatabase::set_connection_charset('utf8');
// necessary for now
SQLite3Database::$vacuum = false;
// Sets up relevant cache settings to prevent permission errors
SS_Cache::add_backend('default', 'File', array('cache_dir' => TEMP_FOLDER . DIRECTORY_SEPARATOR . 'cache', 'hashed_directory_umask' => 2775, 'cache_file_umask' => 0660));
require_once 'Zend/Cache.php';
require_once 'Zend/Date.php';
$coreCache = Zend_Cache::factory('Core', 'File', array(), array('hashed_directory_umask' => 2775, 'cache_file_umask' => 0660, 'cache_dir' => TEMP_FOLDER));
Zend_Date::setOptions(array('cache' => $coreCache));