Skip to content

Commit

Permalink
move required theme files to theme root folder to fix autoupdater iss…
Browse files Browse the repository at this point in the history
  • Loading branch information
zdol committed Nov 12, 2018
1 parent a33bbe5 commit fed2471
Show file tree
Hide file tree
Showing 23 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions config/view.php
Expand Up @@ -13,8 +13,8 @@
*/

'paths' => [
get_theme_file_path().'/resources/views',
get_parent_theme_file_path().'/resources/views',
get_theme_file_path().'/views',
get_parent_theme_file_path().'/views',
],


Expand Down
20 changes: 10 additions & 10 deletions resources/functions.php → functions.php
Expand Up @@ -38,7 +38,7 @@
* Ensure dependencies are loaded
*/
if (!class_exists('Roots\\Sage\\Container')) {
if (!file_exists($composer = __DIR__.'/../vendor/autoload.php')) {
if (!file_exists($composer = __DIR__.'/vendor/autoload.php')) {
$sage_error(
__('You must run <code>composer install</code> from the Sage directory.', 'sage'),
__('Autoloader not found.', 'sage')
Expand All @@ -54,7 +54,7 @@
* Add or remove files to the array as needed. Supports child theme overrides.
*/
array_map(function ($file) use ($sage_error) {
$file = "../app/{$file}.php";
$file = "./app/{$file}.php";
if (!locate_template($file, true, true)) {
$sage_error(sprintf(__('Error locating <code>%s</code> for inclusion.', 'sage'), $file), 'File not found');
}
Expand All @@ -77,16 +77,16 @@
* ├── STYLESHEETPATH -> /srv/www/example.com/current/web/app/themes/sage/resources/views
* └── TEMPLATEPATH -> /srv/www/example.com/current/web/app/themes/sage/resources
*/
array_map(
'add_filter',
['theme_file_path', 'theme_file_uri', 'parent_theme_file_path', 'parent_theme_file_uri'],
array_fill(0, 4, 'dirname')
);
// array_map(
// 'add_filter',
// ['theme_file_path', 'theme_file_uri', 'parent_theme_file_path', 'parent_theme_file_uri'],
// array_fill(0, 4, 'dirname')
// );
Container::getInstance()
->bindIf('config', function () {
return new Config([
'assets' => require dirname(__DIR__).'/config/assets.php',
'theme' => require dirname(__DIR__).'/config/theme.php',
'view' => require dirname(__DIR__).'/config/view.php',
'assets' => require __DIR__.'/config/assets.php',
'theme' => require __DIR__.'/config/theme.php',
'view' => require __DIR__.'/config/view.php',
]);
}, true);
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fed2471

Please sign in to comment.