PHPSimpl 0.8.5 Feature Release

7 views
Skip to first unread message

Nick DeNardis

unread,
Mar 9, 2008, 9:26:08 AM3/9/08
to PHPSimpl
Long awaited features now implemented. Main highlights include cross
database join's. Functions on DisplayList() fields and a way to change
where the required indicator (*) is on forms and the character that is
displayed after the label.

A rundown of the complete changes include:

* Updated example
* Completely rewritten Export class with CVS, JSON, XML and SQL
support
* Export() function on DbTemplate for seamless exporting
* Removed the requirement to have DB_DEFAULT defined
* DisplayList() now places a   for NULL table values for IE
border support
* GetList() and Join() now support cross database queries
* Added the "required" class to the field items that are required
* DisplayList() $options can now take a function name as a value for
a field.
* Added the DateTimeDiff() function to the global functions to
produce a human readable "time ago" output.
* Added a type of "settings" for forms to manipulate the Form::Form()
function output.
* A few bug fixes.

This is a Recommended Update

PHPSimpl 0.8.5 (100Kb)
- http://phpsimpl.googlecode.com/files/phpsimpl-0.8.5.zip

Install Guide
- http://code.google.com/p/phpsimpl/wiki/Installation

API and Examples
- http://code.google.com/p/phpsimpl/wiki/BaseClasses

marion

unread,
Mar 12, 2008, 10:22:12 PM3/12/08
to PHPSimpl
hi nick
looking forward to looking at your script.
marion

marion

unread,
Mar 12, 2008, 11:27:44 PM3/12/08
to PHPSimpl
hi nick
cant work out the config.php
QUESTION
what should i put in
// Where things are sitting the DIR_ABS
thankyou for your time
mairon

// Always Include trailing slash "/" in Direcories
define('DIR_ABS','/usr/local/www/http://www.parentsawake.com/');
define('WS_SIMPL','simpl/');
define('WS_SIMPL_IMAGE','img/');
define('WS_SIMPL_INC','inc/');
define('WS_SIMPL_CSS','css/');
define('WS_SIMPL_JS','js/');
define('WS_CACHE','cache/');
define('FS_SIMPL',DIR_ABS . WS_SIMPL);
define('FS_CACHE',FS_SIMPL . WS_CACHE);

marion

unread,
Mar 12, 2008, 11:45:13 PM3/12/08
to PHPSimpl
hi again nick
these are the error messages
http://www.parentsawake.com/simpl/simpl.php


Warning: include_once(DIR_ABSsimpl/config.php) [function.include-
once]: failed to open stream: No such file or directory in /home/
parents/public_html/simpl/simpl.php on line 6

