Read about OpenSencillo changes
Continue reading






There is $inc object that allows you to store information about modules. Module information system can move as follows.
Code in fw_modules/mymodule/info_mymodule.php
<?php //-------your module group name------------// $modname='mymodule'; //-------group information-----------------// $inc->lib['group_'.$modname]['name']=$modname; $inc->lib['group_'.$modname]['version']=1.3; $inc->lib['group_'.$modname]['author']='Bc. Peter Horváth'; $inc->lib['group_'.$modname]['email']='info[at]opensencillo[dot]com'; $inc->lib['group_'.$modname]['license']='GNU/GPL'; $inc->lib['group_'.$modname]['homepage']='www.mymodule.com'; $inc->lib['group_'.$modname]['integrity']='966x1$b9u7qga4401hu7'; $inc->lib['group_'.$modname]['your_own_key']='my own info'; //-------your module group function--------// $inc->lib['function'][]='test function'; $inc->lib['function'][]='smile function'; $inc->lib['function'][]='good function'; ?>
This saves the information about the module to RAM during execution of the script.
Information will be publicly available throughout the system.
PHP code needs to be divided into multiple parts? Use OpenSencillo modules. You can then create logical units separate from the source code yourcode.php.
Question: When OpenSencillo connect the module?
Ask: Before loading yourcode.php.
Question: Can I move code from yourcode.php into modules?
Ask: Yes, of course.
We have four classes for SQL in three layers:
mysqlInterface PHP OpenSencillo example:
<?php //yourcode.php //call class mysqlInterface $mysql = new mysqlInterface($DBHost,$DBName,$DBUser,$DBPass); //prepare table structure $newTable = array('hostCtr'=>array( 'id'=>array('type'=>'int','auto_increment'=>true,'primary_key'=>true), 'ip'=>array('type'=>'varchar(15)','unique_key'=>true), 'datetime'=>array('type'=>'datetime')) ); //create shadow configuration and open connection to OpenSencillo database $mysql->config(); $mysql->connect(); //add new table $mysql->dbCreateTable($newTable); //collected all queries from the last execute and send queries to SQL server $mysql->execute(); echo "SQL changes saved!"; ?>
Output to SQL:
New table: hostCtr
Structure of new table:
Now you can save your own data. Continue like this:
<?php //continue yourcode.php //assign data structure $newInsert = array('hostCtr'=>array( 'id'=>"''", 'ip'=>"'".$_SERVER['REMOTE_ADDR']."'", 'datetime'=>"'".date('Y-m-d H:i:s')."'") ); //add structure and data to SQL generator $mysql->insert($newInsert); //execute generated queries $mysql->execute(); ?>
Now you save new id, new unique ip with date and time.
File system after OpenSencillo installation.
System folders:
System files:
You can add pretty debug. This tool not work correct if your server using PHP xdebug module.
<?php $seo=new headerSeo; $seo->encode(); $seo->robots(); echo $seo->save(); ?> <body> <?php $var=array('my first debug','my second debug',null,123); //debuging variable log::vd($var); //Print pretty var_dump equivalent ?> </body> </html>
You can add your first subpage with custom URL.
<?php $seo=new headerSeo; //add minimal seo and create opening HTML tag $seo->encode(); //add page encoding to UTF-8 $seo->robots(); //add support for bots control echo $seo->save(); //generate meta tags ?> <body> <?php switch(PAGE) { //create new subpage by case case 'my-first-subpage': case '/my-first-subpage': echo 'HELLO SUBPAGE'; break; //create homepage / landing page case '': case '/': echo 'HELLO WORLD'; break; //create custom 404 page default: echo 'MY 404 PAGE'; } ?> </body> </html>
After installation you can write your first webpage.
<?php $seo=new headerSeo; //add minimal seo and add opening HTML tag $seo->encode(); //add page encoding to UTF-8 $seo->robots(); //add support for bots control echo $seo->save(); //generate meta tags ?> <body> HELLO WORLD </body> </html>