当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Io_File::allowedPath方法代码示例

本文整理汇总了PHP中Varien_Io_File::allowedPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Io_File::allowedPath方法的具体用法?PHP Varien_Io_File::allowedPath怎么用?PHP Varien_Io_File::allowedPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Io_File的用法示例。


在下文中一共展示了Varien_Io_File::allowedPath方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _beforeSave

 protected function _beforeSave()
 {
     $io = new Varien_Io_File();
     $realPath = $io->getCleanPath(Mage::getBaseDir() . '/' . $this->getSitemapPath());
     /**
      * Check path is allow
      */
     if (!$io->allowedPath($realPath, Mage::getBaseDir())) {
         Mage::throwException(Mage::helper('sitemap')->__('Please define correct path'));
     }
     /**
      * Check exists and writeable path
      */
     if (!$io->fileExists($realPath, false)) {
         Mage::throwException(Mage::helper('sitemap')->__('Please create the specified folder "%s" before saving the sitemap.', Mage::helper('core')->htmlEscape($this->getSitemapPath())));
     }
     if (!$io->isWriteable($realPath)) {
         Mage::throwException(Mage::helper('sitemap')->__('Please make sure that "%s" is writable by web-server.', $this->getSitemapPath()));
     }
     /**
      * Check allow filename
      */
     if (!preg_match('#^[a-zA-Z0-9_\\.]+$#', $this->getSitemapFilename())) {
         Mage::throwException(Mage::helper('sitemap')->__('Please use only letters (a-z or A-Z), numbers (0-9) or underscore (_) in the filename. No spaces or other characters are allowed.'));
     }
     if (!preg_match('#\\.xml$#', $this->getSitemapFilename())) {
         $this->setSitemapFilename($this->getSitemapFilename() . '.xml');
     }
     $this->setSitemapPath(rtrim(str_replace(str_replace('\\', '/', Mage::getBaseDir()), '', $realPath), '/') . '/');
     return parent::_beforeSave();
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:31,代码来源:Sitemap.php

示例2: _beforeSave

 protected function _beforeSave()
 {
     $x114 = "preg_split";
     $x115 = "implode";
     $x116 = "str_replace";
     $x117 = "utf8_encode";
     $x118 = "preg_match_all";
     $x119 = "preg_match";
     $x11a = "rtrim";
     $x11b = "is_null";
     $x11c = "count";
     $x11d = "is_numeric";
     $x11e = "explode";
     $x11f = "substr";
     $x120 = "trim";
     $x121 = "strlen";
     $x122 = "htmlentities";
     $x123 = "html_entity_decode";
     $x124 = "preg_replace";
     $x125 = "json_decode";
     $x126 = "is_array";
     $x127 = "stristr";
     $x128 = "print_r";
     $x129 = "is_string";
     $x12a = "ucwords";
     $x12b = "array_push";
     $x12c = "version_compare";
     $x12d = "in_array";
     $x12e = "sprintf";
     $x12f = "array_pop";
     $x130 = "ceil";
     $x131 = "ini_get";
     $x132 = "set_time_limit";
     $x133 = "number_format";
     $x134 = "strip_tags";
     $x135 = "htmlspecialchars";
     $x136 = "strrpos";
     $x137 = "is_bool";
     $x138 = "mb_strtolower";
     $x139 = "mb_strtoupper";
     $x13a = "ftp_connect";
     $x13b = "ftp_login";
     $x13c = "ftp_pasv";
     $x13d = "ftp_put";
     $x13e = "ftp_close";
     $x43 = new Varien_Io_File();
     $x44 = $x43->getCleanPath(Mage::getBaseDir() . '/' . $this->getFeedPath());
     if (!$x43->allowedPath($x44, Mage::getBaseDir())) {
         Mage::throwException(Mage::helper('datafeedmanager')->__('Please define correct path'));
     }
     if (!$x43->fileExists($x44, false)) {
         Mage::throwException(Mage::helper('datafeedmanager')->__('Please create the specified folder "%s" before saving the data feed configuration.', Mage::helper('core')->htmlEscape($this->getFeedPath())));
     }
     if (!$x43->isWriteable($x44)) {
         Mage::throwException(Mage::helper('datafeedmanager')->__('Please make sure that "%s" is writable by web-server.', $this->getFeedPath()));
     }
     if (!$x119('#^[a-zA-Z0-9_\\.]+$#', $this->getFeedName())) {
         Mage::throwException(Mage::helper('datafeedmanager')->__('Please use only letters (a-z or A-Z), numbers (0-9) or underscore (_) in the filename. No spaces or other characters are allowed.'));
     }
     $this->setFeedPath($x11a($x116($x116('\\', '/', Mage::getBaseDir()), '', $x44), '/') . '/');
     return parent::_beforeSave();
 }
开发者ID:rafaelferreiraxd,项目名称:modulos-magento,代码行数:62,代码来源:Configurations.php

示例3: _beforeSave

 protected function _beforeSave()
 {
     $io = new Varien_Io_File();
     $pathmap = $this->getHelper()->getGeneralConf($this->getStoreId())->getPathMap();
     if ($pathmap) {
         $pathmap = DS . $pathmap;
     }
     $realPath = $io->getCleanPath(Mage::getBaseDir() . $pathmap . DS . $this->getSitemapPath());
     $realPath_save = $io->getCleanPath(Mage::getBaseDir() . DS . $this->getSitemapPath());
     $_isCompressed = $this->getHelper()->getGeneralConf($this->getStoreId())->getUsecompression();
     /**
      * Check path is allow
      */
     if (!$pathmap) {
         if (!$io->allowedPath($realPath, Mage::getBaseDir())) {
             Mage::throwException(Mage::helper('sitemap')->__('Please define correct path'));
         }
     }
     /**
      * Check exists and writeable path
      */
     if (!$io->fileExists($realPath, false)) {
         Mage::throwException(Mage::helper('sitemap')->__('Please create the specified folder "%s" before saving the sitemap.', Mage::helper('core')->htmlEscape($realPath)));
     }
     if (!$io->isWriteable($realPath)) {
         Mage::throwException(Mage::helper('sitemap')->__('Please make sure that "%s" is writable by web-server.', $realPath));
     }
     /**
      * Check allow filename
      */
     if (!preg_match('#^[a-zA-Z0-9_\\.]+$#', $this->getSitemapFilename())) {
         Mage::throwException(Mage::helper('sitemap')->__('Please use only letters (a-z or A-Z), numbers (0-9) or underscore (_) in the filename. No spaces or other characters are allowed.'));
     }
     if ($_isCompressed) {
         $this->setSitemapFilename($this->getHelper()->clearExtension($this->getSitemapFilename()) . '.xml.gz');
     } else {
         $this->setSitemapFilename($this->getHelper()->clearExtension($this->getSitemapFilename()) . '.xml');
     }
     if (!$this->getHelper()->isUnique($this)) {
         Mage::throwException(Mage::helper('sitemap')->__('Please select another filename/path, as another sitemap with same filename already exists on the specified location.'));
     }
     $this->setSitemapPath(rtrim(str_replace(str_replace('\\', '/', Mage::getBaseDir()), '', $realPath_save), '/') . '/');
     return Mage_Core_Model_Abstract::_beforeSave();
 }
开发者ID:rcclaudrey,项目名称:dev,代码行数:44,代码来源:SitemapEnhanced.php

示例4: _beforeSave

 protected function _beforeSave()
 {
     $x11f = "strlen";
     $x120 = "implode";
     $x121 = "str_replace";
     $x122 = "utf8_encode";
     $x123 = "preg_match_all";
     $x124 = "preg_match";
     $x125 = "rtrim";
     $x126 = "is_null";
     $x127 = "number_format";
     $x128 = "count";
     $x129 = "is_numeric";
     $x12a = "explode";
     $x12b = "substr";
     $x12c = "trim";
     $x12d = "preg_split";
     $x12e = "utf8_decode";
     $x12f = "is_string";
     $x130 = "json_decode";
     $x131 = "is_array";
     $x132 = "ucwords";
     $x133 = "array_push";
     $x134 = "print_r";
     $x135 = "version_compare";
     $x136 = "in_array";
     $x137 = "sprintf";
     $x138 = "array_pop";
     $x139 = "ceil";
     $x13a = "ini_get";
     $x13b = "set_time_limit";
     $x13c = "unserialize";
     $x13d = "getType";
     $x13e = "round";
     $x13f = "str_pad";
     $x140 = "abs";
     $x141 = "floor";
     $x142 = "usort";
     $x143 = "array_shift";
     $x144 = "array_reverse";
     $x145 = "array_values";
     $x146 = "preg_replace";
     $x147 = "strip_tags";
     $x148 = "html_entity_decode";
     $x149 = "htmlspecialchars";
     $x14a = "strrpos";
     $x14b = "stristr";
     $x14c = "mb_strtolower";
     $x14d = "mb_strtoupper";
     $x14e = "htmlentities";
     $x3d = new Varien_Io_File();
     $x3e = $x3d->getCleanPath(Mage::getBaseDir() . '/' . $this->getSimplegoogleshoppingPath());
     if (!$x3d->allowedPath($x3e, Mage::getBaseDir())) {
     }
     if (!$x3d->fileExists($x3e, false)) {
         Mage::throwException(Mage::helper('simplegoogleshopping')->__('Please create the specified folder %s before saving the googleshopping.', Mage::helper('core')->htmlEscape($this->getSimplegoogleshoppingPath())));
     }
     if (!$x3d->isWriteable($x3e)) {
         Mage::throwException(Mage::helper('simplegoogleshopping')->__('Please make sure that %s is writable by web-server.', $this->getSimplegoogleshoppingPath()));
     }
     if (!$x124('#^[a-zA-Z0-9_\\.]+$#', $this->getSimplegoogleshoppingFilename())) {
         Mage::throwException(Mage::helper('simplegoogleshopping')->__('Please use only letters (a-z or A-Z), numbers (0-9) or underscore (_) in the filename. No spaces or other characters are allowed.'));
     }
     if (!$x124('#\\.xml$#', $this->getSimplegoogleshoppingFilename())) {
         $this->setSimplegoogleshoppingFilename($this->getSimplegoogleshoppingFilename() . '.xml');
     }
     $this->setSimplegoogleshoppingPath($x125($x121($x121('\\', '/', Mage::getBaseDir()), '', $x3e), '/') . '/');
     return parent::_beforeSave();
 }
开发者ID:buttasg,项目名称:cowgirlk,代码行数:69,代码来源:Simplegoogleshopping.php

示例5: _beforeSave

 protected function _beforeSave()
 {
     $xb4 = "array_push";
     $xb5 = "count";
     $xb6 = "date";
     $xb7 = "eval";
     $xb8 = "explode";
     $xb9 = "header";
     $xba = "htmlspecialchars";
     $xbb = "html_entity_decode";
     $xbc = "htmlentities";
     $xbd = "in_array";
     $xbe = "implode";
     $xbf = "ini_get";
     $xc0 = "is_bool";
     $xc1 = "is_array";
     $xc2 = "is_null";
     $xc3 = "is_numeric";
     $xc4 = "mb_strtolower";
     $xc5 = "mb_strtoupper";
     $xc6 = "number_format";
     $xc7 = "preg_match";
     $xc8 = "preg_match_all";
     $xc9 = "preg_split";
     $xca = "preg_replace";
     $xcb = "print_r";
     $xcc = "round";
     $xcd = "rtrim";
     $xce = "set_time_limit";
     $xcf = "sprintf";
     $xd0 = "str_replace";
     $xd1 = "strlen";
     $xd2 = "stristr";
     $xd3 = "strip_tags";
     $xd4 = "substr";
     $xd5 = "strrpos";
     $xd6 = "trim";
     $xd7 = "ucwords";
     $xd8 = "utf8_decode";
     $x0b = new Varien_Io_File();
     $x0c = $x0b->getCleanPath(Mage::getBaseDir() . '/' . $this->getFeedPath());
     if (!$x0b->allowedPath($x0c, Mage::getBaseDir())) {
         Mage::throwException(Mage::helper('datafeedmanager')->__('Please define correct path'));
     }
     if (!$x0b->fileExists($x0c, false)) {
         Mage::throwException(Mage::helper('datafeedmanager')->__('Please create the specified folder "%s" before saving the data feed configuration.', Mage::helper('core')->htmlEscape($this->getFeedPath())));
     }
     if (!$x0b->isWriteable($x0c)) {
         Mage::throwException(Mage::helper('datafeedmanager')->__('Please make sure that "%s" is writable by web-server.', $this->getFeedPath()));
     }
     if (!$xc7('#^[a-zA-Z0-9_\\.]+$#', $this->getFeedName())) {
         Mage::throwException(Mage::helper('datafeedmanager')->__('Please use only letters (a-z or A-Z), numbers (0-9) or underscore (_) in the filename. No spaces or other characters are allowed.'));
     }
     $this->setFeedPath($xcd($xd0($xd0('\\', '/', Mage::getBaseDir()), '', $x0c), '/') . '/');
     return parent::_beforeSave();
 }
开发者ID:,项目名称:,代码行数:56,代码来源:

示例6: _beforeSave

 protected function _beforeSave()
 {
     $xd6 = "str_replace";
     $xd7 = "utf8_encode";
     $xd8 = "preg_match_all";
     $xd9 = "preg_match";
     $xda = "rtrim";
     $xdb = "is_null";
     $xdc = "count";
     $xdd = "is_numeric";
     $xde = "explode";
     $xdf = "substr";
     $xe0 = "trim";
     $xe1 = "preg_split";
     $xe2 = "strlen";
     $xe3 = "utf8_decode";
     $xe4 = "is_string";
     $xe5 = "json_decode";
     $xe6 = "is_array";
     $xe7 = "header";
     $xe8 = "ucwords";
     $xe9 = "array_push";
     $xea = "print_r";
     $xeb = "version_compare";
     $xec = "in_array";
     $xed = "round";
     $xee = "implode";
     $xef = "sprintf";
     $xf0 = "array_pop";
     $xf1 = "ini_get";
     $xf2 = "set_time_limit";
     $xf3 = "number_format";
     $xf4 = "preg_replace";
     $xf5 = "strip_tags";
     $xf6 = "html_entity_decode";
     $xf7 = "htmlspecialchars";
     $xf8 = "strrpos";
     $xf9 = "stristr";
     $xfa = "mb_strtolower";
     $xfb = "mb_strtoupper";
     $xfc = "htmlentities";
     $x20 = new Varien_Io_File();
     $x21 = $x20->getCleanPath(Mage::getBaseDir() . '/' . $this->getSimplegoogleshoppingPath());
     if (!$x20->allowedPath($x21, Mage::getBaseDir())) {
     }
     if (!$x20->fileExists($x21, false)) {
         Mage::throwException(Mage::helper('simplegoogleshopping')->__('Please create the specified folder "%s" before saving the googleshopping.', Mage::helper('core')->htmlEscape($this->getSimplegoogleshoppingPath())));
     }
     if (!$x20->isWriteable($x21)) {
         Mage::throwException(Mage::helper('simplegoogleshopping')->__('Please make sure that "%s" is writable by web-server.', $this->getSimplegoogleshoppingPath()));
     }
     if (!$xd9('#^[a-zA-Z0-9_\\.]+$#', $this->getSimplegoogleshoppingFilename())) {
         Mage::throwException(Mage::helper('simplegoogleshopping')->__('Please use only letters (a-z or A-Z), numbers (0-9) or underscore (_) in the filename. No spaces or other characters are allowed.'));
     }
     if (!$xd9('#\\.xml$#', $this->getSimplegoogleshoppingFilename())) {
         $this->setSimplegoogleshoppingFilename($this->getSimplegoogleshoppingFilename() . '.xml');
     }
     $this->setSimplegoogleshoppingPath($xda($xd6($xd6('\\', '/', Mage::getBaseDir()), '', $x21), '/') . '/');
     return parent::_beforeSave();
 }
开发者ID:jokusafet,项目名称:MagentoSource,代码行数:60,代码来源:Simplegoogleshopping.php


注:本文中的Varien_Io_File::allowedPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。