Re: [PHP] Unable to use exec() in php

2007-06-17 Thread Crayon Shin Chan
On Monday 18 June 2007 13:15, makhan wrote:

Stop top posting.

> I am also using shell_exec('matlab -r myscript') to run
> my matlab script.

Using shell_exec('matlab -r /path/to/myscript') would be a better idea.

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Controlling project version

2007-06-17 Thread Stut

Chris wrote:

That's odd since this is one of the major advantages that Subversion has
over CVS (for me at any rate). When you branch or tag in CVS it will sit
there and create a copy of every single file in the repository.
Depending on the size of your projects this can take a while.


Maybe it's just the whole structure thing I don't understand:

http://svnbook.red-bean.com/nightly/en/svn.tour.importing.html#svn.tour.importing.layout 


If you already have your project in subversion, how do you branch it?

Compare that to:

cvs tag -b "branch name" module_name

;)


Ok, this is where you need to understand the fundamental difference 
between how CVS and Subversion work. For CVS branching and tagging are 
operations in themselves. In Subversion they're just copies. How you 
layout your repository is up to you, but the recommended layout is 
usually used because you need somewhere in the repository to put 
branches and tags.


As for how to do it... think of it as simply copying files and it should 
make sense...


svn copy svn+ssh://server/repos/trunk svn+ssh://server/repos/tags/mytag

So, that wasn't too hard was it? It's different to CVS, and it does 
require that you think about your repositories in a slightly different 
way, but to me it's a lot more flexible and it's definitely more 
efficient than CVS. But it's all down to personal choice.


-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Controlling project version

2007-06-17 Thread Chris



I fail to see the difference between "just a script" and "a proper
program", but regardless...


I think of a "script" as something like a firewall script - where-as 
cvs/subversion have a bunch of different commands to do different things.


All interpretation I guess :P


I use cvs at work (because it was more mature at the time I set it up)
and subversion at home.


CVS wraps RCS, so you have used it!


OK I haven't used RCS *directly* - Happy? ;)


I don't like the branching in subversion, it's a lot easier to work with
in CVS.


That's odd since this is one of the major advantages that Subversion has
over CVS (for me at any rate). When you branch or tag in CVS it will sit
there and create a copy of every single file in the repository.
Depending on the size of your projects this can take a while.


Maybe it's just the whole structure thing I don't understand:

http://svnbook.red-bean.com/nightly/en/svn.tour.importing.html#svn.tour.importing.layout

If you already have your project in subversion, how do you branch it?

Compare that to:

cvs tag -b "branch name" module_name

;)

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unable to use exec() in php

2007-06-17 Thread Jim Lucas

makhan wrote:

Thanks jim for your reponse , from no success means I am not able to get any
output. I am also using shell_exec('matlab -r myscript') to run my matlab
script. I see a new matlab.exe process starting in the windows task manager.
And the browser keeps busy trying to open this php page. 


I have made my matlab script to write on a text file but this file is never
created.



Try this




This should return to you any output that the program may have.

You might have to look into redirecting your standard out and your 
standard error


Jim





Jim Lucas-2 wrote:

makhan wrote:
Hi 


I am using exec() funtions to run simple commands like exec('date') in
php
without any success. I am using apache on my windows system. Can someno
guid
me what could be wrong.

I have checked the php.ini file and its not in the safe mode.

"without any success"

What exactly does this mean?

You get no output? Read this: and read up on the second argument.

http://us2.php.net/manual/en/function.exec.php

Jim

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php








--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Unknown

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Controlling project version

2007-06-17 Thread Stut
Chris wrote:
> Miguel Vaz wrote:
>>
>> Hi,
>>
>> I recently finished a project for our local city hall and some
>> people asked me to do some version control for future updates. They
>> suggested the use of a linux script called Recursive Version Control,
>> which i never even heard anything about.
> 
> Sure you don't mean RCS ? http://www.gnu.org/software/rcs/ Never used it.

Sure you have, you just don't realise it.

>> What do you guys/girls use out there? Subversion? CVS? Is there a
>> point in using some linux script versus a "proper" program?
> 
> You won't get any sort of revision control with just a script, you need
> a "proper program" like either cvs or subversion or one of the others
> (some are commercial - eg bitkeeper).

I fail to see the difference between "just a script" and "a proper
program", but regardless...

> I use cvs at work (because it was more mature at the time I set it up)
> and subversion at home.

CVS wraps RCS, so you have used it!

> They are close enough that what you know in one will work in the other
> for the most part.
> 
> Subversion has a few more features (eg renaming a folder in the
> repository).

There's a little more to it than that. In CVS folders are not tracked at
all. In Subversion they are treated like files, and therefore have their
own history. One of the major effects of this is that you can have empty
folders in your repository - something I usually have in most of my
projects, but that CVS insisted on having a file inside before it would
retain the fact the folder exists.

> I don't like the branching in subversion, it's a lot easier to work with
> in CVS.

That's odd since this is one of the major advantages that Subversion has
over CVS (for me at any rate). When you branch or tag in CVS it will sit
there and create a copy of every single file in the repository.
Depending on the size of your projects this can take a while.

Subversion can create a tag or a branch instantly regardless of the size
of the repository. It does this by using a mechanism akin to pointers.
It doesn't actually create a copy of the files until you commit a change
in a tag or a branch.

Personally I used to use CVS until I discovered Subversion, and I've
never looked back. However, I am now looking forward and have recently
started playing with Git. Git is something of a paradigm shift when
compared to "traditional" source control, but the way it works is
starting to make a lot of sense to me. I suggest you include it in your
evaluations before deciding on a source control system.

http://git.or.cz/

-Stut

-- 
http://stut.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php script diagnostic app?

2007-06-17 Thread Paul Scott

On Mon, 2007-06-18 at 06:39 +0200, Paul Scott wrote:
> If you would like a more detailed HOWTO, please let me know, and I will
> write up something for you.

http://fsiu.uwc.ac.za/index.php?module=blog&action=viewsingle&postid=gen9Srv59Nme5_9262_1182142431&userid=3897070607

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Unable to use exec() in php

2007-06-17 Thread makhan

Thanks jim for your reponse , from no success means I am not able to get any
output. I am also using shell_exec('matlab -r myscript') to run my matlab
script. I see a new matlab.exe process starting in the windows task manager.
And the browser keeps busy trying to open this php page. 

I have made my matlab script to write on a text file but this file is never
created.



