devaneando / Wikitten

Wikitten is a small, fast, PHP wiki, and the perfect place to store your notes, code snippets, ideas, and so on.
MIT License
739 stars 174 forks source link

Proposal: Use composer? #9

Open filp opened 11 years ago

filp commented 11 years ago

This point of this issue is to gather opinions on the possibility of using Composer with Wikitten.

Pros:

Cons:

victorstanciu commented 11 years ago

That con is a pretty big one. I want to keep Wikitten as simple to use and install as possible, just download, drop it in the docroot, and it just works, no other steps necessary. I like Composer and what it tries to do, but I don't want to include anything that isn't absolutely necessary. At one point I was even considering dropping Apache altogether and using the builtin webserver, but I think PHP 5.4 hasn't yet spread enough to justify this.

wojons commented 9 years ago

I am there for simple things. You dont know if the user is using a shard godaddy server or something. Its better to allow them flexibility

Caffe1neAdd1ct commented 9 years ago

@victorstanciu started using wikitten on my local machine with php 5.5 inbuilt webserver along with a gnome .desktop file to launch it from gnome super search:

screenshot from 2015-05-28 16 00 33

Can be achieved using the following on fedora 21:

~/.local/share/applications/phpwikitten.desktop

[Desktop Entry]
Encoding=UTF-8
Name=PHPWikitten
Comment=PHP Wiki
Exec=/home/username/Software/run-scripts/run-phpwikitten.sh
Icon=/home/username/Software/Wikitten/static/img/logo.png
Categories=Application;Development
Version=1.0
Type=Application
Terminal=0

~/Software/run-scripts/run-phpwikitten.sh

#!/bin/bash
cd /home/username/Software/Wikitten;
nohup php -S 0.0.0.0:8011 routing.php &
google-chrome http://localhost:8011/

note - may need to change the browser command above and make sure nohup is available.

First idea which popped into my head when opening the code base in netbeans was why not use composer for the markdown parser lib. I'm wondering if perhaps a download of the project post composer processed would be an option?

Getting a project via git clone i would expect to run a few setup tasks like fetching deps, however a release bundle should contain a ready to go package...

I wouldn't say drop Apache as a configuration option as some may want to host a wiki on a server/vps/shared host however i would recommend adding in a routing.php file for php inbuilt webserver:

php -S localhost:8000 routing.php

routing.php

<?php
if (file_exists(__DIR__ . '/' . $_SERVER['REQUEST_URI'])) {
    return false; // serve the requested resource as-is.
} else {
    require_once 'index.php';
}

Works perfectly for me :+1:

Also a supporting point towards supporting inbuilt is everyone should be looking to move up from php 5.3 as of last year... http://php.net/supported-versions.php