bauncms / framework Goto Github PK
View Code? Open in Web Editor NEWFramework for BaunCMS
Home Page: https://bauncms.com
License: MIT License
Framework for BaunCMS
Home Page: https://bauncms.com
License: MIT License
Hi, I installed BaunCMS and planned on using if for a blog, but the pagination is not working for me. I tried to track down the error and it turns out that the GET variables are not being detected correctly. For debugging purposes, I added these lines to the beginning of the Baun.php __construct() function:
public function __construct()
{
echo "<div style='display:none;'>\n";
print_r($_GET);
echo "</div>";
...
To be able to see the GET variables. Then I made some tests.
When I accessed:
http://www.oscarello.me/?page=2
This was added to beginning after the opening body tag:
<div style="display:none;">
Array
(
[page] => 2
)
</div>
But when I accessed:
http://www.oscarello.me/blog?page=2
This was added instead:
<div style="display:none;">
Array
(
)
</div>
Without this variable, the pagination doesn't work and it always gets stuck on the first page. Do you know if this is a real bug or maybe just an erroneous nginx configuration?
I'm using:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
# webpage location
root ROOT_TO_MY_WEBSITE;
index index.php index.html index.htm;
# server name
server_name MY_SITE_NAME;
try_files $uri $uri/ /index.php$args;
# log files
access_log /var/log/nginx/pico_access.log;
error_log /var/log/nginx/pico_error.log;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php5-fpm;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
# limit_req zone=one burst=5;
}
location ~*\.(gif|jpg|png)$ {
expires 30d;
}
location ~ /\.ht {
deny all;
}
}
Thanks!
baun_nav()
to allow setting a subfolder to be the "top" folder. Allows you to show only a subset of the navigation.Related to #10
Make the paths to all folders configurable.
So I am beginning to use this framework for my personal site and was mapping it all out in my head before diving into it.
I was thinking that the config could probably be separated for ease of use? To config/app.php and config/blog.php? Also what if I want two blogs, for example a "Journal" and a "Projects", maybe it should be renamed to listings instead, then in the listings.php config you can define an array of folders and configuration for each folder. Possibly even going to the length of /config/listings/x.php.
Just writing this out as a general discussion. I feel like Baun could be really good as a quick & simple turnaround framework but also feel that the blog config is out of place in config/app.php
Loading of config files should allow configs to be in multiple levels of subfolders.
Just now posts
are only available on the blog page. Allow access on all pages so users can create templates to show a list of posts, on homepage for example.
Need to get some tests written.
I believe this is a Windows only issue due to a bug in the loadConfigs() function in Baun class.
foreach ($configFiles as $configFile) {
$configKey = str_replace(BASE_PATH . 'config/', '', $configFile);
$configKey = str_replace(DIRECTORY_SEPARATOR, '-', strtolower($configKey));
$configKey = str_replace('.php', '', $configKey);
$configData[$configKey] = require $configFile;
}
should be:
foreach ($configFiles as $configFile) {
$configKey = str_replace(BASE_PATH . 'config'.DIRECTORY_SEPARATOR, '', $configFile);
$configKey = str_replace(DIRECTORY_SEPARATOR, '-', strtolower($configKey));
$configKey = str_replace('.php', '', $configKey);
$configData[$configKey] = require $configFile;
}
or else config keys are created incorrectly and $this->config->get('providers.events')
will return nothing and fail.
Bug only appears to happen when adding listener to event that has more than one arg. Example 'baun.beforePageRender'.
Baun emits event like this:
$this->events->emit('baun.beforePostRender', $template, $data);
But Baun events provider emit function only accepts 2 arguments:
public function emit($event, $args = [])
{
$this->emitter->emit($event, $args);
}
Therefore $template
gets passed through and $data
does not.
This could be fixed by emitting events with multiple args in an array:
$this->events->emit('baun.beforePageRender', [$template, $data]);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.