fork download
  1. <?php
  2. define('_JEXEC', 1);
  3. define('DS', DIRECTORY_SEPARATOR);
  4.  
  5. if (file_exists(dirname(__FILE__) . '/defines.php')) {
  6. include_once dirname(__FILE__) . '/defines.php';
  7. }
  8. if (!defined('_JDEFINES')) {
  9. define('JPATH_BASE', dirname(__FILE__));
  10. require_once JPATH_BASE.'/includes/defines.php';
  11. }
  12.  
  13. define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_BASE . DS . 'administrator' . DS . 'components' . DS . 'com_content');
  14. require_once JPATH_BASE.'/includes/framework.php';
  15. require_once JPATH_BASE. "/administrator/components/com_content/models/article.php";
  16.  
  17.  
  18. $app = JFactory::getApplication('site', array('session' => false));
  19.  
  20. var_dump($app);
  21.  
  22. $new_article = new ContentModelArticle();
  23.  
  24. $data = array(
  25. 'catid' => 3, //newsarticles
  26. 'title' => 'тест3',
  27. 'introtext' => 'тесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттест',
  28. 'fulltext' => 'тесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттесттест',
  29. 'created_by' => 905,
  30. 'state' => 1,
  31. 'language' => 'ru-RU'
  32. );
  33. $new_article->save($data);
Runtime error #stdin #stdout #stderr 0.01s 20520KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Warning:  require_once(/home/WVryv2/includes/defines.php): failed to open stream: No such file or directory in /home/WVryv2/prog.php on line 10
PHP Fatal error:  require_once(): Failed opening required '/home/WVryv2/includes/defines.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/WVryv2/prog.php on line 10