GithubHelp home page GithubHelp logo

dancer2-session-dbic's Introduction

Interchange

Interchange is a web application server, electronic catalog and database display system.

Features include:

  • online ordering
  • real-time payment processing integration
  • high-level database access and retrieval with SQL support
  • product categorizing, merchandising, and discounting
  • basic customer relationship management
  • dynamic content presentation
  • content management
  • internationalization and localization support
  • real-time tax and shipping hooks
  • reporting
  • web-based administration

License

Licensed under GPLv2. This program is offered without warranty of any kind. See file LICENSE for redistribution terms.

Copyright © 2002-2021 Interchange Development Group
Copyright © 1996-2002 Red Hat, Inc.
Originally based on Vend 0.2 and 0.3, copyright 1995-96 by Andrew M. Wilcox.

Documentation

More information is in the following files:

README.rpm-dist

Notes on using Interchange when installed from RPM packages.

README.debian

Notes on using Interchange when installed from Debian packages.

README-DEVELOPMENT.md

How to track ongoing development of Interchange.

doc/WHATSNEW-*

Changes per specified version family.

UPGRADE

Instructions on how to upgrade from an earlier Interchange version.

A documentation package is available, with documentation in many different formats. This and other information is available at the Interchange home on the web:

https://www.interchangecommerce.org/

Repository layout

Major files and directories in the distribution:

Makefile.PL

Script to create a Makefile, used for installation. Run ./configure for usage instructions.

dist/

The distribution files, exclusive of executable files and modules. Includes:

  • code/ - Usertags and other customizable code
  • interchange.cfg.dist - Distribution-default interchange.cfg
  • lib/ - Back-end administrative interface
  • src/ - C and Perl code for CGI link programs
  • strap/ - Demo catalog skeleton, used by makecat

eg/

Various helper scripts and addons.

hints.pl

OS-specific configuration settings.

lib/

The library modules needed to run Interchange.

relocate.pl

Script that adjusts paths in scripts/ for installation into bin/.

scripts/

The executable files, relocated to bin/ in the install directory.

test.pl

The installation test script.

Prerequisites

Interchange requires Perl 5.16.3 or later, on a Unix-like operating system. It is primarily used on various Linux distributions, and has also been used on FreeBSD, OpenBSD, macOS, and other Unix variants.

Interchange requires some extra Perl modules to be installed on your system. Unless you are installing from distribution-specific packages (Red Hat, Debian, etc.) the quick way to install the necessary support is to run from the untarred Interchange directory:

cpanm --installdeps .

Alternatively, you can run:

perl -MCPAN -e 'install Bundle::Interchange'

If you would like to use a specific installation of Perl, invoke Perl with an absolute path to the perl binary, such as

/usr/local/bin/perl -MCPAN -e 'install Bundle::Interchange'

Installation

You can install Interchange as root for a multi-user system-wide setup, or as an unprivileged user who will be the only one modifying Interchange files.

Here is the quick installation summary:

tar xvzf interchange-5.12.0.tar.gz
cd interchange-5.12.0
perl Makefile.PL
make
make test
make install

If you would like to use a specific version of Perl, simply invoke with an absolute path to the perl binary, such as:

/usr/local/bin/perl Makefile.PL

The build procedure asks where you’d like to install Interchange and the name of the user account that will own the installation.

The Interchange server doesn’t do much if it isn’t servicing one or more actual catalogs, so you next need to make your first Interchange catalog, as described in the next section.

Demo catalog

There is a demo catalog skeleton called strap included.

To build your own catalog from the demo, go to the directory where you installed Interchange (default is "interchange" in your home directory, /usr/local/interchange for root installations, or /usr/lib/interchange for RPM installations) and run:

bin/makecat

Follow the prompts and after restarting the Interchange server you should be able to access the new instance of the demo catalog.

Please note that some functionality (notably the reporting features) may not be available if you are not using an SQL database such as MySQL, PostgreSQL, or SQLite.

Try a live demo at: https://www.interchangecommerce.org/i/dev/demo

dancer2-session-dbic's People

Contributors

andyjack avatar lpmi-13 avatar melmothx avatar racke avatar syspete avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dancer2-session-dbic's Issues

db_connection_name other than default

