473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PEAR like, php-csl, code library - anyone doing this?

howdy, I am using this code library thing:
http://sourceforge.net/projects/php-csl/

http://www.php-csl.com/snippets/
and had an idea. I was thinking about keeping a bunch of functions in
the root dir of my server, so I can re-use my code from any of my
websites without having to copy each func or code into the current
site that i’m working on. So, It’d be kinda like PEAR, you’d just go:

Code:
include "/home/library/thefunction.php;
$var = thefunction();

That php-csl that i linked to would have to be modified, cuz it stores
the snippets in *.s files. No biggie. Also, it would be cool to have
the code you need for including the func be in a text area that could
have a copy to clipboard button.

Anyone doing such a thing? Have any security concerns? Other
thoughts?

thanks,
juglesh

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/PHP-PEAR-csl...ict241484.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=839478
Jul 21 '05 #1
2 1659
juglesh wrote:
howdy, I am using this code library thing:
http://sourceforge.net/projects/php-csl/

http://www.php-csl.com/snippets/
Hmmm, interesting.
and had an idea. I was thinking about keeping a bunch of functions in
the root dir of my server,
This is a really bad place to put things.
so I can re-use my code from any of my
websites without having to copy each func or code into the current
site that i’m working on. So, It’d be kinda like PEAR, you’d just go:

Code:
include "/home/library/thefunction.php;
$var = thefunction();

That php-csl that i linked to would have to be modified, cuz it stores
the snippets in *.s files. No biggie. Also, it would be cool to have
the code you need for including the func be in a text area that could
have a copy to clipboard button.


I'm guessing the '.s' files are some sort of composite of the PHP code, the
documentation and meta-data? Wouldn't it be a lot simpler to just write
your own wrapper for extracting the PHP code from the .s file? That way you
don't have to maintain 2 seperate repositories. e.g.

require_once "http://localhost/snippets_archive.php?snip=someref";

(make sure you know about code injection, safe_mode and open_basedir before
you try this at home kids).

C.
Jul 21 '05 #2

Colin McKinnon wrote:
juglesh wrote:
howdy, I am using this code library thing:
http://sourceforge.net/projects/php-csl/

http://www.php-csl.com/snippets/
Hmmm, interesting.
and had an idea. I was thinking about keeping a bunch of functions in
the root dir of my server,


This is a really bad place to put things.


how come? actually, I was going to put them in the same dir as my
cpanel 'users'. In a sub domain.
so I can re-use my code from any of my
websites without having to copy each func or code into the current
site that i'm working on. So, It'd be kinda like PEAR, you'd just go:

Code:
include "/home/library/thefunction.php;
$var = thefunction();

That php-csl that i linked to would have to be modified, cuz it stores
the snippets in *.s files. No biggie. Also, it would be cool to have
the code you need for including the func be in a text area that could
have a copy to clipboard button.

got that clipboard part going, too.
I'm guessing the '.s' files are some sort of composite of the PHP code, the
documentation and meta-data? Wouldn't it be a lot simpler to just write
your own wrapper for extracting the PHP code from the .s file? That way you
don't have to maintain 2 seperate repositories. e.g.
Yeah, I just rewrote the thing, mine just reads php files.

require_once "http://localhost/snippets_archive.php?snip=someref";

(make sure you know about code injection, safe_mode and open_basedir before
you try this at home kids).


It doesnt include the snip, it just reads it and echos it.

Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: red | last post by:
I have PHP Version 5.0.1 installed on my computer, and according to the pear manual pear is already installed. But how do I tell if it is installed ? for example, how do I get this line, which I...
1
by: steve | last post by:
Hi, I have a set of passwords encrypted using perl’s crypt, from a perl forum being migrated to php. I like to bring them into php, and use them without changing them. How do I emulate perl’s...
1
by: webguynow | last post by:
I've installed PEAR in my local area, on my shared host, under htdocs but I'm anticipating a number of issues. I'm forcing use of PHP5 with an .htaccess file, but by default the host runs ...
0
by: Mike | last post by:
WinXP Pro SP2 PHP 4.1.1 from php.net Installed on D:\php\ I have tried several times to install PEAR in PHP 4.1.1. I keep getting an error and I am not proficient enough to be able to fixit...
0
by: Werner Elflein | last post by:
Hi! I tried to use the PEAR class Config.php to parse a XML configuration file which looks like <?xml version="1.0" encoding="utf-8"?> <configuration> <section> <item1>value1</item1>...
0
by: Robert Lummert | last post by:
Hi there, I've got a severe problem with pear when trying to install pdflib. First pear demanded a program named phpize. After searching a while I found that phpize is part of php-devel while...
5
by: crescent_au | last post by:
Hi all, I've been using PHP for a while now but I haven't actually used PEAR. I have just read half a chapter in a book, it sounds alright but haven't actually used it. I was just wondering, is...
1
by: Paul | last post by:
I just installed php 4.4 with apache 2.0 on WIN XP. All is working so far. From: the prompt, I type: go-pear and here's what I get: Loading zlib: ok Using local package: PEAR-stable......ok...
4
by: inetquestion | last post by:
php has been configured with the following two configure lines and core's during "make install" on the PEAR section. Is there something simple i'm missing? Any help would be appreciated. ...
1
by: luftikus143 | last post by:
Hi there, I would say that the PEAR package is correctly installed. I added the OLE package ( $ pear install OLE ) and the PEAR Spreadsheet Excel Writer ( $ pear install Spreadsheet_Excel_Writer...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.