Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $base_path = MODX_CORE_PATH . 'components/one_to_one/';
- $result = $modx->addPackage('one_to_one',$base_path.'model/','');
- //$userService = //$modx->getService('one_to_one','One_to_one',$modx->getOption('one_to_one.core_path',null,$modx->getOption//('core_path').'components/one_to_one/').'model/one_to_one/','');
- //if (!($userService instanceof One_to_one)) return 'dfdsfd';
- $output = '';
- if (! $result) {
- return 'failed to add package';
- } else {
- $output .= '<p>Packet loaded successfully</p>';
- }
- $database_server = '****';
- $database_type = '***';
- $dbase = '****';
- $database_user = '****';
- $database_password = '****';
- $table_prefix = '****';
- $xpdo = new xPDO("mysql:host=$database_server;dbname=$dbase",
- $database_user,$database_password,'');
- $output .= ($xpdo->connect()) ? '<p>Connected</p>' : '<p>Not Connected</p>';
- $user = $xpdo->getObject('Users', array('user_id' => 1 ) );
- $output .= $user->get('user_id');
- $userdata = $user->getOne('Userdata');
- $output .= $user->get('username');
- $output .= $userdata->get('age');
- return $output;
Add Comment
Please, Sign In to add comment