Re: [PHP] Php's future with Asp .NET?

2003-01-16 Thread Sancar Saran
On Thursday 16 January 2003 09:07, Dhaval Desai wrote:
> Hello ppl,
>
> I was just wondering what is php's future with something like Asp .Net
> coming up...I have read many articles by Php guys who think Asp.Net is the
> future. If that's the true case...is it really worth sticking to Php at
> all?
>
> Thanx!
> -Dhaval
>
Hi,
My opinon is Php future is very bright. .NET is marketing mumbo jumbo, and 
java is Sun's bug yard.

It was pretty clear. None of them able to compete against PHP. ASP.NET is 
expensive, JSP is hard to config and code. Both of them slower than PHP, 
learning PHP easier than others.

Sancar "Delifisek" Saran



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




Re: [PHP] Passing Arrays Through Forms

2003-01-17 Thread Sancar Saran
On Thursday 16 January 2003 20:58, [EMAIL PROTECTED] wrote:
> Hello Everyone,
>
> I've attempted this many times, but have failed to understand it each time.
> I want to make it easier for myself to deal with passing variables through
> a form. So I thought, why not use a single array variable to do that. If I
> do such a thing, what steps do I need to take to ensure that the values in
> the array are intact just as the user entered it? How do I serialize array
> data from an initial form? Here's a simple example of what I might have:
>
> 
>
>
>
>
>
>
> 
>

 






 

some_page.php






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




[PHP] Session Question

2003-01-21 Thread Sancar Saran
Hi,
I'm working on a project. It uses large sql data to create pages. Last week I 
create some kind of cache info to create faster execution. It really works 
(system runs more than 10 times faster)

But stroring cache data is problem. I use the session to store cache info. 
With using cache data session files growing 60K, I think it can be 100K or 
more. 

I need advice about using large session data. Or is there any way to store 
large array (10 or more dimestion) into memory or someting.

Thanks.

Sancar "Delifisek" Saran.



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




[PHP] Session Performance questions

2003-07-02 Thread Sancar Saran
Hi,

I'm working on a CMS like system. Its uses heavly SQL for page rendering. 
Yesterday I made a stress test. System stable for just 30 secs (for 60 
request per sec, An Athlon750 with 320 mb ram). My investigation is Apache 
stalls when writing sessions. System uses sessions for store sniffed browser 
information.

Which is faster, writing 2 or 3 k data into session or sql db (after 
serializing)

Thanks.


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



Re: [PHP] Red Hat 9, Apache 2, and PHP

2003-07-03 Thread Sancar Saran
On Thursday 03 July 2003 20:51, Jeff Schwartz wrote:
> The PHP site (under Servers-Apache 2.0) says "Do not use Apache 2.0 and PHP
> in a production environment neither on Unix nor on Windows" but isn't clear
> whether Linux is included or whether it applies to all Apache 2 releases
> (such as 2.0.46) or just the original 2.0.
>
> And, Red Hat 9 comes with 2.0 so it's really confusing. Has anyone had any
> experience with this combo?
>
> Thanks,
> Jeff

Hi,
Not on RH 9. But on gentoo I use apache 2.0, it not for production nor 
development. 

Lots of problems,

Perhaps RH solve someting using own patch, and I repead if you gonna build 
production server. Stay away Apache 2.0

Basicly, when you ecounter a problem, then ask question here,
first response

Use Apache 1.3.27 or someting like that.

Good luck


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



[PHP] Stop Neurotic Posting

2003-08-06 Thread Sancar Saran
Why ?

So many people always asking same questions. Many of them so lazy. They aren't 
search lists archieve or google, they just ask or wait for the somebody do 
his/her job.

It just classic, if people doesn't ask same stupid questions, there is no RTFM 
or similar things. 

This is about human nature and this is a php technical list. Please post about 
list topics. We just try to write php programs, programming human brain is 
different thing.


Good Day

Sancar "Delifisek" Saran


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



[PHP] Cliend Side Support

2003-03-29 Thread Sancar Saran
Hello,
I see PHP5 news on /. , and noting about client side php support.

Does any one had any new news about client side PHP ? (not PHP+GTK)

Thanks.
-- 
Sancar Saran
Koytur Networks System Administrator



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



Re: [PHP] PHP and Flash

2003-05-30 Thread Sancar Saran
On Thursday 29 May 2003 14:31, César Aracena wrote:
> Hi all,
>
> I just made a pretty little flash banner with buttons and everything...
> Does anyone knows if I can make the flash buttons links with dynamic
> content? I need to fetch cartain common pages but with different
> variables.
>
> Thanks in advanced,
>

Hi,
I try to do same think a while ago, You have to pass variable into flash code. 
I think Flash 6.0  able to do this. Also I found that code. Which is work 
with flash 4.0.



moock>> web>> flash>> importing a cookie using a query string

















But I.m not sure work well with php
If you get workable solution, can you shared us?


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



[PHP] Php code to create php code

2003-06-11 Thread Sancar Saran
Hi,
Is there any example or/and tutorial for create php code with using php.

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



[PHP] SQL injection

2003-06-22 Thread Sancar Saran
Hi,
Is there any way, doc, article, example, idea, suggestion to how to 
prevent sql injection on php sites...

Thanks

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


Re: [PHP] Manners and Heritage

2003-06-24 Thread Sancar Saran
[EMAIL PROTECTED] wrote:
Hello Everyone

This is slightly off topic... so ignore or comment.
Just wondering where does the term RTFM actually originate. And wouldn't 
it be better to say RTM or RTAM (thats Read the amazing Manual) since as a 
foreigner, that means non english native speaker, I can't see whats so 
f...ing about the Manual?!
I mean it's the single most important knowledge source when it  comes to 
php. SO Guys and Gals use it as much as possible. 
HINT: The online version even has a very nice search function.

Just had to say this. Oh and for all those that do not know of the fact 
that there is an archive for this list: There is a searchable archive for 
this list. Just go to www.php.net/mailing-lists.php and click on the 
appropriate link. 

Regards 
Stefan Langer

Hi,

According to Hackers Jargon
RTFM: /R·T·F·M/, imp.
[Unix] Abbreviation for ‘Read The Fucking Manual’.

1. Used by gurus to brush off questions they consider trivial or 
annoying. Compare Don't do that then!.

2. Used when reporting a problem to indicate that you aren't just 
asking out of randomness. “No, I can't figure out how to interface Unix 
to my toaster, and yes, I have RTFM.” Unlike sense 1, this use is 
considered polite. See also FM, RTFAQ, RTFB, RTFS, STFW, RTM, all of 
which mutated from RTFM, and compare UTSL.



But I think, orginally it is Read The Fine Manual ;)

Regards
Sancar "Delifisek" Saran
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Gd Lib PHP.4.3.2 Gentoo

2003-06-24 Thread Sancar Saran
Hi,

Is there any problem on Php 4.3.2 GD lib ?

My code works fine on Php 4.3.1 but not work 4.3.2

here code



Header ("Content-type: image/jpeg");

 $text = "some text";
 $s= 20;
 $fontfile = "/usr/X11R6/lib/X11/fonts/truetype/arial.ttf";
 $size = imagettfbbox($s,0,"$fontfile",$text);
 $dx = abs($size[2]-$size[0]);
 $dy = $s-1;
 $xpad=9;
 $ypad=9;
 $im = imagecreate($dx+$xpad,$dy+$ypad);
 $white = ImageColorAllocate($im, 255,255,255);
 $black = ImageColorAllocate($im, 0,0,0);
 $blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);
 ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, 
"$fontfile", $text);

 Imagejpeg ($im);
 ImageDestroy ($im);
?>


Thanks for help...

Sancar "Delifisek" Saran

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


Re: [PHP] Gd Lib PHP.4.3.2 Gentoo

2003-06-24 Thread Sancar Saran
I change system from apach2 to apache it fixed...

Sancar Saran

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


[PHP] Pushing MySQL AB for using PHP for stored procedures language

2003-06-28 Thread Sancar Saran
Dear PHP users,

MySQL AB, going to add stored procedure language for MySQL. They say 

"Stored procedures are currently being implemented. This effort is based on 
SQL-99, which has a basic syntax similar (but not identical) to Oracle 
PL/SQL. We will also implement the SQL-99 framework to hook in external 
languages, and (where possible) compatibility with, for example, PL/SQL and 
T-SQL."

As you know our community mostly uses MySQL for SQL needs, also we had lots of 
open source projects depend on MySQL.

So I'm asking community to push MySQL AB to implement PHP language to MySQL 
stored procedure language.

Please wisit following url (MySQL AB todo list) and add your comments

http://www.mysql.com/doc/en/TODO_MySQL_5.0.html

Thanks...

Sancar "Delifisek" Saran


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



Re: [PHP] Happy Turkey Day

2008-11-27 Thread Sancar Saran
On Thursday 27 November 2008 19:07:42 Daniel P. Brown wrote:
> On Thu, Nov 27, 2008 at 11:08 AM, tedd <[EMAIL PROTECTED]> wrote:
> > Hi gang:
> >
> > Happy Turkey Day to all who are working on Thanksgiving.
>
> Back at you, my friend.
>
> Some on the list may not even know what Thanksgiving is, being an
> American holiday.  I had a client last year comment that she was
> surprised so many people around the world work Thanksgiving Day.  I
> didn't correct her.
>

And some on the list may live in Turkey...

Cheers :)


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



Re: [PHP] IE8 and HTML5

2008-12-04 Thread Sancar Saran
On Thursday 04 December 2008 10:45:21 Richard Heyes wrote:
> Hi,
>
> From a recent IEBlog post:
>
> http://blogs.msdn.com/ie/archive/2008/12/03/compatibility-view-improvements
>-to-come-in-ie8.aspx
>
Microsoft and Standarts ?

Ship load of crap...

Every web developer should open class action suit against M$ because of IE and 
M$ should banned from to create web browser for ever...


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



Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Sancar Saran
On Sunday 28 December 2008 01:40:01 Michael C. Yates wrote:
> Hey,
>
> How do you structure your web applications? I am thinking in terms of
> separating presentation  and logic. How is that done in PHP? And how
> many architecture patterns are there?
>
>
> Thanks
>
>
> Micheal C. Yates


Well,

I use, way of Rasmus (I give that name)

and please read this why

http://talks.php.net/show/drupal08/0

regards

Sancar


Re: [PHP] setting up FTP account names via PHP

2009-01-05 Thread Sancar Saran
On Monday 05 January 2009 16:29:09 Merlin Morgenstern wrote:
> Hello everybody,
>
> I am running a real estate site where I would like to enable bulk upload
> via real estate software that exports an xml file into an ftp account.
>
> In order to give every user unique access I would need to generate
> individual ftp name and passwords for each member. I can not see how
> this should work. My portal is written in PHP 4.x and there every
> members loges in with a unique ID. The FTP Server runns on the same
> linux machine. How could I generate users for this FTP server with php,
> for example on sign up?
>
> Thank you for any help on this.
>
> Best regards,
>
> Merlin

If those xml files not that big, you may consider uploading with php.

Or perhaps you may find an ftp server which can use mysql database for 
authentication.


Re: [PHP] Zend Framework...where to start? -- don't.

2009-01-15 Thread Sancar Saran
On Wednesday 14 January 2009 23:39:02 Daevid Vincent wrote:
> Not to start a Holy War (as these "to framework" or "not to framework"
> debates often turn into), but I personally had a horrible experience
> with using frameworks. I was forced to use Symfony at my last job and it
> was so cumbersome and slow to do even the simplest things. The whole MVC
> thing can be overkill. Plus the learning curve can be quite steep. Then
> if you want to hire other developers to work with you, you have to train
> them and let them ramp up on not only the framework but also your core
> project too! More wasted time.
>
> The pages are significantly slower than straight PHP by orders of
> magnitude: http://paul-m-jones.com/?p=315
>
> The basic problem with frameworks is they try to be one thing for all
> people. This carries a lot of baggage with it. There's a lot of crap you
> end up pulling in that you don't want/need. Plus if you want to deviate
> at all, you either have to roll your own, or sometimes you simply just
> can't. They seem attractive with all their plugins and stuff, but
> honestly, rarely do the plugins do EXACTLY what you want, the way you
> want. It might be as simple as trying to change the look/feel of a
> button or something and you'll find out that you can't -- so now you
> have this website that has this section that doesn't look like the rest
> of your site. And if you find a bug, you have to try to either fix it
> yourself and then keep those changes migrated into new updates, or
> submit it to the developer and hope they implement them (and trust me,
> you can submit to them and have them rejected for all sorts of lame
> reasons -- even though the work has been done and you're using it!)
>
> I advise against it. Just follow good practices and use thin wrappers
> and functions. Don't get all OO googlie eyed and try to over-engineer
> and over-OO the code. OO is great for some things (like a User class)
> but don't start making some OO page renderer or form builder. Don't fall
> into the DB Abstraction trap either -- just use a wrapper around your DB
> calls (see attached), so you can swap out that wrapper if (and you
> almost never do) you change the DB. Don't be suckered by something like
> QuickForms -- you WILL run into limitations that you can't get around
> and are at their mercy. Don't buy the hype that DIV's are the magic
> bullet and TABLEs are "poor design" -- Tables are still the best and
> most ubiquitous way to align things in a browser agnostic way (including
> mobile phones, etc.) and to layout forms.
>
> I've not used Zend myself, so I can't say for certain, but the above
> tenements I think would still hold true. I guess I would trust the Zend
> one the most given they actually make PHP, but at this point in time, I
> would never choose to use a bloated framework. Then again, I write
> enterprise level and very custom applications (Saas) so maybe this
> doesn't apply if all you're trying to do is make yet another Blog or
> Photo-album or personal/corporate website or something generic/basic.
> I've been coding nearly 20 years and founded several $MM companies.
> That's my take (or rant depending on how you look at it).
>
> Daevid.
> http://daevid.com
>

Hell, yes, signed to from start to end.

After RoR, PHP guys (including Zend) goes nuts.
Every one eat his brains to develop RoR like Framework. 

I wish to see fixed function parameter names, option orders, easy and strong 
input validation in PHP 6. And they give full effort to generate Zend 
Framework.

Then what? It still harder than Ror...

Hell yes, Compete own community. teh best way to spend your resources...

Sancar Saran


Re: [PHP] Zend Framework...where to start? -- don't.

2009-01-15 Thread Sancar Saran
On Thursday 15 January 2009 17:45:35 Robert Cummings wrote:

> >
> > Hell, yes, signed to from start to end.
> >
> > After RoR, PHP guys (including Zend) goes nuts.
> > Every one eat his brains to develop RoR like Framework.
>
> What are you smoking? I like my framework the way it is. I'm sure others
> like theirs the way it is. In no way do I try to be like RoR and
> probably for good reason since I hear mostly bad things about RoR.
>
Naah, I left somoking more than 3 years ago and having problems discussing in 
English (still no former education). 

And I'm sorry, My English better than your Turkish. 
So please be polute about my grammar errors. :)

