Coder Social home page Coder Social logo

phlyblog's People

Contributors

pavkatar avatar rieschl avatar volkan avatar vrkansagara avatar weierophinney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phlyblog's Issues

Fatal error: Class 'PhlyBlog\Model\ViewModel'

tried this package, copied sample-posts.php to ./data/posts then ran php public/index.php compile -a and got this error.

file and line number is:
Development\php\myZf2Test\vendor\phly\phly-blog\Module.php on line 54

Routing Question

I correctly compiled the sample-post.php entity and it generated a a public/blog folder with"
author/
day/
month/
tag/
year/
Example-Blog_post.html

I can view the Example-Blog_post.html by URL, but how do I view the paginated entry files that you would typically see on the front page of a blog?

DateTime::__construct(): It is not safe to rely on the system's timezone settings.

@weierophinney: Any idea why I am getting this exception?

Compiling and sorting entries======================================================================

The application has thrown an exception!

Exception

DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

/Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/phly/phly-common/src/PhlyCommon/Filter/Timestamp.php:23
#0 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/phly/phly-common/src/PhlyCommon/Filter/Timestamp.php(23): DateTime->__construct()
#1 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/phly/phly-blog/src/PhlyBlog/EntryEntity.php(234): PhlyCommon\Filter\Timestamp->filter(1300744335)
#2 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/data/blog/sample-post.php(19): PhlyBlog\EntryEntity->setCreated(1300744335)
#3 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/phly/phly-blog/src/PhlyBlog/Compiler.php(60): include('/Users/jkershne...')
#4 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/phly/phly-blog/src/PhlyBlog/CompileController.php(233): PhlyBlog\Compiler->compile()
#5 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(82): PhlyBlog\CompileController->compileAction()
#6 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#7 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#8 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#9 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Console\Request), Object(Zend\Console\Response))
#11 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#12 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#13 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#14 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(313): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#15 /Users/jkershner/Documents/Projects/Personal/goferhost.dev/public_html/index.php(26): Zend\Mvc\Application->run()
#16 {main}

Previous Exception(s):

Layout.phtml

I am able to get this to work perfectly by modifying the view phtml files and adding the site's templates directly into these files (where appropriate).

Is there a way to have this use the main Application's layout.phtml template? I tried added a layout/layout in the view manager's template map:

'layout/layout' => DIR . '/../view/phly-blog/layout.phtml',

... but the blog.html file just renders the

...
blog list part and doesn't include the template.

First Entry blog appear twice

When i execute blog compile --all, the first entry appear twice into the blog list
i putted a breakpoint in the Compiler::compile() line 60.
I have 2 files into data/blog but the loop is repeated 3 times

Blog compilation error [Request URI has not been set ]

Hello @weierophinney

I am simply using this compile command and it give me bellow error.

 ./vendor/bin/laminas phly-blog:compile

image

Few file I debug and found one issue relate to layout.
(1) Removal of code from master layout (layout.phtml)

    <link rel="canonical" href="<?=$this->url('home', [], ['force_canonical' => true]); ?>" />

If I remove above line from layout.phtml ( which is master layout ) then it will work as expected. I don't know what is wrong with this.
(2) Removal of config from config.php file

        'base_path' => '/',
        'base_url' => '/',

If I remove above line from module config then it has no effect on error.

Would you like to help or give any hint on issue. much appreciated

Tags

I see how to render all tags from a particular blog article, but is there a way to render all tags from all articles to create a master tag cloud for the entire blog?

Site returning 200 response when 404 should be provided

Matthew, thanks for writing this blog module!

I'm still fiddling with it in my spare time and encountered what appears to be some kind of configuration error. If I navigate to http://SomeImplementationOfThisBlogModule.com/Some_Missing_Page The status code being provided is a 200 OK. I would expect 404 response code. It looks like the module.config.php file does include reference to a 404 handler; however, something is a bit funky -- as it is sending that bugger of a 200 OK no matter what.