Jim Lucas-2 wrote:
> 
> makhan wrote:
>> Hi 
>> 
>> I am using exec() funtions to run simple commands like exec('date') in
>> php
>> without any success. I am using apache on my windows system. Can someno
>> guid
>> me what could be wrong.
>> 
>> I have checked the php.ini file and its not in the safe mode.
> 
> "without any success"
> 
> What exactly does this mean?
> 
> You get no output? Read this: and read up on the second argument.
> 
> http://us2.php.net/manual/en/function.exec.php
> 
> Jim
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Unable-to-use-exec%28%29-in-php-tf3937852.html#a11170086
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php script diagnostic app?

2007-06-17 Thread Paul Scott

On Sun, 2007-06-17 at 13:53 -0400, Robert Cummings wrote:
> I believe there are profiling tools... probably from Zend. How big is

I prefer using XDEBUG, which is totally free. You can install it from
the pecl repositories: pecl install xdebug

Then, you simply install it as an extension on your development machine,
and execute your scripts. A really nice feature of xdebug is that not
only does it give you detailed stack traces and things when stuff goes
wrong, but you can also do really excellent (and graphical) profiling in
combination with cachegrind (I use KCacheGrind on Ubuntu), which uses
GraphViz to make very interesting graphs of what your code is doing.

If you would like a more detailed HOWTO, please let me know, and I will
write up something for you.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Controlling project version

2007-06-17 Thread Chris

Miguel Vaz wrote:


Hi,

I recently finished a project for our local city hall and some 
people asked me to do some version control for future updates. They 
suggested the use of a linux script called Recursive Version Control, 
which i never even heard anything about.


Sure you don't mean RCS ? http://www.gnu.org/software/rcs/ Never used it.

What do you guys/girls use out there? Subversion? CVS? Is there a 
point in using some linux script versus a "proper" program?


You won't get any sort of revision control with just a script, you need 
a "proper program" like either cvs or subversion or one of the others 
(some are commercial - eg bitkeeper).


I use cvs at work (because it was more mature at the time I set it up) 
and subversion at home.


They are close enough that what you know in one will work in the other 
for the most part.


Subversion has a few more features (eg renaming a folder in the repository).

I don't like the branching in subversion, it's a lot easier to work with 
in CVS.


--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Controlling project version

2007-06-17 Thread Jim Lucas

Miguel Vaz wrote:


Hi,

I recently finished a project for our local city hall and some 
people asked me to do some version control for future updates. They 
suggested the use of a linux script called Recursive Version Control, 
which i never even heard anything about.


What do you guys/girls use out there? Subversion? CVS? Is there a 
point in using some linux script versus a "proper" program?


Would really appreciate some input on this. On everything works, 
etc. Thanks.



Miguel Vaz

well, since google know nothing of this "linux script", I would be less 
likely to use it versus a well know prog like CVS or Subversion.


I prefer CVS.

Since you are working with a completed project, for the most part, I 
would recommend CVS.


One major pitfall that could arise is if you needed to change a 
directory name.  It isn't too easy to do this with CVS, but it is fairly 
easy with Subversion.


Others may have different opinions about the two mentioned version 
control system, or suggest a different approach all together. But CVS is 
what I use, and it seems to work fine in all my projects just fine.


Jim

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Controlling project version

2007-06-17 Thread Larry Garfield
Never heard of RVC.  I use subversion both at work and for my personal stuff.  
Fairly easy to setup once you understand it, fairly easy to use, good command 
line and GUI tools to suit your preference.

On Sunday 17 June 2007, Miguel Vaz wrote:
>   Hi,
>
>   I recently finished a project for our local city hall and some
> people asked me to do some version control for future updates. They
> suggested the use of a linux script called Recursive Version Control,
> which i never even heard anything about.
>
>   What do you guys/girls use out there? Subversion? CVS? Is there a
> point in using some linux script versus a "proper" program?
>
>   Would really appreciate some input on this. On everything works, etc.
> Thanks.
>
>
>   Miguel Vaz


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Unable to use exec() in php

2007-06-17 Thread Jim Lucas

makhan wrote:
Hi 


I am using exec() funtions to run simple commands like exec('date') in php
without any success. I am using apache on my windows system. Can someno guid
me what could be wrong.

I have checked the php.ini file and its not in the safe mode.


"without any success"

What exactly does this mean?

You get no output? Read this: and read up on the second argument.

http://us2.php.net/manual/en/function.exec.php

Jim

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Controlling project version

2007-06-17 Thread Miguel Vaz


Hi,

	I recently finished a project for our local city hall and some 
people asked me to do some version control for future updates. They 
suggested the use of a linux script called Recursive Version Control, 
which i never even heard anything about.


	What do you guys/girls use out there? Subversion? CVS? Is there a 
point in using some linux script versus a "proper" program?


Would really appreciate some input on this. On everything works, etc. 
Thanks.


Miguel Vaz

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread Robert Cummings
On Sun, 2007-06-17 at 17:26 -0500, Larry Garfield wrote:
> On Sunday 17 June 2007, martins wrote:
> > So,
> > Much off topic, but ok.
> > 1. drupal are ok, but soo slow.. and I don't need CMS. I want to write
> > my own.
> >
> > The main reason I want write my own framework / project is performance.
> > Now I think to use postgresql, memcached, PDO, apc.
> 
> Three of those are independent of the framework per se.  APC can be used with 
> any serious PHP project.  memcached can be supported by many.  
> 
> And Drupal can support APC and memcached and postgresql just fine, 
> actually. :-)  That makes it fly.

Yep, fly like a chicken.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Unable to use exec() in php

2007-06-17 Thread makhan

Hi 

I am using exec() funtions to run simple commands like exec('date') in php
without any success. I am using apache on my windows system. Can someno guid
me what could be wrong.

I have checked the php.ini file and its not in the safe mode.
-- 
View this message in context: 
http://www.nabble.com/Unable-to-use-exec%28%29-in-php-tf3937852.html#a11168623
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: possible to "move_uploaded_file" to a variable instead a file?

2007-06-17 Thread Gregory Beaver
Mark wrote:
> hey,
> 
> i`m wondering if it`s possible to move a uploaded file inside a variable.
> i would like to know this because i`m currently writing a database backup
> script and in there the user uploads a sql file that gets executed. now i
> _don`t_ want the file to be stored on the server!! simply because that`s
> not
> safe. however i do want to store it inside a variable and than run the
> database query.
> 
> any idea`s on this?

Hi Mark,

Instead of move_uploaded_file($uploaded, $newlocation), use:



HOWEVER, what you are doing is a *really* bad idea regardless of where
you save the uploaded file.  No matter how much you trust your end
users, running SQL uploaded directly on the database is extremely dangerous.

