codeigniter custom config file calling config data - codeigniter

i've a file # /config/form_validation.php
i've another file # /config/ion_auth.php
i tried to get the 'ion_auth data' in form_validation but failed:
'rules'=>'required|min_length['.$this->config->item('min_password_length', 'ion_auth').']'
error Message: Undefined property: CI_Loader::$config
If i change it to this, all works well.
'rules'=>'required|min_length[3]'
It seems that i cannot call the data from another config file at the current config file.
How to overcome this problem or is this a system limitation?

it seems you create form at wrong place, try to get main controller first:
$CI =$ get_instence();
'rules'=>'required|min_length['.$CI->config->item('min_password_length', 'ion_auth').']'

Related

Neo.ClientError.Statement.ExternalResourceFailed on Mac

I have a CSV file I generate through code. I want to import the generated CSV file into neo4j using the following cypher query.
LOAD CSV WITH HEADERS FROM 'file:////Users/{user}/Desktop/neo4j-importer/tmp/temp_data.csv'
I have changed the following config varables
Commenting out dbms.directories.import=import.
And set dbms.security.allow_csv_import_from_file_urls=true
Problem is I get thrown the following error:
Neo.ClientError.Statement.ExternalResourceFailed:
Couldn't load the external resource at:
file:/Users/{user}/Library/Application%20Support/Neo4j%20Desktop/Application/neo4jDatabases/database-c517b267-220d-4b7a-be26-813d5b64a51a/installation-3.5.3/import/Users/{user}/Desktop/neo4j-importer/tmp/temp_data.csv
I mean it is partly right just not the /Users/{user}/Library/Application%20Support/Neo4j%20Desktop/Application/neo4jDatabases/database-c517b267-220d-4b7a-be26-813d5b64a51a/installation-3.5.3/import/ bit... Any suggestions on how to fix this weird file pathing problem?
Try changing the config setting to point to the directory with your imports:
dbms.directories.import=/Users/{user}/Desktop/neo4j-importer/tmp
and then changing the Cypher query to just specify the CSV file:
LOAD CSV WITH HEADERS FROM 'file:///temp_data.csv'
...

I cant make a dynamic image path in pdf

I've been trying to display an image in a fpdf file, it only works when I specify the exact location of the image. Can I make it dynamic?
Heres sample line of code:
$this->Image('fpdf/img/logo1.png',10,6,30);
and it works when I turn this way:
D:\Installed Apps\New
folder\XAMPP\htdocs\votingsystem\application\views\admin\senior\fpdf\img\logo1.png',10,6,30);
I want to transfer it to another laptop, I'm afraid it wont work.
I always get this error:
Message: fopen(fpdf/img/logo1.png): failed to open stream: No such
file or directory
I use code igniter as framework.
You can use multicell option in fpdf. I use this below code in php to it working.
`
define('ASSETS_URL','Your url or path to image file');
$yaxix = $pdf->GetY();
$xaxix = $pdf->GetX();
$pdf->MultiCell(50,10.5,$pdf->Image(ASSETS_URL.'/img/your-image-name.jpg',$xaxix,$yaxix+5,50)."\nAuthorised Signatory",1,'C',FALSE);
`
In this case you only have to change constants.

Sketchup ruby definitionlist load method error: Invalid component file

When I create a script file and load it from the console with:
load '//192.168.0.0/Mağaza/script.rb'
I get 'Invalid component file' error for:
someModel = Sketchup.active_model.definitions.load '//192.168.0.0/Mağaza/Definitions/model.skp'
But when running the code directly in console, it works.
Any idea why?
DefinitionList.load is a completely different method from Ruby's load.
To load a component from a URL you need to use model.definitions.load_from_url:
http://www.sketchup.com/intl/en/developer/docs/ourdoc/definitionlist#load_from_url
After two days, I figured out that the problem was the encoding of 'ğ' in the folder name (mağaza). I tried ANSI and UTF-8 encoding in my script file but nothing changed. But when print the path name in the console, it turned out that the character was not encoding properly.

WordPress does not go to correct address to find a file

I am running WordPress on my localhost and trying to send request from a file of my plugin to another file called photos.php using ajax, I have correctly written the address of file in xmlhttp.open function but it runs into following error.
Not Found
The requested URL /wordpress/wp-admin/wp-content/plugins/myphoto/photos.php was not found on this server.
the actual address of the file is /wordpress/wp-content/plugins/myphoto/photos.php
xmlhttp.open("GET","wp-content/plugins/myphoto/photos.php?c="+option,true);
xmlhttp.send();
Try setting the absolute path:
xmlhttp.open("GET","/wordpress/wp-content/plugins/myphoto/photos.php?c="+option,true);
Your error implies you're using the relative path. Directory /wordpress/wp-admin/wp-content... does not exist.

Perl::WSDL. Generated methods in different directory than script

I am trying to write a script for using with op5/nagios.
What it tries to do is to connect to database an get a value there, and then send a request to a webservice and match the response from the webservice with the value from the database.
Now writing the script wasn't the problem. The problem arrises when trying to run it from OP5.
When including the interface to script I use the following syntax
use MyInterfaces::PortalServicesImplService::PortalServicesImplPort;
This works just fine when I execute the script located on the same level as "MyInterfaces".
The problem is that the script itself is located in the folder /opt/plugins/custom/SOAP where both the script and the folders generated by wsdl2perl.pl is located. However when OP5 executes the script is does so from the folder /opt/monitor.
So I tried to include the "PortalServicesImplPort" using this syntax
use lib "/opt/plugins/custom/SOAP/MyInterfaces/PortalservicesImplServices/PortalServicesImplPort
The code compiles but when trying to run it I get an error message saying
Can't locate object method "new" via package "MyInterfaces::PortalServicesImplService::PortalServicesImplPort" (perhaps you forgot to load "MyInterfaces::PortalServicesImplService::PortalServicesImplPort"?)
Am I doing something wrong when importing methods from another location or doesn't SOAP::WSDL support placing the auto generated files in a different directory from where you are executing the script?
Seems I managed to solve this myself by adding use lib "/opt/plugins/custom/SOAP

Resources