In my config.yml I have:
plugins: DBIC: interch: schema_class: Interchange6::Schema dsn: "..." ... etc ...
So I want to point the session engine to that schema name:

`engines:
session:
DBIC:
db_connection_name: interch # connection name from DBIC plugin

session: DBIC
`
I get this error:

[apptestname:49759] error @2016-08-16 22:16:52> Route exception: Exception caught in 'core.app.before_request' filter: Hook error: The schema default is not configured at /usr/local/lib/perl5/site_perl/DBICx/Sugar.pm line 52.
at /usr/local/lib/perl5/site_perl/Dancer2/Plugin.pm line 580.
at /usr/local/lib/perl5/site_perl/Dancer2/Core/Role/Hookable.pm line 115. in /usr/local/lib/perl5/site_perl/Dancer2/Core/App.pm l. 1388

I think this happens at the moment of session creation.

What do you think?

Test failure t/serializers/yaml.t

http://www.cpantesters.org/cpan/report/b39defb4-f271-11e5-8bf0-cb9afbd2507e

#   Failed test 'deserialize {"foo":{"camel":"���"}} lives'
#   at t/serializers/yaml.t line 42.
#          got: 'YAML Error: Stream does not end with newline character
#    Code: YAML_PARSE_ERR_NO_FINAL_NEWLINE
#    Line: 0
#    Document: 0
#  at /opt/perl-5.20.1D/lib/site_perl/5.20.1/YAML/Loader.pm line 37.
# '
#     expected: undef

#   Failed test 'we got the hashref we expected'
#   at t/serializers/yaml.t line 45.
# Compared reftype($data)
#    got : undef
# expect : 'HASH'
# Looks like you failed 2 tests of 10.
t/serializers/yaml.t .... 

Test failure: could not find a config.yml or config.yaml file

http://www.cpantesters.org/cpan/report/b37ee2e4-f25e-11e5-978c-21ddfcd2507e