Instead, you should define a simple set of questions based on the user
and the databases they have access to, i.e. a multi-select box that
allows the user to select which databases to backup, and possibly allow
an .ini file to be uploaded defining which tables in databases to back
up, and then from the .ini file construct the actual SQL that will be
run.  Your ini-to-sql script should also contain verification to ensure
that, for instance, the user is not requesting to "back up" the mysql
table and acquire all the people's accounts/passwords.

If the user wishes to back up the user_blah database, tables foo and
bar, your ini could be:

[user_blah]
tables = foo,bar

Or, for all:

[user_blah]
tables = *

Otherwise, you're just asking to get shot in the digital foot.

Good luck,
Greg

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] possible to "move_uploaded_file" to a variable instead a file?

2007-06-17 Thread Larry Garfield
I believe you can just fopen() and friends the file directly out of /tmp, or 
wherever the file gets put.  Just read the file itself into a string and have 
your way with it.  PHP will delete the temp file for you when the script 
ends.

On Sunday 17 June 2007, Mark wrote:
> hey,
>
> i`m wondering if it`s possible to move a uploaded file inside a variable.
> i would like to know this because i`m currently writing a database backup
> script and in there the user uploads a sql file that gets executed. now i
> _don`t_ want the file to be stored on the server!! simply because that`s
> not safe. however i do want to store it inside a variable and than run the
> database query.
>
> any idea`s on this?
>
> Thanx alot in favor,
> Mark


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] possible to "move_uploaded_file" to a variable instead a file?

2007-06-17 Thread Mark

hey,

i`m wondering if it`s possible to move a uploaded file inside a variable.
i would like to know this because i`m currently writing a database backup
script and in there the user uploads a sql file that gets executed. now i
_don`t_ want the file to be stored on the server!! simply because that`s not
safe. however i do want to store it inside a variable and than run the
database query.

any idea`s on this?

Thanx alot in favor,
Mark


[PHP] Re: pack vs. serialize

2007-06-17 Thread Abdullah Ramazanoglu
Nathan Nobbe dedi ki:

> all,
> 
> i have recently stumbled upon the
> packmethod.
> can this be used as a substitute for
> serialize
> ?
> if so, is there any rationalization for this; like would it perhaps
> create a more
> compact representation of the data or run more quickly?
> it looks like pack cannot be used on object as i didnt see object in the
> format listing;
> what would be a typical application of the pack method?

I've not used serialize(), but I think it packs its input into some
proprietary (internal) format best suited to handle as a single entity
(pass it to-fro, store it in database, etc.). Ergo, a serialized entity
cannot be used as it is - you need to unserialize it back before use.
OTOH, pack() returns the internal binary representation of its input as a
binary string. This may not always be the optimal way to handle a given
collection of data as in the case for serialize(), but it enables you to
access, use and manipulate internal representations of the data, be it
just a single variable or an assorted structure.

I once used pack to obtain a 128 bit long binary string (xor key for
rudimentary file encryption) by packing four 32-bit integers into a binary
string and then using it as the xor key. (FWIW, bitwise operations work
both on integers and "strings" - binary or otherwise.)

Kind regards,
-- 
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php script diagnostic app?

2007-06-17 Thread Daniel Brown

On 6/17/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Sun, 2007-06-17 at 13:35 -0400, MIKE YRABEDRA wrote:
>
> I was wondering if there was some kind of application that would process a
> php script, logging any functions (or classes) it encounters along the way.
> Logging times and memory use.
>
> I am trying to figure out what in a script slows it down so much.
>
> Any ideas?

I believe there are profiling tools... probably from Zend. How big is
your script? You might get away with using the microtime() function to
locate slow areas of code. Generally speaking I use it to binary
partition the code with echos of the current microtime() and narrow down
what I want to know.

Cheers,
Rob.
--
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




   You could check out xdebug, which is a real-time processor.  I use
it on two of my servers, and I'm actually pretty pleased with it.  If
you have a bug in your code that's multiple-functions- and
several-include-files-deep, it does pretty well about telling which
function (called by which function, etc.) in which file (included by
which file, etc.) caused the exception.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread Larry Garfield
On Sunday 17 June 2007, martins wrote:
> So,
> Much off topic, but ok.
> 1. drupal are ok, but soo slow.. and I don't need CMS. I want to write
> my own.
>
> The main reason I want write my own framework / project is performance.
> Now I think to use postgresql, memcached, PDO, apc.

Three of those are independent of the framework per se.  APC can be used with 
any serious PHP project.  memcached can be supported by many.  

And Drupal can support APC and memcached and postgresql just fine, 
actually. :-)  That makes it fly.  

> Need some help from experienced users! How to get done big project! Ok,
> thanks.

For what definition of "big"?  If you're developing something that actually 
needs APC and memcached, then you're looking at several months of time for 
the framework itself to develop, test, and benchmark for performance if 
you're already skilled and have experience with other similar systems.  If 
you have no prior experience with other systems (Drupal, Cake, Symfony, 
Propel, ezComponents, Zend Framework, whatever) then you're going to be 
coding yourself into oblivion and get nothing done.

I speak from experience. :-)

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread martins

So,
Much off topic, but ok.
1. drupal are ok, but soo slow.. and I don't need CMS. I want to write 
my own.


The main reason I want write my own framework / project is performance.
Now I think to use postgresql, memcached, PDO, apc.

Need some help from experienced users! How to get done big project! Ok, 
thanks.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread Nathan Nobbe

the best part about re-inventing the wheel is,
once youve re-invented it; its yours!

time is precious yes; but what happens when you get along using some lib and
you cant get it to do what you want?
you start writing weak code because you never learned how to write good code
in the first place, or you cant analyze
the code in the library because you dont understand the constructs theyve
used to build the library.
need i say design patterns?

obviously incorporating libraries into your codebase is an excellent way to
leverage working code, that theoretically is
well written.
that being said, i think w/ php, many people are still implementing home
grown solutions for 'frameworks' because there arent, or
isnt a defacto standard for php.  eg. if you hear people talk about java,
they will always mumble something about hibernate in a conversation about a
database abstraction layer.
why?  its solid, proven, capable, etc., etc.

to the author of the thread; if you want to write your own framework, i
suggest you start
studying:)

-nathan

On 6/17/07, Robert Cummings <[EMAIL PROTECTED]> wrote:


On Mon, 2007-06-18 at 02:55 +0800, Crayon Shin Chan wrote:
> On Monday 18 June 2007 02:12, Robert Cummings wrote:
>
> > Why not? You're argument is invalid.
>
> "You're" == "You are", which makes the above invalid, or at least
> nonsensical.

