Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
300
Merge Requests
300
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
d26f29bb
Commit
d26f29bb
authored
Mar 13, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#394512
by csevb10: converted to the new database abstraction layer.
parent
38e5e907
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
modules/php/php.install
modules/php/php.install
+16
-4
No files found.
modules/php/php.install
View file @
d26f29bb
...
...
@@ -5,17 +5,29 @@
* Implementation of hook_install().
*/
function
php_install
()
{
$format_exists
=
db_
result
(
db_query
(
"SELECT COUNT(*) FROM
{
filter_format
}
WHERE name = 'PHP code'"
)
);
$format_exists
=
db_
query
(
"SELECT COUNT(*) FROM
{
filter_format
}
WHERE name = 'PHP code'"
)
->
fetchField
(
);
// Add a PHP code text format, if it does not exist. Do this only for the
// first install (or if the format has been manually deleted) as there is no
// reliable method to identify the format in an uninstall hook or in
// subsequent clean installs.
if
(
!
$format_exists
)
{
db_query
(
"INSERT INTO
{
filter_format
}
(name, roles, cache) VALUES ('PHP code', '', 0)"
);
$format
=
db_result
(
db_query
(
"SELECT MAX(format) FROM
{
filter_format
}
"
));
$format
=
db_insert
(
'filter_format'
)
->
fields
(
array
(
'name'
=>
'PHP code'
,
'roles'
=>
''
,
'cache'
=>
0
,
))
->
execute
();
// Enable the PHP evaluator filter.
db_query
(
"INSERT INTO
{
filter
}
(format, module, delta, weight) VALUES (%d, 'php', 0, 0)"
,
$format
);
db_insert
(
'filter'
)
->
fields
(
array
(
'format'
=>
$format
,
'module'
=>
'php'
,
'delta'
=>
0
,
'weight'
=>
0
,
))
->
execute
();
drupal_set_message
(
t
(
'A !php-code text format has been created.'
,
array
(
'!php-code'
=>
l
(
'PHP code'
,
'admin/settings/filter/'
.
$format
))));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment