Renaming base url config keys and methods for better uniformity.

This commit is contained in:
ADmad 2013-07-31 20:06:57 +05:30
parent b22b39f158
commit 61bf8df454
15 changed files with 69 additions and 69 deletions

View file

@ -115,25 +115,25 @@
* will override the automatic detection of full base URL and can be * will override the automatic detection of full base URL and can be
* useful when generating links from the CLI (e.g. sending emails) * useful when generating links from the CLI (e.g. sending emails)
*/ */
//Configure::write('App.fullBaseURL', 'http://example.com'); //Configure::write('App.fullBaseUrl', 'http://example.com');
/** /**
* Web path to the public images directory under webroot. * Web path to the public images directory under webroot.
* If not set defaults to 'img/' * If not set defaults to 'img/'
*/ */
//Configure::write('App.imagesURL', 'img/'); //Configure::write('App.imageBaseUrl', 'img/');
/** /**
* Web path to the CSS files directory under webroot. * Web path to the CSS files directory under webroot.
* If not set defaults to 'css/' * If not set defaults to 'css/'
*/ */
//Configure::write('App.cssURL', 'css/'); //Configure::write('App.cssBaseUrl', 'css/');
/** /**
* Web path to the js files directory under webroot. * Web path to the js files directory under webroot.
* If not set defaults to 'js/' * If not set defaults to 'js/'
*/ */
//Configure::write('App.jsURL', 'js/'); //Configure::write('App.jsBaseUrl', 'js/');
/** /**
* Uncomment the define below to use CakePHP prefix routes. * Uncomment the define below to use CakePHP prefix routes.

View file

@ -137,9 +137,9 @@ class ShellDispatcher {
$this->setErrorHandlers(); $this->setErrorHandlers();
if (!defined('FULL_BASE_URL')) { if (!defined('FULL_BASE_URL')) {
$url = Configure::read('App.fullBaseURL'); $url = Configure::read('App.fullBaseUrl');
define('FULL_BASE_URL', $url ? $url : 'http://localhost'); define('FULL_BASE_URL', $url ? $url : 'http://localhost');
Configure::write('App.fullBaseURL', FULL_BASE_URL); Configure::write('App.fullBaseUrl', FULL_BASE_URL);
} }
return true; return true;

View file

@ -106,25 +106,25 @@
* will override the automatic detection of full base URL and can be * will override the automatic detection of full base URL and can be
* useful when generating links from the CLI (e.g. sending emails) * useful when generating links from the CLI (e.g. sending emails)
*/ */
//Configure::write('App.fullBaseURL', 'http://example.com'); //Configure::write('App.fullBaseUrl', 'http://example.com');
/** /**
* Web path to the public images directory under webroot. * Web path to the public images directory under webroot.
* If not set defaults to 'img/' * If not set defaults to 'img/'
*/ */
//Configure::write('App.imagesURL', 'img/'); //Configure::write('App.imageBaseUrl', 'img/');
/** /**
* Web path to the CSS files directory under webroot. * Web path to the CSS files directory under webroot.
* If not set defaults to 'css/' * If not set defaults to 'css/'
*/ */
//Configure::write('App.cssURL', 'css/'); //Configure::write('App.cssBaseUrl', 'css/');
/** /**
* Web path to the js files directory under webroot. * Web path to the js files directory under webroot.
* If not set defaults to 'js/' * If not set defaults to 'js/'
*/ */
//Configure::write('App.jsURL', 'js/'); //Configure::write('App.jsBaseUrl', 'js/');
/** /**
* Uncomment the define below to use CakePHP prefix routes. * Uncomment the define below to use CakePHP prefix routes.

View file

@ -88,8 +88,8 @@ class Object {
$data = isset($extra['data']) ? $extra['data'] : null; $data = isset($extra['data']) ? $extra['data'] : null;
unset($extra['data']); unset($extra['data']);
if (is_string($url) && strpos($url, Router::baseURL()) === 0) { if (is_string($url) && strpos($url, Router::fullBaseUrl()) === 0) {
$url = Router::normalize(str_replace(Router::baseURL(), '', $url)); $url = Router::normalize(str_replace(Router::fullBaseUrl(), '', $url));
} }
if (is_string($url)) { if (is_string($url)) {
$request = new CakeRequest($url); $request = new CakeRequest($url);

View file

@ -238,7 +238,7 @@ class CakeRequest implements ArrayAccess {
if ($qPosition !== false && strpos($_SERVER['REQUEST_URI'], '://') > $qPosition) { if ($qPosition !== false && strpos($_SERVER['REQUEST_URI'], '://') > $qPosition) {
$uri = $_SERVER['REQUEST_URI']; $uri = $_SERVER['REQUEST_URI'];
} else { } else {
$uri = substr($_SERVER['REQUEST_URI'], strlen(Configure::read('App.fullBaseURL'))); $uri = substr($_SERVER['REQUEST_URI'], strlen(Configure::read('App.fullBaseUrl')));
} }
} elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['SCRIPT_NAME'])) { } elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['SCRIPT_NAME'])) {
$uri = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']); $uri = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']);
@ -424,7 +424,7 @@ class CakeRequest implements ArrayAccess {
$ref = $forwarded; $ref = $forwarded;
} }
$base = Configure::read('App.fullBaseURL') . $this->webroot; $base = Configure::read('App.fullBaseUrl') . $this->webroot;
if (!empty($ref) && !empty($base)) { if (!empty($ref) && !empty($base)) {
if ($local && strpos($ref, $base) === 0) { if ($local && strpos($ref, $base) === 0) {
$ref = substr($ref, strlen($base)); $ref = substr($ref, strlen($base));

View file

@ -62,7 +62,7 @@ class Router {
* *
* @var string * @var string
*/ */
protected static $_baseURL; protected static $_fullBaseUrl;
/** /**
* List of action prefixes used in connected routes. * List of action prefixes used in connected routes.
@ -767,7 +767,7 @@ class Router {
* cake relative URLs are required when using requestAction. * cake relative URLs are required when using requestAction.
* - `?` - Takes an array of query string parameters * - `?` - Takes an array of query string parameters
* - `#` - Allows you to set URL hash fragments. * - `#` - Allows you to set URL hash fragments.
* - `full_base` - If true the `Router::baseURL()` value will be prepended to generated URLs. * - `full_base` - If true the `Router::fullBaseUrl()` value will be prepended to generated URLs.
* *
* @param string|array $url Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4" * @param string|array $url Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4"
* or an array specifying any of the following: 'controller', 'action', * or an array specifying any of the following: 'controller', 'action',
@ -805,7 +805,7 @@ class Router {
if (empty($url)) { if (empty($url)) {
$output = isset($path['here']) ? $path['here'] : '/'; $output = isset($path['here']) ? $path['here'] : '/';
if ($full) { if ($full) {
$output = self::baseURL() . $output; $output = self::fullBaseUrl() . $output;
} }
return $output; return $output;
} elseif (is_array($url)) { } elseif (is_array($url)) {
@ -893,7 +893,7 @@ class Router {
$output = str_replace('//', '/', $base . '/' . $output); $output = str_replace('//', '/', $base . '/' . $output);
if ($full) { if ($full) {
$output = self::baseURL() . $output; $output = self::fullBaseUrl() . $output;
} }
if (!empty($extension)) { if (!empty($extension)) {
$output = rtrim($output, '/'); $output = rtrim($output, '/');
@ -917,15 +917,15 @@ class Router {
* For example: ``http://example.com`` * For example: ``http://example.com``
* @return string * @return string
*/ */
public static function baseURL($base = null) { public static function fullBaseUrl($base = null) {
if ($base !== null) { if ($base !== null) {
self::$_baseURL = $base; self::$_fullBaseUrl = $base;
Configure::write('App.fullBaseURL', $base); Configure::write('App.fullBaseUrl', $base);
} }
if (empty(self::$_baseURL)) { if (empty(self::$_fullBaseUrl)) {
self::$_baseURL = Configure::read('App.fullBaseURL'); self::$_fullBaseUrl = Configure::read('App.fullBaseUrl');
} }
return self::$_baseURL; return self::$_fullBaseUrl;
} }
/** /**

View file

@ -456,7 +456,7 @@ class ObjectTest extends CakeTestCase {
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
$result = $this->object->requestAction( $result = $this->object->requestAction(
Configure::read('App.fullBaseURL') . '/request_action/test_request_action' Configure::read('App.fullBaseUrl') . '/request_action/test_request_action'
); );
$expected = 'This is a test'; $expected = 'This is a test';
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);

View file

@ -157,7 +157,7 @@ class CakeRequestTest extends CakeTestCase {
$request = new CakeRequest(); $request = new CakeRequest();
$this->assertEquals('some/path', $request->url); $this->assertEquals('some/path', $request->url);
$_SERVER['REQUEST_URI'] = Configure::read('App.fullBaseURL') . '/other/path?url=http://cakephp.org'; $_SERVER['REQUEST_URI'] = Configure::read('App.fullBaseUrl') . '/other/path?url=http://cakephp.org';
$request = new CakeRequest(); $request = new CakeRequest();
$this->assertEquals('other/path', $request->url); $this->assertEquals('other/path', $request->url);
} }
@ -689,19 +689,19 @@ class CakeRequestTest extends CakeTestCase {
$result = $request->referer(); $result = $request->referer();
$this->assertSame($result, '/'); $this->assertSame($result, '/');
$_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseURL') . '/some/path'; $_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseUrl') . '/some/path';
$result = $request->referer(true); $result = $request->referer(true);
$this->assertSame($result, '/some/path'); $this->assertSame($result, '/some/path');
$_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseURL') . '/some/path'; $_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseUrl') . '/some/path';
$result = $request->referer(false); $result = $request->referer(false);
$this->assertSame($result, Configure::read('App.fullBaseURL') . '/some/path'); $this->assertSame($result, Configure::read('App.fullBaseUrl') . '/some/path');
$_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseURL') . '/some/path'; $_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseUrl') . '/some/path';
$result = $request->referer(true); $result = $request->referer(true);
$this->assertSame($result, '/some/path'); $this->assertSame($result, '/some/path');
$_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseURL') . '/recipes/add'; $_SERVER['HTTP_REFERER'] = Configure::read('App.fullBaseUrl') . '/recipes/add';
$result = $request->referer(true); $result = $request->referer(true);
$this->assertSame($result, '/recipes/add'); $this->assertSame($result, '/recipes/add');

View file

@ -49,8 +49,8 @@ class RouterTest extends CakeTestCase {
public function tearDown() { public function tearDown() {
parent::tearDown(); parent::tearDown();
CakePlugin::unload(); CakePlugin::unload();
Router::baseURL(''); Router::fullbaseURL('');
Configure::write('App.fullBaseURL', 'http://localhost'); Configure::write('App.fullBaseUrl', 'http://localhost');
} }
/** /**
@ -71,13 +71,13 @@ class RouterTest extends CakeTestCase {
* @return void * @return void
*/ */
public function testBaseURL() { public function testBaseURL() {
$this->assertEquals(FULL_BASE_URL, Router::baseUrl()); $this->assertEquals(FULL_BASE_URL, Router::fullBaseUrl());
Router::baseURL('http://example.com'); Router::fullbaseURL('http://example.com');
$this->assertEquals('http://example.com/', Router::url('/', true)); $this->assertEquals('http://example.com/', Router::url('/', true));
$this->assertEquals('http://example.com', Configure::read('App.fullBaseURL')); $this->assertEquals('http://example.com', Configure::read('App.fullBaseUrl'));
Router::baseURL('https://example.com'); Router::fullbaseURL('https://example.com');
$this->assertEquals('https://example.com/', Router::url('/', true)); $this->assertEquals('https://example.com/', Router::url('/', true));
$this->assertEquals('https://example.com', Configure::read('App.fullBaseURL')); $this->assertEquals('https://example.com', Configure::read('App.fullBaseUrl'));
} }
/** /**

View file

@ -210,7 +210,7 @@ class HtmlHelperTest extends CakeTestCase {
Router::reload(); Router::reload();
$result = $this->Html->link('Posts', array('controller' => 'posts', 'action' => 'index', 'full_base' => true)); $result = $this->Html->link('Posts', array('controller' => 'posts', 'action' => 'index', 'full_base' => true));
$expected = array('a' => array('href' => Router::baseURL() . '/posts'), 'Posts', '/a'); $expected = array('a' => array('href' => Router::fullBaseUrl() . '/posts'), 'Posts', '/a');
$this->assertTags($result, $expected); $this->assertTags($result, $expected);
$result = $this->Html->link('Home', '/home', array('confirm' => 'Are you sure you want to do this?')); $result = $this->Html->link('Home', '/home', array('confirm' => 'Are you sure you want to do this?'));
@ -1877,7 +1877,7 @@ class HtmlHelperTest extends CakeTestCase {
array('pathPrefix' => 'videos/', 'poster' => 'poster.jpg', 'text' => 'Your browser does not support the HTML5 Video element.') array('pathPrefix' => 'videos/', 'poster' => 'poster.jpg', 'text' => 'Your browser does not support the HTML5 Video element.')
); );
$expected = array( $expected = array(
'video' => array('poster' => Configure::read('App.imagesURL') . 'poster.jpg'), 'video' => array('poster' => Configure::read('App.imageBaseUrl') . 'poster.jpg'),
array('source' => array('src' => 'videos/video.webm', 'type' => 'video/webm')), array('source' => array('src' => 'videos/video.webm', 'type' => 'video/webm')),
array('source' => array('src' => 'videos/video.ogv', 'type' => 'video/ogg; codecs='theora, vorbis'')), array('source' => array('src' => 'videos/video.ogv', 'type' => 'video/ogg; codecs='theora, vorbis'')),
'Your browser does not support the HTML5 Video element.', 'Your browser does not support the HTML5 Video element.',

View file

@ -600,8 +600,8 @@ class HelperTest extends CakeTestCase {
public function testAssetTimestamp() { public function testAssetTimestamp() {
Configure::write('Foo.bar', 'test'); Configure::write('Foo.bar', 'test');
Configure::write('Asset.timestamp', false); Configure::write('Asset.timestamp', false);
$result = $this->Helper->assetTimestamp(Configure::read('App.cssURL') . 'cake.generic.css'); $result = $this->Helper->assetTimestamp(Configure::read('App.cssBaseUrl') . 'cake.generic.css');
$this->assertEquals(Configure::read('App.cssURL') . 'cake.generic.css', $result); $this->assertEquals(Configure::read('App.cssBaseUrl') . 'cake.generic.css', $result);
Configure::write('Asset.timestamp', true); Configure::write('Asset.timestamp', true);
Configure::write('debug', 0); Configure::write('debug', 0);
@ -609,25 +609,25 @@ class HelperTest extends CakeTestCase {
$result = $this->Helper->assetTimestamp('/%3Cb%3E/cake.generic.css'); $result = $this->Helper->assetTimestamp('/%3Cb%3E/cake.generic.css');
$this->assertEquals('/%3Cb%3E/cake.generic.css', $result); $this->assertEquals('/%3Cb%3E/cake.generic.css', $result);
$result = $this->Helper->assetTimestamp(Configure::read('App.cssURL') . 'cake.generic.css'); $result = $this->Helper->assetTimestamp(Configure::read('App.cssBaseUrl') . 'cake.generic.css');
$this->assertEquals(Configure::read('App.cssURL') . 'cake.generic.css', $result); $this->assertEquals(Configure::read('App.cssBaseUrl') . 'cake.generic.css', $result);
Configure::write('Asset.timestamp', true); Configure::write('Asset.timestamp', true);
Configure::write('debug', 2); Configure::write('debug', 2);
$result = $this->Helper->assetTimestamp(Configure::read('App.cssURL') . 'cake.generic.css'); $result = $this->Helper->assetTimestamp(Configure::read('App.cssBaseUrl') . 'cake.generic.css');
$this->assertRegExp('/' . preg_quote(Configure::read('App.cssURL') . 'cake.generic.css?', '/') . '[0-9]+/', $result); $this->assertRegExp('/' . preg_quote(Configure::read('App.cssBaseUrl') . 'cake.generic.css?', '/') . '[0-9]+/', $result);
Configure::write('Asset.timestamp', 'force'); Configure::write('Asset.timestamp', 'force');
Configure::write('debug', 0); Configure::write('debug', 0);
$result = $this->Helper->assetTimestamp(Configure::read('App.cssURL') . 'cake.generic.css'); $result = $this->Helper->assetTimestamp(Configure::read('App.cssBaseUrl') . 'cake.generic.css');
$this->assertRegExp('/' . preg_quote(Configure::read('App.cssURL') . 'cake.generic.css?', '/') . '[0-9]+/', $result); $this->assertRegExp('/' . preg_quote(Configure::read('App.cssBaseUrl') . 'cake.generic.css?', '/') . '[0-9]+/', $result);
$result = $this->Helper->assetTimestamp(Configure::read('App.cssURL') . 'cake.generic.css?someparam'); $result = $this->Helper->assetTimestamp(Configure::read('App.cssBaseUrl') . 'cake.generic.css?someparam');
$this->assertEquals(Configure::read('App.cssURL') . 'cake.generic.css?someparam', $result); $this->assertEquals(Configure::read('App.cssBaseUrl') . 'cake.generic.css?someparam', $result);
$this->Helper->request->webroot = '/some/dir/'; $this->Helper->request->webroot = '/some/dir/';
$result = $this->Helper->assetTimestamp('/some/dir/' . Configure::read('App.cssURL') . 'cake.generic.css'); $result = $this->Helper->assetTimestamp('/some/dir/' . Configure::read('App.cssBaseUrl') . 'cake.generic.css');
$this->assertRegExp('/' . preg_quote(Configure::read('App.cssURL') . 'cake.generic.css?', '/') . '[0-9]+/', $result); $this->assertRegExp('/' . preg_quote(Configure::read('App.cssBaseUrl') . 'cake.generic.css?', '/') . '[0-9]+/', $result);
} }
/** /**
@ -644,13 +644,13 @@ class HelperTest extends CakeTestCase {
), ),
array('fullBase' => true) array('fullBase' => true)
); );
$this->assertEquals(Router::baseURL() . '/js/post.js', $result); $this->assertEquals(Router::fullBaseUrl() . '/js/post.js', $result);
$result = $this->Helper->assetUrl('foo.jpg', array('pathPrefix' => 'img/')); $result = $this->Helper->assetUrl('foo.jpg', array('pathPrefix' => 'img/'));
$this->assertEquals('img/foo.jpg', $result); $this->assertEquals('img/foo.jpg', $result);
$result = $this->Helper->assetUrl('foo.jpg', array('fullBase' => true)); $result = $this->Helper->assetUrl('foo.jpg', array('fullBase' => true));
$this->assertEquals(Router::baseURL() . '/foo.jpg', $result); $this->assertEquals(Router::fullBaseUrl() . '/foo.jpg', $result);
$result = $this->Helper->assetUrl('style', array('ext' => '.css')); $result = $this->Helper->assetUrl('style', array('ext' => '.css'));
$this->assertEquals('style.css', $result); $this->assertEquals('style.css', $result);
@ -708,8 +708,8 @@ class HelperTest extends CakeTestCase {
$this->Helper->webroot = ''; $this->Helper->webroot = '';
Configure::write('Asset.timestamp', 'force'); Configure::write('Asset.timestamp', 'force');
$result = $this->Helper->assetUrl('cake.generic.css', array('pathPrefix' => Configure::read('App.cssURL'))); $result = $this->Helper->assetUrl('cake.generic.css', array('pathPrefix' => Configure::read('App.cssBaseUrl')));
$this->assertRegExp('/' . preg_quote(Configure::read('App.cssURL') . 'cake.generic.css?', '/') . '[0-9]+/', $result); $this->assertRegExp('/' . preg_quote(Configure::read('App.cssBaseUrl') . 'cake.generic.css?', '/') . '[0-9]+/', $result);
} }
/** /**

View file

@ -328,7 +328,7 @@ class Helper extends Object {
$path = $this->_encodeUrl($this->assetTimestamp($this->webroot($path))); $path = $this->_encodeUrl($this->assetTimestamp($this->webroot($path)));
if (!empty($options['fullBase'])) { if (!empty($options['fullBase'])) {
$path = rtrim(Router::baseURL(), '/') . '/' . ltrim($path, '/'); $path = rtrim(Router::fullBaseUrl(), '/') . '/' . ltrim($path, '/');
} }
return $path; return $path;
} }

View file

@ -1880,7 +1880,7 @@ class FormHelper extends AppHelper {
} elseif ($isImage) { } elseif ($isImage) {
unset($options['type']); unset($options['type']);
if ($caption{0} !== '/') { if ($caption{0} !== '/') {
$url = $this->webroot(Configure::read('App.imagesURL') . $caption); $url = $this->webroot(Configure::read('App.imageBaseUrl') . $caption);
} else { } else {
$url = $this->webroot(trim($caption, '/')); $url = $this->webroot(trim($caption, '/'));
} }

View file

@ -444,13 +444,13 @@ class HtmlHelper extends AppHelper {
if (strpos($path, '//') !== false) { if (strpos($path, '//') !== false) {
$url = $path; $url = $path;
} else { } else {
$url = $this->assetUrl($path, $options + array('pathPrefix' => Configure::read('App.cssURL'), 'ext' => '.css')); $url = $this->assetUrl($path, $options + array('pathPrefix' => Configure::read('App.cssBaseUrl'), 'ext' => '.css'));
$options = array_diff_key($options, array('fullBase' => null)); $options = array_diff_key($options, array('fullBase' => null));
if (Configure::read('Asset.filter.css')) { if (Configure::read('Asset.filter.css')) {
$pos = strpos($url, Configure::read('App.cssURL')); $pos = strpos($url, Configure::read('App.cssBaseUrl'));
if ($pos !== false) { if ($pos !== false) {
$url = substr($url, 0, $pos) . 'ccss/' . substr($url, $pos + strlen(Configure::read('App.cssURL'))); $url = substr($url, 0, $pos) . 'ccss/' . substr($url, $pos + strlen(Configure::read('App.cssBaseUrl')));
} }
} }
} }
@ -545,11 +545,11 @@ class HtmlHelper extends AppHelper {
$this->_includedScripts[$url] = true; $this->_includedScripts[$url] = true;
if (strpos($url, '//') === false) { if (strpos($url, '//') === false) {
$url = $this->assetUrl($url, $options + array('pathPrefix' => Configure::read('App.jsURL'), 'ext' => '.js')); $url = $this->assetUrl($url, $options + array('pathPrefix' => Configure::read('App.jsBaseUrl'), 'ext' => '.js'));
$options = array_diff_key($options, array('fullBase' => null)); $options = array_diff_key($options, array('fullBase' => null));
if (Configure::read('Asset.filter.js')) { if (Configure::read('Asset.filter.js')) {
$url = str_replace(Configure::read('App.jsURL'), 'cjs/', $url); $url = str_replace(Configure::read('App.jsBaseUrl'), 'cjs/', $url);
} }
} }
$attributes = $this->_parseAttributes($options, array('block', 'once'), ' '); $attributes = $this->_parseAttributes($options, array('block', 'once'), ' ');
@ -803,7 +803,7 @@ class HtmlHelper extends AppHelper {
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::image * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#HtmlHelper::image
*/ */
public function image($path, $options = array()) { public function image($path, $options = array()) {
$path = $this->assetUrl($path, $options + array('pathPrefix' => Configure::read('App.imagesURL'))); $path = $this->assetUrl($path, $options + array('pathPrefix' => Configure::read('App.imageBaseUrl')));
$options = array_diff_key($options, array('fullBase' => null, 'pathPrefix' => null)); $options = array_diff_key($options, array('fullBase' => null, 'pathPrefix' => null));
if (!isset($options['alt'])) { if (!isset($options['alt'])) {
@ -1106,7 +1106,7 @@ class HtmlHelper extends AppHelper {
} }
if (isset($options['poster'])) { if (isset($options['poster'])) {
$options['poster'] = $this->assetUrl($options['poster'], array('pathPrefix' => Configure::read('App.imagesURL')) + $options); $options['poster'] = $this->assetUrl($options['poster'], array('pathPrefix' => Configure::read('App.imageBaseUrl')) + $options);
} }
$text = $options['text']; $text = $options['text'];

View file

@ -163,14 +163,14 @@ if (!defined('FULL_BASE_URL')) {
if (isset($httpHost)) { if (isset($httpHost)) {
define('FULL_BASE_URL', 'http' . $s . '://' . $httpHost); define('FULL_BASE_URL', 'http' . $s . '://' . $httpHost);
Configure::write('App.fullBaseURL', FULL_BASE_URL); Configure::write('App.fullBaseUrl', FULL_BASE_URL);
} }
unset($httpHost, $s); unset($httpHost, $s);
} }
Configure::write('App.imagesURL', IMAGES_URL); Configure::write('App.imageBaseUrl', IMAGES_URL);
Configure::write('App.cssURL', CSS_URL); Configure::write('App.cssBaseUrl', CSS_URL);
Configure::write('App.jsURL', JS_URL); Configure::write('App.jsBaseUrl', JS_URL);
App::$bootstrapping = true; App::$bootstrapping = true;