These are chat archives for redaxmedia/redaxscript

24th
Jul 2015
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:06
Ah, yes, this works. :-)
Somehow, the composer.json file did not execute the copying of ORM.php. Doing this manually, fixed the error.
(even though it's defined... dunno why, but OK)
And wow, #303 is no longer relevant with the current master branch. Seems like a lot has changes since the 2.4 release in May.
No errors thrown.
Henry Ruhs
@redaxmedia
Jul 24 2015 22:12
Hey... are you sure? This sound very strange... because I did not change something related to that issue.
It does not copy the file to libraries/ORM.php ?
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:12
Perhaps you replaced several ROOT usages with relative paths, causing the browser to be satisfied.
It did not copy the file, yes.
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:13
w.r.t. #303 I'm not sure any more... Seems like not all code was copied correctly.
The post-install-cmd is the part that confused me... Manually copying fixed it though.
Henry Ruhs
@redaxmedia
Jul 24 2015 22:15
ok, however
have you installed grunt.js ?
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:16
I've installed with npm install -g grunt-cli, and then some dependencies which installed grunt@0.4.5.
so I guess the answer is 'Yes'.
Henry Ruhs
@redaxmedia
Jul 24 2015 22:17
please try grunt --version
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:18
grunt-cli v0.1.13
grunt v0.4.5
Henry Ruhs
@redaxmedia
Jul 24 2015 22:19
yes
now try just "grunt" and many linter for JS and CSS get fired
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:20
Done, without errors.
(after those linter)
Henry Ruhs
@redaxmedia
Jul 24 2015 22:21
ok
now try grunt phpunit
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:21
Running "phpunit:development" (phpunit) task
Starting phpunit (target: development) in tests/includes
SQLite - Fatal error: Command failed: PHP Fatal error:  Uncaught exception 'PDOException' with message 'could not find driver' in /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php:255
Stack trace:
#0 /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php(255): PDO->__construct('sqlite:', NULL, NULL, NULL)
#1 /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php(388): ORM::_setup_db('default')
#2 [internal function]: ORM::raw_execute('DROP TABLE IF E...')
#3 /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php(2205): call_user_func_array(Array, Array)
#4 /tmp/redaxscript/includes/Installer.php(271): ORM::__callStatic('rawExecute', Array)
#5 /tmp/redaxscript/includes/Installer.php(271): Redaxscript\Db::rawExecute('DROP TABLE IF E...')
#6 /tmp/redaxscript/includes/Installer.php(64): Redaxscript\Installer->_rawExecute('drop', 'sqlite')
#7 /tmp/redaxscript/tests/bootstrap.php(61): Redaxscript\Installer->rawDrop()
#8 /tmp/redaxscript/vendor/phpunit/phpunit/src/Util/Fileloader.php(58): include_once('/tmp/redaxscrip...')
#9 /tmp/redaxscript/vendor/phpunit/phpunit/src/Util/Fileloader.php(42): in /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php on line 255
Henry Ruhs
@redaxmedia
Jul 24 2015 22:22
yeahh... it could not find the PDO driver
there is a guide under local testing in our wiki
i guess the mysql pdo driver are enough
or he is missing the sqlite pdo driver maby
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:24
I'll install those; it'll take a while though, on a slow 2mbps connection today.
Henry Ruhs
@redaxmedia
Jul 24 2015 22:24
and you can just run grunt phpunit --testsuite mysql
take your time
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:26
w.r.t. the mysql socket code you created, it's missing a semicolon (not that big of an issue), but it's not working somehow... I'll need a while to figure out if it's that code that's failing, or if it's failing because I'm using the master branch instead of the 2.4 release
Henry Ruhs
@redaxmedia
Jul 24 2015 22:27
once you have phpunit running, you can test if the code is still valid and not broken
that is great, you will love it
your pull request get validated that way here: https://travis-ci.org/redaxmedia/redaxscript/pull_requests
if you wondered what is going on^^
i only merge the green ones
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:29
I've noticed ;) It made me notice that when changing the ROOT to only //, the tests were failing (because I didn't alter those as well)
Henry Ruhs
@redaxmedia
Jul 24 2015 22:31
but that is good, you know if you broke something - that makes you relaxed while changing
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:31
true
Henry Ruhs
@redaxmedia
Jul 24 2015 22:31
i can release Redaxscript everytime as long the tests are passing
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:32
I've done some php in the past, a few years back, so it's a bit getting used to it again
also, I don't know if the pgsql and the mysql driver work in the same way; (i.e.: I don't know if pgsql also likes us to send a separate unix_socket or not)
Henry Ruhs
@redaxmedia
Jul 24 2015 22:36
searching for "pgsql:unix_socket" is resulting somethign on google
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:37
lgtm
Could you spot the syntax error in this?
self::configure('connection_string', 'mysql:' . 'unix_socket' . '=' . $dbHost . ';dbname=' . $dbName . ';charset=utf8');
Henry Ruhs
@redaxmedia
Jul 24 2015 22:39
the ' . ' between two strings is not needed
PHPcodesniffer will tell you :D
grunt phpcs
between mysql and unix_socket
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:40
any . between strings isn't really required, but still... I broke something, and don't yet know what
Henry Ruhs
@redaxmedia
Jul 24 2015 22:40
you missed the check for $dbSocket ? ....
unix_socket: ???
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:40
Explicitly removed it, because it wasn't working (so I wanted to make sure it wasn't because of the $dbSocket
Henry Ruhs
@redaxmedia
Jul 24 2015 22:41
just run grunt phpcs
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:43