Warning: include_once() [function.include]: Failed opening
'DIR_ABSsimpl/config.php' for inclusion (include_path='.:/usr/lib/php:/
usr/local/lib/php:/usr/bin/convert:/home/parents/php') in /home/
parents/public_html/simpl/simpl.php on line 6

Warning: include_once(FS_SIMPLfunctions.php) [function.include-once]:
failed to open stream: No such file or directory in /home/parents/
public_html/simpl/simpl.php on line 9

Warning: include_once() [function.include]: Failed opening
'FS_SIMPLfunctions.php' for inclusion (include_path='.:/usr/lib/php:/
usr/local/lib/php:/usr/bin/convert:/home/parents/php') in /home/
parents/public_html/simpl/simpl.php on line 9

Warning: include_once(FS_SIMPLmain.php) [function.include-once]:
failed to open stream: No such file or directory in /home/parents/
public_html/simpl/simpl.php on line 12

Warning: include_once() [function.include]: Failed opening
'FS_SIMPLmain.php' for inclusion (include_path='.:/usr/lib/php:/usr/
local/lib/php:/usr/bin/convert:/home/parents/php') in /home/parents/
public_html/simpl/simpl.php on line 12

Fatal error: Class 'Simpl' not found in /home/parents/public_html/
simpl/simpl.php on line 15

Nick DeNardis

unread,
Mar 13, 2008, 6:25:37 AM3/13/08
to phps...@googlegroups.com
Marion,
Have you taken a look at the example that is included with PHPSimpl?
the DIR_ABS is the actual file system path to the web viewable
directory of your site. Try putting this line at the top of your php
file and see what it displays: "print_r($_SERVER["DOCUMENT_ROOT"]);"

You could also try this to make it variable throughout multiple sites
on your server if you are in a shared hosting environment
define('DIR_ABS', $_SERVER["DOCUMENT_ROOT"] . '/');


// Always Include trailing slash "/" in Direcories
define('DIR_ABS','/usr/local/www/http://www.parentsawake.com/');
define('WS_SIMPL','simpl/');
define('WS_SIMPL_IMAGE','img/');
define('WS_SIMPL_INC','inc/');
define('WS_SIMPL_CSS','css/');
define('WS_SIMPL_JS','js/');
define('WS_CACHE','cache/');
define('FS_SIMPL',DIR_ABS . WS_SIMPL);
define('FS_CACHE',FS_SIMPL . WS_CACHE);

--
Nick D.

marion

unread,
Mar 13, 2008, 6:51:59 AM3/13/08
to phps...@googlegroups.com
hi nick
thankyou,  yes, have been attempting also with the example - i know i will get this to work with your assistance.
how long are you online for? approx?
 
marion

Nick DeNardis

unread,
Mar 13, 2008, 6:53:51 AM3/13/08
to phps...@googlegroups.com
I will be on and off the computer all day and will be able to respond
to your questions if you need further assistance.

--
Nick D.

marion

unread,
Mar 13, 2008, 7:00:34 AM3/13/08
to PHPSimpl
ok, thankyou ... it is 9 pm here, and will be successful soon in
getting this to work for me ...

On Mar 13, 8:53 pm, "Nick DeNardis" <nick.denar...@gmail.com> wrote:
> I will be on and off the computer all day and will be able to respond
> to your questions if you need further assistance.
>
>
>
> On Thu, Mar 13, 2008 at 6:51 AM, marion <mar...@spiderweb.com.au> wrote:
>
> > hi nick
> > thankyou, yes, have been attempting also with the example - i know i will
> > get this to work with your assistance.
> > how long are you online for? approx?
>
> > marion
>

marion

unread,
Mar 13, 2008, 7:03:57 AM3/13/08
to PHPSimpl
re:the example folder
what do you recommend?
do i place the files into the simpl folder or do i upload it as is
into the root folder, so it is on the same level as the simpl folder?

On Mar 13, 8:53 pm, "Nick DeNardis" <nick.denar...@gmail.com> wrote:
> I will be on and off the computer all day and will be able to respond
> to your questions if you need further assistance.
>
>
>
> On Thu, Mar 13, 2008 at 6:51 AM, marion <mar...@spiderweb.com.au> wrote:
>
> > hi nick
> > thankyou, yes, have been attempting also with the example - i know i will
> > get this to work with your assistance.
> > how long are you online for? approx?
>
> > marion
>
> Nire:ck D.

Nick DeNardis

unread,
Mar 13, 2008, 7:13:08 AM3/13/08
to phps...@googlegroups.com
Root folder would be best, also remember so run the .sql file in the
example folder to create the tables in your MySQL database and to edit
the define.php with your database information.

--
Nick D.

marion

unread,
Mar 13, 2008, 7:17:29 AM3/13/08
to PHPSimpl
i have created test.php and uploaded to example folder.
in the test.php is

<?php
print_r($_SERVER["DOCUMENT_ROOT"]);
?>

the output is:

/home/parents/public_html

=============================

marion

unread,
Mar 13, 2008, 7:19:42 AM3/13/08
to PHPSimpl
ok, have uplooaded example folder into the root, same level as simpl
folder
and have run the .sql file in the example folder - the table have been
created.

Nick DeNardis

unread,
Mar 13, 2008, 7:37:01 AM3/13/08
to phps...@googlegroups.com
Okay so now edit the define.php with you db connection settings at the bottom of the file. The go to http://yoursite.com/examples but replace your site.com with your domain. You should see the example blog.
Sent from my BlackBerry® wireless device

-----Original Message-----
From: marion <mar...@spiderweb.com.au>

Date: Thu, 13 Mar 2008 04:19:42
To:PHPSimpl <phps...@googlegroups.com>
Subject: Re: PHPSimpl 0.8.5 Feature Release

marion

unread,
Mar 13, 2008, 7:38:29 AM3/13/08
to PHPSimpl
this is what i have in define.php (in example folder)
i will give it a go ...
yes, have uploaed define.php
the header looks promising

http://www.parentsawake.com/examples/inc/header.php

=============
PS. is this correct?
define('ADDRESS', 'http://' . $_SERVER['parentsawake.com/'] . '/
examples/');
define('TITLE', 'PHPSimpl Blog');
----------------------------------------------------
<?php
$mode = 'dev';

switch ($mode){
case 'production':
// Simpl Config
define('LOGGING', true);
define('DEBUG', false);
define('DEBUG_QUERY', false);
define('DEBUG_LOG', false);
define('USE_CACHE', true);
define('USE_ENUM', true);
define('QUERY_CACHE', true);
define('DB_SESSIONS', true);

break;
case 'dev':
case 'testing':
default:
// Simpl Config
define('LOGGING', true);
define('DEBUG', false);
define('DEBUG_QUERY', false);
define('DEBUG_LOG', true);
define('USE_CACHE', true);
define('USE_ENUM', true);
define('QUERY_CACHE', false);
define('DB_SESSIONS', false);

break;
}

// Basic Information
define('ADDRESS', 'http://' . $_SERVER['parentsawake.com/'] . '/
examples/');
define('TITLE', 'PHPSimpl Blog');

// Directories
// Always Include trailing slash "/" in Direcories
define('DIR_ABS', $_SERVER["DOCUMENT_ROOT"] . '/');
define('DIR_INC', 'inc/');
define('DIR_CSS', 'css/');
define('DIR_MANAGER', 'manager/');

// Simpl Directories
define('FS_SIMPL', DIR_ABS . 'simpl/');
define('FS_CACHE', DIR_ABS . 'cache/');


// Database Connection Options
define('DB_USER', 'parents_abc');
define('DB_PASS', 'inthegarden123');
define('DB_HOST', 'localhost');
define('DB_DEFAULT', 'simpl_example');
?>

marion

unread,
Mar 13, 2008, 7:56:21 AM3/13/08
to PHPSimpl
define('DB_USER', 'parents_abc');
define('DB_PASS', 'inthegarden123');
define('DB_HOST', 'localhost');
define('DB_DEFAULT', 'simpl_example');

define('DB_DEFAULT', 'simpl_example'); ======== is this correct?
define('DB_DEFAULT', 'parents_abc''); ========- or should it be
the name of my database? as

> Okay so now edit the define.php with you db connection settings at the bottom of the file. The go tohttp://yoursite.com/examplesbut replace your site.com with your domain. You should see the example blog.

Nick DeNardis

unread,
Mar 13, 2008, 7:58:48 AM3/13/08
to phps...@googlegroups.com
You should not have to change anything except the db info
Sent from my BlackBerry® wireless device

-----Original Message-----
From: marion <mar...@spiderweb.com.au>

Date: Thu, 13 Mar 2008 04:38:29
To:PHPSimpl <phps...@googlegroups.com>
Subject: Re: PHPSimpl 0.8.5 Feature Release



marion

unread,
Mar 13, 2008, 8:00:54 AM3/13/08
to PHPSimpl
http://www.parentsawake.com/examples/

this is what i am seeing at the moment ...
---------------------------------------------------------

Warning: include_once(/home/parents/public_html/inc/classes.php)
[function.include-once]: failed to open stream: No such file or
directory in /home/parents/public_html/examples/inc/
application_top.php on line 10

Warning: include_once() [function.include]: Failed opening '/home/
parents/public_html/inc/classes.php' for inclusion (include_path='.:/
usr/lib/php:/usr/local/lib/php:/usr/bin/convert:/home/parents/php')
in /home/parents/public_html/examples/inc/application_top.php on line
10

Fatal error: Class 'Post' not found in /home/parents/public_html/
examples/index.php on line 6


> Okay so now edit the define.php with you db connection settings at the bottom of the file. The go tohttp://yoursite.com/examplesbut replace your site.com with your domain. You should see the example blog.

marion

unread,
Mar 13, 2008, 8:13:49 AM3/13/08
to PHPSimpl
what is this setting for?
define('DB_DEFAULT', 'simpl_example');

is it the name of my database?

Nick DeNardis

unread,
Mar 13, 2008, 8:19:30 AM3/13/08
to phps...@googlegroups.com
Yup, it is the name of the database you ran the .sql file on. When you
load the page it will connect to the server and select that database.

On Thu, Mar 13, 2008 at 8:13 AM, marion <mar...@spiderweb.com.au> wrote:
>
> what is this setting for?
>
> define('DB_DEFAULT', 'simpl_example');
>
> is it the name of my database?
>
>
>
> On Mar 13, 9:58 pm, "Nick DeNardis" <nick.denar...@gmail.com> wrote:
> > You should not have to change anything except the db info

> > Sent from my BlackBerry(R) wireless device

--
Nick D.

marion

unread,
Mar 13, 2008, 8:30:48 AM3/13/08
to PHPSimpl
You should not have to change anything except the db info

ok, i have reuploaded define.php
the only two lines i have changed are:

define('DB_USER', 'parents_abc');
define('DB_PASS', 'inthegarden123');


RESULT:
still error messages on http://www.parentsawake.com/examples/
---------------------------
Warning: include_once(/home/parents/public_html/inc/classes.php)
[function.include-once]: failed to open stream: No such file or
directory in /home/parents/public_html/examples/inc/
application_top.php on line 10

Warning: include_once() [function.include]: Failed opening '/home/
parents/public_html/inc/classes.php' for inclusion (include_path='.:/
usr/lib/php:/usr/local/lib/php:/usr/bin/convert:/home/parents/php')
in /home/parents/public_html/examples/inc/application_top.php on line
10

Fatal error: Class 'Post' not found in /home/parents/public_html/
examples/view.php on line 6
----------------------------------------
QUESTION: is this note by other user relevent to this release?

Good example! Thank you. Finally got it going. Had to comment out:
... include_once(DIR_INC . 'functions.php');
in the "application_top.php" file.

http://groups.google.com/group/phpsimpl/browse_thread/thread/8174a7e0f24a35a7#

===========
define('DB_DEFAULT', 'parents_abc');
?>

Nick DeNardis

unread,
Mar 13, 2008, 8:35:56 AM3/13/08
to phps...@googlegroups.com
Hmm.. it seems the with the DIR_ABS, try replacing it with this line.

define('DIR_ABS', $_SERVER["DOCUMENT_ROOT"] . '/examples/');

--
Nick D.

marion

unread,
Mar 13, 2008, 8:39:45 AM3/13/08
to PHPSimpl

Yup, it is the name of the database you ran the .sql file on. When
you
load the page it will connect to the server and select that database.
--------------------
ok , have changed that database name setting also ... and uploaded...

by the error messages, it still does not appear to be connecting ...
still appears n

marion

unread,
Mar 13, 2008, 8:59:26 AM3/13/08
to PHPSimpl

Hmm.. it seems the with the DIR_ABS, try replacing it with this line.
--------------------------
ok have tried replacing it - have tried 2 diffferent codes in that
line

define('DIR_ABS', $_SERVER["DOCUMENT_ROOT"] . '/');

Nick DeNardis

unread,
Mar 13, 2008, 9:07:43 AM3/13/08
to phps...@googlegroups.com
Okay I see whats up, Change this define:
define('FS_SIMPL', DIR_ABS . '../simpl/');

Make sure PHPSimpl is uploaded to:
/home/parents/public_html/simpl/

It was just looking for simpl inside the /examples folder. Make sure
you have this for your DIR_ABS:


define('DIR_ABS', $_SERVER["DOCUMENT_ROOT"] . '/examples/');

--
Nick D.

marion

unread,
Mar 13, 2008, 9:21:45 AM3/13/08
to PHPSimpl
Okay I see whats up, Change this define:
define('FS_SIMPL', DIR_ABS . '../simpl/');

Make sure PHPSimpl is uploaded to:
/home/parents/public_html/simpl/

It was just looking for simpl inside the /examples folder. Make sure
you have this for your DIR_ABS:
define('DIR_ABS', $_SERVER["DOCUMENT_ROOT"] . '/examples/');
=====================
1. ok, have
changed
define('FS_SIMPL', DIR_ABS . 'simpl/');
to
define('FS_SIMPL', DIR_ABS . '../simpl/');

2, yes,
PHPSimpl is uploaded to:
/home/parents/public_html/simpl/

3. yes, IN EXAMPLE/INC folder, i have in define.php for the
DIR_ABS:
define('DIR_ABS', $_SERVER["DOCUMENT_ROOT"] . '/examples/');
===========================
EUREKA, you have found it !....

now the message is

1046 - No database selected

SELECT * FROM `post` LIMIT 1
----------------------------------------
QUESTION
is this what is meant to be ???

Nick DeNardis

unread,
Mar 13, 2008, 9:24:00 AM3/13/08
to phps...@googlegroups.com
It has something to do with the DB_ define's, are you sure DB_DEFAULT
is set to the database you ran the .sql file on? It looks like it is
not selecting the database.

--
Nick D.

marion

unread,
Mar 13, 2008, 9:30:19 AM3/13/08
to PHPSimpl


On Mar 13, 11:24 pm, "Nick DeNardis" <nick.denar...@gmail.com> wrote:
It has something to do with the DB_ define's, are you sure DB_DEFAULT
is set to the database you ran the .sql file on? It looks like it is
not selecting the database.

YES! it is working see
http://www.parentsawake.com/examples/

my apologies ... i made a stupid change
DB_DEFAULT
i had changed to
DB_NAME

marion

unread,
Mar 13, 2008, 9:41:14 AM3/13/08
to PHPSimpl
congratulations, you were able to make it work for me ....

re simpl FOLDER
WHAT do i change in th config.php
??? i have posted the original here ...
----------------------
<?php
// Debug everything, set only if you need to know exactly what is
going on
define('DEBUG', false);
// Debug only raw queies
define('DEBUG_QUERY', false);
// Store all the debug info in a debug log file
define('DEBUG_LOG', false);
// Use a file cache to store the data structures (recommended)
define('USE_CACHE', true);
// Pull the ENUM data from database as options (only use if your
tables have ENUM data)
define('USE_ENUM', false);
// Cache query results to a file for faster re-queries
define('QUERY_CACHE', false);
// Store the session data in a table (import the table from the
examples)
define('DB_SESSIONS', false);

// Where things are sitting
// Always Include trailing slash "/" in Direcories
define('DIR_ABS','./');
define('WS_SIMPL','simpl/');
define('WS_SIMPL_IMAGE','img/');
define('WS_SIMPL_INC','inc/');
define('WS_SIMPL_CSS','css/');
define('WS_SIMPL_JS','js/');
define('WS_CACHE','cache/');
define('FS_SIMPL',DIR_ABS . WS_SIMPL);
define('FS_CACHE',FS_SIMPL . WS_CACHE);

// Database Connection Option
define('DB_USER',DBUSER);
define('DB_HOST',DBHOST);
define('DB_PASS',DBPASS);
define('DB_DEFAULT', NULL);
?>

-------------------

On Mar 13, 11:24 pm, "Nick DeNardis" <nick.denar...@gmail.com> wrote:

Nick DeNardis

unread,
Mar 13, 2008, 9:43:33 AM3/13/08
to phps...@googlegroups.com
You dont have to change anything inside there, each application you
make on the site should have its own define.php like the example does
and anything inside there will overwrite what Simpl has in its config.

--
Nick D.

marion

unread,
Mar 13, 2008, 9:49:18 AM3/13/08
to PHPSimpl
You dont have to change anything inside there, each application you
make on the site should have its own define.php like the example does
and anything inside there will overwrite what Simpl has in its
config.
=====
ok, thankyou,
so is this correct ? the following link ...

QUESTION
1 is it meant to have error messages??

http://www.parentsawake.com/simpl/simpl.php

2 do i basically leave the simpl FOLDER alone ...

and if i want another application i, create it in the manner of
EXAMPLES, i use simpler AS IT IS, for the basic engine so to speak

Nick DeNardis

unread,
Mar 13, 2008, 9:52:36 AM3/13/08
to phps...@googlegroups.com
Yea you can just leave the simpl folder as is, for each application
you just have to include it like:
http://code.google.com/p/phpsimpl/wiki/Installation

You dont need to access the simpl folder from the web, it needs to be
included into an application like the example.

--
Nick D.

marion

unread,
Mar 13, 2008, 10:02:22 AM3/13/08
to PHPSimpl
Yea you can just leave the simpl folder as is, for each application
you just have to include it like:http://code.google.com/p/phpsimpl/
wiki/Installation

You dont need to access the simpl folder from the web, it needs to be
included into an application like the example.
------------------
ok, all understood,

QUESTION
the fix that you found tonight ie change line

define('FS_SIMPL', DIR_ABS . '../simpl/');

Will that apply to everyone, ie will you change the download file
accordingly?

wish me luck ...
i am about to have a go at an application - small - just viewing ALL
users in a table with link to their profile ...

Nick DeNardis

unread,
Mar 13, 2008, 10:08:40 AM3/13/08
to phps...@googlegroups.com
Yea i will update it in SVN right now.

--
Nick D.

marion

unread,
Mar 13, 2008, 10:19:08 AM3/13/08
to PHPSimpl
thankyou nick
you must feel a tremendous sense of achievement having created
simpl ...

and i am wondering if you could put a clear note in installation
notes
eg so that people know WHERE to put the folders ....

1. upload simpl into webroot.
2. upload examples in webroot.

and another NOTE about WHAT TO DO, if they want to place the FILES
into the webroot, rather than placing the FOLDERS into the webrrot.

marion

unread,
Mar 13, 2008, 10:26:57 AM3/13/08
to PHPSimpl
and another note about what to do if they want to place simpl BENEATH
webroot.
QUESTION
is there an advantage in place simpl BENEATH webroot?

Nick DeNardis

unread,
Mar 13, 2008, 11:13:05 AM3/13/08
to phps...@googlegroups.com
Thanks for the suggestion, we know the documentation is really
limited. We are open to suggestions also.

The advantage of having it below web root is that the files are not
accessible from the web, we recommend it be below the web root.

--
Nick D.

marion

unread,
Mar 13, 2008, 11:27:40 AM3/13/08
to PHPSimpl
The advantage of having it below web root is that the files are not
accessible from the web, we recommend it be below the web root.


ok, what do i need to change in order to have simpl BELOW webroot?

marion

unread,
Mar 13, 2008, 12:28:37 PM3/13/08
to PHPSimpl
hi again nick
QUESTION
do you happen to have already extended a user/author class for user/
author to be able to register/loginremember passwork/forgot password
etc?
i am still getting used to all this, so am not sure of correct
terminology ...

Nick DeNardis

unread,
Mar 14, 2008, 6:24:08 AM3/14/08
to phps...@googlegroups.com
To Move it below web root just move the simpl folder to:
/home/parents/simpl/

And change this define:
define('FS_SIMPL', '/home/parents/simpl/');

And you should be all set.

--
Nick D.

Nick DeNardis

unread,
Mar 14, 2008, 6:24:53 AM3/14/08
to phps...@googlegroups.com
We do not have one for distribution but we do have some written, I
will see if I can package one up to send to you.

--
Nick D.

marion

unread,
Mar 14, 2008, 7:14:33 AM3/14/08
to phps...@googlegroups.com
thankyou nick

marion

unread,
Mar 14, 2008, 7:15:21 AM3/14/08
to phps...@googlegroups.com
thankyou nick
Reply all
Reply to author
Forward
0 new messages