Typo... *yawn*. You knew what was intended. Feel free to comment on the
typo, but calling the statement nonsensical when the meaning was easy to
ascertain suggests you're either stupid or trolling. I'll presume the
latter, but feel free to correct me if it's the former.

> > It suggests that since solutions
> > already exist to a problem that we should lie down and leave things as
> > they are. Progress, and I'm not suggesting my personal projects have
> > caused much progress, progress can only be achieved by revisiting what
> > exists and either attempting to improve upon them, or attempting to
> > create a new approaches.
>
> I didn't say anything to that effect.

You implied it.

>  What I _would_ like to see is that
> people stuffed their hubris

Don't confuse pursuit of happiness and personal satisfaction as hubris.
They are quite different and you can't glean hubris simply from reading
that someone wants to write their own framework. You are jumping to
conclusions.

>  and get into the spirit of free software.

I have no problems with the philosophy of free software, but I do have
issues when someone suggests that we should all follow, like sheep to
the slaughter, a particular worldview. What you "_would_ like" and what
you "will get" is entirely up to individual in question.

> Instead of starting "Yet Another Soon To Be Neglected Sourceforge
> Project"

You presume the use of SourceForge to host such a project. Granted, you
probably meant "Yet Another Soon To Be Neglected Project", but that
doesn't excuse you from once again presuming it will be neglected. A
project used by *1* person, no matter how useless YOU think it is, is
not neglected by that person. Popularity hardly constitutes a
measurement of quality.

>  people should shop around and find a project which most closely
> matches their vision and start contributing their bright ideas to it.

People can and do shop around when they want to. This should not stop
anyone who wants to create their own project from doing so. People have
free will, biases, opinions, ideas, goals and as such can pursue
fulfilment as they please. While it can be nice that they might
contribute their bright ideas to some other project, they are in no way
obligated to do so. If their ideas are bright enough then chances are
they will attract their own following.

> Of course history is full of lone inventors pottering about in their
spare
> time coming up with earth-shattering discoveries. But the fact is that
> today, most science and breakthroughs are done by teams working
> collaboratively.

Maybe so, but much science and many breakthroughs are still done by the
lone inventory/researcher. You cannot discount the merit of one person's
contribution because you think they should have another work
style/ethic.

> Now going back to the OP:
>
> "...can some body help me, how to start php framwork for large site?",
in
> the absence of any other cues, this question gives me the impression
that
> the questioner is completely clueless (sorry if it offends you OP), to
> which the only sensible response is "to use a variety of existing
> frameworks until you no longer need to ask the question".

Actually from the OP's statement I see that he wants clues on how to
st

Re: [PHP] if test

2007-06-17 Thread Stut

Jochem Maas wrote:

jekillen wrote:

Hello again;
does the following test pass if the file is successfully included:
if( include( some file ) )

or does it pass with:
if( ! include( some file ) )


have you tried it?


Or, better yet, looked in the manual?

http://php.net/include

-Stut

--
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread Robert Cummings
On Mon, 2007-06-18 at 02:55 +0800, Crayon Shin Chan wrote:
> On Monday 18 June 2007 02:12, Robert Cummings wrote:
> 
> > Why not? You're argument is invalid.
> 
> "You're" == "You are", which makes the above invalid, or at least 
> nonsensical.

Typo... *yawn*. You knew what was intended. Feel free to comment on the
typo, but calling the statement nonsensical when the meaning was easy to
ascertain suggests you're either stupid or trolling. I'll presume the
latter, but feel free to correct me if it's the former.

> > It suggests that since solutions 
> > already exist to a problem that we should lie down and leave things as
> > they are. Progress, and I'm not suggesting my personal projects have
> > caused much progress, progress can only be achieved by revisiting what
> > exists and either attempting to improve upon them, or attempting to
> > create a new approaches.
> 
> I didn't say anything to that effect.

You implied it.

>  What I _would_ like to see is that 
> people stuffed their hubris

Don't confuse pursuit of happiness and personal satisfaction as hubris.
They are quite different and you can't glean hubris simply from reading
that someone wants to write their own framework. You are jumping to
conclusions.

>  and get into the spirit of free software. 

I have no problems with the philosophy of free software, but I do have
issues when someone suggests that we should all follow, like sheep to
the slaughter, a particular worldview. What you "_would_ like" and what
you "will get" is entirely up to individual in question.

> Instead of starting "Yet Another Soon To Be Neglected Sourceforge 
> Project"

You presume the use of SourceForge to host such a project. Granted, you
probably meant "Yet Another Soon To Be Neglected Project", but that
doesn't excuse you from once again presuming it will be neglected. A
project used by *1* person, no matter how useless YOU think it is, is
not neglected by that person. Popularity hardly constitutes a
measurement of quality.

>  people should shop around and find a project which most closely 
> matches their vision and start contributing their bright ideas to it.

People can and do shop around when they want to. This should not stop
anyone who wants to create their own project from doing so. People have
free will, biases, opinions, ideas, goals and as such can pursue
fulfilment as they please. While it can be nice that they might
contribute their bright ideas to some other project, they are in no way
obligated to do so. If their ideas are bright enough then chances are
they will attract their own following.

> Of course history is full of lone inventors pottering about in their spare 
> time coming up with earth-shattering discoveries. But the fact is that 
> today, most science and breakthroughs are done by teams working 
> collaboratively.

Maybe so, but much science and many breakthroughs are still done by the
lone inventory/researcher. You cannot discount the merit of one person's
contribution because you think they should have another work
style/ethic.

> Now going back to the OP:
> 
> "...can some body help me, how to start php framwork for large site?", in 
> the absence of any other cues, this question gives me the impression that 
> the questioner is completely clueless (sorry if it offends you OP), to 
> which the only sensible response is "to use a variety of existing 
> frameworks until you no longer need to ask the question".

Actually from the OP's statement I see that he wants clues on how to
start a FRAMEWORK, not clues on how to start a PROJECT. If he wanted you
to infer another intent he probably would have used another set of
words. And if he did mean PROJECT instead of FRAMEWORK then he should
have stated so since given no other context we can only know what he has
written... all else is conjecture. It's possible I missed something
though, perhaps invisible font text *uhuh uhuh*, and there really is the
word "project" in the OP's post. I'd appreciate you pointing it out to
me.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Need a more elegant way of bitwise ORing values

2007-06-17 Thread Nathan Nobbe

admittedly i had to read up quickly on the usage of a *binary pattern* where
each
bit in said* pattern* is used to represent the state of some boolean
variable.
wikipedia sufficed 
this makes much more sense to me now; as ive seen this technique before but
never
taken in a formal explanation of it.
i hesitate now to suggest what i would do, which would be to define an
object
encapsulating an array of boolean variables and providing acccessors and
mutators for each
respective value it represented. presumably the internal implementation
might be
enhanced using the bitwise OR mechanism discussed in this thread, in which
case
we would still like to know how to best handle the implementation component
of said
object.
but i do very much love my objects :>
nice thread,

-nathan

ps.
sorry for the repeated mailings of this reply, apparently im still learning
how to use my mailer :-O


Re: Re[6]: [PHP] Need a more elegant way of bitwise ORing values

2007-06-17 Thread Nathan Nobbe


admittedly i had to read up quickly on the usage of a *binary pattern*where each
bit in said *pattern* is used to represent the state of some boolean
variable.
wikipedia sufficed 
this makes much more sense to me now; as ive seen this technique before
but never
taken in a formal explanation of it.
i hesitate now to suggest what i would do, which would be to define an
object
encapsulating an array of boolean variables and providing acccessors and
mutators for each
respective value it represented. presumably the internal implementation
might be
enhanced using the bitwise OR mechanism discussed in this thread, in which
case
we would still like to know how to best handle the implementation
component of said
object.
but i do very much love my objects :>
nice thread,

-nathan




Re: [PHP] OK to have many files in one folder?

2007-06-17 Thread Tijnema

On 6/17/07, Brian Dunning <[EMAIL PROTECTED]> wrote:

For everyone who advised me to "beware the inode", allow me to
forward what the Rackspace admins told me. This is Greek to me, and
I'm hoping one of you can translate. All I understood was where he
said "I appear to have more than enough." Yes?

---snip---

All of your slices on the disk are ext3. As this is the only file
system that the Red Hat kernel provides support for.

[EMAIL PROTECTED] ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/hda5 ext3 227G 93G 123G 43% /
/dev/hda1 ext3 99M 12M 83M 12% /boot
none tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/hda2 ext3 2.0G 36M 1.9G 2% /tmp

As far as I am able to recall, there are only 2 limitations that you
must be concerned with. There might be others, but these are the only
ones I am aware of, which also appears to be true from the research I
have done.

1. The number if i-nodes. You appear to have more than enough.

[EMAIL PROTECTED] ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/hda5 30130176 3729871 26400305 13% /
/dev/hda1 26104 46 26058 1% /boot
none 220613 1 220612 1% /dev/shm
/dev/hda2 262144 18 262126 1% /tmp

2. The subdirectory limitation for the ext3 file system. You can only
have 32000 subdirectories with in any directory.


Enough Inodes, and 32000 subdirectory's is quiet a lot, and definitly
not a problem if you place all files in one directory ;)
But, speed is a different story, so you might want to test how it
works when you store the files in a database, it might be faster...

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] pack vs. serialize

2007-06-17 Thread Nathan Nobbe

all,

i have recently stumbled upon the
packmethod.
can this be used as a substitute for
serialize
?
if so, is there any rationalization for this; like would it perhaps create a
more
compact representation of the data or run more quickly?
it looks like pack cannot be used on object as i didnt see object in the
format listing;
what would be a typical application of the pack method?

thanks,

-nathan


Re: [PHP] if test

2007-06-17 Thread Jochem Maas
jekillen wrote:
> Hello again;
> does the following test pass if the file is successfully included:
> if( include( some file ) )
> 
> or does it pass with:
> if( ! include( some file ) )

have you tried it?

> 
> Thanks
> JK
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] OK to have many files in one folder?

2007-06-17 Thread Brian Dunning
For everyone who advised me to "beware the inode", allow me to  
forward what the Rackspace admins told me. This is Greek to me, and  
I'm hoping one of you can translate. All I understood was where he  
said "I appear to have more than enough." Yes?


---snip---

All of your slices on the disk are ext3. As this is the only file  
system that the Red Hat kernel provides support for.


[EMAIL PROTECTED] ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/hda5 ext3 227G 93G 123G 43% /
/dev/hda1 ext3 99M 12M 83M 12% /boot
none tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/hda2 ext3 2.0G 36M 1.9G 2% /tmp

As far as I am able to recall, there are only 2 limitations that you  
must be concerned with. There might be others, but these are the only  
ones I am aware of, which also appears to be true from the research I  
have done.


1. The number if i-nodes. You appear to have more than enough.

[EMAIL PROTECTED] ~]# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/hda5 30130176 3729871 26400305 13% /
/dev/hda1 26104 46 26058 1% /boot
none 220613 1 220612 1% /dev/shm
/dev/hda2 262144 18 262126 1% /tmp

2. The subdirectory limitation for the ext3 file system. You can only  
have 32000 subdirectories with in any directory.


---/snip---

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] unlink before imagepng?

2007-06-17 Thread Brian Dunning
If I write an edited image back to disk using imagepng, is it  
desirable to first unlink the existing image? I notice that it works  
fine if I don't. Just wondering if there are any pros or cons.


- Brian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread Crayon Shin Chan
On Monday 18 June 2007 02:12, Robert Cummings wrote:

> Why not? You're argument is invalid.

"You're" == "You are", which makes the above invalid, or at least 
nonsensical.

> It suggests that since solutions 
> already exist to a problem that we should lie down and leave things as
> they are. Progress, and I'm not suggesting my personal projects have
> caused much progress, progress can only be achieved by revisiting what
> exists and either attempting to improve upon them, or attempting to
> create a new approaches.

I didn't say anything to that effect. What I _would_ like to see is that 
people stuffed their hubris and get into the spirit of free software. 
Instead of starting "Yet Another Soon To Be Neglected Sourceforge 
Project" people should shop around and find a project which most closely 
matches their vision and start contributing their bright ideas to it.

Of course history is full of lone inventors pottering about in their spare 
time coming up with earth-shattering discoveries. But the fact is that 
today, most science and breakthroughs are done by teams working 
collaboratively.

Now going back to the OP:

"...can some body help me, how to start php framwork for large site?", in 
the absence of any other cues, this question gives me the impression that 
the questioner is completely clueless (sorry if it offends you OP), to 
which the only sensible response is "to use a variety of existing 
frameworks until you no longer need to ask the question".

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread Robert Cummings
On Mon, 2007-06-18 at 01:52 +0800, Crayon Shin Chan wrote:
> On Monday 18 June 2007 00:12, Robert Cummings wrote:
> 
> > Good reasons to write your own:
> 
> It's an extremely inefficient use of precious time. Inventing the wheel 
> over and over. Surely out of the billions of half-baked to fully-baked 
> frameworks out there must be something suitable for everyone. How far 
> would you take it?

As far as I want.

>  Write your own PHP

I've written my own scripting language. it's not PHP but it suited my
needs at the time:

http://www.wocmud.org/Carnage/blobbieScript/features.phtml

> why not write your own OS, heck

Maybe some day, don't have time right now for that partcular bit of side
fun.

> build your own computer while you're at it :)

Why not? You're argument is invalid. It suggests that since solutions
already exist to a problem that we should lie down and leave things as
they are. Progress, and I'm not suggesting my personal projects have
caused much progress, progress can only be achieved by revisiting what
exists and either attempting to improve upon them, or attempting to
create a new approaches.

The wheel as we know it today wouldn't exist in the thousands of forms
that it does if not for re-invention. Should we have left it at the
stone wheel? The wooden wheel? The metal wheel? The solid wheel? The
spoked wheel? The rubber coated circumference wheel? The tired wheel?
The inflatable wheel? Tell me at which point attempts at advancement
should have been abandoned because "we have enough wheels"? In fact,
I'll wager that advancements to the wheel continue.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: php framework, large site

2007-06-17 Thread Brian Seymour
Depends, is time a factor. If not, why not write your own framework.

Brian Seymour
AeroCoreProductions
http://www.aerocore.net/
-Original Message-
From: Crayon Shin Chan [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 17, 2007 1:53 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: php framework, large site

On Monday 18 June 2007 00:12, Robert Cummings wrote:

> Good reasons to write your own:

It's an extremely inefficient use of precious time. Inventing the wheel 
over and over. Surely out of the billions of half-baked to fully-baked 
frameworks out there must be something suitable for everyone. How far 
would you take it? Write your own PHP, why not write your own OS, heck 
build your own computer while you're at it :)

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Php script diagnostic app?

2007-06-17 Thread Robert Cummings
On Sun, 2007-06-17 at 13:35 -0400, MIKE YRABEDRA wrote:
> 
> I was wondering if there was some kind of application that would process a
> php script, logging any functions (or classes) it encounters along the way.
> Logging times and memory use.
> 
> I am trying to figure out what in a script slows it down so much.
> 
> Any ideas?

I believe there are profiling tools... probably from Zend. How big is
your script? You might get away with using the microtime() function to
locate slow areas of code. Generally speaking I use it to binary
partition the code with echos of the current microtime() and narrow down
what I want to know.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread Crayon Shin Chan
On Monday 18 June 2007 00:12, Robert Cummings wrote:

> Good reasons to write your own:

It's an extremely inefficient use of precious time. Inventing the wheel 
over and over. Surely out of the billions of half-baked to fully-baked 
frameworks out there must be something suitable for everyone. How far 
would you take it? Write your own PHP, why not write your own OS, heck 
build your own computer while you're at it :)

-- 
Crayon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] if test

2007-06-17 Thread jekillen

Hello again;
does the following test pass if the file is successfully included:
if( include( some file ) )

or does it pass with:
if( ! include( some file ) )

Thanks
JK

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Php script diagnostic app?

2007-06-17 Thread MIKE YRABEDRA


I was wondering if there was some kind of application that would process a
php script, logging any functions (or classes) it encounters along the way.
Logging times and memory use.

I am trying to figure out what in a script slows it down so much.

Any ideas?


-- 
Mike Yrabedra B^)>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Previous and Next Month and Year

2007-06-17 Thread Myron Turner

Keith Spiller wrote:

Hi Vlad,

Thank you for taking the time to help me.

The code:
 $prev_month = date('F Y', mktime(0, 0, 0, 0, date('m') - 6, date('Y')));
 $next_month = date('F Y', mktime(0, 0, 0, 0, date('m') + 6, date('Y')));

 echo "$prev_month  \n";
 echo "$next_month  \n";

Generates:
 November 2006  December 2006
The $prev_month value seems correct,
but the $next_month value should be:
 December 2008

Do you see my mistake?



You've mixed up the parameter positions:

$prev_month = date('F Y', mktime(0, 0, 0, date("m")-6, date("d"), 
date("Y")));
$next_month = date('F Y', mktime(0, 0, 0, date("m")+6, date("d"), 
date("Y")));


See http://ca3.php.net/manual/en/function.date.php for just this example.

--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Basic Encoding Rules (BER)

2007-06-17 Thread Tijnema

On 6/17/07, Elier <[EMAIL PROTECTED]> wrote:

Hi guys,

I'm searching for a implementation of Basic Encoding Rules (BER) in PHP but
I can't find anything ..

This encodign is required in the RFC 2696 - LDAP Control Extension for
Simple Paged Results Manipulation

Any idea ?

Best Regards, Elier



I think the following site has all you need:
http://www.vijaymukhi.com/vmis/ber.htm

Tijnema

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: php framework, large site

2007-06-17 Thread Robert Cummings
On Sun, 2007-06-17 at 12:04 -0400, itoctopus wrote:
> cakephp is not bad, why write your own?

Why not write your own?

Good reasons to write your own:

1. gain experience from doing
2. a solution that exactly fits your needs
3. 100% license control
4. it's fun

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Basic Encoding Rules (BER)

2007-06-17 Thread Elier
Hi guys,

I'm searching for a implementation of Basic Encoding Rules (BER) in PHP but
I can't find anything ..

This encodign is required in the RFC 2696 - LDAP Control Extension for
Simple Paged Results Manipulation

Any idea ?

Best Regards, Elier

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Are IP addresses reliable?

2007-06-17 Thread Daniel Brown

On 6/16/07, william(at)elan.net <[EMAIL PROTECTED]> wrote:


On Sat, 16 Jun 2007, PHP Developer wrote:

> I wanna know that is there a way to forge someone's IP address? for
> example, I have a client with an static ip address, and she is a
> superuser. Can i rely on her IP address? or somebody else can forge her
> IP? I don't want her to enter a username and a password..

For purposes of above question only (and assuming application is PHP and
thus running on HTTP which is TCP-based protocol) the answer is that you
can rely on the ip address. For general purposes the answer is you can
forge ip address and can not rely on them (due to NAT and other issues)
but its very very not easy and a lot depends on protocol in question.

--
William Leibzon
Elan Networks
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




   If it's something very mission-critical and/or top secret, NEVER
strictly rely on the IP.  In fact, IP spoofing is one of the very
basic fundamentals in "hackology" and is not only rather easy to do,
but also rather common.  I'd suggest doing a hash of the system
(similar to what the default SSH client on Linux does) and using that,
which is a lot more difficult to duplicate.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php framework, large site

2007-06-17 Thread itoctopus
cakephp is not bad, why write your own?