It whines about

self::configure('connection_string', 'pgsql:' . $dbSocket ? 'unix_so    cket' : 'host' . '=' . $dbHost . ';dbname=' . $dbName . ';options=--client_encoding=    utf8');

that the . is optional here as well (and thereby should be removed). But if that's the case, we need something else... because the '=' can either go after the unix_socket, or after the host

Henry Ruhs
@redaxmedia
Jul 24 2015 22:44
ahhh
i think
try . ($dbSocket ? 'unix_socket' : 'host') .
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:45
(and if the = gets appended to host, but not to unix_socket...
Henry Ruhs
@redaxmedia
Jul 24 2015 22:45
i think just a (...) is missing
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:47
Not sure what's failing here... docker really does not want me to find the problem here
Henry Ruhs
@redaxmedia
Jul 24 2015 22:48
all right, let me do try it on my localhost
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:49
it somehow crashes after presenting the credentials on the install.php screen
(return error 500)
Henry Ruhs
@redaxmedia
Jul 24 2015 22:49
you dont have to open install.php
just run phpunit
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:49
he says it's fine; so perhaps it's a runtime error after all
Henry Ruhs
@redaxmedia
Jul 24 2015 22:51
grunt phpunit --testsuite=mysql
did you run that?
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:51

looks like the database wasn't happy after all


Notice: Undefined variable: argv in /var/www/public/install.php on line 17

Notice: Undefined index: d_type in /var/www/public/install.php on line 297

Notice: Undefined index: d_host in /var/www/public/install.php on line 298

Notice: Undefined index: d_name in /var/www/public/install.php on line 299

Notice: Undefined index: d_user in /var/www/public/install.php on line 300

Notice: Undefined index: d_password in /var/www/public/install.php on line 301

Notice: Undefined index: d_prefix in /var/www/public/install.php on line 302

Notice: Undefined index: d_salt in /var/www/public/install.php on line 303

Notice: Undefined index: name in /var/www/public/install.php on line 304

Notice: Undefined index: user in /var/www/public/install.php on line 305

Notice: Undefined index: password in /var/www/public/install.php on line 306

Notice: Undefined index: email in /var/www/public/install.php on line 307

Notice: Undefined index: install_post in /var/www/public/install.php on line 330
string(27) "/var/run/mysqld/mysqld.sock" 
Notice: Undefined index: //redax.huperwebs.nl/logged_in in /var/www/public/includes/startup.php on line 66

Notice: Undefined index: //redax.huperwebs.nl/attack_blocked in /var/www/public/includes/startup.php on line 67

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'redaxscript_demo.redaxsettings' doesn't exist' in /var/www/public/libraries/ORM.php:429 Stack trace: #0 /var/www/public/libraries/ORM.php(429): PDOStatement->execute() #1 /var/www/public/libraries/ORM.php(1828): ORM::_execute('SELECT * FROM `...', Array, 'default') #2 /var/www/public/libraries/ORM.php(638): ORM->_run() #3 /var/www/public/libraries/ORM.php(649): ORM->_find_many() #4 /var/www/public/libraries/ORM.php(625): ORM->find_result_set() #5 [internal function]: ORM->find_many() #6 /var/www/public/libraries/ORM.php(2183): call_user_func_array(Array, Array) #7 /var/www/public/includes/Db.php(155): ORM->__call('findMany', Array) #8 /var/www/public/includes/Db.php(155): Redaxscript\Db->findMany() #9 /var/www/public/includes/migrate.php(161): Redaxscript\Db::getSettings('charset') #10 /var/www/public/includes/startup.php(73): s('charset') #11 /var/www/public/includes/bootstrap.php(26): startup() #12 /va in /var/www/public/libraries/ORM.php on line 429

That testsuite has some connection issues

(which I'm fixing, but not sure where to start)
Henry Ruhs
@redaxmedia
Jul 24 2015 22:53
i get PDOException: invalid data source name
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:54
that's a strange exception
Henry Ruhs
@redaxmedia
Jul 24 2015 22:56
let me test something more, i will find it
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:56
Running "phpunit:development" (phpunit) task
Starting phpunit (target: development) in tests/includes
MySQL - string(9) "localhost"
string(52) "mysql:unix_socket=localhost;dbname=test;charset=utf8"
Fatal error: Command failed: PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket 'localhost' (2)' in /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php:258
Stack trace:
#0 /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php(258): PDO->__construct('mysql:unix_sock...', 'root', 'test', NULL)
#1 /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php(391): ORM::_setup_db('default')
#2 [internal function]: ORM::raw_execute('DROP TABLE IF E...')
#3 /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php(2208): call_user_func_array(Array, Array)
#4 /tmp/redaxscript/includes/Installer.php(271): ORM::__callStatic('rawExecute', Array)
#5 /tmp/redaxscript/includes/Installer.php(271): Redaxscript\Db::rawExecute('DROP TABLE IF E...')
#6 /tmp/redaxscript/includes/Installer.php(64): Redaxscript\Installer->_rawExecute('drop', 'mysql')
#7 /tmp/redaxscript/tests/bootstrap.php(61): Redaxscript\Installer->rawDrop()
#8 /tmp/redaxscript/vendor/phpunit/phpunit/src/Util/Fileloader.php(58): include_once('/tmp/redax in /tmp/redaxscript/vendor/j4mie/idiorm/idiorm.php on line 258
Also a bit weird... Seems like it's sending localhost as it's unix_socket now
Henry Ruhs
@redaxmedia
Jul 24 2015 22:57
this is what i defined inside the tests i guess
but within localhost is no .socket ?
so it should not use that
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:58
correct
Henry Ruhs
@redaxmedia
Jul 24 2015 22:58
or you hard coded it somewhere
Etienne Bruines
@EtienneBruines
Jul 24 2015 22:59
I think I'll spend some time the next few days, setting up an actual php environment.... changed the code server-side (which doesn't have grunt), and not locally (where I ran grunt)
Running "phpunit:development" (phpunit) task
Starting phpunit (target: development) in tests/includes
MySQL - string(9) "localhost"
string(45) "mysql:host=localhost;dbname=test;charset=utf8"
PHPUnit 4.6.6 by Sebastian Bergmann and contributors.

...............................................................  63 / 489 ( 12%)
..................................string(9) "localhost"
.string(9) "localhost"
.string(9) "localhost"
........................... 126 / 489 ( 25%)
............................................................... 189 / 489 ( 38%)
............................................................... 252 / 489 ( 51%)
............................................................... 315 / 489 ( 64%)
............................................................... 378 / 489 ( 77%)
............................................................... 441 / 489 ( 90%)
................................................

Time: 2.71 seconds, Memory: 12.75Mb

OK (489 tests, 496 assertions)

Done, without errors.
Seems like your implementation works, when adding the ()
Which is a lot more positive than that sounded. ;)
Henry Ruhs
@redaxmedia
Jul 24 2015 23:03
i still get errors, haha... but ok
Etienne Bruines
@EtienneBruines
Jul 24 2015 23:04
invalid data source name; do you have a database called test?
You did fix the semicolon, and haven't got something like this?
Henry Ruhs
@redaxmedia
Jul 24 2015 23:07
looks like something is broken with my mysql, right
i just push my changes now, ok
pgsql is working
Etienne Bruines
@EtienneBruines
Jul 24 2015 23:10
that's nice, as I don't have pgsql installed yet to test it
is this like your code?
Etienne Bruines
@EtienneBruines
Jul 24 2015 23:11
Yes
Henry Ruhs
@redaxmedia
Jul 24 2015 23:11
all right, please do some testing with it and report me
i have to sleep now, otherwise my gf kills me^^
Etienne Bruines
@EtienneBruines
Jul 24 2015 23:12
hehe, sure thing. :O it's already one
Henry Ruhs
@redaxmedia
Jul 24 2015 23:12
you can close the HTTPS issue if it is invalid
yeah it is really late
Etienne Bruines
@EtienneBruines
Jul 24 2015 23:12
I'll check on it, and close if it's indeed invalid
I'd say goodnight then ;)
Henry Ruhs
@redaxmedia
Jul 24 2015 23:12
see you later, i hope you enjoy Redaxscript
n8