Everyone likes own dog-meat. 
And, last week I meet a tiny php shop to fix their code against remote file 
inclusion. Their code was uber mess and one thing make me sad.  

Their old coder (which he doesn't know anything about current php development 
trends) do the job wint under 20k phtml code. (most of k was spend for  html 
tables). maybe 5 functions and so.

I'm very sure to updating his code with current trends plus some improvement 
under (excluding the templates) in 20k I can give the answer for 80% of web 
demands.

And if we look someting more  TYPO3 / Joomla / Drupal can do the job.

For Ruby, Perl, Python, you have have a web focused frame work to get job done 
in faster.

And that php already web focused language.

we need faster, more organized, better language, not uber bloated framwork 
from ZEND.

> > I wish to see fixed function parameter names
>
> Good luck with that... it's been shot down several times on the PHP
> internals list.
>
> > , option orders, easy and strong input validation in PHP 6.
>
> Isn't the filters stuff available in PHP5 already for doing stronger
> validation. It's not like input validation is difficult.
>
> > And they give full effort to generate Zend Framework.
>
> Huh?
>
> > Then what? It still harder than Ror...
>
> What is? PHP? What are you talking about?

I mean, ZEND Framework still harder to handle than RoR.

>
> > Hell yes, Compete own community. teh best way to spend your resources...
>
> Internal competition only makes something better. If all you have are
> yes men, then the only answer you'll get is "yes". Having those who
> dissent in opinion provides a basis for different views and approaches
> to problem solving. May survival of the fittest benefit all both from
> the perspective of getting a better final product and from the
> perspective of learning from mistakes along the way.

Yes of course and that Zend was not M$, they not swim in to dollar filled 
pools. 

And wIth zend framework, Zend begin rivalling against CI, Symphony, Solar and 
other popular framework communuties. (including yours and mine).

> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP

Regards

Sancar


Re: [PHP] Re: Opinions / Votes Needed

2009-01-19 Thread Sancar Saran
Hello guys,

It seems most of you very tallended programmers.

Could you generate someting like 

php--

withouth OO just namespaces ?

and make 95% of php programmers very happy...

this Object Orgy going to blow that language

which makes us productive programmers.

and

My vote goes to Tony...

Regards...


[PHP] Web Shop Management

2009-01-30 Thread Sancar Saran
Hello everyone,

Maybe it was bit off topic.

Recently we move our web server. Of course there where tons of WTF ???

So is there any kindof web based management system to handle. Web based 
projects.

I'm looking for someting like this

Customer
  -- Project 1
  -- Project 2
-- Project Propeties


Thanks for advice 

Regards

Sancar

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



Re: [PHP] Web Shop Management

2009-01-31 Thread Sancar Saran
On Friday 30 January 2009 23:14:25 Edmund Hertle wrote:
> 2009/1/30 Sancar Saran 
>
> > Hello everyone,
> >
> > Maybe it was bit off topic.
> >
> > Recently we move our web server. Of course there where tons of WTF ???
> >
> > So is there any kindof web based management system to handle. Web based
> > projects.
> >
> > I'm looking for someting like this
> >
> > Customer
> >  -- Project 1
> >  -- Project 2
> >-- Project Propeties
> >
> >
> > Thanks for advice
> >
> > Regards
> >
> > Sancar
>
> Web based projects? Code projects? SVN/Git?
> -eddy

Not really.

It was someting like customer tracking.  

Finding 200 apache directory with no info was very frustrating experiment.

Some of them are abandoned,  some customers are leaved. some of them just 
projects but customers does not accept.

I want store some info about the customer or project. Maybe categorize them. 

Lets call it customer documentation. 

I want to record something like that

This was blahblah.com owned by some guy, needs this. dislikes this. Please be 
careful when moving or altering site. 
He was sychopath to check every 30 min to his 5 hit per day site. 

This system uses uber CMS system which needs php-tidy php-postgresql etc etc. 
Have to acess some blah blah service.


Regards

Sancar

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



Re: [PHP] Web Shop Management

2009-01-31 Thread Sancar Saran
On Saturday 31 January 2009 12:43:52 Michael Kubler wrote:
> If it's just documentation you could use a wiki.
> I've found that mediawiki <http://www.mediawiki.org/wiki/MediaWiki> is
> the best (the one that wikipedia uses), although twiki isn't too bad,
> but the problems with wiki's are that they expect you to know how to use
> them, and all their crazy words and syntax. Something like Google Docs
> <http://www.google.com/google-d-s/tour1.html> is actually really sexy
> (can I say that about a web app that looks like a slimmed down version
> of office?), because it is so easy to use.
>
> You could also check out things like dotproject
> <http://www.dotproject.net/>, or google 'project management + PHP'.
> As a non PHP, hosted alternatively you could look into basecamp
> <http://www.basecamphq.com/>, which is designed for making project
> collaboration, with goals, timelines, and all sorts, although that
> doesn't quite sound like what you want as it isn't something you host,
> and you'd basically need to create a new one for each project.
>
> Michael Kubler
> *G*rey *P*hoenix *P*roductions <http://www.greyphoenix.biz>
>
> Sancar Saran wrote:
> > Not really.
> > It was someting like customer tracking.
> >
> > Finding 200 apache directory with no info was very frustrating
> > experiment.
> >
> > Some of them are abandoned,  some customers are leaved. some of them just
> > projects but customers does not accept.
> >
> > I want store some info about the customer or project. Maybe categorize
> > them.
> >
> > Lets call it customer documentation.
> >
> > I want to record something like that
> >
> > This was blahblah.com owned by some guy, needs this. dislikes this.
> > Please be careful when moving or altering site.
> > He was sychopath to check every 30 min to his 5 hit per day site.
> >
> > This system uses uber CMS system which needs php-tidy php-postgresql etc
> > etc. Have to acess some blah blah service.
> >
> >
> > Regards
> >
> > Sancar

Thanks,

It look like, do it with wiki or do it with own code

Regards

Sancar


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



Re: [PHP] long echo statement performance question

2009-02-06 Thread Sancar Saran
On Friday 06 February 2009 19:12:08 Frank Stanovcak wrote:
> I'm in the process of seperating logic from display in a section of code,
> and wanted to make sure I wasn't treading on a performance landmine here,
> so I ask you wizened masters of the dark arts this...
>
> is there a serious performance hit, or reason not to use long, ie more than
> 30 - 40 lines, comma conjoined echo statments...
>
> echo 'blah', $var, 'blah', $var2,...ad nauseum
>
> ... to output mixed html and php var values?  If so could you refer me to a
> work around, or better way?
>
> Frank

Seperate logic.

Not the template.

 was good for templating. With opcode cache all your template 
was cached.

And of course you should not use write functions in templates.

and if you really want to do this with

echo  yada yada I suggest this one.

$output = '';


do someting remove echo  and put $output.

and end of the script

do echo $output.

This was the best way. Of course you can use output buffering. 



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



[PHP] Module Structure ideas

2009-02-10 Thread Sancar Saran
Hello List,

Last year I began to sepearte my module files to many files for their 
purposes.

Last time use use lots of dirs for their types

someting like

controllers
  a.cont.php
  b.cont.php
definition
  a.def.php
  b.def.php
models
  a.model.php
  b.model.php
views
  a.view.php
  b.view.php

Then I realize this model creates confusion when you start to debug a module.

My next step was putting module files in one dir, 
also I want to load them into text editor with spesific order 
(same to including order).

and I came up some ting like this

a.test.def.php
c.test.mdl.php
e.test.cnt.php
g.test.rtr.php
i.test.view.php
k.test.dr.js
m.test.m.js
o.test.css

test_app.a.def.php
test_app.c.mdl.php
test_app.e.cnt.php
test_app.g.rtr.php
test_app.i.view.php
test_app.k.dr.js
test_app.m.js
test_app.o.css

test.adef.php
test.cmdl.php
test.ecnt.php
test.grtr.php
test.iview.php
test.kdr.js
test.m.js
test.o.css

My point of view the 3. option is good for me.  

So I want to ask  this 