-- 
itoctopus - http://www.itoctopus.com
"martins" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> hi, can some body help me, how to start php framwork for large site? 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: Re[6]: [PHP] Need a more elegant way of bitwise ORing values

2007-06-17 Thread Robin Vickery

On 13/06/07, Richard Davey <[EMAIL PROTECTED]> wrote:

Hi Robert,

Wednesday, June 13, 2007, 3:15:39 PM, you wrote:

> It's terribly verbose and inefficient...

>  $filter['flags'] = 0;

> if( $allow_fraction )
> {
> $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION;
> }

> if( $allow_thousand )
> {
> $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND;
> }

> if( $allow_scientific )
> {
> $filter['flags'] |= FILTER_FLAG_ALLOW_SCIENTIFIC;
> }

?>>

I don't think it's *terribly* verbose, as it has good sentence structure
to it, but your version is certainly more efficient, hence I've
swapped to that. Any other takers? ;)


lose the conditionals?

$filter['flags'] = 0;
$allow_fraction && $filter['flags'] |= FILTER_FLAG_ALLOW_FRACTION;
$allow_thousand && $filter['flags'] |= FILTER_FLAG_ALLOW_THOUSAND;
$allow_scientific && $filter['flags'] |= FILTER_FLAG_ALLOW_SCIENTIFIC;

or keep the conditionals and just do one assignment?

$filter['flags'] = ($allow_fraction ? FILTER_FLAG_ALLOW_FRACTION : 0)
 | ($allow_thousand ? FILTER_FLAG_ALLOW_THOUSAND : 0)
 | ($allow_scientific ? FILTER_FLAG_ALLOW_SCIENTIFIC : 0);

as the perl motto says, "there's more than one way to do it".

-robin


-robin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] create file permission problem (solved)

2007-06-17 Thread Daniel Brown

On 6/15/07, tedd <[EMAIL PROTECTED]> wrote:

At 6:56 PM -0400 6/15/07, Daniel Brown wrote:
>>
>
>I don't think it's PAM-compliant to use a single-quote character
>in your passwords, Tedd.  ;-P
>
>--
>Daniel P. Brown

Daniel:

Bzzzet, thanks for trying.

Let me explain again, maybe I did explain myself well.

In the show-code folder (link below) is a php file entitled "a.php".
Inside that file are password and user ID variables. They don't mean
anything, nor do they do anything, but they are there.

Now, I did say that you have all the tools you need at the site to
discover what these values are. Can you do it?

Again, here's the link:

http://sperling.com/a/show-code/

Is this trivial or not?

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com



   Tedd,

   You may not have noticed the fact that the joke I made was
directly-related to the content within the file.  I just didn't want
to post it to the list in case anyone else was trying.  It only took
about 90 seconds to get the data.  The password has a single-quote in
it (hence the non-PAM-compliant crack).  Also, is it necessary to have
the space before the $id tag?  Aren't $id fields usually placed prior
to the $password field?  And finally, shouldn't the phrase end with a
question mark, considering it's an inquiry and not a statement?

   That should suffice right?  ;-P

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] I have a problem with nobody! SOLVED!

2007-06-17 Thread Robert Cummings
On Sun, 2007-06-17 at 12:56 +0100, Stut wrote:
> tedd wrote:
> > 
> > $headers ='From: "Larry, Curly and Moe"<[EMAIL PROTECTED]>')>\n";
> > $headers .= 'Reply-to: "Moe"<[EMAIL PROTECTED]>' >\n";
> 
> Strictly speaking, those line endings should be \r\n.

While I agree with you that it "should" be \r\n, I've found I get more
consistent results when I use just \n and things get borked when I use
\r\n. I'm using postfix, maybe it's buggy :|

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] New htmlentities() '$double_enocde' Param Question

2007-06-17 Thread Chris
I just need a clarification about the new "$double_encode" param for  
htmlentities() and htmlspecialchars().


Is it supposed to do as I expect it to do in the code below or am I  
misuderstanding its use?


// Output: <
echo htmlentities('<', ENT_QUOTES, false);

// Expected Output: <
// Actual Output: <
echo htmlentities(htmlentities('<', ENT_QUOTES, false), ENT_QUOTES,  
false);



Thanks,
Chris

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] I have a problem with nobody! SOLVED!

2007-06-17 Thread Stut
tedd wrote:
>> The last paragraph of the page
>>
>> Go figure!
>>
>> The appropriate code is;
>>
>> mail ($to, $subject, $message, $header = 'From: "Larry, Curly and Moe"
>> <[EMAIL PROTECTED]>');
> 
> Brad:
> 
> Don't forget to add the content.
> 
> mail($to, $subject, $headers, $body);

Headers and body should be the other way around.

> And you can also add "Reply-to: "
> 
> Such as:
> 
> $headers ='From: "Larry, Curly and Moe"<[EMAIL PROTECTED]>')>\n";
> $headers .= 'Reply-to: "Moe"<[EMAIL PROTECTED]>' >\n";

Strictly speaking, those line endings should be \r\n.

> And, IF you are permitted to use the fifth parameter:
> 
> $extra = "-f" . $fromAddress;
> 
> mail($to, $subject, $headers, $body, $extra);
> 
> or
> 
> ini_set('sendmail_from', '[EMAIL PROTECTED]');
> mail($to, $subject, $headers, $body);

AFAIK, the sendmail_from setting only has an effect when running on Win32.

-Stut

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] I have a problem with nobody! SOLVED!

2007-06-17 Thread tedd

The last paragraph of the page

Go figure!

The appropriate code is;

mail ($to, $subject, $message, $header = 'From: "Larry, Curly and Moe"
<[EMAIL PROTECTED]>');


Brad:

Don't forget to add the content.

mail($to, $subject, $headers, $body);

And you can also add "Reply-to: "

Such as:

$headers ='From: "Larry, Curly and Moe"<[EMAIL PROTECTED]>')>\n";
$headers .= 'Reply-to: "Moe"<[EMAIL PROTECTED]>' >\n";

And, IF you are permitted to use the fifth parameter:

$extra = "-f" . $fromAddress;

mail($to, $subject, $headers, $body, $extra);

or

ini_set('sendmail_from', '[EMAIL PROTECTED]');
mail($to, $subject, $headers, $body);

Cheers,

tedd


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Previous and Next Month and Year

2007-06-17 Thread Larry Garfield
I generally use strtotime() as the swiss army knife of PHP date handling.  You 
give it a string and a timestamp to use as a base, and it gives you back a 
new timestamp.  So you can say:

strtotime("+6 months", $sometimestamp);

And it will give you back the time stamp six months after $sometimestamp, 
taking into account leap years, changes of year, I think daylight savings 
(although I'm not certain of that), etc.  Really, if you want to do any sort 
of time math that's not second-based, strtotime() will take most of the hard 
work off your hands.  It's simply amazing.

On Sunday 17 June 2007, Keith Spiller wrote:
> Hi,
>
> RE:  Previous and Next Month and Year
>
> This is my code:
>
>   $next_month = date('F Y', time()+$month);
>   $prev_month = date('F Y', time()-$month);
>
>   echo "$prev_month  \n";  #Result "June 2007"
>   echo "$next_month  \n";  #Result "June 2007"
>
> What I am trying to do is get the month and year
> based upon a + or - $month value.
>
> The variable $month being "6" for the month of June of
> the present year of 2007.
>
> For example ($month -7) would be December 2006,
> and ($month +7) would be January 2006.
>
> Please help...  Thank you.
>
> Keith


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] I have a problem with nobody! SOLVED!

2007-06-17 Thread Stut
BSumrall wrote:
> The last paragraph of the page
> 
> Go figure!
> 
> The appropriate code is;
> 
> mail ($to, $subject, $message, $header = 'From: "Larry, Curly and Moe"
> <[EMAIL PROTECTED]>');

The final parameter is important and should also be included. It sets
the envelope sender which is the address the email will get bounced to
if necessary.

-Stut

> -Original Message-
> From: BSumrall [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:39 AM
> To: php-general@lists.php.net
> Subject: RE: [PHP] I have a problem with nobody!
> 
> Let's take it one step further for arguments sake.
> 
> What is I wanted to change "nobody" as the sender to, let's just say Larry
> or Curly, or Moe?
> Making message header as;
> Larry Shmuckatelli  [EMAIL PROTECTED]
> Or
> Curly Shmuckatelli  [EMAIL PROTECTED]
> Or
> Moe Shmuckatelli  [EMAIL PROTECTED]
> 
> What is the php driving force that controls the "who sent me" function?
> 
> -Original Message-
> From: BSumrall [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:31 AM
> To: php-general@lists.php.net
> Subject: RE: [PHP] I have a problem with nobody!
> 
> Well, I am now 1 step closer
> 
> The php file do nor reference the importance of "having no spaces" between
> the -f and email address.
> [EMAIL PROTECTED] is key!
> 
> But, still can't get rid of nobody.
> 
> How do I make nobody disappear?
> 
> Here is my message header now.
> 
> Nobody [EMAIL PROTECTED]
> 
> Using:
> 
> mail ($to, $subject, $message, $header,
> '[EMAIL PROTECTED]');
> 
> -Original Message-
> From: BSumrall [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:19 AM
> To: 'Stut'
> Cc: php-general@lists.php.net
> Subject: RE: [PHP] I have a problem with nobody!
> 
> PS
> mail ($to, $subject, $message, $header, '-f
> [EMAIL PROTECTED]');
> 
> doesn't work either.
> 
> Still have nobody to deal with.
> As per being RFC compliant!
> 
> -Original Message-
> From: Stut [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 17, 2007 12:15 AM
> To: BSumrall
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] I have a problem with nobody!
> 
> BSumrall wrote:
>> I have read about a -f function.
>> I tried 
>> mail ($to, $subject, $message, -f$header);
>> mail -f($to, $subject, $message, $header);
>>
>> both result in parse error.
> 
> Boy did you not read the documentation carefully!
> 
> mail($to, $subject, $message, $headers, '[EMAIL PROTECTED]');
> 
> Go back and read http://php.net/function.mail properly.
> 
> -Stut
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Previous and Next Month and Year

2007-06-17 Thread Tom Rogers
Hi,

Sunday, June 17, 2007, 3:54:01 PM, you wrote:
KS> Hi,

KS> RE:  Previous and Next Month and Year

KS> This is my code:

KS>   $next_month = date('F Y', time()+$month);
KS>   $prev_month = date('F Y', time()-$month);

KS>   echo "$prev_month  \n";  #Result "June 2007"
KS>   echo "$next_month  \n";  #Result "June 2007"

KS> What I am trying to do is get the month and year
KS> based upon a + or - $month value.

KS> The variable $month being "6" for the month of June of
KS> the present year of 2007.   

KS> For example ($month -7) would be December 2006,
KS> and ($month +7) would be January 2006.

KS> Please help...  Thank you.

KS> Keith


$now = strtotime(date('Y-m-15'));
$current = date('F',$now);
$last = date('F', strtotime('-1  month', $now));
$next = date('F',strtotime('+1  month', $now));
echo "Current:$current Previous:$last Next:$next\n";

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Previous and Next Month and Year

2007-06-17 Thread Keith Spiller

Hi Vlad,

Thank you for taking the time to help me.

The code:
 $prev_month = date('F Y', mktime(0, 0, 0, 0, date('m') - 6, date('Y')));
 $next_month = date('F Y', mktime(0, 0, 0, 0, date('m') + 6, date('Y')));

 echo "$prev_month  \n";
 echo "$next_month  \n";

Generates:
 November 2006 
 December 2006 


The $prev_month value seems correct,
but the $next_month value should be:
 December 2008

Do you see my mistake?


Keith

- Original Message - 
From: "Vlad Vlasceanu" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, June 17, 2007 12:13 AM
Subject: [PHP] Re: Previous and Next Month and Year


time() returns a unix timestamp of the current moment in time (now), so 
in effect you are adding or subtracting 6 seconds to that.

calling:
date('m/d/Y', time());
is the same as calling:
date('m/d/Y');

On the other hand:
mktime(hour, minute, second, month, day, year) generates a timestamp 
such that:

mktime(0, 0, 0, date('d'), date('m') + 6, date('Y'));
would generate a date timestamp 6 months in the future.
or
mktime(0, 0, 0, 0, date('m'), date('Y'));
would generate last day from last month this year.

Word of wisdom: don't rely solely on timestamp calculations e.g. now + 
24 hours and so on, because you may need to take into account daylight 
savings times and such otherwise your calculations may be off.


Vlad

Keith Spiller wrote:

Hi,

RE:  Previous and Next Month and Year   
This is my code:


 $next_month = date('F Y', time()+$month);
 $prev_month = date('F Y', time()-$month);

 echo "$prev_month  \n";  #Result "June 2007"
 echo "$next_month  \n";  #Result "June 2007"

What I am trying to do is get the month and year
based upon a + or - $month value.

The variable $month being "6" for the month of June of
the present year of 2007.  
For example ($month -7) would be December 2006,

and ($month +7) would be January 2006.

Please help...  Thank you.

Keith


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php