new folders

This commit is contained in:
Nicolas Lœuillet 2015-01-20 07:40:39 +01:00
parent c78c1a3f08
commit 6ad93dff69
61 changed files with 146 additions and 97 deletions

9
.gitignore vendored
View file

@ -1,9 +1,8 @@
.DS_Store
assets/*
cache/*
.vagrant
app/assets/*
app/cache/*
vendor
composer.phar
db/poche.sqlite
inc/poche/config.inc.php
inc/3rdparty/htmlpurifier/HTMLPurifier/DefinitionCache/Serializer/
.vagrant
app/config/config.inc.php

0
TRANSLATION.md Executable file → Normal file
View file

9
app/check_setup.php Executable file
View file

@ -0,0 +1,9 @@
<?php
// install folder still present, need to install wallabag
// if (is_dir('install')) {
// require('install/index.php');
// exit;
// }

View file

@ -13,7 +13,7 @@
@define ('STORAGE', 'sqlite'); # postgres, mysql or sqlite
@define ('STORAGE_SQLITE', ROOT . '/db/poche.sqlite'); # if you are using sqlite, where the database file is located
@define ('STORAGE_SQLITE', ROOT . '/app/db/poche.sqlite'); # if you are using sqlite, where the database file is located
# only for postgres & mysql
@define ('STORAGE_SERVER', 'localhost');
@ -62,13 +62,13 @@
@define ('SHOW_PRINTLINK', '1');
// display or not percent of read in article view. Affects only default theme.
@define ('SHOW_READPERCENT', '1');
@define ('ABS_PATH', 'assets/');
@define ('ABS_PATH', ROOT . '/app/assets/');
@define ('DEFAULT_THEME', 'baggy');
@define ('THEME', ROOT . '/themes');
@define ('LOCALE', ROOT . '/locale');
@define ('CACHE', ROOT . '/cache');
@define ('LOCALE', ROOT . '/src/Wallabag/Wallabag/Resources/translations/locale');
@define ('CACHE', ROOT . '/app/cache');
@define ('PAGINATION', '12');

25
app/config/global.inc.php Executable file
View file

@ -0,0 +1,25 @@
<?php
/**
* wallabag, self hostable application allowing you to not miss any content anymore
*
* @category wallabag
* @author Nicolas Lœuillet <nicolas@loeuillet.org>
* @copyright 2013
* @license http://opensource.org/licenses/MIT see COPYING file
*/
define('ROOT', dirname(__FILE__) . '/../..');
require_once ROOT . '/vendor/autoload.php';
# system configuration; database credentials et caetera
require_once dirname(__FILE__) . '/config.inc.php';
require_once dirname(__FILE__) . '/config.inc.default.php';
if (!ini_get('date.timezone') || !@date_default_timezone_set(ini_get('date.timezone'))) {
date_default_timezone_set('UTC');
}
if (defined('ERROR_REPORTING')) {
error_reporting(ERROR_REPORTING);
}

0
assets/.gitignore → app/db/.gitignore vendored Executable file → Normal file
View file

BIN
app/db/poche.sqlite Executable file

Binary file not shown.

View file

@ -1,12 +0,0 @@
<?php
// Check if /cache is writeable
if (! is_writable('cache')) {
die('The directory "cache" must be writeable by your web server user');
}
// install folder still present, need to install wallabag
if (is_dir('install')) {
require('install/index.php');
exit;
}

View file

@ -74,6 +74,9 @@
"require-dev": {
"phpunit/phpunit": "~3.7"
},
"autoload": {
"psr-0": { "Wallabag\\Wallabag": "src/" }
},
"config": {
"bin-dir": "bin"
}

