Commit 877a89dd authored by Andrey Filippov's avatar Andrey Filippov

Porting i2c functionality to PHP scripts

parent 33c12313
DOCUMENTROOT=/www/pages
INCLUDES=$(DOCUMENTROOT)/include
OWN = -o root -g root
INSTDOCS = 0644
#INSTALL = install
......@@ -15,6 +16,8 @@ PHP_SCRIPTS=camvars.php \
parsedit.php \
phpinfo.php \
snapfull.php
PHPINCLUDES=i2c_include.php show_source_include.php
all:
......@@ -25,8 +28,10 @@ all:
install:
@echo "make install in src"
$(INSTALL) $(OWN) -d $(DESTDIR)$(DOCUMENTROOT)
$(INSTALL) $(OWN) -d $(DESTDIR)$(INCLUDES)
$(INSTALL) $(OWN) -m $(INSTDOCS) $(DOCS) $(DESTDIR)$(DOCUMENTROOT)
$(INSTALL) $(OWN) -m $(INSTDOCS) $(PHP_SCRIPTS) $(DESTDIR)$(DOCUMENTROOT)
$(INSTALL) $(OWN) -m $(INSTDOCS) $(PHPINCLUDES) $(DESTDIR)$(INCLUDES)
$(INSTALL) $(OWN) -d $(DESTDIR)$(SYSCONFDIR)
$(INSTALL) $(OWN) -d $(DESTDIR)$(CONFDIR)
$(INSTALL) $(OWN) -m $(INSTDOCS) -T autocampars.xml $(DESTDIR)$(CONFDIR)/autocampars0.xml
......
This diff is collapsed.
This diff is collapsed.
<?php
/*!***************************************************************************
*! FILE NAME : show_source.inc
*! DESCRIPTION: Outputs program source code if url has 'source' parameter.
*! Copyright (C) 2012 Elphel, Inc
*! -----------------------------------------------------------------------------**
*!
*! This program is free software: you can redistribute it and/or modify
*! it under the terms of the GNU General Public License as published by
*! the Free Software Foundation, either version 3 of the License, or
*! (at your option) any later version.
*!
*! This program is distributed in the hope that it will be useful,
*! but WITHOUT ANY WARRANTY; without even the implied warranty of
*! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*! GNU General Public License for more details.
*!
*! You should have received a copy of the GNU General Public License
*! along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
if (array_key_exists('source',$_GET)) {
$source=file_get_contents ($_SERVER['SCRIPT_FILENAME']);
header("Content-Type: text/php");
header("Content-Length: ".strlen($source)."\n");
header("Pragma: no-cache\n");
echo $source;
exit(0);
}
if (array_key_exists('help',$_GET)) {
if (function_exists('_help')) {
_help();
exit(0);
}
}
if (count($_GET)==0) {
if (function_exists('_usage')) {
_usage();
exit(0);
}
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment