Comments (2)
comment by: briceburgess
created at: 2011-04-07
Sharvey,
As a workaround to this I've used:
$themePath = 'themes/' . SSViewer::current_theme() . '/';
Requirements::combine_files($themePath . 'css/core.css',$cssFiles);
Requirements::set_combined_files_folder('.');
successfully under a Linux / SilverStripe 2.4 platform for awhile. Just be sure the webserver can write to the named directory passed to the combine_files method. E.g. SS_BASE/themes/blackcandy/css
Below is an example of my typical Page_Controller init() method -- perhaps useful for others suffering from this;
public function init() {
parent::init();
// set the path of the files
$themePath = 'themes/' . SSViewer::current_theme() . '/';
// core css files
$cssFiles = array(
$themePath . 'css/jquery-ui-1.8.9.custom.css',
// $themePath . 'css/typography.css',
$themePath . 'css/01_style.css',
$themePath . 'css/02_forms.css',
// $themePath . 'css/05_nav.css',
$themePath . 'css/07_features.css',
$themePath . 'css/07_media.css',
$themePath . 'css/10_overrides.css',
);
// core javascript files
$jsFiles = array(
$themePath . 'js/jquery-1.4.4.min.js',
$themePath . 'js/jqModal.js',
$themePath . 'js/cufon-yui.js',
$themePath . 'js/verdana.font.js',
$themePath . 'js/jquery-ui-1.8.9.custom.js',
$themePath . 'js/page.js',
$themePath . 'js/media.js',
$themePath . 'js/digomeTabs.js',
'digomePlayer/digomePlayer.js'
);
array_walk($cssFiles,'Requirements::css');
array_walk($jsFiles,'Requirements::javascript');
Requirements::combine_files($themePath . 'js/core.js',$jsFiles);
Requirements::combine_files($themePath . 'css/core.css',$cssFiles);
Requirements::set_combined_files_folder('.');
Requirements::process_combined_files();
if($pos = strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'MSIE' )) {
$version = substr( $_SERVER[ 'HTTP_USER_AGENT' ], $pos + 5, 3 );
if($version < 9)
{
// Requirements::css($themePath . 'css/09_ie8.css');
}
if($version < 8)
{
// Requirements::css($themePath . 'css/09_ie7.css');
}
if($version < 7)
{
Requirements::css($themePath . 'css/ie6.css');
Requirements::javascript($themePath . 'js/png-fix.js');
}
}
// adjustment for user-defined forms
Requirements::block(SAPPHIRE_DIR .'/thirdparty/jquery/jquery.js');
/*
Requirements::block(THIRDPARTY_DIR . '/prototype/prototype.js');
Requirements::block(THIRDPARTY_DIR . '/behaviour/behaviour.js');
Requirements::block(SAPPHIRE_DIR . '/javascript/prototype_improvements.js');
Requirements::block(SAPPHIRE_DIR . '/javascript/Validator.js');
Requirements::block(SAPPHIRE_DIR . '/javascript/i18n.js');
Requirements::block(SAPPHIRE_DIR . '/javascript/lang/en_US.js');
Validator::set_javascript_validation_handler('none');
*/
}
from silverstripe-framework.
Closing as not assigned to anyone and generally requirements shouldn't take on too much more effort. I'd imagine requirements would be better standing on the shoulders of an existing asset pipeline with something like https://github.com/kriswallsmith/assetic/
from silverstripe-framework.
Related Issues (20)
- TinyMCE Styles-Dropdown shows incorrect empty-value HOT 2
- Add an SQL comment in dev mode showing where queries were executed
- Add generic typehints in PHPDoc HOT 2
- StandardRelatedDataService not working for complex relations HOT 2
- Make data representations in `ArrayList` more consistent
- Don't remove the `GridFieldFilterHeader` from `GridFieldConfig_RecordViewer`
- EPIC Explode framework into multiple modules
- Allow each `DataObject` subclass to define its own formfield when autoscaffolded from relation HOT 3
- Consolidate Dropdown components
- Incorrect hostname lookup when relying on `$_SERVER['HTTP_HOST']` HOT 3
- UnsavedRelationList::first() / last() return false instead of null when list is empty HOT 5
- [User Warning] Authenticator "default" doesn't support tabbed forms for Security Actions
- Toast message has problems with umlauts HOT 4
- Unused code in `FieldList::findTab()` HOT 2
- Any field using react-select has menu z-index issue when above a HTMLEditorField HOT 2
- Multiple Authenticators prevent Member password change
- PasswordField inside ConfirmedPasswordField isn't correctly marked as "required" HOT 2
- Unable to disable dev tasks via static configuration HOT 2
- Does not check the member email to send password reset link HOT 1
- switch to standard X-Forwarded-Proto instead of X-Forwarded-Protocol
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silverstripe-framework.