本文整理汇总了PHP中Maged_Controller类的典型用法代码示例。如果您正苦于以下问题:PHP Maged_Controller类的具体用法?PHP Maged_Controller怎么用?PHP Maged_Controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Maged_Controller类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: singleton
/**
* Initialize object of class
*
* @return Maged_Controller
*/
public static function singleton()
{
if (!self::$_instance) {
self::$_instance = new self();
if (self::$_instance->isDownloaded() && self::$_instance->isInstalled()) {
Mage::app('', 'store', array('global_ban_use_cache' => true));
Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
}
}
return self::$_instance;
}
开发者ID:lightyoruichi,项目名称:Magento-Pre-Patched-Files,代码行数:16,代码来源:Controller.php
示例2: singleton
/**
* Initialize object of class
*
* @return Maged_Controller
*/
public static function singleton()
{
if (!self::$_instance) {
self::$_instance = new self();
if (self::$_instance->isDownloaded() && self::$_instance->isInstalled()) {
Mage::app();
Mage::getSingleton('adminhtml/url')->turnOffSecretKey();
}
}
return self::$_instance;
}
开发者ID:votanlean,项目名称:Magento-Pruebas,代码行数:16,代码来源:Controller.php
示例3: controller
/**
* Retrieve Controller as singleton
*
* @return Maged_Controller
*/
public function controller()
{
return Maged_Controller::singleton();
}
开发者ID:relue,项目名称:magento2,代码行数:9,代码来源:View.php
示例4: umask
*
* NOTICE OF LICENSE
*
* This source file is subject to the Magento Enterprise Edition License
* that is bundled with this package in the file LICENSE_EE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.magentocommerce.com/license/enterprise-edition
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
* @package Mage_Connect
* @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
* @license http://www.magentocommerce.com/license/enterprise-edition
*/
if (version_compare(phpversion(), '5.2.0', '<') === true) {
echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="http://www.magentocommerce.com/install" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
exit;
}
require_once "lib/Mage/Autoload/Simple.php";
Mage_Autoload_Simple::register();
umask(0);
Maged_Controller::run();
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:30,代码来源:index.php
示例5: mkDirHier
/**
* Wrapper to System::mkDir(), creates a directory as well as
* any necessary parent directories.
*
* @param string $dir directory name
*
* @return bool TRUE on success, or a PEAR error
*
* @access public
*/
function mkDirHier($dir)
{
$this->log(2, "+ create dir {$dir}");
if (!class_exists('System')) {
require_once 'System.php';
}
/*
* Magento fix for custom set permissions in config.ini
*/
if (class_exists('Maged_Controller', false)) {
$magedConfig = Maged_Controller::model('Config', true)->load();
if ($magedConfig->get('use_custom_permissions_mode') == '1' && ($mode = $magedConfig->get('mkdir_mode'))) {
return System::mkDir(array('-m' . $mode, $dir));
}
}
/*
* End fix
*/
return System::mkDir(array('-p', $dir));
}
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:30,代码来源:Common.php
示例6: _installFile2
//.........这里部分代码省略.........
$task =& new $task($this->config, $this, PEAR_TASK_INSTALL);
if (!$task->isScript()) {
// scripts are only handled after installation
$task->init($raw, $attribs, $pkg->getLastInstalledVersion());
$res = $task->startSession($pkg, $contents, $final_dest_file);
if ($res === false) {
continue;
// skip this file
}
if (PEAR::isError($res)) {
return $res;
}
$contents = $res;
// save changes
}
$wp = @fopen($dest_file, "wb");
if (!is_resource($wp)) {
return $this->raiseError("failed to create {$dest_file}: {$php_errormsg}", PEAR_INSTALLER_FAILED);
}
if (fwrite($wp, $contents) === false) {
return $this->raiseError("failed writing to {$dest_file}: {$php_errormsg}", PEAR_INSTALLER_FAILED);
}
fclose($wp);
}
}
// {{{ check the md5
if (isset($md5sum)) {
if (strtolower($md5sum) === strtolower($attribs['md5sum'])) {
$this->log(2, "md5sum ok: {$final_dest_file}");
} else {
if (empty($options['force'])) {
// delete the file
if (file_exists($dest_file)) {
unlink($dest_file);
}
if (!isset($options['ignore-errors'])) {
return $this->raiseError("bad md5sum for file {$final_dest_file}", PEAR_INSTALLER_FAILED);
} else {
if (!isset($options['soft'])) {
$this->log(0, "warning : bad md5sum for file {$final_dest_file}");
}
}
} else {
if (!isset($options['soft'])) {
$this->log(0, "warning : bad md5sum for file {$final_dest_file}");
}
}
}
}
// }}}
// {{{ set file permissions
if (!OS_WINDOWS) {
if ($role->isExecutable()) {
$mode = 0777 & ~(int) octdec($this->config->get('umask'));
$this->log(3, "+ chmod +x {$dest_file}");
} else {
$mode = 0666 & ~(int) octdec($this->config->get('umask'));
}
/*
* Magento fix for custom set permissions in config.ini
*/
if (class_exists('Maged_Controller', false)) {
$magedConfig = Maged_Controller::model('Config', true)->load();
if ($magedConfig->get('use_custom_permissions_mode') == '1') {
if ($role->isExecutable() && ($configMode = $magedConfig->get('chmod_file_mode_executable'))) {
$mode = $magedConfig;
}
if (!$role->isExecutable() && ($configMode = $magedConfig->get('chmod_file_mode'))) {
$mode = $magedConfig;
}
}
}
/*
* End fix
*/
if ($attribs['role'] != 'src') {
$this->addFileOperation("chmod", array($mode, $dest_file));
if (!@chmod($dest_file, $mode)) {
if (!isset($options['soft'])) {
$this->log(0, "failed to change mode of {$dest_file}: {$php_errormsg}");
}
}
}
}
// }}}
if ($attribs['role'] == 'src') {
rename($dest_file, $final_dest_file);
$this->log(2, "renamed source file {$dest_file} to {$final_dest_file}");
} else {
$this->addFileOperation("rename", array($dest_file, $final_dest_file, $role->isExtension()));
}
}
// Store the full path where the file was installed for easy uninstall
if ($attribs['role'] != 'src') {
$loc = $this->config->get($role->getLocationConfig(), null, $channel);
$this->addFileOperation("installed_as", array($file, $installed_as, $loc, dirname(substr($installed_as, strlen($loc)))));
}
//$this->log(2, "installed: $dest_file");
return PEAR_INSTALLER_OK;
}
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:101,代码来源:Installer.php
示例7: tmpdir
/**
* Get the path of the temporal directory set in the system
* by looking in its environments variables.
* Note: php.ini-recommended removes the "E" from the variables_order setting,
* making unavaible the $_ENV array, that s why we do tests with _ENV
*
* @static
* @return string The temporary directory on the system
*/
function tmpdir()
{
/*
* Magento fix for set tmp dir in config.ini
*/
if (class_exists('Maged_Controller', false)) {
$magedConfig = Maged_Controller::model('Config', true)->load();
if (!is_null($tmpDir = $magedConfig->get('tmp_dir'))) {
return $tmpDir;
}
}
/*
* End fix
*/
if (OS_WINDOWS) {
if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) {
return $var;
}
if ($var = isset($_ENV['TEMP']) ? $_ENV['TEMP'] : getenv('TEMP')) {
return $var;
}
if ($var = isset($_ENV['USERPROFILE']) ? $_ENV['USERPROFILE'] : getenv('USERPROFILE')) {
return $var;
}
if ($var = isset($_ENV['windir']) ? $_ENV['windir'] : getenv('windir')) {
return $var;
}
return getenv('SystemRoot') . '\\temp';
}
if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) {
return $var;
}
return realpath('/tmp');
}
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:43,代码来源:System.php
示例8: singleton
public static function singleton()
{
if (!self::$_instance) {
self::$_instance = new self();
}
return self::$_instance;
}
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:7,代码来源:Controller.php
注:本文中的Maged_Controller类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论