2
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "93ca2016541bb1e9aaf52a82468ce04d",
"hash": "7915fd3c1343f447145fb167b0bb4d36",
"packages": [
{
"name": "ezyang/htmlpurifier",

0
db/.gitignore vendored
View file

View file

@ -1,43 +0,0 @@
<?php
/**
* wallabag, self hostable application allowing you to not miss any content anymore
*
* @category wallabag
* @author Nicolas Lœuillet <nicolas@loeuillet.org>
* @copyright 2013
* @license http://opensource.org/licenses/MIT see COPYING file
*/
# the poche system root directory (/inc)
define('INCLUDES', dirname(__FILE__) . '/..');
# the poche root directory
define('ROOT', INCLUDES . '/..');
require_once ROOT . '/vendor/autoload.php';
require_once INCLUDES . '/poche/Tools.class.php';
require_once INCLUDES . '/poche/User.class.php';
require_once INCLUDES . '/poche/Url.class.php';
require_once INCLUDES . '/poche/Template.class.php';
require_once INCLUDES . '/poche/Language.class.php';
require_once INCLUDES . '/poche/Routing.class.php';
require_once INCLUDES . '/poche/WallabagEBooks.class.php';
require_once INCLUDES . '/poche/Poche.class.php';
require_once INCLUDES . '/poche/Database.class.php';
require_once INCLUDES . '/poche/FlattrItem.class.php';
# system configuration; database credentials et caetera
require_once INCLUDES . '/poche/config.inc.php';
require_once INCLUDES . '/poche/config.inc.default.php';
if (DOWNLOAD_PICTURES) {
require_once INCLUDES . '/poche/pochePictures.php';
}
if (!ini_get('date.timezone') || !@date_default_timezone_set(ini_get('date.timezone'))) {
date_default_timezone_set('UTC');
}
if (defined('ERROR_REPORTING')) {
error_reporting(ERROR_REPORTING);
}

View file

@ -1,22 +0,0 @@
<?php
/**
* wallabag, self hostable application allowing you to not miss any content anymore
*
* @category wallabag
* @author Nicolas Lœuillet <nicolas@loeuillet.org>
* @copyright 2013
* @license http://opensource.org/licenses/MIT see COPYING file
*/
define ('POCHE', '1.8.1');
require 'check_essentials.php';
require 'check_setup.php';
require_once 'inc/poche/global.inc.php';
// Start session
Session::$sessionName = 'wallabag';
Session::init();
// Let's rock !
$wallabag = new Poche();
$wallabag->run();

View file

@ -1,2 +0,0 @@
Order deny,allow
Deny from all

View file

@ -0,0 +1,27 @@
<?php
use Phinx\Migration\AbstractMigration;
class InitDatabase extends AbstractMigration
{
/**
* Migrate Up.
*/
public function up()
{
$this->execute("CREATE TABLE IF NOT EXISTS `montest` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
}
/**
* Migrate Down.
*/
public function down()
{
$this->execute("DROP DATABASE montest;");
}
}

17
phinx.yml Normal file
View file

@ -0,0 +1,17 @@
paths:
migrations: %%PHINX_CONFIG_DIR%%/migrations
environments:
default_migration_table: phinxlog
default_database: development
production:
adapter: sqlite
name: db/poche
development:
adapter: sqlite
name: db/poche
testing:
adapter: sqlite
name: db/poche

View file

@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
class Database {
var $handle;
@ -25,7 +27,7 @@ class Database {
case 'sqlite':
// Check if /db is writeable
if ( !is_writable(STORAGE_SQLITE) || !is_writable(dirname(STORAGE_SQLITE))) {
die('An error occured: "db" directory must be writeable for your web server user!');
die('An error occured: ' . STORAGE_SQLITE . ' directory must be writeable for your web server user!');
}
$db_path = 'sqlite:' . STORAGE_SQLITE;
$this->handle = new PDO($db_path);

View file

@ -8,7 +8,9 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
class WallabagEBooks
namespace Wallabag\Wallabag;
class Ebooks
{
protected $wallabag;
protected $method;
@ -18,7 +20,7 @@ class WallabagEBooks
protected $bookFileName;
protected $author = 'wallabag';
public function __construct(Poche $wallabag, $method, $value)
public function __construct(Wallabag $wallabag, $method, $value)
{
$this->wallabag = $wallabag;
$this->method = $method;

View file

@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
class FlattrItem
{
public $status;

View file

@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
class Language
{
protected $wallabag;
@ -30,7 +32,7 @@ class Language
'uk_UA.utf8' => 'Українська',
);
public function __construct(Poche $wallabag)
public function __construct(Wallabag $wallabag)
{
$this->wallabag = $wallabag;
$pocheUser = Session::getParam('poche_user');

View file

@ -8,6 +8,7 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
final class Picture
{

View file

@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
class Routing
{
protected $wallabag;
@ -20,7 +22,7 @@ class Routing
protected $defaultVars = array();
protected $vars = array();
public function __construct(Poche $wallabag)
public function __construct(Wallabag $wallabag)
{
$this->wallabag = $wallabag;
$this->_init();

View file

@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
class Template extends Twig_Environment
{
protected $wallabag;
@ -15,7 +17,7 @@ class Template extends Twig_Environment
private $canRenderTemplates = TRUE;
private $currentTheme = '';
public function __construct(Poche $wallabag)
public function __construct(Wallabag $wallabag)
{
$this->wallabag = $wallabag;

View file

@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
final class Tools
{
/**

View file

@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
class Url
{
public $url;

View file

@ -8,6 +8,8 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
namespace Wallabag\Wallabag;
class User
{
public $id;

View file

@ -8,7 +8,9 @@
* @license http://opensource.org/licenses/MIT see COPYING file
*/
class Poche
namespace Wallabag\Wallabag;
class Wallabag
{
/**
* @var User

View file

@ -12,7 +12,7 @@ namespace wallabag\wallabag\Tests;
class EntryTest extends \PHPUnit_Framework_TestCase
{
public function testFoo()
public function testCreateUser()
{
$this->assertTrue(true);
}

27
web/index.php Normal file
View file

@ -0,0 +1,27 @@
<?php
/**
* wallabag, self hostable application allowing you to not miss any content anymore
*
* @category wallabag
* @author Nicolas Lœuillet <nicolas@loeuillet.org>
* @copyright 2013
* @license http://opensource.org/licenses/MIT see COPYING file
*/
define ('WALLABAG', '2.0.0-alpha');
require_once '../app/check_essentials.php';
require_once '../app/check_setup.php';
require_once '../app/config/global.inc.php';
// Check if /cache is writeable
if (! is_writable(CACHE)) {
die('The directory ' . CACHE . ' must be writeable by your web server user');
}
Session::$sessionName = 'wallabag';
Session::init();
// Let's rock !
$wallabag = new Wallabag\Wallabag\Wallabag();
$wallabag->run();