diff --git a/.gitignore b/.gitignore index 5b34c79f4..e4979f318 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +app/config/config.inc.php \ No newline at end of file diff --git a/TRANSLATION.md b/TRANSLATION.md old mode 100755 new mode 100644 diff --git a/cache/.gitignore b/app/cache/.gitignore similarity index 100% rename from cache/.gitignore rename to app/cache/.gitignore diff --git a/cache/.htaccess b/app/cache/.htaccess similarity index 100% rename from cache/.htaccess rename to app/cache/.htaccess diff --git a/check_essentials.php b/app/check_essentials.php similarity index 100% rename from check_essentials.php rename to app/check_essentials.php diff --git a/app/check_setup.php b/app/check_setup.php new file mode 100755 index 000000000..57495f2c1 --- /dev/null +++ b/app/check_setup.php @@ -0,0 +1,9 @@ + + * @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); +} \ No newline at end of file diff --git a/assets/.gitignore b/app/db/.gitignore old mode 100755 new mode 100644 similarity index 100% rename from assets/.gitignore rename to app/db/.gitignore diff --git a/db/.htaccess b/app/db/.htaccess similarity index 100% rename from db/.htaccess rename to app/db/.htaccess diff --git a/app/db/poche.sqlite b/app/db/poche.sqlite new file mode 100755 index 000000000..3d1a8e43b Binary files /dev/null and b/app/db/poche.sqlite differ diff --git a/check_setup.php b/check_setup.php deleted file mode 100755 index cf02c34ba..000000000 --- a/check_setup.php +++ /dev/null @@ -1,12 +0,0 @@ - - * @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); -} \ No newline at end of file diff --git a/index.php b/index.php deleted file mode 100755 index adfef71be..000000000 --- a/index.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @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(); diff --git a/locale/.htaccess b/locale/.htaccess deleted file mode 100644 index 93169e4eb..000000000 --- a/locale/.htaccess +++ /dev/null @@ -1,2 +0,0 @@ -Order deny,allow -Deny from all diff --git a/migrations/20150119171459_init_database.php b/migrations/20150119171459_init_database.php new file mode 100644 index 000000000..48a7d4b6a --- /dev/null +++ b/migrations/20150119171459_init_database.php @@ -0,0 +1,27 @@ +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;"); + } +} \ No newline at end of file diff --git a/phinx.yml b/phinx.yml new file mode 100644 index 000000000..f6c6300f4 --- /dev/null +++ b/phinx.yml @@ -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 diff --git a/inc/poche/Database.class.php b/src/Wallabag/Wallabag/Database.php similarity index 99% rename from inc/poche/Database.class.php rename to src/Wallabag/Wallabag/Database.php index f6ba47089..afda69de5 100755 --- a/inc/poche/Database.class.php +++ b/src/Wallabag/Wallabag/Database.php @@ -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); diff --git a/inc/poche/WallabagEBooks.class.php b/src/Wallabag/Wallabag/Ebooks.php similarity index 99% rename from inc/poche/WallabagEBooks.class.php rename to src/Wallabag/Wallabag/Ebooks.php index a9c62af93..2ad89a1cb 100644 --- a/inc/poche/WallabagEBooks.class.php +++ b/src/Wallabag/Wallabag/Ebooks.php @@ -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; diff --git a/inc/poche/FlattrItem.class.php b/src/Wallabag/Wallabag/FlattrItem.php similarity index 98% rename from inc/poche/FlattrItem.class.php rename to src/Wallabag/Wallabag/FlattrItem.php index ef8c62f7f..17eccd3fa 100644 --- a/inc/poche/FlattrItem.class.php +++ b/src/Wallabag/Wallabag/FlattrItem.php @@ -8,6 +8,8 @@ * @license http://opensource.org/licenses/MIT see COPYING file */ +namespace Wallabag\Wallabag; + class FlattrItem { public $status; diff --git a/inc/poche/Language.class.php b/src/Wallabag/Wallabag/Language.php similarity index 97% rename from inc/poche/Language.class.php rename to src/Wallabag/Wallabag/Language.php index 420f2fb9c..434118176 100644 --- a/inc/poche/Language.class.php +++ b/src/Wallabag/Wallabag/Language.php @@ -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'); diff --git a/inc/poche/pochePictures.php b/src/Wallabag/Wallabag/Picture.php similarity index 99% rename from inc/poche/pochePictures.php rename to src/Wallabag/Wallabag/Picture.php index 52394c703..8a9cd764b 100644 --- a/inc/poche/pochePictures.php +++ b/src/Wallabag/Wallabag/Picture.php @@ -8,6 +8,7 @@ * @license http://opensource.org/licenses/MIT see COPYING file */ +namespace Wallabag\Wallabag; final class Picture { diff --git a/locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo similarity index 100% rename from locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo diff --git a/locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po b/src/Wallabag/Wallabag/Resources/translations/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po similarity index 100% rename from locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po diff --git a/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo similarity index 100% rename from locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo diff --git a/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po b/src/Wallabag/Wallabag/Resources/translations/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po similarity index 100% rename from locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po diff --git a/locale/en_EN.utf8/LC_MESSAGES/en_EN.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/en_EN.utf8/LC_MESSAGES/en_EN.utf8.mo similarity index 100% rename from locale/en_EN.utf8/LC_MESSAGES/en_EN.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/en_EN.utf8/LC_MESSAGES/en_EN.utf8.mo diff --git a/locale/en_EN.utf8/LC_MESSAGES/en_EN.utf8.po b/src/Wallabag/Wallabag/Resources/translations/en_EN.utf8/LC_MESSAGES/en_EN.utf8.po similarity index 100% rename from locale/en_EN.utf8/LC_MESSAGES/en_EN.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/en_EN.utf8/LC_MESSAGES/en_EN.utf8.po diff --git a/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/en_US.utf8/LC_MESSAGES/en_US.utf8.mo similarity index 100% rename from locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/en_US.utf8/LC_MESSAGES/en_US.utf8.mo diff --git a/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.po b/src/Wallabag/Wallabag/Resources/translations/en_US.utf8/LC_MESSAGES/en_US.utf8.po similarity index 100% rename from locale/en_US.utf8/LC_MESSAGES/en_US.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/en_US.utf8/LC_MESSAGES/en_US.utf8.po diff --git a/locale/es_ES.utf8/LC_MESSAGES/es_ES.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/es_ES.utf8/LC_MESSAGES/es_ES.utf8.mo similarity index 100% rename from locale/es_ES.utf8/LC_MESSAGES/es_ES.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/es_ES.utf8/LC_MESSAGES/es_ES.utf8.mo diff --git a/locale/es_ES.utf8/LC_MESSAGES/es_ES.utf8.po b/src/Wallabag/Wallabag/Resources/translations/es_ES.utf8/LC_MESSAGES/es_ES.utf8.po similarity index 100% rename from locale/es_ES.utf8/LC_MESSAGES/es_ES.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/es_ES.utf8/LC_MESSAGES/es_ES.utf8.po diff --git a/locale/fa_IR.utf8/LC_MESSAGES/fa_IR.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/fa_IR.utf8/LC_MESSAGES/fa_IR.utf8.mo similarity index 100% rename from locale/fa_IR.utf8/LC_MESSAGES/fa_IR.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/fa_IR.utf8/LC_MESSAGES/fa_IR.utf8.mo diff --git a/locale/fa_IR.utf8/LC_MESSAGES/fa_IR.utf8.po b/src/Wallabag/Wallabag/Resources/translations/fa_IR.utf8/LC_MESSAGES/fa_IR.utf8.po similarity index 100% rename from locale/fa_IR.utf8/LC_MESSAGES/fa_IR.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/fa_IR.utf8/LC_MESSAGES/fa_IR.utf8.po diff --git a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo similarity index 100% rename from locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo diff --git a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po b/src/Wallabag/Wallabag/Resources/translations/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po similarity index 100% rename from locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po diff --git a/locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/it_IT.utf8/LC_MESSAGES/it_IT.utf8.mo similarity index 100% rename from locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/it_IT.utf8/LC_MESSAGES/it_IT.utf8.mo diff --git a/locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.po b/src/Wallabag/Wallabag/Resources/translations/it_IT.utf8/LC_MESSAGES/it_IT.utf8.po similarity index 100% rename from locale/it_IT.utf8/LC_MESSAGES/it_IT.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/it_IT.utf8/LC_MESSAGES/it_IT.utf8.po diff --git a/locale/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.mo similarity index 100% rename from locale/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.mo diff --git a/locale/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.po b/src/Wallabag/Wallabag/Resources/translations/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.po similarity index 100% rename from locale/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.po diff --git a/locale/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.mo similarity index 100% rename from locale/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.mo diff --git a/locale/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.po b/src/Wallabag/Wallabag/Resources/translations/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.po similarity index 100% rename from locale/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/pt_BR.utf8/LC_MESSAGES/pt_BR.utf8.po diff --git a/locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.mo similarity index 100% rename from locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.mo diff --git a/locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.po b/src/Wallabag/Wallabag/Resources/translations/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.po similarity index 100% rename from locale/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/ru_RU.utf8/LC_MESSAGES/ru_RU.utf8.po diff --git a/locale/sl_SI.utf8/LC_MESSAGES/sl_SI.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/sl_SI.utf8/LC_MESSAGES/sl_SI.utf8.mo similarity index 100% rename from locale/sl_SI.utf8/LC_MESSAGES/sl_SI.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/sl_SI.utf8/LC_MESSAGES/sl_SI.utf8.mo diff --git a/locale/sl_SI.utf8/LC_MESSAGES/sl_SI.utf8.po b/src/Wallabag/Wallabag/Resources/translations/sl_SI.utf8/LC_MESSAGES/sl_SI.utf8.po similarity index 100% rename from locale/sl_SI.utf8/LC_MESSAGES/sl_SI.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/sl_SI.utf8/LC_MESSAGES/sl_SI.utf8.po diff --git a/locale/tools/fillCache.php b/src/Wallabag/Wallabag/Resources/translations/tools/fillCache.php similarity index 100% rename from locale/tools/fillCache.php rename to src/Wallabag/Wallabag/Resources/translations/tools/fillCache.php diff --git a/locale/uk_UA.utf8/LC_MESSAGES/uk_UA.utf8.mo b/src/Wallabag/Wallabag/Resources/translations/uk_UA.utf8/LC_MESSAGES/uk_UA.utf8.mo similarity index 100% rename from locale/uk_UA.utf8/LC_MESSAGES/uk_UA.utf8.mo rename to src/Wallabag/Wallabag/Resources/translations/uk_UA.utf8/LC_MESSAGES/uk_UA.utf8.mo diff --git a/locale/uk_UA.utf8/LC_MESSAGES/uk_UA.utf8.po b/src/Wallabag/Wallabag/Resources/translations/uk_UA.utf8/LC_MESSAGES/uk_UA.utf8.po similarity index 100% rename from locale/uk_UA.utf8/LC_MESSAGES/uk_UA.utf8.po rename to src/Wallabag/Wallabag/Resources/translations/uk_UA.utf8/LC_MESSAGES/uk_UA.utf8.po diff --git a/inc/poche/Routing.class.php b/src/Wallabag/Wallabag/Routing.php similarity index 98% rename from inc/poche/Routing.class.php rename to src/Wallabag/Wallabag/Routing.php index be06a433d..85b6af1e1 100755 --- a/inc/poche/Routing.class.php +++ b/src/Wallabag/Wallabag/Routing.php @@ -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(); diff --git a/inc/poche/Template.class.php b/src/Wallabag/Wallabag/Template.php similarity index 98% rename from inc/poche/Template.class.php rename to src/Wallabag/Wallabag/Template.php index 4d0bfdbb1..e8a6daa3b 100644 --- a/inc/poche/Template.class.php +++ b/src/Wallabag/Wallabag/Template.php @@ -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; diff --git a/inc/poche/Tools.class.php b/src/Wallabag/Wallabag/Tools.php similarity index 99% rename from inc/poche/Tools.class.php rename to src/Wallabag/Wallabag/Tools.php index d625fc400..19d98614a 100755 --- a/inc/poche/Tools.class.php +++ b/src/Wallabag/Wallabag/Tools.php @@ -8,6 +8,8 @@ * @license http://opensource.org/licenses/MIT see COPYING file */ +namespace Wallabag\Wallabag; + final class Tools { /** diff --git a/inc/poche/Url.class.php b/src/Wallabag/Wallabag/Url.php similarity index 95% rename from inc/poche/Url.class.php rename to src/Wallabag/Wallabag/Url.php index d9172b7d0..b18fe3d43 100644 --- a/inc/poche/Url.class.php +++ b/src/Wallabag/Wallabag/Url.php @@ -8,6 +8,8 @@ * @license http://opensource.org/licenses/MIT see COPYING file */ +namespace Wallabag\Wallabag; + class Url { public $url; diff --git a/inc/poche/User.class.php b/src/Wallabag/Wallabag/User.php similarity index 97% rename from inc/poche/User.class.php rename to src/Wallabag/Wallabag/User.php index eaadd3e5b..4a10c2edc 100644 --- a/inc/poche/User.class.php +++ b/src/Wallabag/Wallabag/User.php @@ -8,6 +8,8 @@ * @license http://opensource.org/licenses/MIT see COPYING file */ +namespace Wallabag\Wallabag; + class User { public $id; diff --git a/inc/poche/Poche.class.php b/src/Wallabag/Wallabag/Wallabag.php similarity index 99% rename from inc/poche/Poche.class.php rename to src/Wallabag/Wallabag/Wallabag.php index 8b0d3a19f..c172a95d1 100755 --- a/inc/poche/Poche.class.php +++ b/src/Wallabag/Wallabag/Wallabag.php @@ -8,7 +8,9 @@ * @license http://opensource.org/licenses/MIT see COPYING file */ -class Poche +namespace Wallabag\Wallabag; + +class Wallabag { /** * @var User diff --git a/tests/Wallabag/Wallabag/Tests/EntryTest.php b/tests/Wallabag/Wallabag/Tests/EntryTest.php index 2c3bf2fcb..dfff9fd4f 100644 --- a/tests/Wallabag/Wallabag/Tests/EntryTest.php +++ b/tests/Wallabag/Wallabag/Tests/EntryTest.php @@ -12,7 +12,7 @@ namespace wallabag\wallabag\Tests; class EntryTest extends \PHPUnit_Framework_TestCase { - public function testFoo() + public function testCreateUser() { $this->assertTrue(true); } diff --git a/web/index.php b/web/index.php new file mode 100644 index 000000000..053557271 --- /dev/null +++ b/web/index.php @@ -0,0 +1,27 @@ + + * @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(); \ No newline at end of file diff --git a/robots.txt b/web/robots.txt similarity index 100% rename from robots.txt rename to web/robots.txt