(beacause I'm using very closed working model. Just KDE and KATE)

is kind of file structure may lead any kind of problems in future or 
diffrerent situation ?

also is there any suggestion to using different methot to archive similar 
goals.

Regards

Sancar

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



Re: [PHP] Module Structure ideas

2009-02-12 Thread Sancar Saran
On Wednesday 11 February 2009 21:42:24 Ashley Sheridan wrote:
> On Wed, 2009-02-11 at 21:20 +0800, Virgilio Quilario wrote:
> > > Last year I began to sepearte my module files to many files for their
> > > purposes.
> > >
> > > Last time use use lots of dirs for their types
> > >
> > > someting like
> > >
> > > controllers
> > >  a.cont.php
> > >  b.cont.php
> > > definition
> > >  a.def.php
> > >  b.def.php
> > > models
> > >  a.model.php
> > >  b.model.php
> > > views
> > >  a.view.php
> > >  b.view.php
> > >
> > > Then I realize this model creates confusion when you start to debug a
> > > module.
> > >
> > > My next step was putting module files in one dir,
> > > also I want to load them into text editor with spesific order
> > > (same to including order).
> > >
> > > and I came up some ting like this
> > >
> > > a.test.def.php
> > > c.test.mdl.php
> > > e.test.cnt.php
> > > g.test.rtr.php
> > > i.test.view.php
> > > k.test.dr.js
> > > m.test.m.js
> > > o.test.css
> > >
> > > test_app.a.def.php
> > > test_app.c.mdl.php
> > > test_app.e.cnt.php
> > > test_app.g.rtr.php
> > > test_app.i.view.php
> > > test_app.k.dr.js
> > > test_app.m.js
> > > test_app.o.css
> > >
> > > test.adef.php
> > > test.cmdl.php
> > > test.ecnt.php
> > > test.grtr.php
> > > test.iview.php
> > > test.kdr.js
> > > test.m.js
> > > test.o.css
> > >
> > > My point of view the 3. option is good for me.
> > >
> > > So I want to ask  this
> > >
> > > (beacause I'm using very closed working model. Just KDE and KATE)
> > >
> > > is kind of file structure may lead any kind of problems in future or
> > > diffrerent situation ?
> > >
> > > also is there any suggestion to using different methot to archive
> > > similar goals.
> >
> > option #3 works for me too small projects without using frameworks.
> > for big projects, i prefer to organize my script files by type:
> > /models
> > /controllers
> > /views
> >
> > i don't have problems with jumping around folder to folder because i
> > keep files open in separate windows.
> >
> > Virgil
> > http://www.jampmark.com
>
> Number 3 looks good. but I would tend to keep .js and .css files in
> their own directories respectively, as for most projects, I'll have lots
> of different .js files for differents tasks, and several .css files
> (screen, print, internet explorer, etc.) It makes it a lot easier for
> me, as usually (unless I'm doing AJAX work) the php and javascript won't
> overlap, and css is almost always completely separate.
>
>
> Ash
> www.ashleysheridan.co.uk

Thanks lot. 

Using dirs for css and jss look more favorable.

Regards

Sancar

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



[PHP] Opinions Please, Describing PHP as Web Framework of C and C++

2009-02-15 Thread Sancar Saran
Hello list.

Recently we had some serious discussion on local boards.

I prefer calling PHP as Web Framework of C and C++

if you had a time for this fruitless discussion. Please send your opinions.

Regards

Sancar

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



[PHP] Object Context Question in object->object->variable

2009-03-02 Thread Sancar Saran
Hello list.

I'm trying to implement someting on OO way. 

I got 2 classes

class a {
  var $config = array();
  var $b = '';

  function  __construct {
   $this->b = new b($this->config);
 }

}

class b {
  var $config = array();
  function foo() {
switch($this->config['bar']) {

   }
  }
}


some where in class a



and when I call 

$bar = new a();

$bar->b->foo();

I got 

Fatal error: Using $this when not in object context in

Could you givme some clue what is wrong ?


I'm using Ubuntu and PHP 5.2.0-8+etch13 

Regards

Sancar

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



Re: [PHP] Object Context Question in object->object->variable SOLVED

2009-03-02 Thread Sancar Saran
On Monday 02 March 2009 20:50:56 Sancar Saran wrote:
> Hello list.
>
> I'm trying to implement someting on OO way.
>
> I got 2 classes
>
> class a {
>   var $config = array();
>   var $b = '';
>
>   function  __construct {
>$this->b = new b($this->config);
>  }
>
> }
>
> class b {
>   var $config = array();
>   function foo() {
> switch($this->config['bar']) {
>
>}
>   }
> }
>
>
> some where in class a
>
>
>
> and when I call
>
> $bar = new a();
>
> $bar->b->foo();
>
> I got
>
> Fatal error: Using $this when not in object context in
>
> Could you givme some clue what is wrong ?
>
>
> I'm using Ubuntu and PHP 5.2.0-8+etch13
>
> Regards
>
> Sancar


Sorry guys. My Bad

for this kind of operations. method must not be static.


Sancar

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



Re: [PHP] Frameworks / obstinate?

2009-03-23 Thread Sancar Saran
Probably a bit off topic and

The Game is over man.

Javascript coming with flank speed. Next generation JS Framworks will take 
html generation jobs from server side.

Whole thing of Server Side MVC and other yada yada was became joke. Those 
server siders become JSON pushers for JS frameworks.

Astrosurfing ?

Yeah, just compare PHP mailing list vs Jquery Mailing list activity.

And The New Game just begun...

Regards

Sancar

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



Re: [PHP] Frameworks / obstinate?

2009-03-23 Thread Sancar Saran
On Monday 23 March 2009 12:33:58 Robert Cummings wrote:
> On Mon, 2009-03-23 at 11:52 +0200, Sancar Saran wrote:
> > Probably a bit off topic and
> >
> > The Game is over man.
> >
> > Javascript coming with flank speed. Next generation JS Framworks will
> > take html generation jobs from server side.
> >
> > Whole thing of Server Side MVC and other yada yada was became joke. Those
> > server siders become JSON pushers for JS frameworks.
> >
> > Astrosurfing ?
> >
> > Yeah, just compare PHP mailing list vs Jquery Mailing list activity.
> >
> > And The New Game just begun...
>
> Yeah, I hear C has been replaced too.
>
Well, I did not see you to write your web app with C.

Regards


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



Re: [PHP] Frameworks / obstinate?

2009-03-23 Thread Sancar Saran
On Monday 23 March 2009 16:24:55 Robert Cummings wrote:
> On Mon, 2009-03-23 at 15:58 +0200, Sancar Saran wrote:
> > On Monday 23 March 2009 12:33:58 Robert Cummings wrote:
> > > On Mon, 2009-03-23 at 11:52 +0200, Sancar Saran wrote:
> > > > Probably a bit off topic and
> > > >
> > > > The Game is over man.
> > > >
> > > > Javascript coming with flank speed. Next generation JS Framworks will
> > > > take html generation jobs from server side.
> > > >
> > > > Whole thing of Server Side MVC and other yada yada was became joke.
> > > > Those server siders become JSON pushers for JS frameworks.
> > > >
> > > > Astrosurfing ?
> > > >
> > > > Yeah, just compare PHP mailing list vs Jquery Mailing list activity.
> > > >
> > > > And The New Game just begun...
> > >
> > > Yeah, I hear C has been replaced too.
> >
> > Well, I did not see you to write your web app with C.
>
> I write in C still. I have a mud I work on in my spare time...
> admittedly MUDs aren't a good example since they are dated... but this
> particular one shares C code, via compile-time macros, with associated
> PHP extensions to speed up certain aspects of data parsing and
> evaluation. My point is, just because new techniques and technoloigies
> come out, is in no way a boundary condition on an existing technology's
> lifespan or efficacy in any particular environment. The deprecation of
> usefulness of any technology is based on many more variables than
> "Jquery - The New Game just began". Jquery runs in the browser, it will
> never replace server side data acquisition, caching, and manipulation.
> It will merely augment. Moreover, it is completely useless when
> JavaScript is disabled. Your post also made the assumption that PHP is
> used for web sites only. Many people are using it for other tasks too.
> Popularity is also not a useful metric of the demise of a language. It
> may just be that less people are familiar with JQuery and so there are
> more questions whereas PHP has been around long enough that the bulk of
> people interested in it have a good enough foundation in it that they
> don't need to ask questions.
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP

Well nice :), I wish to able to write C stuff for boosting PHP performance by 
myself too...

And of course, no body will replace C or PHP.

And there where a but and very big BUT. When those dynamic web thing begin to 
appear there where programming language named PERL. 

And yes it was still aroud here and Slashdot still running perl based code.

BUT momentum was lost. No body expect to some ground breaking thing from PERL 
6.

And Server side become less interesting day by day. Collect request values, 
generate HTML output and push. 

Each new server side language or framework do same thing, this way or that 
way. Web Programming momentum shifting from server side to Javascript.

So tellme your last PHP vs Someting else dynamic web language flamewar ?

Currently JS guys are busying with fancy effects, browser behavior fix, menus, 
dom manuplation etc.  When they fix things, their next step was content 
management or someting like that frameworks.

Anywhow we well see. 

PS: Is there any shorh way to learn do someting for PHP with C (My C knowladge 
was 0)

Regards

Sancar




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



Re: [PHP] 800 pound gorilla

2009-04-20 Thread Sancar Saran
On Monday 20 April 2009 16:48:42 Marc Christopher Hall wrote:
> Sun buys MySQL and now Oracle buys Sun (not final, yet). What will happen
> with the main db we PHP'ers have come to know and love especially since v 5


sudo apt-get install postgresql

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



Re: [PHP] CSS & tables

2009-05-18 Thread Sancar Saran
Well.

If you really really want to go Table less css. 

You have to you one of those CSS frameworks.

I suggest YAML

And even with YAML. 

You have to fix your design to IE6. 

My point of view positioning with DIV was time consuming process and very 
frustrating experience (especially with IE6).

And to those pesky Table Nay sayers.

Damn get over it. Did you still believe those TABLES ARE SLOW marketing 
buzz ?

Hello we are in 2009. We got wordwide broadband access and guess what. 

Images and flash contend much bigger  than any html and css data. And 
your JS generate more load than html parsing to client cpu.

Yes CSS was most elegant solution and most time consuming. 


Regards

Sancar

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



Re: [PHP] templating engine options

2009-05-25 Thread Sancar Saran

> > You're missing the point just because he threw in some old HTML
> > styling attributes.  The main issue is the overhead of added parsing
> > layers to find where content goes in the HTML.  Aren't we already
> > using a language (PHP) that parses for place holders for dynamic
> > content within HTML tags?  Write the template in XHTML, style it with
> > CSS, and insert content place marks with PHP short tags.  Do the
> > programming work of calculations, validation, and DB access in another
> > script which will include the template at the appropriate time.  Even
> > create classes to hold various data sets (think JavaBeans) if you
> > want.  Adding a layer of abstraction just so your designers don't have
> > to write  is silly at best.  At lest that's my opinion.  Do
> > whatever works for you.
> >
> > Mike
>
Completely agree.

A year ago, we got a IBE project. It based TYPO3 and Templavolia.

After completion, it slow like hell. 
Then some optimization, some TYPO3 tweak. And still slow like hell.

Then I realize, we got more than 20 template pieces in a page. (it was 
something about the travel business you have to show lots of different travel 
options in landing page).

Anyhow, then I found  a f*ckin simple thing.

ob_start();
require(template.php);
$output. = ob_get_clean();

With converting templates to php and opcode cache compatibility (yes your 
template was a php file so it was stored in the memory). things was become 
blazingly fast. 

Then we covert entire thing to php based templates. Things become much more 
flexible and fast. Of course there where a thin red line. Do not put writer 
functions in the templates.

Other than that. Perfect solution.

Except one condition. Your designers must have php enabled. 

Regards

Sancar


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



Re: [PHP] templating engine options

2009-05-25 Thread Sancar Saran
On Tuesday 26 May 2009 01:44:43 am Nathan Rixham wrote:
> Stuart wrote:
> > 2009/5/25 Robert Cummings :
> >> I continued the discussion with Nathan.
> >
> > I too have had an off-list discussion with Nathan on this topic, and a
> > productive one at that.
>
> which would probably be a good time for me to step back in; having had a
>   nice little inside in to both Robert and Stuarts template systems, and
> indeed way(s) of doing things. Also thanks to everybody else who made
> suggestions and gave input - it was all appreciated.
>
> I'm far from making a final decision, as I've decided to approach this
> by setting a few guidelines and a wishlist, then either finding /
> modifying something to do the job, or creating something from scratch.
>
> Both Rob and Stuarts systems were more in common than they may think,
> focus in both was on performance, and only making set data available to
> the templates (whether pushing or pulling).
>
> The syntax did differ though, and functionality aside this is probably
> one of the most important aspects (imho).
>
> Markup & XML sits well with me (and most) because we are web developers
> and use it daily.
>
> PHP syntax also sits well because we also use it daily.
>
> The fact remains though that this "feels like" (and possibly is) a
> different job which requires something different. Both XHTML and PHP do
> their job well - just as ecma(java)script and css do theirs.
>
> However none of these technologies / languages are suited and dedicated
> to converting provided data in to specified output; specifically, and
> only, xhtml.
>
> XSL Templates are near perfect, built for the job, and very powerful -
> but time hasn't favoured them well; and until (if ever) a wide spread
> adoption happens something else needs to fill the gap.
>
> Template Specific Thoughts:
>
> Smarty, Stuarts Engine, Robs Engine, PHPLIB and many more had one common
> theme, they all limited the data available. My terminology of limited
> perhaps sounds wrong, so maybe "make specified selected data available"
> or "provide access to the view" will make more sense. Inline with
> layered and tiered application design this makes perfect sense; thus..
>
> A template /should/ only be able to access the data made available to
> it, nothing else. Whether it requests the data or the data is provided
> is covered later. If it doesn't have all the data needed then this needs
> reviewed and the application needs changed to provide it. Not the
> template engine bastardized to accommodate a limited app.
>
> A template ~should~ have unique yet easy to understand syntax, something
> that complements xhtml and provides all needed functionality. (IMHO it
> should not be php syntax)
>
> A template engine must stick within it's role boundaries, it's not a
> cache engine, its not php, its not xhtml, its not for implementing
> functionality - it is simply and purely to do its job - take data,
> populate an xhtml template with it and return the result - nothing more,
> nothing less.
>
>
> Push vs Pull.
>
> This is a much bigger issue than I thought, and perhaps is the crux of
> the whole thing. I can see two clear approaches;
>
> Firstly, (the common one)
> - app passes data and a template to the template engine
> - template engine merges it together and passes back
> - app does as it pleases with data (sends it to client, caches it, fires
> it in an email - whatever)
>
> Secondly, (uncomment)
> [think modular]
> - app provides an api / gateway to views of data
> - template engine requests view(s) specified in template from app
> - template engine populates template modules with data & sends output to
>
> I guess the first is template engine as a Util / Service - and the
> second is template engine as a Layer / App.
>
> There are pros and cons in each design, concentrating on the second
> design for now - this brings in a lot of scope which seems to fit well
> both practically and architecturally.
>
> The freedom to be able to specify in template that...
>
> this is template module "latest posts", it is bound to the data view (or
> data provider) "latest posts(8)"
> whilst overall combining template (page) is comprised of modules x,y and
> z - here, here and here.
>
> ...really appeals to me; certainly in this scenario where you request
> (pull) from the application rather than make it all available. This way
> you only ever perform the business logic required for the information
> available. The counter part of making everything available incase it may
> be used is ridiculous (and makes me think coldfusion for some reason??).
>
> Architecturally this appears to be good - it's the presentation tier
> being a presentation tier, the logic tier knows nothing of the
> presentation tier and simply serves up what is requested. However thats
> only on the one side of the tier - on the other side we have a huge
> gaping hole where functionality should be (cache, compilation, delivery)
> etc, which would require another, as yet unk

Re: [PHP] templating engine options

2009-05-26 Thread Sancar Saran
On Tuesday 26 May 2009 03:48:41 am Nathan Rixham wrote:
> Sancar Saran wrote:
> >  > $content = 'No Comments';
> > if(isset($comments) and is_array($comments) and count($comments) > 0 ) {
> > $content = '';
> > foreach( $comments as $index => $comment ) : $content. = "".$comment->title.""; endforeach;
> > }
> > ?>
> >
> > Comments
> > 
> > 
> > 
> >
> > index.php
> > ob_start();
> > require('template.php');
> > echo ob_get_clean();
> >
> >
> > I'm still do not understand for complex template system requirement.
>
> I just _need_ the two abstracted.
>
> php must have no html in it
> html template must contain no php
>
> > Why it have to be very complex system.
> >
> > Large data array, some conditions, lots of loops, and What else ?
> >
> > http://www.flytag.de/
> > http://urlaub-finder.de/
> > http://airportdirekt.de/
> >
> > All same system. With different css designs.
>
> yup, did this myself for a long time; here is some very old code I
> used to use!
>
> newCage();
> $content = cage(include $file);
>
> function newCage() {
>   ob_start();
> }
> function cage() {
>   $includeOutput = ob_get_contents();
>   ob_end_clean();
>   return $includeOutput;
> }
>
> lol
Alright, my vote going to smarty.

After compilation, it running on native php.

And

When we use TYPO3 native marker model (which fits your requirement, no php in 
template) I found very dull. Load template to memory, fetch part of template, 
generate loop for processing template, feed template keys in the loop. 

After some time %75 of code become template feed. Like this

//--- Get Template
$this->templateFileContent = $this->cObj-
>fileResource('fileadmin/templates/travelit_booking.html');
$strCarLoop= $this->cObj->getSubpart($this-
>templateFileContent,"###CAR_LOOP###");
$strPLoop  = $this->cObj->getSubpart($this-
>templateFileContent,"###PASSANGER_LOOP###");
$strCarTable   = $this->cObj->getSubpart($this-
>templateFileContent,"###CAR_TABLE###");
$strHotelBooking   = $this->cObj->getSubpart($this-
>templateFileContent,"###HOTEL_BOOKING###");
$strFlightBooking  = $this->cObj->getSubpart($this-
>templateFileContent,"###FLIGHT_BOOKING###");



if(isset($arrData['MW']) && is_array($arrData['MW']['MWLIST']['CAR']))
{
$intCarSize = sizeof($arrData['MW']['MWLIST']['CAR']);
for($intX=0;$intX < $intCarSize;$intX++)
{
$arrSubst = '';
$arrSubst['###CAR_OPTION_VALUE###'] = 
$arrData['MW']['MWLIST']['CAR'][$intX]
["@"]['GROUP']."-".$arrData['MW']['MWLIST']['CAR'][$intX]["@"]['ID1']."-".
$arrData['MW']['MWLIST']['CAR'][$intX]["@"]['ID2']."-".$arrData['MW']
['MWLIST']['CAR'][$intX]["@"]['NAME']."-".$arrData['MW']['MWLIST']['CAR']
[$intX]["@"]['PRICE'];
$arrSubst['###CAR_OPTION_PRICE###'] = 
number_format($arrData['MW']['MWLIST']
['CAR'][$intX]["@"]['PRICE'], 0, ',', '.');
$arrSubst['###CAR_OPTION_NAME###']  = 
$arrData['MW']['MWLIST']['CAR'][$intX]
["@"]['NAME'];
$strCarss.= 
$this->cObj->substituteMarkerArrayCached($strCarLoop,$arrSubst);
}
}


 ###CAR_OPTION_PRICE € ###CAR_OPTION_NAME###





###BOOKING_RENT_A_CAR_LABEL###





###BOOKING_RENT_A_CAR_INFO###



###BOOKING_CAR_INFO_LABEL###



###BOOKING_I_DONT_WANT_TO_RENT_A_CAR###

###BOOKING_RENT_A_CAR_LOOP###

Re: [PHP] Web application design considerations - a good reference ?

2009-06-02 Thread Sancar Saran
On Tuesday 02 June 2009 07:50:36 am Angus Mann wrote:
> Hi all.
>
> I'm working on a PHP project for my own personal business use. It will
> handle billing and invoices as well as payments and time management,
> bookings, appointments and a few more. I may add things like personal
> messaging between the various users and a customer login to check on the
> progress of their accounts.
>
> It is a big project and will probably take a year or so to complete in my
> spare time.
>
> I have made a couple of starts but I have no experience in creating such
> large applications and I find I often end up with spaghetti code. I've
> tried using session variables to keep track of where and what the program
> is doing but there are so many permuations and combinations I found myself
> writing endless streams of if's, and's and or's just to figure out what
> page to display.
>
> The code is not the probblem for me...it's the flow and organization of the
> code.
>
> Can anybody point me to a good book or tutorial that lays down the
> principles and gives some suggestions for integrating the many subroutines
> of a large application? I want to make the code readable and logical in its
> flow, and avoid repetition of code segments.
>
> Much appreciated.
> Angus


Hello,

Use CMS/Framework

like Drupal or TYPO3

All of them have coding principles.

You can follow. Plus they do tons of things.

(authentication. this that)

Your time may cut 3 months.

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



Re: [PHP] MySQL after oracle, still Wise?, was Web application design .......

2009-06-03 Thread Sancar Saran
On Tuesday 02 June 2009 11:36:28 pm optoma...@rogers.com wrote:
> Everybody has given Angus really great advice in this previous thread
> and I have learned a lot too. I hope no one mines the fork but I am in
> the exact same situation as Angus. If anyone could spare a bit of time
> regarding application infrastructure I would really appreciate it.
>
> I know there are lots of databases out there and PostgreSQL is held in
> high regard but the overwhelming majority of examples seem to use MySQL.
> Considering that Oracle has bought Sun, do you think it is still wise to
> use it for new applications? Oracle does not have much "street cred" in
> open source circles, maybe they'll cause trouble later and MySQL was
> already forking was it not? I'd like to use the same DB for a few years.
>
> I am attracted to building an application from scratch but I will never
> get an object relational mapper to work without a framework. If I go the
> scratch route, I'd better get my database done right(as was advised in
> the previous thread!)and getting that right probably starts with
> choosing the right DB.
>
> Any thoughts?-Patrick

Check the popular projects (phpBB, TYPO3, Drupal) when they start to move 
MySQL to somewhere it time to start moving.

And if you so much thinking about future DB change. Just wrote compatible sql 
and use multi drive layer (phpADO db).

And you are problem free

Regards

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



Re: [PHP] Periodic Actions in PHP?

2009-06-13 Thread Sancar Saran
On Saturday 13 June 2009 11:42:49 am Parham Doustdar wrote:
> Hi there,
> I'm going to create a small chat script with PHP. The messages you want
> others to see will be added to a flat file (I.E. TXT file), and read and
> displayed by PHP. However, I want this reading and displaying to be
> periodic. This means that I want PHP to check the file for new lines
> every,say, fifteen seconds. How may I do that? I have been unable to find
> any function that acts like a timer. Thanks!

Please search google daemonized php

Regards

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



[PHP] Using large multi dimenstional arrays in js

2009-06-17 Thread Sancar Saran
Hello all,

My new project needs to use large multi dimenstional php arrays in javascript.

I'm not sure how to do it.

Is there any lead or any one give a clue.

Regards

Sancar

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



Re: [PHP] Asterisk anyone?

2009-07-30 Thread Sancar Saran
On Wednesday 29 July 2009 10:18:08 pm Skip Evans wrote:
> Hey,
>
> I've been asked to write a simple couple of public pages that
> would let an Asterisk customer modify their account
> configuration, but the client has no idea how Asterisk stores
> its data, apparently not in MySQL.
>
> Anyone know of any resources for accessing Asterisk from PHP?
>
> If anyone has done this can you tell me if I'm on the right
> track here?
>
> http://www.voip-info.org/wiki/view/Asterisk+AGI+php#PHPTipsandExamples

Hello,

Asterisk's default storage was text files.

You should check Trixbox. 

It was a Asterisk with MySQL backend. Also it has all bells and whistles. And 
web based management console.

Even it comes packed with a centos.

Your link shows how to remote asterisk console from web.

Regards

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



Re: [PHP] Question: what are frameworks?

2009-08-09 Thread Sancar Saran
On Sunday 09 August 2009 02:47:37 pm Parham Doustdar wrote:
> Hi there,
> I've heard of frameworks, but I don't quite know what they are used for.
> I've done a little search on the internet, but even though I've been able
> to find different PHP frameworks, I'm not quite sure what they offer, or in
> what they differ, or why I shouldn't just use PHP as it is. Can someone
> give a little bit of explaination?
> Thanks!

They are the different way of the programming php.

PHP is the Temple Of the Shaolin, those fw programmers are master of the 
techniques. 

They are generate their way of the PHP-FU. Like kung-fu there are many ways to 
do things in php. 

From my point of view. All of them sh*t load of bloated code masterpieces. 

After RoR craze, Nearly every PHP developer sees the light in a one night. 
Then PHP Frameworks was skyrocketed. And Zend jump the bandwagon.

Main point of Framework craze was not technical. PHP was loose type language, 
you can easily mess up your self in seconds and in the Internet you can see 
giantic size of spagetti code. Because of this, Java and .net programmers 
constantly mauls PHP as non enterprise language.

So ? What is the point ? The point is, As a company owner or the project 
manager when you get a Certified this or that framework master, you can easily 
adopt a standard to your projects, plus, you can get support and more 
important than that you can show your badges and whistles to your customer to 
prove yourself as a Experienced php crafter.

In simple, They says to your customer, you are in safe, these guys knows php, 
you can buy things from them even if they blows things up, you can find another 
certified master somewhere else.

From my point of view.

If you want to learn a Framework, I suggest you to learn a CMS/Framework, 
something like TYPO3.

Because, after installing learning maybe certifying a framework, you have to 
do tons of coding to generate a usable platform. For example you have to write 
a session controller, have to generate a administrator interface, this that 
yada yada.

So why you have to do all of this. Use a CMS/Framework and do just you need.

Plus, TYPO3 also has same badges and whistles (if you wish) for your 
customers. Even in Germany it has bigger balls too.

Regards

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



Re: [PHP] ini files as config - hidden

2009-08-15 Thread Sancar Saran
On Friday 14 August 2009 08:31:46 pm דניאל דנון wrote:
> I'm building a little framework for my self,
>
> The configuration of the framework is done in an ini file,
>
> How do you suggest to hide its contents?
>
> .htaccess wont be good (or atleast only htaccess) since if its turned
> off
>
> The file contains mysql password and important data.
>
>
> How should I make sure the file stays hidden from someone who might tries
> to access it?

Hello there,

1-) You have to parse ini file in each execution. It was negative for 
performance. I suggest use plain php array

2-) To hide your config put it in out of html document root.

define('ROOTDIR', dirname(__FILE__).'/');
define("CONFDIR",ROOTDIR.'../config/');

require(CONFDIR.'config.php');

Regards

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



Re: [PHP] send email by php class

2007-01-08 Thread Sancar Saran
On Monday 08 January 2007 16:56, Jochem Maas wrote:
> [EMAIL PROTECTED] wrote:
> >> [EMAIL PROTECTED] wrote:
> >>> Hi,
>
> ...
>
> >>> Was looking on phpclasses.net for the class but there are tons of them.
> >>> Can somebody recomend any class? Something simple.
> >>
> >> phpmailer.sourceforge.net
> >
> > I think this is it.
> >
> > :)
>
> not to sound like an ass (there's at least 3 people out there that will
> hear me going 'Eeee Aw' regardless of what I say so what the hack) - but
> this has been mentioned about 3 times on the list on the last week, it's
> one of these ones things that keeps coming up.
>
> this is a good example of why scanning the list on a regular basis (and/or
> doing the occasional search in the archives when your looking into a
> problem) is a really good idea.
>
> I can't emphasize enough how much I personally learn from just reading
> questions and answers on this list - many a time I've [vaguely] remembered
> reading something that I didn't quite understand at the time but 6 months
> later I was confronted by a similar problem and I was able to solve the
> problem in a fraction of the time that it would have taken if I had not
> read whatever thread was relevant.
>
> an extension to this is trying to answer questions that you don't actually
> know the answers to ... the act of trying to figure out someone else's
> questions/problems can often be a great way to increase your skills ...
> additionally it's good practice for solving the problems you encounter in
> your own work, I remember when I first started out that trying things out,
> researching and debugging problems was often a very daunting proposition
> [that never-ending-story feeling] ... I have found that the more practice
> the less impedance I find when it comes to figuring out something I'm stuck
> on ... this is pretty obvious I guess, but worth mentioning.

After using this kind of lists, forums, boards, people realize, asking same 
question again and again easier than diggin entire list and or searching 
manuals etc.

Yes you are absolute right about dealing others questions makes you stronger 
and this is Shaolin Monk aproach and another question was is that people 
wants to be stronger?

Anyhow this is one of the can't be solved problem of internet (and or mailing 
lists, forums etc.) . People will asking same question again and again... 

Regards

Sancar

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



Re: [PHP] mssql_* overhead

2007-01-11 Thread Sancar Saran
On Wednesday 10 January 2007 17:47, Philip Thompson wrote:
> Hi.
>
> Does anyone know if the mssql_connect/_init/_bind/etc require a lot
> of overhead?
>
> I have a page that requires multiple function calls and each of those
> opens a new connection to the database, performs the necessary
> actions in stored procedure(s), and then closes the connection.
> However, I found this to be slower than I was wanting. So I thought,
> just create one connection and assign it to the SESSION (a global),
> and in each function that requires a connection, call that SESSION
> variable. At the end of the page, close the connection and nullify
> the variable.
>
> Does anyone see a problem with doing it this way? Security concerns?
> Anything?
>
> Thanks in advance,
> ~Philip


Using pconnect solves your problem (if I understood correctly (I had liddle 
English knowladge). Putting data into $_SESSION may bit slower because every 
time you nullf the variable and that means php have to serialize $_SESSION 
and wrote into disk. (You may use SQL or Memcached base sessions)

just generate for example $_db variable and make it global, call every 
function. if your regenerate your db connection data every time you init the 
script, you don't need to store int $_SESSION. 

$_SESSION gives you state, not security. Actually it stores data into disk (or 
sql or memory (depends your config)) per connection state (PHPSESSID).

and if you bored declaring global $_db in ever function you may use 
$GLOBALS['_db'] = $_db 

then call in other functions

and if you want speed  use Memcached.  Using SQL for state like using Tractor 
in F1 Race.

Regards

Sancar

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



[PHP] Debugging PHP

2007-01-12 Thread Sancar Saran
Hi,

Due to my English knowladge shortcomings or just my own stupity I cannot setup 
a working php debug module.

Is any one have working solution.

My target was, able to check every functions and or files for performance 
issues.

I thing this called profiling or someting like that.

Regards

Sancar

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



Re: [PHP] most powerful php editor

2007-01-24 Thread Sancar Saran
I believe this was related to what did you want to do with your editor. 

I use these editors

Linux - KDE -> Kate
Win32 -> Ultra Edit

Both are support UTF8 and both can handle more than one file at one session.. 
Enough search and replace abilites.  Both can highlight code...

I wish to KDE (and or Kate) can support key macros to support my G15 extra 
buttons for speeding up some HTML and PHP standart code blocks...

I use pico and nano for editing php code very long time ago. (multiple shell 
windows etc).

Then I realize, abilites of editor effect my coding style. At that days, I 
star to add line brake to SQL querys line because of long sql querys does not 
fit the screen.

And also I detect when you adjust yourself to high capacity editor, you may be 
very frusturated and feel uncomfortable with that low capacity ones...

and also in these days I'm looking for 19 inch (or more) wide LCD sceerns to 
able to fit longer lines in my screen...

Regards

Sancar

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



[PHP] Unserialize problem (and or bug)

2007-01-24 Thread Sancar Saran
Hi,

After updating company test server to dotdeb 5.2.0 it star to give memory 
problems (even 32mb session). I tought it was because of suhosin. And I 
cannot update that server to vanilla debian php5 package because it was a 
sarge so today my company gives me another debian etch (like my home pc). I 
setup latest php 5.2.0.8 for debian etch.

Then unserialize gives another problem 

Message: unserialize(): Error at offset 1384 of 3177 bytes
Code: 8
Line: 419

My pc uses debian etch and have php 5.1.6-5 my scripts working normally.

Is there any suggestion for handle this ? 

Regards

Sancar

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



Re: [PHP] Unserialize problem (and or bug)

2007-01-24 Thread Sancar Saran
Hi,
I mean there was no offical php5 package for debian sarge. Dotdeb was not 
offical.

On Wednesday 24 January 2007 17:46, Németh Zoltán wrote:
> On sze, 2007-01-24 at 17:17 +0200, Sancar Saran wrote:
> > Hi,
> >
> > After updating company test server to dotdeb 5.2.0 it star to give memory
> > problems (even 32mb session). I tought it was because of suhosin. And I
> > cannot update that server to vanilla debian php5 package because it was a
> > sarge so today my company gives me another debian etch (like my home pc).
> > I setup latest php 5.2.0.8 for debian etch.
>
> sorry for my ignorance but what is the difference between "vanilla php5"
> and php5?
>
> thanks
> Zoltán Németh
>
> > Then unserialize gives another problem
> >
> > Message: unserialize(): Error at offset 1384 of 3177 bytes
> > Code: 8
> > Line: 419
> >
> > My pc uses debian etch and have php 5.1.6-5 my scripts working normally.
> >
> > Is there any suggestion for handle this ?
> >
> > Regards
> >
> > Sancar

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



Re: [PHP] Unserialize problem (and or bug)

2007-01-25 Thread Sancar Saran
Hi
On Thursday 25 January 2007 02:16, Richard Lynch wrote:
> On Wed, January 24, 2007 9:17 am, Sancar Saran wrote:
> > After updating company test server to dotdeb 5.2.0 it star to give
> > memory
> > problems (even 32mb session). I tought it was because of suhosin. And
> > I
> > cannot update that server to vanilla debian php5 package because it
> > was a
> > sarge so today my company gives me another debian etch (like my home
> > pc). I
> > setup latest php 5.2.0.8 for debian etch.
> >
> > Then unserialize gives another problem
> >
> > Message: unserialize(): Error at offset 1384 of 3177 bytes
> > Code: 8
> > Line: 419
> >
> > My pc uses debian etch and have php 5.1.6-5 my scripts working
> > normally.
> >
> > Is there any suggestion for handle this ?
>
> What is in the data at byte 1384 that can't be unserialized?

some UTF-8 data

>
> Are you trying to take data serialized by one version of PHP and
> unserialize it with another?
Yes
> That does not work in current versions, though discussion on Internals
> lends hope that future versions will be able to deal intelligently
> with this situation.

Jochem was inform me, then I was re generate that arrays then problem fixed. 

>
> Check http://bugs.php.net/ for similar bugs -- there may be a patch.
>
> Also check with suhosin and Debian bug tracking, as it may be specific
> to either of those.
>

Currently My machine and target has same php version, Today I may do another 
transfer. I'll recheck situation, maybe backporting data from server solve 
the issue. And or I move my machine to more updated PHP...

Dotdeb (including suhosin) and standart PHP act very differently. In dotdeb 
unserialize filling 32 mb'ed session and stop. Vanilla php 5.1.6 (at target 
server) and 5.2.0 (at target server) giving offset error...

More interesting was I'm on so tigh schedule to do someting... 

Maybe I have to go and burn a candle to St.Murphy

God save Jochem and you, because there was no info anywhere in web, yesterday 
I go crazy. And I bet myself to this serialize/unserialize thing...

Many thanks...


Sancar

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



Re: [PHP] most powerful php editor

2007-01-25 Thread Sancar Saran
On Wednesday 24 January 2007 15:41, Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-01-24 13:57:03 +0200:
> > and also in these days I'm looking for 19 inch (or more) wide LCD
> > sceerns to able to fit longer lines in my screen...
>
> Number of reading errors people make grows with line length,
> this has been known for as long as I remember.  You're increasing the
> probability of bugs in the code, and get tired sooner because following
> long lines requires more energy.

Yes and no, because these days I'm obsessed very very large arrays like 
$arr['this']['is']['what']['i']['m']['looking']['for'];

And If I start to do 

if( ($arr['this']['is']['what']['i']['m']['looking']['for'] > 5) && 
($arr['this']['is']['what']['i']['m']['looking']['for'] < 10))

blah blah

then problem begins :)

> --
> How many Vietnam vets does it take to screw in a light bulb?
> You don't know, man.  You don't KNOW.
> Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] memory_limit Setting?

2007-01-26 Thread Sancar Saran
On Friday 26 January 2007 19:35, Jay Paulson wrote:
> Hi everyone,
>
> I¹m trying to upload a 25MB file via PHP and I¹m setting the memory limit
> way high so I don¹t get a fatal error from php (the error is below).  What
> I find really odd about this is that the error message says that PHP tried
> to allocate almost 54MB.  First question is why is PHP allocating so much
> memory when I¹m only uploading a 25MB file?  Second question is why is PHP
> failing when obviously the memory limit is set to just over 100MB?  (I¹m
> using PHP 5.1.2 Apache 2.0.55 and using an .htaccess file to change the PHP
> settings on the fly.)
>
>
> Fatal error: Allowed memory size of 104857600 bytes exhausted (tried to
> allocate 53764163 bytes) in /path/to/php/file on line 942
>
> .htaccess settings below:
>
> php_value memory_limit 100M
> php_value post_max_size 30M
> php_value upload_max_filesize 30M
> php_value max_execution_time 300
> php_value max_input_time 300
> php_value display_errors On

In these days combining UTF-8 with serialize commands gives memory problems. 
Is your code coantains this combination.

?

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



[PHP] Server Stall

2007-02-05 Thread Sancar Saran
Hi,

One of my scripts are using wget to get external xml data

$fp = popen ("wget -O - '".$dst."' | cat","r");

Some time $dst host responds very slowly. And that time if I open another 
connection to same server the second request waits to complete wget 
operation.

I'm very noobie about this file operations. Is there any suggestion about this 
situation ?

Regards.

Sancar

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



Re: [PHP] PHP4 to PHP5 issue

2007-02-05 Thread Sancar Saran
Hi,

It look like your system cannot init adodb library.
It may SQL setup problem...

On Monday 05 February 2007 19:58, Skip Evans wrote:
> Hey all,
>
> I installed a new FreeBSD 6.0 server here in the
> office with PHP5. I moved over several sites we
> developed under PHP4, and all of those seem to be
> functioning perfectly, but I am getting an error
> on to sites, on PostNuke based and our dotProject
> system.
>
> Both errors are the same, and here is the one from
> dotProject:
>
> Fatal error: Call to a member function Execute()
> on a non-object in
> /usr/home/dotproject/public_html/classes/query.class.php
> on line 589
>
> And the code:
>
> $this->_query_id =  $db->Execute($q);
>
> Where $q is a pretty typical SQL statement.
>
> What I'm wondering if there is an easy way to
> convert $q to an object type rather than a string
> to satisfy Execute? Or some other straightforward fix?
>
> Thanks!
>
>
> Skip Evans
> Big Sky Penguin, LLC
> 61 W Broadway
> Butte, Montana 59701
> 406-782-2240
> http://bigskypenguin.com
> =-=-=-=-=-=-=-=-=-=

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



Re: [PHP] Server Stall

2007-02-05 Thread Sancar Saran
Hi, Matt
Thanks for answer, I try your solution and use it. 

And interestingly I found this,

If my request coming from second tab of firefox it will wait util first 
request done.

I think php does not open second thread for same session...

Anyway thanks for answer. It was very useful..

Regards


On Monday 05 February 2007 20:32, Matt Carlson wrote:
> function doRequest($method, $url, $vars = '', $headers = '0') {
>     $ch = curl_init();
>     curl_setopt($ch, CURLOPT_URL, $url);
>     curl_setopt($ch, CURLOPT_HEADER, $headers);
>     curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
>     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
>     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>     curl_setopt($ch, CURLOPT_TIMEOUT, 30);
>     curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
>     curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
>     if ($method == 'POST') {
>         curl_setopt($ch, CURLOPT_POST, 1);
>         curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);
>     }
>     $data = curl_exec($ch);
>     curl_close($ch);
>     if ($data) {
>         return $data;
>     }
>     else {
>         return curl_error($ch);
>     }
> }

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



Re: [PHP] Updating PHP checkout page

2007-02-09 Thread Sancar Saran
On Friday 09 February 2007 21:29, Robert wrote:
Greetings,
This is about to your aproach to problem.

For my point of view there are too many solution.

1-) Is that customer may have to register himself? If so you may get from his 
state date from here (when customer register himself you require his state 
data). This solution can be done in PHP.

2-) If that justomer may not have to register. This is mainly Javascript 
solution. A liddle js library may solve this. Of course you can post his data 
to server and calculate tax then post back again.

3-) And or you may generate ajax solution for this. When user selects his 
state, script auto post and get calculated tax.

4-) and of course BEST WAY is find a professional php programmer. Then tell 
what do you want. 

Ps: Also you may guessing STATE via IP number checking. (and this was not 100% 
safe way)

Regards 
Sancar

> Hopefully I will manage to explain my problem and you will have a solution
> for it :).
> I have a checkout page, coded in PHP (by some other coder, not available
> anymore). On the page I have one table containing shopping cart items and
> one submission form, to collect all information from the customer. When the
> page is loaded, the table is filled with data from the temporary data table
> through SQL query (collected on the previous page, shopping cart page),
> except for the field about the amount of the sales tax, which is not yet
> known because I don't know anything about the customer. So I have a
> shopping cart table and a blank form below that, ready to be filled with
> customer's information.
>
> Now, my question is: How can I calculate and fill the sales tax field in
> the shopping cart table, if the customer chooses his state from the drop
> down list in the form? I must say here that the sales tax is only
> applicable for residents of just one state, Vermont, because the company is
> based in Vermont. For instance, if the customer chooses Vermont as his
> state, how this can be translated into sales tax amount, added into the
> field in the shopping cart table and recalculated the total amount? Should
> the page be reloaded, with changed value of some variable for the sales
> tax? Should the JavaScript be used?
> All information entered in the form should be kept after the selection of
> the state and calculation is made (I assume that the page should be
> reloaded/refreshed), so the user shouldn't have to re-enter them again.
> After this recalculation, the customer hits the "Make Purchase" button and
> the form is submitted and the receipt for the purchase is sent.
>
>
>
> I'm not very familiar with PHP or JavaScript, so any help is greatly
> appreciated.
>
>
>
>
> Thanks,
> Robert

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



Re: [PHP] Re: Text Editor for Windows?

2007-02-09 Thread Sancar Saran
I bet for one more week about this topic ? Any bidders ?

:)

Regards

Sancar

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



[PHP] Web Based Game Theory

2007-02-11 Thread Sancar Saran
Greetings all,

I just want to TRY write a web based strategy game. Lets say a famous ogame 
clone.

Is there any paper about to game engine. I feel a bit a lost.

For example, for realtime gaming I need some kind of back size cli based big 
game loop. Right ?

Last night I try to write down some thoughts. 

Its look like I need a some kind of scheduler. Some kind of event system to 
process events..

So, I'm looking for papers to give a clue about these problems

Regards

Sancar

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



Re: [PHP] insert html into php variable

2007-02-12 Thread Sancar Saran
Hi,

If I understood your questions here my solution.

Tip: Do not use " in html files...

externalFile.php
".$arrData[$i]['foo']." ".$arrData[$i]['bar']." ".$arrData[$i]
['baz']."\n";
}
?>

mailFile.php
Some 
Header\n";


$strSubject = "This Is subject";

$strBody =
"
".$strFirsRow."
".$strExternal."
\n";

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From = $strFrom;
$mail->FromName = $strFormName;
$mail->Host = $strMailHost;
$mail->SMTPAuth = $strMailAuth;
$mail->Username = $strMailUserName;
$mail->Password = $strPassword;
$mail->Mailer   = $strMailer;
$mail->IsHTML(true);
$mail->Subject  = $strSubject;
$mail->Body = $strBodyHtml;
$mail->AddAddress($strToAddress);

if(!$mail->Send())
{
echo "can't send mail\n";
}

unset($mail);
?>

Regards

Sancar

On Monday 12 February 2007 14:03, Ross wrote:
> I am using phpmailer for a rich html mailer and I have been using lines
> like this to build up the mailbody
>
>
> $mail_body .= " src=\"http://www.myurl.org/mylogo.gif\";;
>
>
>
> Is there a  build in function to assign html code to a php variable and
> then output them? Or can I read an external php file into a variable?
>
> 
> div id="content-top">thsi is some content
>  
>  
>   
>
>
>
> many thanks,
>
>
> R.

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



Re: [PHP] $_FILES path on client's machine?

2007-02-18 Thread Sancar Saran
Hi,
No solution from php...

If you find you way to read form file tag path via js you ma send this value 
to server and may store sql then send back.

Aslo I'm not sure to sending back those stored info to client solve the 
problem. 

If you really want to do this.

You have to write your own file browser uploader form via Flash...

regards 

On Sunday 18 February 2007 04:19, Skip Evans wrote:
> Hey all,
>
> I get the feeling from not finding an argument for
> the path on the client's machine for the complete
> path of a file in $_FILES that it might not be
> available for security reasons?
>
> The reason  I am interested in this is to restore
> the value of a input type='file' field in a form if
> the user has to return to the form for validation
> reasons.
>
> I'd like to restore the full value so the user does
> not have to browse the file again.
>
> Is there a way to do this?
>
> I thought perhaps there might be a
> $_FILES['image']['path'] value or something.
>
> Thanks!
> --
> Skip Evans
> Big Sky Penguin, LLC
> 61 W Broadway
> Butte, Montana 59701
> 406-782-2240
>
> =-=-=-=-=-=-=-=-=-=-=
>
> Check out PHPenguin, a lightweight and versatile
> PHP/MySQL development framework.
>
> http://phpenguin.bigskypenguin.com

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



Re: [PHP] What is $this->

2007-02-19 Thread Sancar Saran
Hi,

I believe there are more offical answes available at around the web.

This is what I understand $this->

This is a base OO programming thing.

IN oo world you have to create new object to do someting.

like

$db = new adodb;

so after the generate object you will modify this object via functions.

$db->execSql($sql);

when you send this command, your class have to do someting with the object...

and program have to know which object?, because you can create unlimited 
amount of object from same code. So. $this points current object.

when you do someting with any object, inside of his class code his name was 
always $this.

Hope helps.

Sancar




On Monday 19 February 2007 02:52, Dick Richard wrote:
> Can someone explain what $this-> does and means. For example what does this
> bit ot php code mean?
>
> $this->SetFont('Arial','B',15);
>
> Thanks
>
> [EMAIL PROTECTED]

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



Re: [PHP] css in mail()

2007-02-19 Thread Sancar Saran
On Monday 19 February 2007 17:03, Danial Rahmanzadeh wrote:
> how can i use css with mail()?
> thank u



Title
".$data."


Html content

";

mail('[EMAIL PROTECTED]', 'You are welcome', $mail);
?>

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



Re: [PHP] css in mail()

2007-02-20 Thread Sancar Saran
Hi,
On Wednesday 21 February 2007 01:14, Richard Lynch wrote:
> On Mon, February 19, 2007 10:56 am, Sancar Saran wrote:
> > On Monday 19 February 2007 17:03, Danial Rahmanzadeh wrote:
> >> how can i use css with mail()?
> >> thank u
> >
> >  > $data ='';
> > $fp = fopen ("site/themes/".$arrStat['theme']."/css/main.css","r");
> > while (!feof($fp)) { $data.= fgets($fp, 16384); }
> >
> > $mail="
> > 
> > 
> > Title
> > ".$data."
> > 
> > 
> > Html content
> > 
> > ";
> >
> > mail('[EMAIL PROTECTED]', 'You are welcome', $mail);
> > ?>
>
> No.
>
> This will only work on very badly-broken email clients.
Really ?
I did not have to much choices to check it, In KMAIL everything looks nice.

Thanks for info
> I believe, in fact, that the only email client broken enough for this
> to work is Outlook.
>
> Though I suspect some very lame web-based email client might actually
> work, come to think of it.

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



Re: [PHP] css in mail()

2007-02-21 Thread Sancar Saran
Hi,
Actual was this

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

 
 
 
 
 Title
 
 
...

Those code was example.


On Wednesday 21 February 2007 06:39, Peter Lauri wrote:
> If you are just using the code snippet below you will probably get problems
> in Outlook and some other clients. This because you haven't set the proper
> header.
>
> But I actually need to assume you did send with a more sophisticated
> version. Otherwise KMAIL probably displayed it incorrectly as well.
>
> Best regards,
>
> Best regards,
> Peter Lauri
>
> www.dwsasia.com - company web site
> www.lauri.se - personal web site
> www.carbonfree.org.uk - become Carbon Free
>
>
> -Original Message-
> From: Sancar Saran [<a  rel="nofollow" href="mailto:[EMAIL">mailto:[EMAIL</a> PROTECTED]
> Sent: Wednesday, February 21, 2007 3:02 AM
> To: [EMAIL PROTECTED]
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] css in mail()
>
> Hi,
>
> On Wednesday 21 February 2007 01:14, Richard Lynch wrote:
> > On Mon, February 19, 2007 10:56 am, Sancar Saran wrote:
> > > On Monday 19 February 2007 17:03, Danial Rahmanzadeh wrote:
> > >> how can i use css with mail()?
> > >> thank u
> > >
> > > <?php
> > > $data ='';
> > > $fp = fopen ("site/themes/".$arrStat['theme']."/css/main.css","r");
> > > while (!feof($fp)) { $data.= fgets($fp, 16384); }
> > >
> > > $mail="
> > > <html>
> > > <head>
> > >   <title>Title</title>
> > >   <style>".$data."
> > > 
> > > 
> > > Html content
> > > 
> > > ";
> > >
> > > mail('[EMAIL PROTECTED]', 'You are welcome', $mail);
> > > ?>
> >
> > No.
> >
> > This will only work on very badly-broken email clients.
>
> Really ?
> I did not have to much choices to check it, In KMAIL everything looks nice.
>
> Thanks for info
>
> > I believe, in fact, that the only email client broken enough for this
> > to work is Outlook.
> >
> > Though I suspect some very lame web-based email client might actually
> > work, come to think of it.

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



Re: [PHP] New Menu Bar - Can people test it for me?

2007-02-21 Thread Sancar Saran
On Wednesday 21 February 2007 14:12, Scott Gunn wrote:
OK for Konquerror Linux 
> All,
>
> http://www.thebigspider.co.uk/test/menu.html
>
> I'm going to write some php code which will build this menu from an XML
> file.
>
> Before I do, I want to know what sort of browser compatibility it has?
> could you guys test it and let me know if it worked ok and looked like the
> preview picture?
>
> If your on IE7 or Firefox2 and it works please don't email back as I know
> these work fine.
>
> Best Regards
> Scott.

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



Re: [PHP] PHP+MySQL website cache ? Yes/No

2007-02-25 Thread Sancar Saran
Hi,

If you able to access memcached. Use memcached. 
Put your shopping chart items, rendered html items in memcached.

It was MUCH faster solution...

Regards

Sancar

On Sunday 25 February 2007 13:59, Martin Zvarík wrote:
> This benchmark is not very accurate, but you are right the database
> connection took most of the time.
>
> Shopping cart is stored in session - not in database.
>
> I am half-way doing the eshop I bet it will took much more than 0.01 sec
> to generate the final version.
>
> I was going to make this file cache system, but I relies that for each
> page like (?page=News, ?page=Products etc.) these HTML blocks
> (Navigation, Recommended) changes and that would mean I would have
> eventually like 50+ cached files.
>
> One way or another I will always need to connect do database (I cannot
> cache 300 products in 300 files, can I?). So I decided to put the cache
> in database table - For each URL Name (news/, products/ etc) a Cache
> (which will be an array of all HTML blocks).
>
> Martin
>
> [EMAIL PROTECTED] napsal(a):
> > Quoting Martin Zvarík <[EMAIL PROTECTED]>:
> >> I did a benchmark with and without caching to HTML file and it's like:
> >>
> >> 0.0031 sec (with) and 0.0160 sec (with database)
> >>
> >> I know these miliseconds don't matter, but it will have significant
> >> contribution in high-traffic website, won't it?
> >>
> >> Martin
> >>
> >> --PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > Yes it will. And the 0.0129 seconds extra most of it is maybe to create
> > the DB connection. Or are you using a persistent connection and reuseing
> > it?
> >
> > This benchmark was that together with all other content of the page? I
> > mean including your dynamic shopping cart etc?
> >
> > /Peter
> >
> > --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



[PHP] Re: [PHP-DB] array field type

2007-03-04 Thread Sancar Saran
On Sunday 04 March 2007 23:04, Sancar Saran wrote:
> Hi,
>
> I want to know is there any db server around there for store php arrays
> natively.
>
> Regards
>
> Sancar
Thanks for responses, it seems I have to give more info about situation.

In my current project, we had tons of arrays. They are very deep and 
unpredictable nested arrays.

Currently we are using serialize/unserialize and it seems it comes with own 
cpu cost. Xdebug shows some serializing cost blips. Sure it was not SO BIG 
deal (for now of course).

My db expertise covers a bit mysql and mysql does not have any array type 
field (enum just so simple). 

I just want to know is there any way to keep array data type natively in a sql 
field.

Regards.

Sancar

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



[PHP] Re: [PHP-DB] array field type

2007-03-05 Thread Sancar Saran
Thanks for all those replies. It seems there was no easy solution (and or 
serializing was better solution) for us.

Our arrays contains lots of things.. XML may not fit because content of array 
may broke xml structure. 

Thanks for help.

Regards

Sancar.

> >>>Hi,
> >>>
> >>>I want to know is there any db server around there for store php arrays
> >>>natively.
> >>>
> >>>Regards
> >>>
> >>>Sancar
> >>
> >>Thanks for responses, it seems I have to give more info about situation.
> >>
> >>In my current project, we had tons of arrays. They are very deep and
> >>unpredictable nested arrays.
> >>
> >>Currently we are using serialize/unserialize and it seems it comes with
> >>own cpu cost. Xdebug shows some serializing cost blips. Sure it was not
> >> SO BIG deal (for now of course).
> >>
> >>My db expertise covers a bit mysql and mysql does not have any array type
> >>field (enum just so simple).
> >>
> >>I just want to know is there any way to keep array data type natively in
> >> a sql field.
> >>
> >>Regards.
> >>
> >>Sancar
>
> _
> Win a trip for four to a concert anywhere in the world!
> http://www.mobilelivetour.ca/

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



Re: [PHP] module and access rights

2007-03-06 Thread Sancar Saran
Hi,
On every request you have to check access rights.

So you need access rights. someting like this

rights table
page_id
user_login
right_type

select right_type from rights_table
where page_id = '".$PHP_SELF."'
and user_login ='".$_SESSION['user_login']."'

if this query returns someting, your code give the permission if not
you show "access denied message"

Regards

Sancar

On Monday 05 March 2007 16:05, Alain Roger wrote:
> I already started to use SSL, but i do not understand how to keep it
> running.
>
> I mean after user has been authenticated and authorized to go further, all
> next web pages are opened using PHP location(https://...); command.
> however, it does not certify that it can not be faked by just typing into
> browser address bar https://another_webpage.php
>
> for example :
> 1.my login page is called "index.php" and it is accessible only by https.
> if user type http://../index.php, the index.php redirect itself to
> https://.../index.php.
> 2. user type logon and password.
> 3. application control it with information stored into DB and authorize
> user to go further, so a session is created and user is redirected to
> https://.../welcome.php
>
> what avoid hacker to directly type https://.../welcome.php ?
> how to be sure that it works correctly as in my example ?
>
> thanks a lot,
>
> Al.
>
> On 3/4/07, Stut <[EMAIL PROTECTED]> wrote:
> > Tijnema ! wrote:
> > > On 3/4/07, Stut <[EMAIL PROTECTED]> wrote:
> > >> Tijnema ! wrote:
> > >> > Give your server a unique ID, and add that to your check string lets
> > >>
> > >> say
> > >>
> > >> > so you store in your cookie the username and the check string.
> > >> >
> > >> > example
> > >> > $user = "tijnema";
> > >> > $server_unique_key =
> > >> > "w#$#%#54dfa4vf4w5$2!@@$
> > >> > ";
> > >> > $check_string = md5($server_unique_key.$user.$server_unqie_key);
> > >> >
> > >> > and check that each time the user does an action.
> > >>
> > >> How, exactly, is that any more secure than a standard session
> >
> > identifier?
> >
> > >> While it's good to worry about security, adding pointless activity
> > >> such as this to every request is not going to help. Anything you do is
> > >> going to involve some piece of data being transferred from client to
> > >> server, and can therefore be faked/shared by the client. Get over it.
> > >>
> > >> -Stut
> > >
> > > It is ofcourse possible to share it to another client, but when
> >
> > combining
> >
> > > this with the IP address. This means it can only be used in the same
> >
> > LAN.
> >
> > > To get to the point, using this means you cannot simply fake the
> > > username in
> > > the cookie, which is possible else. session identifiers can be faked
> >
> > too.
> >
> > As I said in another email, you *cannot* use the IP address for any
> > verification without causing usability issues. It is perfectly
> > legitimate for sequential requests from any given user to come from
> > different IP addresses. The biggest user of systems like this is AOL,
> > and that's a fairly large user base you may want to avoid annoying by
> > insisting that they login for every other request.
> >
> > In short, this issue has been discussed to death, not only by the PHP
> > community but also by the web community at large. If you're really
> > paranoid, use SSL to secure all data transferred, but just accept that
> > it's possible that a session may be hijacked. However, unless you're a
> > bank, is anyone really going to bother?
> >
> > -Stut
> >
> > >> On 3/4/07, Alain Roger <[EMAIL PROTECTED]> wrote:
> > >> >> Ok, but i would be very glad to know how can i REALLY authenticate
> >
> > the
> >
> > >> >> user.
> > >> >> for example, user is logged, so i have in the cookie his login
> > >> >> name.
> > >> >>
> > >> >> how can i be sure that it's the same user and not some hacker who
> > >>
> > >> hacked
> > >>
> > >> >> the cookie and the session ?
> > >> >> what should be checked and where those data should be stored ?
> > >> >>
> > >> >> because i can store in DB the sessionID, and check it to every DB
> > >>
> > >> request
> > >>
> > >> >> user does...but a sessionID can be easily fake.
> > >> >>
> > >> >> So what should I do ?
> > >> >>
> > >> >> Al.
> > >> >>
> > >> >> On 3/4/07, Tijnema ! <[EMAIL PROTECTED]> wrote:
> > >> >> > On 3/4/07, Stut <[EMAIL PROTECTED]> wrote:
> > >> >> > > Alain Roger wrote:
> > >> >> > > > I would like to implement a module access rights in my web
> > >> >> >
> > >> >> > application.
> > >> >> >
> > >> >> > > > Basically after authentication and authorization. Logged user
> > >>
> > >> has
> > >> a
> > >>
> > >> >> > > > particular profile which allow him to have access to some
> > >>
> > >> part of
> > >>
> > >> >> > the
> > >> >> >
> > >> >> > > web
> > >> >> > >
> > >> >> > > > application.
> > >> >> > > >
> > >> >> > > > after reading the security guide from *php*sec.org webpage,
> >
> > i'm
> >
> > >> >> > confused
> > >> >> >
> > >> >> > > > regarding how to store user login and passwor

[PHP] Value evaluation library

2007-03-11 Thread Sancar Saran
Hi,

Does anyone suggest to evaluation lib. 

I want to build sometin for check user posted values in php. If I remember 
correctly zend framework has someting like this...

So I cust need evaluation part. 

Is there any other good lib around there ?


Regards

Sancar

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



Re: [PHP] Performance: While or For loop

2007-03-24 Thread Sancar Saran
Hi,
I'm using so much FOR loops in my code, after seeing discussion I try to test. 
My findigs it was giving %2 to %10 percent performance boost.

So ?

My recent template addon to this code cost me around %5 to %10 percent of 
total page process.. 

I think It was nice trade off.

Thank you guys.

Just changing two chars.

Regards

Sancar

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



[PHP] Zend Guard Performance Problem

2007-03-28 Thread Sancar Saran
Hi,

Recently we bought Zend Guard and because of Zend encoder we have to use 
another Opcode cacher other than APC.

After searching net I found eAccelerator.

After installing eAccelerator with Zend Guard I saw more than %30 percent 
performance lost against Normal PHP + APC.

Here my setup

;eAccelarator
zend_extension="/usr/lib/php5/20060613+lfs/eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"

[Zend]
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.2.6
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.2.6
zend_optimizer.version=3.2.6
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

E accelerator gives %100 boost for normal php and not much as APC.

Is anyone have any idea about this ? Any suggestion to another opcode cacher 
and or Zend Guard options.

Regards

Sancar

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



Re: [PHP] Zend Guard Performance Problem

2007-03-28 Thread Sancar Saran
On Wednesday 28 March 2007 11:36, Chris wrote:
> Sancar Saran wrote:
> > Hi,
> >
> > Recently we bought Zend Guard and because of Zend encoder we have to use
> > another Opcode cacher other than APC.
> >
> > After searching net I found eAccelerator.
> >
> > After installing eAccelerator with Zend Guard I saw more than %30 percent
> > performance lost against Normal PHP + APC.
>
> Wouldn't it be better to talk to Zend directly about this? Since you've
> purchased their software they give you support and are pretty helpful.
>

Really ???, 

Owww how can I miss this 

Maybe you did not notice they sell own Expensive opcode cache...

If I understand your point of view, I can guess  your reply. "If you had rich 
enogh to buy a encoder, you can buy that zend cache". 

Thank you...

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



Re: [PHP] Re: WYSIWYG vs. the 'power-user'

2007-04-13 Thread Sancar Saran
It depends what did you want...

For example. My current project uses own template engine. It was so simple. 
you have to use {} marked nodes inside of generic html document.

You have to use text editor to update template file...

Then guess what... Our HTML designers cring for dreamweaver support. Yes sure 
they are very capable html design (they can create better designs than me). 
And without dreamweaver their capacity was gone...

In GUI mode you are connected to gui. Without it your knowladge was 
worthless...

Depending some buttons and images make me sick. 

And if you there for doing someting to win your food, gui way is so much 
simpler.

And if you there for walking to your way you have to know what happen inside 
to depend only yourself...

Regards

Sancar

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



Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Sancar Saran
On Wednesday 24 March 2010 03:17:56 Tommy Pham wrote:
> Let's go back to my 1st e-commerce example.  The manufacturers list is
> about 3,700.  The categories is about about 2,400.  The products list
> is right now at 500,000 and expected to be around 750,000.  The site
> is only in English.  The store owner wants to expand and be I18n:
> Chinese, French, German, Korean, Spanish.  You see how big and complex
> that database gets?  The store owners want to have this happens when a
> customer clicks on a category:
> 
> * show all subcategories for that category, if any
> * show all products for that category, if any,
> * show all manufacturers, used as filtering, for that category and
> subcategories * show price range filter for that category
> * show features & specifications filter for that category
> * show 10 top sellers for that category and related subcategories
> * the shopper can then select/deselect any of those filters and
> ability to sort by manufacturers, prices, user rating, popularity
> (purchased quantity)
> * have the ability to switch to another language translation on the fly
> * from the moment the shopper click on a link, the response time (when
> web browser saids "Done" in the status bar) is 5 seconds or less.
> Preferably 2-3 seconds. Will be using stopwatch for the timer.
> 
> Now show me a website that meets those requirements and uses PHP, I'll
> be glad to support your argument about PHP w/o threads :)  BTW, this
> is not even enterprise requirement.  I may have another possible
> project where # products is over 10 million easily.  With similar
> requirements when the user click on category.  Do you think this site,
> which currently isn't, can run on PHP?
> 
> Regards,
> Tommy


If you design and code correctly. Yes.


If you want to use someting alredy. Try TYPO3.

PS: Your arguments are something about implementation not something about 
platform abilities. You can do this things any server side programming with 
enough hardware.

Regards

Sancar







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



Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Sancar Saran
On Wednesday 24 March 2010 21:42:53 Tommy Pham wrote:
> On Wed, Mar 24, 2010 at 10:18 AM, Sancar Saran  
wrote:
> > On Wednesday 24 March 2010 03:17:56 Tommy Pham wrote:
> >> Let's go back to my 1st e-commerce example.  The manufacturers list is
> >> about 3,700.  The categories is about about 2,400.  The products list
> >> is right now at 500,000 and expected to be around 750,000.  The site
> >> is only in English.  The store owner wants to expand and be I18n:
> >> Chinese, French, German, Korean, Spanish.  You see how big and complex
> >> that database gets?  The store owners want to have this happens when a
> >> customer clicks on a category:
> >> 
> >> * show all subcategories for that category, if any
> >> * show all products for that category, if any,
> >> * show all manufacturers, used as filtering, for that category and
> >> subcategories * show price range filter for that category
> >> * show features & specifications filter for that category
> >> * show 10 top sellers for that category and related subcategories
> >> * the shopper can then select/deselect any of those filters and
> >> ability to sort by manufacturers, prices, user rating, popularity
> >> (purchased quantity)
> >> * have the ability to switch to another language translation on the fly
> >> * from the moment the shopper click on a link, the response time (when
> >> web browser saids "Done" in the status bar) is 5 seconds or less.
> >> Preferably 2-3 seconds. Will be using stopwatch for the timer.
> >> 
> >> Now show me a website that meets those requirements and uses PHP, I'll
> >> be glad to support your argument about PHP w/o threads :)  BTW, this
> >> is not even enterprise requirement.  I may have another possible
> >> project where # products is over 10 million easily.  With similar
> >> requirements when the user click on category.  Do you think this site,
> >> which currently isn't, can run on PHP?
> >> 
> >> Regards,
> >> Tommy
> > 
> > If you design and code correctly. Yes.
> > 
> > 
> > If you want to use someting alredy. Try TYPO3.
> > 
> > PS: Your arguments are something about implementation not something about
> > platform abilities. You can do this things any server side programming
> > with enough hardware.
> > 
> > Regards
> > 
> > Sancar
> 
> Platform abilities = PHP with/without threads.
> Implementation = If PHP has threads, how do I implement it.  If not,
> what work around / hacks do I need to do.


Please forgive my low ability on English and you sound like.

"I can drive a car, if it has a diesel engine and we want Ferrari for our 
need. Is there any way to fit a diesel engine in Ferrari  ?"

Your problem isn't php, You problem is your way to think...

You are trying to bend php to fit your way of the building web sites.

I'm sorry, things does not work like that. 

You are trying to represent your business logic as "ENTERPRISE SOFTWARE 
STANDARTS".

I'm sorry, it wont ! 

Even with provocative subject, it still business logic at large.

On Large Web sites, Site has own standards which enterprise must have to 
obey.. (like Facebook or any other uber number cruncher you name it)

Anyway...

You want to build a damn huge web site with damn huge data set and damn huge 
requests per second.

and  you still want to use that SQL for primary data store for reading.

ARE YOU NUTS ???

With this kind of approach,

You will be in deep trouble with any language, with any Reational SQL Server.

If your customers need that kind of thing. You need lots of sophisticated 
people which know how to handle big things under web enviroment.

Good luck to you. 

Regards

Sancar

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



Re: [PHP] Will PHP ever "grow up" and have threading?

2010-03-24 Thread Sancar Saran
On Wednesday 24 March 2010 22:42:17 Rene Veerman wrote:
> On Wed, Mar 24, 2010 at 10:34 PM, Sancar Saran  
wrote:
> > On Wednesday 24 March 2010 21:42:53 Tommy Pham wrote:
> >> On Wed, Mar 24, 2010 at 10:18 AM, Sancar Saran 
> > 
> > wrote:
> >> > On Wednesday 24 March 2010 03:17:56 Tommy Pham wrote:
> >> >> Let's go back to my 1st e-commerce example.  The manufacturers list
> >> >> is about 3,700.  The categories is about about 2,400.  The products
> >> >> list is right now at 500,000 and expected to be around 750,000.  The
> >> >> site is only in English.  The store owner wants to expand and be
> >> >> I18n: Chinese, French, German, Korean, Spanish.  You see how big and
> >> >> complex that database gets?  The store owners want to have this
> >> >> happens when a customer clicks on a category:
> >> >> 
> >> >> * show all subcategories for that category, if any
> >> >> * show all products for that category, if any,
> >> >> * show all manufacturers, used as filtering, for that category and
> >> >> subcategories * show price range filter for that category
> >> >> * show features & specifications filter for that category
> >> >> * show 10 top sellers for that category and related subcategories
> >> >> * the shopper can then select/deselect any of those filters and
> >> >> ability to sort by manufacturers, prices, user rating, popularity
> >> >> (purchased quantity)
> >> >> * have the ability to switch to another language translation on the
> >> >> fly * from the moment the shopper click on a link, the response time
> >> >> (when web browser saids "Done" in the status bar) is 5 seconds or
> >> >> less. Preferably 2-3 seconds. Will be using stopwatch for the timer.
> >> >> 
> >> >> Now show me a website that meets those requirements and uses PHP,
> >> >> I'll be glad to support your argument about PHP w/o threads :)  BTW,
> >> >> this is not even enterprise requirement.  I may have another
> >> >> possible project where # products is over 10 million easily.  With
> >> >> similar requirements when the user click on category.  Do you think
> >> >> this site, which currently isn't, can run on PHP?
> >> >> 
> >> >> Regards,
> >> >> Tommy
> >> > 
> >> > If you design and code correctly. Yes.
> >> > 
> >> > 
> >> > If you want to use someting alredy. Try TYPO3.
> >> > 
> >> > PS: Your arguments are something about implementation not something
> >> > about platform abilities. You can do this things any server side
> >> > programming with enough hardware.
> >> > 
> >> > Regards
> >> > 
> >> > Sancar
> >> 
> >> Platform abilities = PHP with/without threads.
> >> Implementation = If PHP has threads, how do I implement it.  If not,
> >> what work around / hacks do I need to do.
> > 
> > Please forgive my low ability on English and you sound like.
> > 
> > "I can drive a car, if it has a diesel engine and we want Ferrari for our
> > need. Is there any way to fit a diesel engine in Ferrari  ?"
> > 
> > Your problem isn't php, You problem is your way to think...
> > 
> > You are trying to bend php to fit your way of the building web sites.
> > 
> > I'm sorry, things does not work like that.
> > 
> > You are trying to represent your business logic as "ENTERPRISE SOFTWARE
> > STANDARTS".
> > 
> > I'm sorry, it wont !
> > 
> > Even with provocative subject, it still business logic at large.
> > 
> > On Large Web sites, Site has own standards which enterprise must have to
> > obey.. (like Facebook or any other uber number cruncher you name it)
> > 
> > Anyway...
> > 
> > You want to build a damn huge web site with damn huge data set and damn
> > huge requests per second.
> > 
> > and  you still want to use that SQL for primary data store for reading.
> > 
> > ARE YOU NUTS ???
> > 
> > With this kind of approach,
> > 
> > You will be in deep trouble with any language, with any Reational SQL
> > Server.
> > 
> > If your customers need that kind of thing. You need lots of sophisticated
> > people which know how to handle big things under web enviroment.
> > 
> > Good luck to you.
> > 
> > Regards
> 
> how dramatic.
> how elitist.
> 
> and btw, use of sql where other solutions (like shared mem and
> threading!) is exactly what i'm against.
> 
> if you ppl just stop barracading, you'll see that with relatively
> minimal effort php can evolve with the times and make such things
> possible for us mere mortals.

Alright. Lets think different.

And please don't take things personal...

If the only problem is threading...

Will Python with mod wsgi solve the problem ? with this programming approach ?

Regards

Sancar...



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



[PHP] Opinion about the using $GLOBALS directly

2007-12-19 Thread Sancar Saran
Hello list.

I want know  to you opinions about using $GLOBALS directly.

like

$GLOBALS['myString'] = 'test';
$GLOBALS['myArray']['this'] = 'this';
$GLOBALS['myArray']['that'] = 'that';
$GLOBALS['myClassObj] = new SomeClass;

Regards

Sancar

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



Re: [PHP] Opinion about the using $GLOBALS directly

2007-12-19 Thread Sancar Saran
Hello Jochem,

Thanks for response, I'm using this aproach maybe more than one year. I did 
not get any problems. 
>
> there is no real difference between 'global $foo' and $GLOBALS['foo'],
> and the second is probably more maintainance friendly (as Rob pionted out)

Yes you are right writing global $foo in 25+ functions a bit problematic.

> that said, avoid globals like the plague - sometimes you may come up with
> a situation where using a global is really necessary - such situations
> should be the exception rather than the rule, often if your thinking of
> using a global there is another way of doing it. jmho

And this is why I'm asking here, WHY I should avoid globals like plague ? 
Every one says bad. Alright, but no one says WHY ?

I try to use alternative ways. But maintenance, complexty and speed costs much 
too high.

I did not see any benefit.

Robert Cummings says to "you may confusing to setting variable". I have some 
debugging methots to detect this.

And Of course I did not use someting like for($GLOBALS['i']=0;

And I use GLOBALS for everything for I need someting more than once. (Db 
pointer or config array etc).

Thanks for response 

Regards

Sancar

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



Re: [PHP] Opinion about the using $GLOBALS directly

2007-12-20 Thread Sancar Saran
Hello All,

Thanks for joining the conversation. It seems there where no real technical 
dead end for using $GLOBALS directly. 
Using $GLOBALS directly very similar to coding standarts. It just up to you.

Also I try explain my enviroment a liddle bit.

First of all my function declarationgs gonna like this

// Set Shorcut Variables
$arrConf   = &$GLOBALS['_LIVE']['_CONF'];
$arrStat   = &$GLOBALS['_LIVE']['_STAT'];
$arrDomSet = &$GLOBALS['_LIVE']['_DOMN'][$GLOBALS['_LIVE']['_STAT']['curDom']]
['settings'];
$arrLang   = &$GLOBALS['_LIVE']['_LANG'][$arrStat['language']];
$rootDir   = &$arrConf['rootDir'];
$webDir= &$arrConf['webDir'];
$arrDb = &$arrConf['_DB'];
$arrDbg= &$GLOBALS['_LIVE']['_DEBG'];


It grows and grows. And  some times in small functions, function declarations 
become larger than the function actual code.

Most of those GLOBALS usage are read only (like configuration variables, or 
stored language keys) or need to update anywhere in the system.

And unde one condition it may become problem.

If 3rd party users develop some code under my enviroment and if there where 
some change about GLOBALS['name'] or PHP core developers may change GLOBALS 
to GLB (or someting like that) there may problem to update 3rd party code.

To prevent this, putting some variable translation functions for 3rd party 
developers was good idea.

Other than this for my point of view it was very useful.

Thank you very much all of you.

Sancar

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



Re: [PHP] Opinion about the using $GLOBALS directly

2007-12-21 Thread Sancar Saran
example code
// current code

//--- Set DB
$GLOBALS['db'] = NewADOConnection($GLOBALS['c']['db']['type'].'://'. 
$GLOBALS['c']['db']['user'].':'.$GLOBALS['c']['db']['pass'].'@'.$GLOBALS['c']
['db']['host'].'/'.$GLOBALS['c']['db']['name']);
$ADODB_FETCH_MODE = ADODB_FETCH_NUM; // Fastest Get Method


function getGalaxy() {
$sqlGGal = "
SELECT *
  FROM ".$GLOBALS['c']['db']['pref']."universe
 WHERE planet_type = 'planet'
   AND planet_galaxy   = '1'
   AND planet_owner_id = 'null'
 ORDER BY planet_id ASC";

$GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC;
$resGGAL   = $GLOBALS['db']->Execute($sqlGGal);
return $resGal;
}

Other Suggestions

function getGalaxy() {
$dbPrefix = $GLOBALS['c']['db']['pref'];
$db = $GLOBALS['db'];
$sqlGGal = "
SELECT *
  FROM ".$dbPrefix."universe
 WHERE planet_type = 'planet'
   AND planet_galaxy   = '1'
   AND planet_owner_id = 'null'
 ORDER BY planet_id ASC";

$GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC;
$resGGAL   = $db->Execute($sqlGGal);
return $resGal;
}

or

function getGalaxy() {
$dbConfig = Zend_Registry::get('dbConfig');
$dbPrefix = $dbConfig['prefix'];
$db = NewADOConnection($dbConfig['type'].'://'. $dbConfig['user'].':'.
$dbConfig['pass'].'@'.$dbConfig['host'].'/'.$dbConfig['name']);

$sqlGGal = "
SELECT *
  FROM ".$dbPrefix."universe
 WHERE planet_type = 'planet'
   AND planet_galaxy   = '1'
   AND planet_owner_id = 'null'
 ORDER BY planet_id ASC";

$GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC;
$resGGAL   = $db->Execute($sqlGGal);
$db->Close();
return $resGal;
}

Etc etc. 

From my point of view first one was more usable. 

Anyhow dont worry. It seems PHP 5.3.0 supporting _NAMESPACE_ :)

Regards

Sancar

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



Re: [PHP] Opinion about the using $GLOBALS directly

2007-12-24 Thread Sancar Saran
Hello Tedd,

Here my opinoins

First of all, I ask this question to is there any technical dead end for using 
$GLOBALS directly.

It seems not.

And I believe other arguments was closely connected to coding style.

I'm self learner, I learn evrything about computers, programming (that means 
PHP) and English by myself. Because of this time to time I found my self into 
very alien position for others.

On Monday 24 December 2007 19:13:07 tedd wrote:
> At 4:18 PM +0200 12/19/07, Sancar Saran wrote:
> >  > that said, avoid globals like the plague - sometimes you may come up
> >  > with
> >>
> >>  a situation where using a global is really necessary - such situations
> >>  should be the exception rather than the rule, often if your thinking of
> >>  using a global there is another way of doing it. jmho
> >
> >And this is why I'm asking here, WHY I should avoid globals like plague ?
> >Every one says bad. Alright, but no one says WHY ?
>
> Hi:
>
> I'm a little late to this thread (been busy), but this is why I
> rarely use globals and have not used them in php.
>
> One of the fundamentals of programming I've learned is to reduce
> problem/solution to their most basic form. Simply, you see a problem
> and you solve it by dividing the problem it into smaller parts and
> then writing code to solve the small parts. Eventually, all the small
> solutions come together to solve the larger problem.

Absolutely. I learn this from very hard way. (rewriting the code :))

> Certainly, and it seems even logical, that you can use a global
> variable to communicate between the different parts and everything
> should work -- IF -- that's all there was to it. But, if you have to
> debug the code OR if you want to use a portion of that solution to
> solve a different problem, then you can have difficulties. For
> example:
>
> [1] If you have to debug the code, there's not a really good way to
> look at a function and see if a variable in it is a global or not --
> therein lies a problem, you don't readily know.
>
> In other languages I adopted a naming convention that used "g" as the
> first letter of a Global variable, like gThisIsMyGolbalVariable --
> that way at least I knew the variable was global. But, even then I
> didn't know where the global was defined or where it might be changed
> -- it was just an unknown in my function that I had to consider.

