本文整理汇总了PHP中Varien_Io_File::chmodRecursive方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Io_File::chmodRecursive方法的具体用法?PHP Varien_Io_File::chmodRecursive怎么用?PHP Varien_Io_File::chmodRecursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Io_File
的用法示例。
在下文中一共展示了Varien_Io_File::chmodRecursive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testChmodRecursive
public function testChmodRecursive()
{
if (substr(PHP_OS, 0, 3) == 'WIN') {
$this->markTestSkipped("chmod may not work for Windows");
}
$permsBefore = 0700;
$expected = 0777;
$this->assertEquals($permsBefore, fileperms($this->_dir) & $permsBefore, "Wrong permissions set for " . $this->_dir);
$this->assertEquals($permsBefore, fileperms($this->_file) & $permsBefore, "Wrong permissions set for " . $this->_file);
Varien_Io_File::chmodRecursive($this->_dir, $expected);
$this->assertEquals($expected, fileperms($this->_dir) & $expected, "Directory permissions were changed incorrectly.");
$this->assertEquals($expected, fileperms($this->_file) & $expected, "File permissions were changed incorrectly.");
}
示例2: _updateFilesystemPermissions
/**
* Update permissions for `var` directory
*/
protected function _updateFilesystemPermissions()
{
Varien_Io_File::chmodRecursive(Mage::getBaseDir('var'), 0777);
}
示例3: install
/**
* Install Magento
*
* @param array $options
* @return string|boolean
*/
public function install(array $options)
{
try {
$options = $this->_getInstallOptions($options);
if (!$options) {
return false;
}
/**
* Check if already installed
*/
if (Mage::isInstalled()) {
$this->addError('ERROR: Magento is already installed.');
return false;
}
/**
* Skip URL validation, if set
*/
$this->_getDataModel()->setSkipUrlValidation($options['skip_url_validation']);
$this->_getDataModel()->setSkipBaseUrlValidation($options['skip_url_validation']);
/**
* Locale settings
*/
$this->_getDataModel()->setLocaleData(array('locale' => $options['locale'], 'timezone' => $options['timezone'], 'currency' => $options['default_currency']));
/**
* Database and web config
*/
$this->_getDataModel()->setConfigData(array('db_model' => $options['db_model'], 'db_host' => $options['db_host'], 'db_name' => $options['db_name'], 'db_user' => $options['db_user'], 'db_pass' => $options['db_pass'], 'db_prefix' => $options['db_prefix'], 'use_rewrites' => $this->_getFlagValue($options['use_rewrites']), 'use_secure' => $this->_getFlagValue($options['use_secure']), 'unsecure_base_url' => $options['url'], 'secure_base_url' => $options['secure_base_url'], 'use_secure_admin' => $this->_getFlagValue($options['use_secure_admin']), 'session_save' => $this->_checkSessionSave($options['session_save']), 'backend_frontname' => $this->_checkBackendFrontname($options['backend_frontname']), 'admin_no_form_key' => $this->_getFlagValue($options['admin_no_form_key']), 'skip_url_validation' => $this->_getFlagValue($options['skip_url_validation']), 'enable_charts' => $this->_getFlagValue($options['enable_charts']), 'order_increment_prefix' => $options['order_increment_prefix']));
/**
* Primary admin user
*/
$this->_getDataModel()->setAdminData(array('firstname' => $options['admin_firstname'], 'lastname' => $options['admin_lastname'], 'email' => $options['admin_email'], 'username' => $options['admin_username'], 'new_password' => $options['admin_password']));
$installer = $this->_getInstaller();
/**
* Install configuration
*/
$installer->installConfig($this->_getDataModel()->getConfigData());
if (!empty($options['cleanup_database'])) {
$this->_cleanUpDatabase();
}
if ($this->hasErrors()) {
return false;
}
/**
* Install database
*/
$installer->installDb();
if ($this->hasErrors()) {
return false;
}
// apply data updates
Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
/**
* Validate entered data for administrator user
*/
$user = $installer->validateAndPrepareAdministrator($this->_getDataModel()->getAdminData());
if ($this->hasErrors()) {
return false;
}
/**
* Prepare encryption key and validate it
*/
$encryptionKey = empty($options['encryption_key']) ? $this->generateEncryptionKey() : $options['encryption_key'];
$this->_getDataModel()->setEncryptionKey($encryptionKey);
$installer->validateEncryptionKey($encryptionKey);
if ($this->hasErrors()) {
return false;
}
/**
* Create primary administrator user
*/
$installer->createAdministrator($user);
if ($this->hasErrors()) {
return false;
}
/**
* Save encryption key or create if empty
*/
$installer->installEnryptionKey($encryptionKey);
if ($this->hasErrors()) {
return false;
}
/**
* Installation finish
*/
$installer->finish();
if ($this->hasErrors()) {
return false;
}
/**
* Change directories mode to be writable by apache user
*/
Varien_Io_File::chmodRecursive(Mage::getBaseDir('var'), 0777);
return $encryptionKey;
} catch (Exception $e) {
//.........这里部分代码省略.........