module.config.php -- Lines 47-59:
'router' => array(
'routes' => array(
'default' => array(
'type' => 'Regex',
'options' => array(
'regex' => '/.*',
'defaults' => array(
'controller' => 'PhlySimplePage\Controller\Page',
'template' => 'pages/404',
),
'spec' => '404',
),
),

Looking at PhlySimplePage/PageController.php Lines 159-193 seem to imply that a 404 would be generated... but for some reason it isn't. Any ideas?

Exception when running blog compile

I've added this module to composer.json and installed. Then, I created data/posts and data/blog. Both have writing and reading access for www. I've copied the sample-post.php to data/posts and then ran php ./public/index.php blog compile. The following was my output:

rwoverdijk$ php ./public/index.php blog compile
Compiling and sorting entriesPHP Catchable fatal error: Argument 1 passed to iterator_to_array() must implement interface Traversable, null given in /Library/WebServer/Documents/packages/PhlyBlog/src/PhlyBlog/Compiler/Listener/Archives.php on line 28
PHP Stack trace:
PHP 1. {main}() /Library/WebServer/Documents/spxbeta.dev/public/index.php:0
PHP 2. Zend\Mvc\Application->run() /Library/WebServer/Documents/spxbeta.dev/public/index.php:12
PHP 3. Zend\EventManager\EventManager->trigger() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:297
PHP 4. Zend\EventManager\EventManager->triggerListeners() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:208
PHP 5. call_user_func() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
PHP 6. Zend\Mvc\DispatchListener->onDispatch() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
PHP 7. Zend\Mvc\Controller\AbstractController->dispatch() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php:113
PHP 8. Zend\EventManager\EventManager->trigger() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php:107
PHP 9. Zend\EventManager\EventManager->triggerListeners() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:208
PHP 10. call_user_func() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
PHP 11. Zend\Mvc\Controller\AbstractActionController->onDispatch() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
PHP 12. PhlyBlog\CompileController->compileAction() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php:88
PHP 13. PhlyBlog\Compiler->compile() /Library/WebServer/Documents/packages/PhlyBlog/src/PhlyBlog/CompileController.php:233
PHP 14. Zend\EventManager\EventManager->trigger() /Library/WebServer/Documents/packages/PhlyBlog/src/PhlyBlog/Compiler.php:85
PHP 15. Zend\EventManager\EventManager->triggerListeners() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:208
PHP 16. call_user_func() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
PHP 17. PhlyBlog\Compiler\Listener\Archives->onCompileEnd() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464

Catchable fatal error: Argument 1 passed to iterator_to_array() must implement interface Traversable, null given in /Library/WebServer/Documents/packages/PhlyBlog/src/PhlyBlog/Compiler/Listener/Archives.php on line 28

Call Stack:
0.0002 226160 1. {main}() /Library/WebServer/Documents/spxbeta.dev/public/index.php:0
0.0351 3092120 2. Zend\Mvc\Application->run() /Library/WebServer/Documents/spxbeta.dev/public/index.php:12
0.0359 3118688 3. Zend\EventManager\EventManager->trigger() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php:297
0.0359 3118688 4. Zend\EventManager\EventManager->triggerListeners() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:208
0.0360 3120448 5. call_user_func() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
0.0360 3120480 6. Zend\Mvc\DispatchListener->onDispatch() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
0.0445 4247760 7. Zend\Mvc\Controller\AbstractController->dispatch() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php:113
0.0445 4248480 8. Zend\EventManager\EventManager->trigger() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php:107
0.0445 4248480 9. Zend\EventManager\EventManager->triggerListeners() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:208
0.0490 4637040 10. call_user_func() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
0.0490 4637072 11. Zend\Mvc\Controller\AbstractActionController->onDispatch() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
0.0490 4637296 12. PhlyBlog\CompileController->compileAction() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php:88
0.0930 5529872 13. PhlyBlog\Compiler->compile() /Library/WebServer/Documents/packages/PhlyBlog/src/PhlyBlog/CompileController.php:233
0.0932 5540944 14. Zend\EventManager\EventManager->trigger() /Library/WebServer/Documents/packages/PhlyBlog/src/PhlyBlog/Compiler.php:85
0.0932 5541160 15. Zend\EventManager\EventManager->triggerListeners() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:208
0.0933 5543224 16. call_user_func() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464
0.0933 5543256 17. PhlyBlog\Compiler\Listener\Archives->onCompileEnd() /Library/WebServer/Documents/spxbeta.dev/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php:464

How to consume?

Alright so I have this sort-of-working but I am having a tough time consuming this blog in my application. If I update the built in views to use my own template, I can serve the /blog/blog.html directly. The title tag seems to concatenate all blogs into a single title and the feed links are duplicated as well (not sure if I am allowed to post my URL so feel free to remove it):

https://goferhost.com/blog/blog.html

I think maybe a better way to do this would be to consume this data into my existing Application module's layout by routing. Does anyone have an example of how I can do this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.