[Foo:2022] error @2016-03-25 08:10:06> Route exception: Unable to create a new session: could not find a config.yml or config.yaml file at /home/cpansand/.cpan/build/2016032506/Dancer2-Session-DBIC-0.100-4k_GPN/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /usr/perl5.18.4p/lib/site_perl/5.18.4/Dancer2/Core/App.pm line 380. in /usr/perl5.18.4p/lib/site_perl/5.18.4/Dancer2/Core/App.pm l. 1288
Use of uninitialized value $cookie in substitution (s///) at t/plugin_dbic.t line 114.
Use of uninitialized value $cookie in concatenation (.) or string at t/plugin_dbic.t line 115.

#   Failed test 'Got the cookie: '
#   at t/plugin_dbic.t line 115.
[Foo:2022] error @2016-03-25 08:10:06> Route exception: Unable to create a new session: could not find a config.yml or config.yaml file at /home/cpansand/.cpan/build/2016032506/Dancer2-Session-DBIC-0.100-4k_GPN/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /usr/perl5.18.4p/lib/site_perl/5.18.4/Dancer2/Core/App.pm line 380. in /usr/perl5.18.4p/lib/site_perl/5.18.4/Dancer2/Core/App.pm l. 1288

#   Failed test 'Retrieve session id'
#   at t/plugin_dbic.t line 119.
#                   '<!DOCTYPE html>
# <html lang="en">
# <head>
#   <meta charset="UTF-8">
#   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
#   <title>Error 500 - Internal Server Error</title>
#   <link rel="stylesheet" href="http://localhost/css/error.css">
# </head>
# <body>
# <h1>Error 500 - Internal Server Error</h1>
# <div id="content">
# Wooops, something went wrong
# </div>
# <div id="footer">
# Powered by <a href="http://perldancer.org/">Dancer2</a> 0.166001
# </div>
# </body>
# </html>
# '
#     doesn't match '(?^i:^[0-9a-z_-]+$)'

Every request generates a new session if id_column and data_column are set to 'id' & 'data'

When I have set the config to:

resultset: "Session"
id_column: "id"
data_column: "data"

I end up with a new session on every request. You can see below how it does try to find the session but one way or another something happens that triggers a new session lookup.

request 1

SELECT me.id, me.data, me.modified FROM session me WHERE ( me.id = ? ): 'Vuql_trKPLdofGSTKODNQoaops0sSNWX'
INSERT INTO session ( data, id) VALUES ( ?, ? ): '{}', 'Vuql_trKPLdofGSTKODNQoaops0sSNWX'

request 2

SELECT me.id, me.data, me.modified FROM session me WHERE ( me.id = ? ): 'Vuql_trKPLdofGSTKODNQoaops0sSNWX'
SELECT me.id, me.data, me.modified FROM session me WHERE ( me.id = ? ): 'VuqmABEiaCcA9JRveJ9LTApFMV2c2N_A'
INSERT INTO session ( data, id) VALUES ( ?, ? ): '{}', 'VuqmABEiaCcA9JRveJ9LTApFMV2c2N_A'

request 3

SELECT me.id, me.data, me.modified FROM session me WHERE ( me.id = ? ): 'VuqmABEiaCcA9JRveJ9LTApFMV2c2N_A'
SELECT me.id, me.data, me.modified FROM session me WHERE ( me.id = ? ): 'VuqmBpEkUo303zUZWtR3mXwGOzayFLH4'
INSERT INTO session ( data, id) VALUES ( ?, ? ): '{}', 'VuqmBpEkUo303zUZWtR3mXwGOzayFLH4'

etc....

The data is inserted in the table so that part works fine.

+----------------------------------+------+---------------------+
| id                               | data | modified            |
+----------------------------------+------+---------------------+
| VuqemLa3fltU4HCmh1C4xA9qMLR2HX1g | {}   | 2016-03-17 12:10:01 |
| VuqerdzZSrEzcZC3lA2_cE94G3Y0DYyn | {}   | 2016-03-17 12:10:21 |
+----------------------------------+------+---------------------+

Now if I set the config to the default:

resultset: "Session"
id_column: "sessions_id"
data_column: "session_data"

Everything works like expected.

request 1

SELECT me.sessions_id, me.session_data, me.modified FROM session me WHERE ( me.sessions_id = ? ): 'Vuqe_BJnilZGVuMGcvl73pQt8B7lgzev'

request 2

SELECT me.sessions_id, me.session_data, me.modified FROM session me WHERE ( me.sessions_id = ? ): 'Vuqe_BJnilZGVuMGcvl73pQt8B7lgzev'

request 3

SELECT me.sessions_id, me.session_data, me.modified FROM session me WHERE ( me.sessions_id = ? ): 'Vuqe_BJnilZGVuMGcvl73pQt8B7lgzev'

cannot destroy session

Trying to destroy it with: context->destroy_session

Not sure yet if the bug is from Dancer2 or this module.

Unable to destroy session with id 'XXX-EDITED-XXX': Can't locate object method "id" via package "Dancer2::Session::DBIC"

DBIC plugin test failure

This is with Dancer2 from Github master + latest release of Dancer2::Plugin::DBIC:

t/plugin_dbic.t ......... 1/? Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Plugin.pm line 247.
[Foo:28809] error @2016-03-24 07:47:09> Route exception: Unable to create a new session: Can't find originating plugin at /home/racke/interchange/Dancer2-Session-DBIC/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm line 429. in /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm l. 833
Use of uninitialized value $cookie in substitution (s///) at t/plugin_dbic.t line 114.
Use of uninitialized value $cookie in concatenation (.) or string at t/plugin_dbic.t line 115.

#   Failed test 'Got the cookie: '
#   at t/plugin_dbic.t line 115.
Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Plugin.pm line 247.
[Foo:28809] error @2016-03-24 07:47:09> Route exception: Unable to create a new session: Can't find originating plugin at /home/racke/interchange/Dancer2-Session-DBIC/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm line 429. in /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm l. 833

#   Failed test 'Retrieve session id'
#   at t/plugin_dbic.t line 119.
#                   '<!DOCTYPE html>
# <html lang="en">
# <head>
#   <meta charset="UTF-8">
#   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
#   <title>Error 500 - Internal Server Error</title>
#   <link rel="stylesheet" href="http://localhost/css/error.css">
# </head>
# <body>
# <h1>Error 500 - Internal Server Error</h1>
# <div id="content">
# Wooops, something went wrong
# </div>
# <div id="footer">
# Powered by <a href="http://perldancer.org/">Dancer2</a> 0.166001
# </div>
# </body>
# </html>
# '
#     doesn't match '(?^i:^[0-9a-z_-]+$)'
Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Plugin.pm line 247.
[Foo:28809] error @2016-03-24 07:47:09> Route exception: Unable to create a new session: Can't find originating plugin at /home/racke/interchange/Dancer2-Session-DBIC/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm line 429. in /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm l. 833

#   Failed test 'Set foo key to bar'
#   at t/plugin_dbic.t line 126.
#          got: '<!DOCTYPE html>
# <html lang="en">
# <head>
#   <meta charset="UTF-8">
#   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
#   <title>Error 500 - Internal Server Error</title>
#   <link rel="stylesheet" href="http://localhost/css/error.css">
# </head>
# <body>
# <h1>Error 500 - Internal Server Error</h1>
# <div id="content">
# Wooops, something went wrong
# </div>
# <div id="footer">
# Powered by <a href="http://perldancer.org/">Dancer2</a> 0.166001
# </div>
# </body>
# </html>
# '
#     expected: 'bar'

#   Failed test 'Retrieve foo key which is "bar" now'
#   at t/plugin_dbic.t line 131.
#          got: ''
#     expected: 'bar'
Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Plugin.pm line 247.
[Foo:28809] error @2016-03-24 07:47:09> Route exception: Unable to create a new session: Can't find originating plugin at /home/racke/interchange/Dancer2-Session-DBIC/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm line 429. in /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm l. 833

#   Failed test 'Set camel key to ラクダ'
#   at t/plugin_dbic.t line 141.
#          got: '<!DOCTYPE html>
# <html lang="en">
# <head>
#   <meta charset="UTF-8">
#   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
#   <title>Error 500 - Internal Server Error</title>
#   <link rel="stylesheet" href="http://localhost/css/error.css">
# </head>
# <body>
# <h1>Error 500 - Internal Server Error</h1>
# <div id="content">
# Wooops, something went wrong
# </div>
# <div id="footer">
# Powered by <a href="http://perldancer.org/">Dancer2</a> 0.166001
# </div>
# </body>
# </html>
# '
#     expected: 'ラクダ'

#   Failed test 'Retrieve camel key which is "ラクダ" now'
#   at t/plugin_dbic.t line 146.
#          got: ''
#     expected: 'ラクダ'
Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Plugin.pm line 247.
[Foo:28809] error @2016-03-24 07:47:09> Route exception: Unable to create a new session: Can't find originating plugin at /home/racke/interchange/Dancer2-Session-DBIC/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm line 429. in /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm l. 833
Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Plugin.pm line 247.
[Foo:28809] error @2016-03-24 07:47:09> Route exception: Unable to create a new session: Can't find originating plugin at /home/racke/interchange/Dancer2-Session-DBIC/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm line 429. in /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm l. 833
Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Plugin.pm line 247.
[Foo:28809] error @2016-03-24 07:47:09> Route exception: Unable to create a new session: Can't find originating plugin at /home/racke/interchange/Dancer2-Session-DBIC/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm line 429. in /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm l. 833

#   Failed test 'Session destroyed without crashing'
#   at t/plugin_dbic.t line 158.
#          got: '<!DOCTYPE html>
# <html lang="en">
# <head>
#   <meta charset="UTF-8">
#   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
#   <title>Error 500 - Internal Server Error</title>
#   <link rel="stylesheet" href="http://localhost/css/error.css">
# </head>
# <body>
# <h1>Error 500 - Internal Server Error</h1>
# <div id="content">
# Wooops, something went wrong
# </div>
# <div id="footer">
# Powered by <a href="http://perldancer.org/">Dancer2</a> 0.166001
# </div>
# </body>
# </html>
# '
#     expected: 'Session destroyed'
Use of uninitialized value $Dancer2::Plugin::CUR_PLUGIN in string at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Plugin.pm line 247.
[Foo:28809] error @2016-03-24 07:47:09> Route exception: Unable to create a new session: Can't find originating plugin at /home/racke/interchange/Dancer2-Session-DBIC/blib/lib/Dancer2/Session/DBIC.pm line 377.
 at /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm line 429. in /home/racke/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/Dancer2/Core/App.pm l. 833

#   Failed test 'New and old ids differ'
#   at t/plugin_dbic.t line 171.
# Looks like you failed 8 tests of 14.
t/plugin_dbic.t ......... Dubious, test returned 8 (wstat 2048, 0x800)

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.