$GLOBALS['myVariable'] directly solves the problem. 

> [2] If you want to reused a portion of the code, then you have to
> also accommodate the global. This makes transporting your code from
> one application to another problematic because you never know IF your
> function replies on a global or not. If you never use globals, then
> that's never a problem.

If is there any possibility to use the function with some other variables I 
use it to.

> So, my advice is to not use globals, but rather make the functions
> independent from globals. That way you troubleshoot them easier and
> can cut/paste them into other solutions without having to worry if
> some part of that function relies on something who knows where.
>
> That's my reasons why I avoid globals.
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com

Here Some basic list for my $GLOBALS usage.

$GLOBALS['db'] =  my Adodb object
$GLOBALS['mc'] =  my Memcached object
$GLOBALS['l'] =  my Language keys
$GLOBALS['d'] = my debug pool. 
$GLOBALS['c'] = my config array.

And someting like that.

A very basic function for pooling debugs.

function addDebug($_sDebugVal) {
$GLOBALS['d']['_DMSG'][] = $_sDebugVal;
}

usage addDebug($MyVar); or addDebug(print_r($arrayFoo,true));

end of page 

getDebug() {
return $GLOBALS['l']['_debug_messages_']."".implode("\n".
$GLOBALS['d']['_DMSG'])."";
}

Regards

Sancar

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



Re: [PHP] best way for PHP page

2008-01-02 Thread Sancar Saran
On Wednesday 02 January 2008 09:17:50 Alain Roger wrote:
> Hi,
>
> i would like to improve my coding quality when i use PHP code and for that
> i would request your help.
> in my web developer experience, i have to confess that i've never succeeded
> in spliting PHP code from HTML code.
>
> i mean that all my web pages consist of PHP code mixed with HTML code (for
> rendering pages).
> Some developers tell it's possible to write only PHP code for web page. i
> agree with them but only when those PHP pages do not render web elements
> (write text, display pictures, display formular, ...).
>
> the purpose of my post is to know if i can really (at 100%) split client
> code (display images, write text,...) from server code (move or copy data
> to DB, create connection objects,...)
>
> so what do you think about that ?


Hello,

I believe TYPO3 has good implementation about splitting code and template.

And to archieve clean php code.

1-) Left   model development
2-) Find good template engine. (no not that smarty, it was too big)
3-) use strict dicipline to move html to outside of the code.

Also if you can use the php based template files you can lift off the template 
overhead.

like.

template.php

$strPage = "

".$strPageTitle."




".$strLeftBlock."
".$strRigthBlock."



";

process.php

$strPageTitle = getPageTitle($_REQUEST['page']);
$strLeftBlock = getPageBlock($_REQUEST['page'],'left');
$strRightBlock = getPageBlock($_REQUEST['page'],'right');

include('template.php');

echo $strPage;

regards

Sancar

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



[PHP] Byte Size of an array

2008-01-07 Thread Sancar Saran
Hello,

I just wonder to how can I find a memory size of an array.

Regards

Sancar

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



Re: [PHP] uh oh, I defined a resoruce

2008-01-10 Thread Sancar Saran
Well,

ADODB and TYPO3 are  successfull oss procjecs which uses PHP and they utilizes 
globals at large.

Regards.

Sancar

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



Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Sancar Saran
On Sunday 13 January 2008 16:53:42 Jochem Maas wrote:
> Sancar Saran schreef:
> > Well,
> >
> > ADODB and TYPO3 are  successfull oss procjecs which uses PHP and they
> > utilizes globals at large.
>
> windows is a successful OS but most people would agree it's built on a
> foundation of cruft.
>
> success != built with good code != globals are good practice.
>
> > Regards.
> >
> > Sancar

Hello there, 

After some research, I found source of the "Globals are evil".

This was coming from common c and c++ practice. In this enviroments using 
globals leding to race conditions which was very hard to resolve.

and uh oh, that php thing was using share nothing perspective. No race 
condtions. except variable crashing.

From my point of view. After 8 years of php programming only one time face the 
variable crashing. And that was a local variable called $i.

Of course your millage was vary...

Regards

Sancar.

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



Re: [PHP] uh oh, I defined a resoruce

2008-01-13 Thread Sancar Saran
On Sunday 13 January 2008 21:42:28 Jochem Maas wrote:
>
> no race conditions occur in code written in php? true that there is
> no direct race conditions that can occur as a direct result of running code
> but obviously you've never dealt with multi-user systems using a databse
> backend, or file-writing based tools used in a web-environment (e.g.
> template output caching) or anything that uses shared memory or trying to
> guanrantee that a command-line script runs as a singleton. to name but a
> few examples that can most definitely be prone to race-conditions.
>

Hmmm interesting so you mean 

$GLOBALS['language'] = memcached->get('language');

race condition prone  than

function hede() {
global $language

$language = memcached->get('language');

}

Regards

Sancar

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



Re: [PHP] uh oh, I defined a resoruce

2008-01-14 Thread Sancar Saran
Hello Jochem,
>
> no not in the slightest. both those bits of code are identical for one
> (apart from the fact that neither are valid syntax). and whatever your
> trying to point out it's beside the point (I think). any possible race
> condition will be occuring with the code that *sets* data into memcache (or
> whatever).
>
> I don't claim to know everything there is no know about race-conditions but
> you can very easily program them into a php app that's for sure. please do
> some reading on the matter (e.g. google 'memcache+race+condition') - I'm
> quite sure you'll find some interesting material - I know I did (just now)
>

Of course, my recent project uses heavly on memcached and race conditions are 
blown. So I have to implement some kind flag system to avoid race conditions.

And in same project I use $GLOBALS->['mc'] for storing memcached resource 
object.

and if I was use to store some kind of data in $GLOBALS i use
$GLOBALS['data'][] =  $some_data;

And of course without proper handling. You can blow yourself...

Regards

Sancar

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



Re: [PHP] re[PHP] gister_globals

2008-01-16 Thread Sancar Saran
On Wednesday 16 January 2008 15:33:04 Jochem Maas wrote:
> tbt schreef:
> > Hi,
> >
> > I'm a newbie to php and i would like to set register_globals to 'on' from
> > my php script itself(eg:- index.php). Is there any way of doing this.
>
> you think you would like that. but you are wrong. register_globals is a
> security risk in the hands of someone who doesn't know exactly what they
> are doing.
>
> besides which register_globals is depreciated. also you can search the
> list archives for lots of posts that explain why register_globals is evil.
>
> learn how to write your script without using register_globals - ask here if
> you get stuck (but don't forget the manual!).
>
> > Thanks

Hell frezezer over. Me thinks regsiter_globals are evil too.

And what about this

session_start();

$_SESSION['refString'] = $_GET['refNo'];

Sancar

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



Re: [PHP] re[PHP] gister_globals

2008-01-16 Thread Sancar Saran
Hello 
> >
> > Hell frezezer over.
>
> odd verb. but I get the message. indeed it's seem it hath freezeth nicely.
>
> > Me thinks regsiter_globals are evil too.
> >
> > And what about this
> >
> > session_start();
> >
> > $_SESSION['refString'] = $_GET['refNo'];
>
> what about it?
>
> 1. you mean the fact that the GET val is not sanitized?
> 2. or the oddness of 'refNo' becoming 'refString' (is it a string, a
> number, superman)? 3. or the direct use of $_SESSION and the lack of
> specific session cookie settings?
>
> 1. is evil, 2. is odd and 3. is a change recommendation ... if you ask me.
>
1. 2.
Orginal Code


3. Could you explain a bit or re direct me a document about this ?

Sancar

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



Re: [PHP] 128M need in PHP5.2.5 instead of 8M in PHP5.1.4!

2008-01-24 Thread Sancar Saran
On Thursday 24 January 2008 17:44:03 Luc Maltier wrote:
> Hello!
>
> My first message:
>
> I've just updated PHP from 5.1.4 to 5.2.5 (to solve an Apache problem when
> double-clicking on links). This was successful, as the problem is now
> solved, but I now, sometimes, get a message stating that the memory is
> exhausted. I modififed php.ini and set memory_limit to 16M (instead of 8M
> with PHP5.1.4), then 32M, then 64M, with the same message. With 128M, it
> works. Can this change in memory required be considered as normal? I don't
> think so... Is there any explanation?
>
If you are used data which serialized by older versions this may lead memory 
leaks.

Remove all caches etc then try.

Sancar

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



Re: [PHP] Session and Multi Server Architecture

2008-02-12 Thread Sancar Saran
On Tuesday 12 February 2008 16:06:04 Stut wrote:
> Sancar Saran wrote:
> > Hello
> >
> > On Tuesday 12 February 2008 13:39:19 Stut wrote:
> >> I'll be using memcache as a simple cache. I hate sessions and avoid them
> >> for anything but the most trivial sites. The main sites I work with no
> >> longer use sessions because they add a pointless layer of complexity to
> >> any application that need to scale beyond a single machine. Maybe I'm
> >> just lucky that the applications I develop don't need to store huge
> >> amounts of temporary data during a visit, but I'm yet to come across a
> >> reason to use "session data".
> >>
> >> -Stut
> >
> > May I ask how can you record the state ?
>
> You may.
>
> Oh, you probably want an actual answer... ok.
>
> The only 'state' I really need to keep track of is a few details about
> the logged in user (ID, username, etc). These get encrypted and get
> passed around as a single value in the same way PHP manages the session
> ID (cookie or embedded in the URL).
>
> The encrypted value is time limited and gets updated on each request.
>
> Clearly there is a limit to how much info can be stored like this but
> after some analysis of how the site worked I reached the conclusion that
> most of the crap that was being put into the session was not required
> from request to request and could be retrieved from the DB when it was
> needed.
>
> This has been running on a site with > 1 million unique users a month
> for over 6 months with no issues. I now use this system with most sites
> I get involved in and am yet to find a valid reason to replace it with a
> traditional session.
>
> Part of the reason this works is that in the few parts of the site where
> it would make sense to use a traditional session to temporarily store
> data it does it in a table in the database. This is essentially a
> SQL-based session but with one important difference... DB hits are
> limited when they are needed only - i.e. when the user is using those
> parts of the site. With a SQL-based session you cause 2+ DB hits for
> each request even if you don't actually use the session. This is bad m'kay!
>
> Over the past few years I've learnt a lot about scalability and the
> single biggest tip I can pass on is to only do what is absolutely
> necessary at any given time. Sessions are the biggest barrier to being
> able to do that, so they had to go.
>
> Hope that answers your question.
>
> -Stut

Yes

Thanks much :)

Sancar

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



Re: [PHP] Session and Multi Server Architecture

2008-02-12 Thread Sancar Saran
Hello 

For poor man's multinode, ADODB offers Sql based sessions, it was good enough 
for starters.

Of course memcached based session storage was an option. But with this model 
need better implementation. Memcached was just cache, there was no offical 
way to backup data. (as far as I know)

Regards

Sancar

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



Re: [PHP] Session and Multi Server Architecture

2008-02-12 Thread Sancar Saran
Hello
On Tuesday 12 February 2008 13:39:19 Stut wrote:
>
> I'll be using memcache as a simple cache. I hate sessions and avoid them
> for anything but the most trivial sites. The main sites I work with no
> longer use sessions because they add a pointless layer of complexity to
> any application that need to scale beyond a single machine. Maybe I'm
> just lucky that the applications I develop don't need to store huge
> amounts of temporary data during a visit, but I'm yet to come across a
> reason to use "session data".
>
> -Stut
>
May I ask how can you record the state ?

Regards

Sancar

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



Re: [PHP] Session and Multi Server Architecture

2008-02-12 Thread Sancar Saran
On Tuesday 12 February 2008 00:45:59 Michael McGlothlin wrote:
> > implement session_set_save_handler() with a database, or
> > ideally, memcache.
>
> I use memcache with a secondary db backing. Works pretty well. I use it
> for session data as well as any other uses I want to make of memcache.
> Memcache makes it fast and using the db makes it more persistent and
> able to handle larger chunks of data.
>
> --
> Michael McGlothlin
> Southwest Plumbing Supply

Hello

I really really interesting about this SECONDARY DB BACKING.

Could you lead me a document, article, ANYTHING to backing up memcached into 
anything ?

Last time it when I was try it, it was huge disaster.

Regards

Sancar

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



Re: [PHP] Template system in PHP

2008-02-13 Thread Sancar Saran
Hello,

I vote for Typo3 template system. If you work bunch of HTML only designers 
this one best.

If you have some php avare designers, you should go with php based + memcached 
template systems.

Second option was much faster anything else.

Just store the template into memcached and do some str_replace.


Regards

Sancar

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



Re: [PHP] Re: Call PHP script from MySQL

2008-02-19 Thread Sancar Saran
Hello,

you may call external php script someting like that

$val = asp's_fopen(http://www.example.com/calculate.php?var=password_field);



Regards

Sancar

On Wednesday 20 February 2008 01:58:48 Mário Gamito wrote:
> Hi Nathan,
>
>  >> Is it possible to call from within MySQL an external PHP script ?
>  >> I've read "MySQL Stored Procedure Programming" from O'Reilly but
>  >> found nothing :(
>  >
>  > I'd really like to see an example of why you need this functionality,
>  > if that'd be okay. Not to judge, just to learn :)
>
> I'm inserting values in a Linux/MySQL table from an ASP.NET/C# page.
> I need to insert the password field with the correct hash (vpopmail).
>
> So, after the first insert leaving the password field blank, I need to
> invoke a PHP script that calculates the hash and then insert it.
>
> Warm Regards,
> Mário Gamito

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



Re: [PHP] Weird Zend IDE Issue

2008-03-03 Thread Sancar Saran
On Monday 03 March 2008 07:07:18 Steve Finkelstein wrote:
> Hi all,
>
> I know this isn't a forum for Zend IDE, but since there's probably a
> decent population here using it, I figured I'd ask away.
>
> I'm using 5.5.1 Professional on Mac OSX 10.5.2.  My issue here is that
> all left brackets, (eg: [ ) are not showing up in the code editor. I
> have a screenshot of it here:  http://catalyst.httpd.org/zend.png
>
> Has anyone ever experienced anything similar?
>
> Thank you,
>
> /sf

Hello,

My bet was, problem on highlight syntax.

Please copy paste the text another editor if [ was there you may ecounter 
syntax higlighting error

Regards

Sancar

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



  1   2   >