Commit 62f621c1 authored by Luke√'s avatar Luke√

Create module Onlinebiz_Optimize

parents
<?php
class Onlinebiz_Optimize_Block_Adminhtml_Config_Source_Heading
extends Mage_Adminhtml_Block_Abstract implements Varien_Data_Form_Element_Renderer_Interface
{
/**
* Render element html
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$useContainerId = $element->getData('use_container_id');
return sprintf('<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4>%s</h4></td></tr>',
$element->getHtmlId(), $element->getLabel()
);
}
}
\ No newline at end of file
<?php
/**
* Diglin
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
*
* @category Diglin
* @package Onlinebiz_Optimize
* @copyright Copyright (c) 2011-2013 Diglin (http://www.onlinebiz.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
class Onlinebiz_Optimize_Block_Adminhtml_Config_Source_Hint
extends Mage_Adminhtml_Block_Abstract
implements Varien_Data_Form_Element_Renderer_Interface
{
/**
* Render fieldset html
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$version = Mage::getConfig()->getModuleConfig('Onlinebiz_Optimize')->version;
$block = $this->getLayout()->createBlock('adminhtml/widget_button')
->setData(array(
'label' => Mage::helper('adminhtml')->__('Flush JavaScript/CSS Cache'),
'onclick' => "setLocation('" . $this->getUrl('*/cache/cleanMedia') ."');",
));
return $block->toHtml() .' ('. $this->__('You will be redirected to the Cache Management page with a successful message') .')</p>';
}
}
\ No newline at end of file
This diff is collapsed.
<?php
if ((string) Mage::getConfig()->getModuleConfig('Smartwave_Porto')->active == 'true'){
class Onlinebiz_Optimize_Block_Optimize_Head_Abstract extends Smartwave_Porto_Block_Html_Head {}
} else {
class Onlinebiz_Optimize_Block_Optimize_Head_Abstract extends Mage_Page_Block_Html_Head {}
}
?>
<?php
class Onlinebiz_Optimize_Helper_Autoloader
{
const CLOUDINARY_EXTENSION_LIB_PATH = 'CloudinaryExtension';
const CLOUDINARY_LIB_PATH = 'MatthiasMullie';
const CONVERT_CLASS_TO_PATH_REGEX = '#\\\|_(?!.*\\\)#';
private $_originalAutoloaders;
public function register()
{
$this->_deregisterVarienAutoloaders();
$this->_registerCloudinaryAutoloader();
$this->_registerCloudinaryExtensionAutoloader();
$this->_reregisterVarienAutoloaders();
}
private function _registerCloudinaryExtensionAutoloader()
{
spl_autoload_register(
function ($className) {
if(
strpos($className, Onlinebiz_Optimize_Helper_Autoloader::CLOUDINARY_EXTENSION_LIB_PATH . '\\') === 0 ||
strpos($className, Onlinebiz_Optimize_Helper_Autoloader::CLOUDINARY_LIB_PATH . '\\') === 0
) {
include_once preg_replace(Onlinebiz_Optimize_Helper_Autoloader::CONVERT_CLASS_TO_PATH_REGEX, '/', $className) . '.php';
}
}
);
return $this;
}
private function _registerCloudinaryAutoloader()
{
$libFolder = Mage::getBaseDir('lib');
spl_autoload_register(
function ($className) use ($libFolder) {
if($className === Onlinebiz_Optimize_Helper_Autoloader::CLOUDINARY_LIB_PATH) {
foreach(new GlobIterator($libFolder . DS . Onlinebiz_Optimize_Helper_Autoloader::CLOUDINARY_LIB_PATH . DS . '*.php') as $phpFile) {
include_once $phpFile;
}
}
}
);
return $this;
}
private function _deregisterVarienAutoloaders()
{
$this->_originalAutoloaders = array();
foreach (spl_autoload_functions() as $callback) {
if (is_array($callback) && $callback[0] instanceof Varien_Autoload) {
$this->_originalAutoloaders[] = $callback;
spl_autoload_unregister($callback);
}
}
}
private function _reregisterVarienAutoloaders()
{
foreach ($this->_originalAutoloaders as $autoloader) {
spl_autoload_register($autoloader);
}
}
}
\ No newline at end of file
This diff is collapsed.
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* 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 license@magentocommerce.com 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_Catalog
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Catalog image helper
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Onlinebiz_Optimize_Helper_Image extends Onlinebiz_Optimize_Helper_Image_Abstract
{
/**
* Used Advanced options
*
* @var int
*/
protected $_useAdvanced = false;
/**
* Reset all previous data
*
* @return Mage_Catalog_Helper_Image
*/
protected function _reset()
{
parent::_reset();
$this->_useAdvanced = false;
return $this;
}
/**
* Initialize Helper to work with Image
*
* @param Mage_Catalog_Model_Product $product
* @param string $attributeName
* @param mixed $imageFile
* @return Mage_Catalog_Helper_Image
*/
public function init(Mage_Catalog_Model_Product $product, $attributeName, $imageFile = null, $useAdvanced = false)
{
parent::init($product, $attributeName, $imageFile, $useAdvanced);
$this->_useAdvanced = $useAdvanced;
return $this;
}
/**
* Return Image URL
*
* @return string
*/
public function __toString()
{
if (Mage::app()->getStore()->isAdmin()) {
return parent::__toString();
}
try {
$model = $this->_getModel();
if ($this->getImageFile()) {
$model->setBaseFile($this->getImageFile(), $this->_useAdvanced);
} else {
$model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir()), $this->_useAdvanced);
}
$disableIMGCache = Mage::helper('onlinebiz_optimize')->isDisabledIMGCache();
if ($model->isCached() || $disableIMGCache) {
return $model->getUrl();
} else {
if ($this->_scheduleRotate) {
$model->rotate($this->getAngle());
}
if ($this->_scheduleResize) {
$model->resize();
}
if ($this->getWatermark()) {
$model->setWatermark($this->getWatermark());
}
$url = $model->saveFile()->getUrl();
}
} catch (Exception $e) {
$url = Mage::getDesign()->getSkinUrl($this->getPlaceholder());
}
return $url;
}
}
<?php
if ((string) Mage::getConfig()->getModuleConfig('Amasty_Shopby')->active == 'true'){
class Onlinebiz_Optimize_Helper_Image_Abstract extends Amasty_Shopby_Helper_Image {}
} else {
class Onlinebiz_Optimize_Helper_Image_Abstract extends Mage_Catalog_Helper_Image {}
}
?>
<?php
class Onlinebiz_Optimize_Model_Core_Design_Package extends Mage_Core_Model_Design_Package
{
protected function _helper()
{
return Mage::helper('onlinebiz_optimize');
}
protected function isCloud()
{
return $this->_helper()->isCloudinaryActive($this->getStore());
}
/**
* Get skin file url
*
* @param string $file
* @param array $params
* @return string
*/
public function getSkinUrl($file = null, array $params = array())
{
Varien_Profiler::start(__METHOD__);
if (empty($params['_type'])) {
$params['_type'] = 'skin';
}
if (empty($params['_default'])) {
$params['_default'] = false;
}
$this->updateParamDefaults($params);
if (!empty($file)) {
if ($this->_helper()->checkVersion('1.9')) {
$result = $this->_fallback(
$file,
$params,
$this->_fallback->getFallbackScheme(
$params['_area'],
$params['_package'],
$params['_theme']
)
);
} else {
$result = $this->_fallback(
$file,
$params,
array(
array(),
array('_theme' => $this->getFallbackTheme()),
array('_theme' => self::DEFAULT_THEME),
)
);
}
}
if($this->isNotImageFile($file))
$result = $this->getSkinJsCss($file, $params) . (empty($file) ? '' : $file);
else
$result = $this->getSkinBaseUrl($params) . (empty($file) ? '' : $file . $this->_helper()->getIMGixOptions());
Varien_Profiler::stop(__METHOD__);
return $result;
}
/**
* Get skin file url
*
* @param string $file
* @param array $params
* @return string
*/
public function getSkinMageUrl($file = null, array $params = array())
{
Varien_Profiler::start(__METHOD__);
if (empty($params['_type'])) {
$params['_type'] = 'skin';
}
if (empty($params['_default'])) {
$params['_default'] = false;
}
$this->updateParamDefaults($params);
if (!empty($file)) {
$result = $this->_fallback($file, $params, array(
array(),
array('_theme' => $this->getFallbackTheme()),
array('_theme' => self::DEFAULT_THEME),
));
}
$result = $this->getSkinBaseMageUrl($params) . (empty($file) ? '' : $file);
Varien_Profiler::stop(__METHOD__);
return $result;
}
public function getSkinJsCss($file = null, array $params=array())
{
$skinMergeURL = Mage::getBaseUrl(Onlinebiz_Optimize_Model_Core_Store::URL_TYPE_SKIN_MERGE);
$params['_type'] = 'skin';
$this->updateParamDefaults($params);
$baseUrl = $skinMergeURL . $params['_area'] . '/' . $params['_package'] . '/' . $params['_theme'] . '/';
return $baseUrl;
}
public function isNotImageFile($file) {
$info = pathinfo($file);
$extension = '';
if(isset($info['extension']))
$extension = $info['extension'];
return in_array(strtolower($extension), array("css", "js"));
}
/**
* Merge specified css files and return URL to the merged file on success
*
* @param $files
* @return string
*/
public function getMergedCssUrl($files)
{
// secure or unsecure
$isSecure = Mage::app()->getRequest()->isSecure();
$mergerDir = $isSecure ? 'css_secure' : 'css';
$targetDir = $this->_initMergerDir($mergerDir);
if (!$targetDir) {
return '';
}
// base hostname & port
$baseMediaUrl = Mage::getBaseUrl('media', $isSecure);
$hostname = parse_url($baseMediaUrl, PHP_URL_HOST);
$port = parse_url($baseMediaUrl, PHP_URL_PORT);
if (false === $port) {
$port = $isSecure ? 443 : 80;
}
// merge into target file
$targetFilename = md5(implode(',', $files) . "|{$hostname}|{$port}") . '.min.css';
$localFiles = $this->_removeParamFiles($files);
$mergeFilesResult = $this->_mergeFiles(
$localFiles, $targetDir . DS . $targetFilename,
false,
array($this, 'beforeMergeCss'),
'css'
);
// get Merge Media URL
$mediaMerge = $this->_helper()->getMediaMergeUrl($mergerDir . DS . $targetFilename, $this->getStore());
$version = $this->_helper()->_getFileVersion($mergerDir . '/' . $targetFilename);
if(!empty($mediaMerge)){
return $mediaMerge . $mergerDir . '/' . $targetFilename . $version;
}
if ($mergeFilesResult) {
return $baseMediaUrl . $mergerDir . '/' . $targetFilename . $version;
}
return '';
}
/**
* Merge specified javascript files and return URL to the merged file on success
*
* @param $files
* @return string
*/
public function getMergedJsUrl($files)
{
$targetFilename = md5(implode(',', $files)) . '.min.js';
$targetDir = $this->_initMergerDir('js');
if (!$targetDir) {
return '';
}
$linkMerge = $this->_helper()->getMediaMergeUrl('js' . DS . $targetFilename, $this->getStore());
$localFiles = $this->_removeParamFiles($files, 'js');
if(!empty($linkMerge)){
if ($this->_mergeFiles($localFiles, $targetDir . DS . $targetFilename, false, null, 'js')) {
$version = $this->_helper()->_getFileVersion('js' . DS . $targetFilename);
return $linkMerge . 'js/' . $targetFilename . $version;
}
}
return '';
}
public function getSkinBaseMageUrl(array $params=array())
{
$params['_type'] = 'skin';
$this->updateParamDefaults($params);
$baseUrl = Mage::getBaseUrl(Onlinebiz_Optimize_Model_Core_Store::URL_TYPE_SKIN_BASE, isset($params['_secure'])?(bool)$params['_secure']:null)
.$params['_area'].'/'.$params['_package'].'/'.$params['_theme'].'/';
return $baseUrl;
}
private function _removeParamFiles( $files, $type = 'css' )
{
$localFiles = array();
$storeId = Mage::app()->getStore()->getId();
$baseWebUrl = Mage::getBaseUrl(Onlinebiz_Optimize_Model_Core_Store::URL_TYPE_WEB);
if($this->isCloud()){
$baseWebUrl = str_replace( '{{type}}', 'raw', $this->_helper()->getCloudinaryConfigData('url',$storeId) );
if($this->_helper()->getCssJsCloudUrl()){
$baseWebUrl = $this->_helper()->getCssJsCloudUrl();
}
}
$useVersion = $this->_helper()->isFileVersion() ;
$baseMediaDir = Mage::getBaseDir() . DS;
if(is_array($files)){
foreach ($files as $file) {
$newFile = $file;
if( $useVersion ){
$fileInfo = parse_url($file);
if( isset($fileInfo['query'])){
$newFile = str_replace( '?'. $fileInfo['query'],'', $newFile);
}
}
$localFiles[] = str_replace( $baseWebUrl, $baseMediaDir, $newFile );
}
}
return $localFiles;
}
/**
* Prepare url for css replacement
*
* @param string $uri
* @return string
*/
protected function _prepareUrl($uri)
{
// check absolute or relative url
if (!preg_match('/^https?:/i', $uri) && !preg_match('/^\//i', $uri)) {
$fileDir = '';
$pathParts = explode(DS, $uri);
$fileDirParts = explode(DS, $this->_callbackFileDir);
$store = $this->getStore();
$isCssCompression = $this->_helper()->isUseCompression('css',$store);
if($isCssCompression && !$store->isAdmin()){
array_unshift($fileDirParts, 'skin');
}
if (is_int($store)) {
$store = Mage::app()->getStore($store);
}
if ($store->isAdmin()) {
$secure = $store->isAdminUrlSecure();
} else {
$secure = $store->isFrontUrlSecure() && Mage::app()->getRequest()->isSecure();
}
if ('skin' == $fileDirParts[0]) {
$baseUrl = Mage::getBaseUrl('skin', $secure);
$fileDirParts = array_slice($fileDirParts, 1);
} elseif ('media' == $fileDirParts[0]) {
$baseUrl = Mage::getBaseUrl('media', $secure);
$fileDirParts = array_slice($fileDirParts, 1);
} else {
$baseUrl = Mage::getBaseUrl('web', $secure);
}
foreach ($pathParts as $key=>$part) {
if ($part == '.' || $part == '..') {
unset($pathParts[$key]);
}
if ($part == '..' && count($fileDirParts)) {
$fileDirParts = array_slice($fileDirParts, 0, count($fileDirParts) - 1);
}
}
if (count($fileDirParts)) {
$fileDir = implode('/', $fileDirParts).'/';
}
if( $fileDir == 'media/css_secure/' || $fileDir == '/media/css_secure/')
$fileDir = '';
$pathParts = implode('/', $pathParts);
if($isCssCompression){
$pathParts = str_replace('../../skin/','',$pathParts);
$pathParts = str_replace('skin/','',$pathParts);
}
if( $this->_helper()->isFontsFile($pathParts) && $this->isCloud()){
$baseUrl = Mage::getBaseUrl('skincloud', $secure);
}
$uri = $baseUrl . $fileDir . $pathParts;
}
return $uri;
}
/**
* Callback function replaces relative links for @import matches in css file
*
* @param array $match
* @return string
*/
protected function _cssMergerImportCallback($match)
{
$quote = $match[1];
$uri = $this->_prepareUrl($match[2]);
return "@import {$quote}{$uri}{$quote}";
}
/**
* Callback function replaces relative links for url() matches in css file
*
* @param array $match
* @return string
*/
protected function _cssMergerUrlCallback($match)
{
$quote = ($match[1][0] == "'" || $match[1][0] == '"') ? $match[1][0] : '';
$uri = ($quote == '') ? $match[1] : substr($match[1], 1, strlen($match[1]) - 2);
$uri = $this->_prepareUrl($uri);
if($this->isCloud() && !$quote)
return "url('{$uri}')";
return "url({$quote}{$uri}{$quote})";
}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* 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 license@magentocommerce.com 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_Core
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Template model
*
* Example:
*
* // Loading of template
* $emailTemplate = Mage::getModel('core/email_template')
* ->load(Mage::getStoreConfig('path_to_email_template_id_config'));
* $variables = array(
* 'someObject' => Mage::getSingleton('some_model')
* 'someString' => 'Some string value'
* );
* $emailTemplate->send('some@domain.com', 'Name Of User', $variables);
*
* @method Mage_Core_Model_Resource_Email_Template _getResource()
* @method Mage_Core_Model_Resource_Email_Template getResource()
* @method string getTemplateCode()
* @method Mage_Core_Model_Email_Template setTemplateCode(string $value)
* @method string getTemplateText()
* @method Mage_Core_Model_Email_Template setTemplateText(string $value)
* @method string getTemplateStyles()
* @method Mage_Core_Model_Email_Template setTemplateStyles(string $value)
* @method int getTemplateType()
* @method Mage_Core_Model_Email_Template setTemplateType(int $value)
* @method string getTemplateSubject()
* @method Mage_Core_Model_Email_Template setTemplateSubject(string $value)
* @method string getTemplateSenderName()
* @method Mage_Core_Model_Email_Template setTemplateSenderName(string $value)
* @method string getTemplateSenderEmail()
* @method Mage_Core_Model_Email_Template setTemplateSenderEmail(string $value)
* @method string getAddedAt()
* @method Mage_Core_Model_Email_Template setAddedAt(string $value)
* @method string getModifiedAt()
* @method Mage_Core_Model_Email_Template setModifiedAt(string $value)
* @method string getOrigTemplateCode()
* @method Mage_Core_Model_Email_Template setOrigTemplateCode(string $value)
* @method string getOrigTemplateVariables()
* @method Mage_Core_Model_Email_Template setOrigTemplateVariables(string $value)
*
* @category Mage
* @package Mage_Core
* @author Magento Core Team <core@magentocommerce.com>
*/
class Onlinebiz_Optimize_Model_Core_Email_Template extends Onlinebiz_Optimize_Model_Core_Email_Template_Abstract
{
protected function _getLogoUrl($store)
{
$store = Mage::app()->getStore($store);
$fileName = $store->getConfig(self::XML_PATH_DESIGN_EMAIL_LOGO);
if ($fileName) {
$uploadDir = Mage_Adminhtml_Model_System_Config_Backend_Email_Logo::UPLOAD_DIR;
$fullFileName = Mage::getBaseDir('media') . DS . $uploadDir . DS . $fileName;
if (file_exists($fullFileName)) {
return Mage::getBaseUrl(Onlinebiz_Optimize_Model_Core_Store::URL_TYPE_MEDIA_BASE) . $uploadDir . '/' . $fileName;
}
}
return Mage::getDesign()->getSkinMageUrl('images/logo_email.gif');
}
}
<?php
if((string) Mage::getConfig()->getModuleConfig('Ebizmarts_Mandrill')->active == 'true'){
class Onlinebiz_Optimize_Model_Core_Email_Template_Abstract extends Ebizmarts_Mandrill_Model_Email_Template {}
}elseif((string) Mage::getConfig()->getModuleConfig('Ebizmarts_MailChimp')->active == 'true'){
class Onlinebiz_Optimize_Model_Core_Email_Template_Abstract extends Ebizmarts_MailChimp_Model_Email_Template {}
}else {
class Onlinebiz_Optimize_Model_Core_Email_Template_Abstract extends Mage_Core_Model_Email_Template {}
}
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* 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 license@magentocommerce.com 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_Core
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Store model
*
* @method Mage_Core_Model_Resource_Store _getResource()
* @method Mage_Core_Model_Resource_Store getResource()
* @method Mage_Core_Model_Store setCode(string $value)
* @method Mage_Core_Model_Store setWebsiteId(int $value)
* @method Mage_Core_Model_Store setGroupId(int $value)
* @method Mage_Core_Model_Store setName(string $value)
* @method int getSortOrder()
* @method Mage_Core_Model_Store setSortOrder(int $value)
* @method Mage_Core_Model_Store setIsActive(int $value)
*
* @category Mage
* @package Mage_Core
* @author Magento Core Team <core@magentocommerce.com>
*/
class Onlinebiz_Optimize_Model_Core_Store extends Mage_Core_Model_Store
{
/**
* Possible URL types
*/
const URL_TYPE_SKIN_BASE = 'skinbase';
const URL_TYPE_SKIN_CLOUD = 'skincloud';
const URL_TYPE_SKIN_MERGE = 'skin_merge';
const URL_TYPE_MEDIA_BASE = 'mediabase';
const URL_TYPE_MEDIA_MERGE = 'media_merge';
const XML_PATH_CLOUDINARY = 'onlinebiz_optimize/cloudmedia/';
/**
* Retrieve base URL
*
* @param string $type
* @param boolean|null $secure
* @return string
*/
public function getBaseUrl($type = self::URL_TYPE_LINK, $secure = null)
{
$cacheKey = $type . '/' . (is_null($secure) ? 'null' : ($secure ? 'true' : 'false'));
if (!isset($this->_baseUrlCache[$cacheKey])) {
switch ($type) {
case self::URL_TYPE_WEB:
$secure = is_null($secure) ? $this->isCurrentlySecure() : (bool)$secure;
$url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_url');
break;
case self::URL_TYPE_LINK:
$secure = (bool)$secure;
$url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_link_url');
$url = $this->_updatePathUseRewrites($url);
$url = $this->_updatePathUseStoreView($url);
break;
case self::URL_TYPE_DIRECT_LINK:
$secure = (bool)$secure;
$url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_link_url');
$url = $this->_updatePathUseRewrites($url);
break;
case self::URL_TYPE_SKIN:
case self::URL_TYPE_SKIN_BASE:
case self::URL_TYPE_SKIN_CLOUD:
case self::URL_TYPE_SKIN_MERGE:
$secure = is_null($secure) ? $this->isCurrentlySecure() : (bool)$secure;
$url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_' . self::URL_TYPE_SKIN . '_url');
if ($type != self::URL_TYPE_SKIN_BASE) {
$cloudType = (self::URL_TYPE_SKIN == $type) ? 'image' : 'raw';
$isCloud = (self::URL_TYPE_SKIN_CLOUD == $type) ? true : false;
$rawUrl = $this->getCloudinaryUrl($cloudType, $isCloud);
if (!is_numeric($rawUrl)) {
$rawUrl = rtrim($rawUrl, DS);
$url = $rawUrl . DS . self::URL_TYPE_SKIN;
}
}
break;
case self::URL_TYPE_JS:
$secure = is_null($secure) ? $this->isCurrentlySecure() : (bool)$secure;
$url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_' . $type . '_url');
if (!is_numeric($this->getCloudinaryUrl('raw')))
$url = $this->getCloudinaryUrl('raw') . self::URL_TYPE_JS;
break;
case self::URL_TYPE_MEDIA:
case self::URL_TYPE_MEDIA_MERGE:
case self::URL_TYPE_MEDIA_BASE:
$url = $this->_updateMediaPathUseRewrites($secure);
if ($type != self::URL_TYPE_MEDIA_BASE) {
$cloudType = (self::URL_TYPE_MEDIA_MERGE == $type) ? 'raw' : 'image';
$cloudUrl = $this->getCloudinaryUrl($cloudType);
if (!is_numeric($cloudUrl)){
$cloudUrl = rtrim($cloudUrl, DS);
$url = $cloudUrl . DS . self::URL_TYPE_MEDIA;
}
}
break;
default:
throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid base url type'));
}
if (false !== strpos($url, '{{base_url}}')) {
$baseUrl = Mage::getConfig()->substDistroServerVars('{{base_url}}');
$url = str_replace('{{base_url}}', $baseUrl, $url);
}
$this->_baseUrlCache[$cacheKey] = rtrim($url, '/') . '/';
}
return $this->_baseUrlCache[$cacheKey];
}
public function getCloudinaryUrl($type = null, $cloud = false)
{
if (!(int)$this->isCloudinaryActive())
return 0;
$baseJSCSS = rtrim($this->getConfig(self::XML_PATH_CLOUDINARY . 'basejscss'), '/');
if ($type == 'raw' && $baseJSCSS && !$cloud)
return $baseJSCSS . '/';
$value = str_replace('{{type}}', $type, $this->getConfig(self::XML_PATH_CLOUDINARY . 'url'));
$value = rtrim($value, '/');
if ($type == 'image')
$value = $value . '/';
return $value;
}
public function isCloudinaryActive()
{
if (Mage::app()->getStore()->isAdmin())
return 0;
else
return $this->getConfig(self::XML_PATH_CLOUDINARY . 'enable');
}
}
<?php
/**
* @package Pagespeed_Css
* @copyright Copyright (c) 2015 mediarox UG (haftungsbeschraenkt) (http://www.mediarox.de)
* @author Steven Fritzsche <sfritzsche@mediarox.de>
* @author Thomas Uhlig <tuhlig@mediarox.de>
*/
/**
* Standard observer class
*/
class Onlinebiz_Optimize_Model_Css_Observer
{
const LOADCSS = '(function(w){"use strict";if(!w.loadCSS){w.loadCSS=function(){}}
var rp=loadCSS.relpreload={};rp.support=(function(){var ret;try{ret=w.document.createElement("link").relList.supports("preload")}catch(e){ret=!1}
return function(){return ret}})();rp.bindMediaToggle=function(link){var finalMedia=link.media||"all";function enableStylesheet(){link.media=finalMedia}
if(link.addEventListener){link.addEventListener("load",enableStylesheet)}else if(link.attachEvent){link.attachEvent("onload",enableStylesheet)}
setTimeout(function(){link.rel="stylesheet";link.media="only x"});setTimeout(enableStylesheet,3000)};rp.poly=function(){if(rp.support()){return}
var links=w.document.getElementsByTagName("link");for(var i=0;i<links.length;i++){var link=links[i];if(link.rel==="preload"&&link.getAttribute("as")==="style"&&!link.getAttribute("data-loadcss")){link.setAttribute("data-loadcss",!0);rp.bindMediaToggle(link)}}};if(!rp.support()){rp.poly();var run=w.setInterval(rp.poly,500);if(w.addEventListener){w.addEventListener("load",function(){rp.poly();w.clearInterval(run)})}else if(w.attachEvent){w.attachEvent("onload",function(){rp.poly();w.clearInterval(run)})}}
if(typeof exports!=="undefined"){exports.loadCSS=loadCSS}
else{w.loadCSS=loadCSS}}(typeof global!=="undefined"?global:this))';
/**
* @const string
*/
const HTML_TAG_BODY = '</body>';
/**
* Will finally contain all css tags to move.
* @var string
*/
private $cssTags = '';
/**
* Contains all exclude regex patterns.
* @var array
*/
private $excludeList = array();
/**
* Processes the matched single css tag or the conditional css tag group.
*
* Step 1: Return if hit is blacklisted by exclude list.
* Step 2: Add hit to css tag list and return empty string for the replacement.
*
* @param array $hits
* @return string
*/
public function processHit($hits)
{
// Step 1
if ($this->isHitExcluded($hits[0])) return $hits[0];
// Step 2
$this->cssTags .= $hits[0];
return '';
}
/**
* Is hit on exclude list?
*
* @param string $hit
* @return bool
*/
protected function isHitExcluded($hit)
{
$c = 0;
preg_replace($this->excludeList, '', $hit, -1, $c);
return ($c > 0);
}
/**
* Move Css (head & inline) to the bottom. ({excluded_css}{stripped_html}{css}</body></html>)
*
* Step 1: Return if module is disabled.
* Step 2: Load needed data.
* Step 3: Return if no </body> is found in html.
* Step 4: Search and replace conditional css units. (example: <!--[if lt IE 7]>{multiple css tags}<![endif]-->)
* Step 5: Search and replace external css tags. (link-tags must xhtml-compliant closed by "/>")
* Step 6: Search and replace inline css tags.
* Step 7: Return if no css is found.
* Step 8: Remove blank lines from html.
* Step 9: Recalculating </body> position, insert css groups right before body ends and set response.
* Final order:
* 1. excluded css
* 2. stripped html
* 3. conditional css tags
* 4. external css tags
* 5. inline css tags
* 6. </body></html>
*
* @param Varien_Event_Observer $observer
*/
public function parseCssToBottom(Varien_Event_Observer $observer)
{
// Step 1
$helper = Mage::helper('onlinebiz_optimize');
if (!$helper->getGeneralConfig('move_to_bottom')) return;
if ($helper->isUrlsBlacklist()) return;
// Step 2
$response = $observer->getFront()->getResponse();
$html = $response->getBody();
$this->excludeList = array();
// Step 3
$closedBodyPosition = strripos($html, self::HTML_TAG_BODY);
if (false === $closedBodyPosition) return;
// Step 4
$html = preg_replace_callback(
'#\<\!--\[if[^\>]*>\s*<link[^>]*type\="text\/css"[^>]*/>\s*<\!\[endif\]-->#isU',
'self::processHit',
$html
);
// Step 5
$html = preg_replace_callback(
'#<link[^>]*type\=["\']text\/css["\'][^>]*/>#isU',
'self::processHit',
$html
);
// Step 6
//$html = preg_replace_callback('#<style.*</style>#isUm','self::processHit',$html);
// Step 7
if (!$this->cssTags) return;
// Step 8
$html = preg_replace('/^\h*\v+/m', '', $html);
// Step 9
$closedBodyPosition = strripos($html, self::HTML_TAG_BODY);
$html = substr_replace($html, $this->cssTags, $closedBodyPosition, 0);
$response->setBody($html);
}
}
\ No newline at end of file
<?php
/**
* @author Amasty Team
* @copyright Copyright (c) 2008-2012 Amasty (http://www.amasty.com)
* @package Amasty_Label
*/
class Onlinebiz_Optimize_Model_Label extends Onlinebiz_Optimize_Model_Label_Abstract
{
protected function _mediaHelper()
{
return Mage::helper('onlinebiz_optimize');
}
public function getImageUrl()
{
return Mage::getBaseUrl('media') . 'amlabel/' . $this->getValue('img') . $this->_mediaHelper()->getIMGixOptions();
}
}
<?php
if((string) Mage::getConfig()->getModuleConfig('OnlineBiz_AmLabelExtend')->active == 'true'){
class Onlinebiz_Optimize_Model_Label_Abstract extends OnlineBiz_AmLabelExtend_Model_Label {}
} else {
class Onlinebiz_Optimize_Model_Label_Abstract extends Amasty_Label_Model_Label {}
}
<?php
class Onlinebiz_Optimize_Model_Observer extends Mage_Core_Model_Abstract
{
public function loadCustomAutoloaders(Varien_Event_Observer $event)
{
Mage::helper('onlinebiz_optimize/autoloader')->register();
return $event;
}
}
\ No newline at end of file
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* 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 license@magentocommerce.com 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_Catalog
* @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
/**
* Catalog product link model
*
* @category Mage
* @package Mage_Catalog
* @author Magento Core Team <core@magentocommerce.com>
*/
class Onlinebiz_Optimize_Model_Product_Image extends Mage_Catalog_Model_Product_Image
{
private function _mediaHelper()
{
return Mage::helper('onlinebiz_optimize');
}
/**
* Set filenames for base file and new file
*
* @param string $file
* @return Mage_Catalog_Model_Product_Image
*/
public function setBaseFile($file, $isAdvanced = false)
{
if( Mage::app()->getStore()->isAdmin() ){
return parent::setBaseFile($file);
}
$this->_isBaseFilePlaceholder = false;
$suffixParams = !$isAdvanced ? $this->_mediaHelper()->getIMGixOptions() : $this->_mediaHelper()->getIMGixAdvancedOptions();
$disableIMGCache = $this->_mediaHelper()->isDisabledIMGCache();
if (($file) && (0 !== strpos($file, '/', 0))) {
$file = '/' . $file;
}
$baseDir = Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath();
if ('/no_selection' == $file) {
$file = null;
}
if ($file) {
if ((!$this->_fileExists($baseDir . $file)) || !$this->_checkMemory($baseDir . $file)) {
$file = null;
}
}
if (!$file) {
// check if placeholder defined in config
$isConfigPlaceholder = Mage::getStoreConfig("catalog/placeholder/{$this->getDestinationSubdir()}_placeholder");
$configPlaceholder = '/placeholder/' . $isConfigPlaceholder;
if ($isConfigPlaceholder && $this->_fileExists($baseDir . $configPlaceholder)) {
$file = $configPlaceholder;
} else {
// replace file with skin or default skin placeholder
$skinBaseDir = Mage::getDesign()->getSkinBaseDir();
$skinPlaceholder = "/images/catalog/product/placeholder/{$this->getDestinationSubdir()}.jpg";
$file = $skinPlaceholder;
if (file_exists($skinBaseDir . $file)) {
$baseDir = $skinBaseDir;
} else {
$baseDir = Mage::getDesign()->getSkinBaseDir(array('_theme' => 'default'));
if (!file_exists($baseDir . $file)) {
$baseDir = Mage::getDesign()->getSkinBaseDir(array('_theme' => 'default', '_package' => 'base'));
}
}
}
$this->_isBaseFilePlaceholder = true;
}
$baseFile = $baseDir . $file;
if (((!$file) || (!file_exists($baseFile))) && !$this->_mediaHelper()->isDevMode()) {
throw new Exception(Mage::helper('catalog')->__('Image file was not found.'));
}
$this->_baseFile = $baseFile;
// build new filename (most important params)
$path = array(
Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath(),
'cache',
Mage::app()->getStore()->getId(),
$path[] = $this->getDestinationSubdir()
);
if($disableIMGCache){
$path = array(Mage::getSingleton('catalog/product_media_config')->getBaseMediaPath());
}
if((!empty($this->_width)) || (!empty($this->_height))){
if(!$this->_height)
$this->_height = $this->_width;
if($disableIMGCache){
$suffixParams .= ($suffixParams != '' ) ? "&w={$this->_width}&h={$this->_height}" : "?w={$this->_width}&h={$this->_height}";
} else {
$path[] = "{$this->_width}x{$this->_height}";
}
}
// add misk params as a hash
$miscParams = array(
($this->_keepAspectRatio ? '' : 'non') . 'proportional',
($this->_keepFrame ? '' : 'no') . 'frame',
($this->_keepTransparency ? '' : 'no') . 'transparency',
($this->_constrainOnly ? 'do' : 'not') . 'constrainonly',
$this->_rgbToString($this->_backgroundColor),
'angle' . $this->_angle,
'quality' . $this->_quality
);
// if has watermark add watermark params to hash
if ($this->getWatermarkFile()) {
$miscParams[] = $this->getWatermarkFile();
$miscParams[] = $this->getWatermarkImageOpacity();
$miscParams[] = $this->getWatermarkPosition();
$miscParams[] = $this->getWatermarkWidth();
$miscParams[] = $this->getWatermarkHeigth();
}
if(!$disableIMGCache)
$path[] = md5(implode('_', $miscParams));
// append prepared filename
$this->_newFile = implode('/', $path) . $file . $suffixParams; // the $file contains heading slash
return $this;
}
/**
* First check this file on FS
* If it doesn't exist - try to download it from DB
*
* @param string $filename
* @return bool
*/
protected function _fileExists($filename)
{
if($this->_mediaHelper()->isDevMode())
return true;
$filename = $this->_removeQueryFile($filename);
if (file_exists($filename)) {
return true;
} else {
return Mage::helper('core/file_storage_database')->saveFileToFilesystem($filename);
}
}
/**
* @return Mage_Catalog_Model_Product_Image
*/
public function saveFile()
{
$filename = $this->getNewFile();
$filename = $this->_removeQueryFile($filename);
$this->getImageProcessor()->save($filename);
Mage::helper('core/file_storage_database')->saveFile($filename);
return $this;
}
private function _removeQueryFile($filename)
{
$fileInfo = parse_url($filename);
if(isset($fileInfo['query']))
$filename = str_replace('?' .$fileInfo['query'], '', $filename);
return $filename;
}
}
<?php
class Onlinebiz_Optimize_Model_System_Config_Source_Position
{
/**
* Reteirves array with options
* @return array
*/
public function toOptionArray()
{
return Mage::helper('onlinebiz_optimize')->getCropPositionsOptions();
}
}
?>
<?xml version="1.0" encoding="UTF-8"?>
<config>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<onlinebiz_optimize translate="title">
<title>Media Optimize</title>
</onlinebiz_optimize>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
\ No newline at end of file
<?xml version="1.0"?>
<config>
<modules>
<Onlinebiz_Optimize>
<version>0.0.2</version>
</Onlinebiz_Optimize>
</modules>
<default>
<onlinebiz_optimize>
<general>
<csscompression><![CDATA[0]]></csscompression>
<jscompression><![CDATA[0]]></jscompression>
<version><![CDATA[1]]></version>
</general>
<cloudmedia>
<enable><![CDATA[0]]></enable>
<options><![CDATA[?auto=compress,format,enhance,strip]]></options>
<cached>1</cached>
</cloudmedia>
</onlinebiz_optimize>
</default>
<global>
<models>
<onlinebiz_optimize>
<class>Onlinebiz_Optimize_Model</class>
</onlinebiz_optimize>
<core>
<rewrite>
<design_package>Onlinebiz_Optimize_Model_Core_Design_Package</design_package>
<store>Onlinebiz_Optimize_Model_Core_Store</store>
<email_template>Onlinebiz_Optimize_Model_Core_Email_Template</email_template>
</rewrite>
</core>
<catalog>
<rewrite>
<product_image>Onlinebiz_Optimize_Model_Product_Image</product_image>
</rewrite>
</catalog>
</models>
<helpers>
<onlinebiz_optimize>
<class>Onlinebiz_Optimize_Helper</class>
</onlinebiz_optimize>
<catalog>
<rewrite>
<image>Onlinebiz_Optimize_Helper_Image</image>
</rewrite>
</catalog>
</helpers>
<blocks>
<onlinebiz_optimize>
<class>Onlinebiz_Optimize_Block</class>
</onlinebiz_optimize>
<page>
<rewrite>
<html_head>Onlinebiz_Optimize_Block_Optimize_Head</html_head>
</rewrite>
</page>
</blocks>
<events>
<controller_front_init_before>
<observers>
<onlinebiz_custom_autoloaders>
<type>singleton</type>
<class>onlinebiz_optimize/observer</class>
<method>loadCustomAutoloaders</method>
</onlinebiz_custom_autoloaders>
</observers>
</controller_front_init_before>
</events>
</global>
</config>
This diff is collapsed.
<?xml version="1.0"?>
<config>
<modules>
<Onlinebiz_Optimize>
<active>true</active>
<codePool>local</codePool>
</Onlinebiz_Optimize>
</modules>
</config>
\ No newline at end of file
This diff is collapsed.
<?php
namespace MatthiasMullie\Minify;
/**
* @deprecated Use Exceptions\BasicException instead
*
* @author Matthias Mullie <minify@mullie.eu>
*/
abstract class Exception extends \Exception
{
}
<?php
namespace MatthiasMullie\Minify\Exceptions;
use MatthiasMullie\Minify\Exception;
/**
* @author Matthias Mullie <minify@mullie.eu>
*/
abstract class BasicException extends Exception
{
}
<?php
namespace MatthiasMullie\Minify\Exceptions;
/**
* @author Matthias Mullie <minify@mullie.eu>
*/
class FileImportException extends BasicException
{
}
<?php
namespace MatthiasMullie\Minify\Exceptions;
/**
* @author Matthias Mullie <minify@mullie.eu>
*/
class IOException extends BasicException
{
}
This diff is collapsed.
This diff is collapsed.
<?php
namespace MatthiasMullie\PathConverter;
/**
* Convert paths relative from 1 file to another.
*
* E.g.
* ../../images/icon.jpg relative to /css/imports/icons.css
* becomes
* ../images/icon.jpg relative to /css/minified.css
*
* Please report bugs on https://github.com/matthiasmullie/path-converter/issues
*
* @author Matthias Mullie <pathconverter@mullie.eu>
* @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
* @license MIT License
*/
class Converter implements ConverterInterface
{
/**
* @var string
*/
protected $from;
/**
* @var string
*/
protected $to;
/**
* @param string $from The original base path (directory, not file!)
* @param string $to The new base path (directory, not file!)
*/
public function __construct($from, $to)
{
$shared = $this->shared($from, $to);
if ($shared === '') {
// when both paths have nothing in common, one of them is probably
// absolute while the other is relative
$cwd = getcwd();
$from = strpos($from, $cwd) === 0 ? $from : $cwd.'/'.$from;
$to = strpos($to, $cwd) === 0 ? $to : $cwd.'/'.$to;
// or traveling the tree via `..`
// attempt to resolve path, or assume it's fine if it doesn't exist
$from = realpath($from) ?: $from;
$to = realpath($to) ?: $to;
}
$from = $this->dirname($from);
$to = $this->dirname($to);
$from = $this->normalize($from);
$to = $this->normalize($to);
$this->from = $from;
$this->to = $to;
}
/**
* Normalize path.
*
* @param string $path
*
* @return string
*/
protected function normalize($path)
{
// deal with different operating systems' directory structure
$path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/');
/*
* Example:
* /home/forkcms/frontend/cache/compiled_templates/../../core/layout/css/../images/img.gif
* to
* /home/forkcms/frontend/core/layout/images/img.gif
*/
do {
$path = preg_replace('/[^\/]+(?<!\.\.)\/\.\.\//', '', $path, -1, $count);
} while ($count);
return $path;
}
/**
* Figure out the shared path of 2 locations.
*
* Example:
* /home/forkcms/frontend/core/layout/images/img.gif
* and
* /home/forkcms/frontend/cache/minified_css
* share
* /home/forkcms/frontend
*
* @param string $path1
* @param string $path2
*
* @return string
*/
protected function shared($path1, $path2)
{
// $path could theoretically be empty (e.g. no path is given), in which
// case it shouldn't expand to array(''), which would compare to one's
// root /
$path1 = $path1 ? explode('/', $path1) : array();
$path2 = $path2 ? explode('/', $path2) : array();
$shared = array();
// compare paths & strip identical ancestors
foreach ($path1 as $i => $chunk) {
if (isset($path2[$i]) && $path1[$i] == $path2[$i]) {
$shared[] = $chunk;
} else {
break;
}
}
return implode('/', $shared);
}
/**
* Convert paths relative from 1 file to another.
*
* E.g.
* ../images/img.gif relative to /home/forkcms/frontend/core/layout/css
* should become:
* ../../core/layout/images/img.gif relative to
* /home/forkcms/frontend/cache/minified_css
*
* @param string $path The relative path that needs to be converted
*
* @return string The new relative path
*/
public function convert($path)
{
// quit early if conversion makes no sense
if ($this->from === $this->to) {
return $path;
}
$path = $this->normalize($path);
// if we're not dealing with a relative path, just return absolute
if (strpos($path, '/') === 0) {
return $path;
}
// normalize paths
$path = $this->normalize($this->from.'/'.$path);
// strip shared ancestor paths
$shared = $this->shared($path, $this->to);
$path = mb_substr($path, mb_strlen($shared));
$to = mb_substr($this->to, mb_strlen($shared));
// add .. for every directory that needs to be traversed to new path
$to = str_repeat('../', mb_substr_count($to, '/'));
return $to.ltrim($path, '/');
}
/**
* Attempt to get the directory name from a path.
*
* @param string $path
*
* @return string
*/
protected function dirname($path)
{
if (is_file($path)) {
return dirname($path);
}
if (is_dir($path)) {
return rtrim($path, '/');
}
// no known file/dir, start making assumptions
// ends in / = dir
if (mb_substr($path, -1) === '/') {
return rtrim($path, '/');
}
// has a dot in the name, likely a file
if (preg_match('/.*\..*$/', basename($path)) !== 0) {
return dirname($path);
}
// you're on your own here!
return $path;
}
}
<?php
namespace MatthiasMullie\PathConverter;
/**
* Convert file paths.
*
* Please report bugs on https://github.com/matthiasmullie/path-converter/issues
*
* @author Matthias Mullie <pathconverter@mullie.eu>
* @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
* @license MIT License
*/
interface ConverterInterface
{
/**
* Convert file paths.
*
* @param string $path The path to be converted
*
* @return string The new path
*/
public function convert($path);
}
<?php
namespace MatthiasMullie\PathConverter;
/**
* Don't convert paths.
*
* Please report bugs on https://github.com/matthiasmullie/path-converter/issues
*
* @author Matthias Mullie <pathconverter@mullie.eu>
* @copyright Copyright (c) 2015, Matthias Mullie. All rights reserved
* @license MIT License
*/
class NoConverter implements ConverterInterface
{
/**
* {@inheritdoc}
*/
public function convert($path)
{
return $path;
}
}
in
public
extends
private
protected
implements
instanceof
\ No newline at end of file
do
in
let
new
var
case
else
enum
void
with
class
const
yield
delete
export
import
public
static
typeof
extends
package
private
function
protected
implements
instanceof
\ No newline at end of file
do
if
in
for
let
new
try
var
case
else
enum
eval
null
this
true
void
with
break
catch
class
const
false
super
throw
while
yield
delete
export
import
public
return
static
switch
typeof
default
extends
finally
package
private
continue
debugger
function
arguments
interface
protected
implements
instanceof
abstract
boolean
byte
char
double
final
float
goto
int
long
native
short
synchronized
throws
transient
volatile
\ No newline at end of file
+
-
*
/
%
=
+=
-=
*=
/=
%=
<<=
>>=
>>>=
&=
^=
|=
&
|
^
~
<<
>>
>>>
==
===
!=
!==
>
<
>=
<=
&&
||
!
.
[
]
?
:
,
;
(
)
{
}
\ No newline at end of file
+
-
*
/
%
=
+=
-=
*=
/=
%=
<<=
>>=
>>>=
&=
^=
|=
&
|
^
~
<<
>>
>>>
==
===
!=
!==
>
<
>=
<=
&&
||
.
[
]
?
:
,
;
(
)
}
\ No newline at end of file
+
-
*
/
%
=
+=
-=
*=
/=
%=
<<=
>>=
>>>=
&=
^=
|=
&
|
^
~
<<
>>
>>>
==
===
!=
!==
>
<
>=
<=
&&
||
!
.
[
?
:
,
;
(
{
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment